Skip to content

Commit

Permalink
fix: take properties from SoftwareApplication, add some to SoftwarePa…
Browse files Browse the repository at this point in the history
…ckage

Closes #4
  • Loading branch information
nokome committed Nov 23, 2018
1 parent 91e8c2a commit d0b6f0e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 25 deletions.
26 changes: 6 additions & 20 deletions src/SoftwareApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ import { Text } from './dataTypes'

/**
* A software application.
*
*
* @see {@link https://schema.org/SoftwareApplication}
*/
@type('schema:SoftwareApplication')
export default class SoftwareApplication extends CreativeWork {

/**
* Type of software application, e.g. 'Game, Multimedia'.
*
*
* @see {@link https://schema.org/applicationCategory}
*/
@property('schema:applicationCategory')
applicationCategories: Array<Text | URL> = []

/**
* Subcategory of the application, e.g. 'Arcade Game'.
*
*
* @see {@link https://schema.org/applicationSubCategory}
*/
@property('schema:applicationSubCategory')
applicationSubCategories: Array<Text | URL> = []

/**
* Operating systems supported (Windows 7, OSX 10.6, Android 1.6).
*
*
* @see {@link https://schema.org/operatingSystem}
*/
@property('schema:operatingSystem')
Expand All @@ -41,27 +41,13 @@ export default class SoftwareApplication extends CreativeWork {
* Component dependency requirements for application.
* This includes runtime environments and shared libraries that are not included in
* the application distribution package, but required to run the application.
*
*
* The [`schema:softwareRequirements`](https://schema.org/softwareRequirements)
* property allows for `Text` or `URL` values. Here, we allow
* values of software packages or applications.
*
*
* @see {@link https://schema.org/softwareRequirements}
*/
@property('schema:softwareRequirements')
softwareRequirements: Array<SoftwarePackage | SoftwareApplication> = []

// These properties were added for use in Dockter `PythonParser`
// https://github.com/stencila/dockter/blob/v0.12.1/src/PythonParser.ts#L188
// But see this discussion for an alternative approach:
// https://github.com/stencila/schema/issues/4

@property('schema:codeRepository')
codeRepository: Text | URL = ''

@property('schema:programmingLanguage')
programmingLanguages: Array<ComputerLanguage> = []

@property('schema:runtimePlatform')
runtimePlatform: Text = ''
}
44 changes: 39 additions & 5 deletions src/SoftwarePackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,58 @@ import SoftwareApplication from './SoftwareApplication'
import SoftwareSourceCode from './SoftwareSourceCode'

/**
* An extension class defined for this context to represent a software package.
* A software package.
*
* This is necessary because `schema:SoftwareSourceCode`
* has most properties needed to represent a package but not all of them.
* This is an extension class defined for this context.
* It is necessary because `schema:SoftwareSourceCode`
* has most, but not all, of the properties that we need to represent a package,
* for applications such as Dockter.
* Meanwhile, `schema:SoftwareApplication` has some of those missing
* properties but lacks most of those needed. Thus, this type does
* properties but lacks most. This type does
* not introduce any new properties, but rather uses
* schema.org properties on a subtype of `schema:SoftwareSourceCode`
*
* An alternative approach would be to create a `SoftwareApplication` which
* links to one or more `SoftwarePackages`. See https://github.com/codemeta/codemeta/issues/198
*/
@type('stencila:SoftwarePackage')
export default class SoftwarePackage extends SoftwareSourceCode {

/**
* Type of software application, e.g. 'Game, Multimedia'.
*
* @see {@link https://schema.org/applicationCategory}
*/
@property('schema:applicationCategory')
applicationCategories: Array<Text | URL> = []

/**
* Subcategory of the application, e.g. 'Arcade Game'.
*
* @see {@link https://schema.org/applicationSubCategory}
*/
@property('schema:applicationSubCategory')
applicationSubCategories: Array<Text | URL> = []

/**
* Operating systems supported (Windows 7, OSX 10.6, Android 1.6).
*
* @see {@link https://schema.org/operatingSystem}
*/
@property('schema:operatingSystem')
operatingSystems: Array<OperatingSystem> = []

/**
* Component dependency requirements for application.
* This includes runtime environments and shared libraries that are not included in
* the application distribution package, but required to run the application.
*
* The [`schema:softwareRequirements`](https://schema.org/softwareRequirements)
* property allows for `Text` or `URL` values. Here, we allow
* values of software packages or applications.
*
* @see {@link https://schema.org/softwareRequirements}
*/
@property('schema:softwareRequirements')
softwareRequirements: Array<SoftwarePackage | SoftwareApplication> = []

}

0 comments on commit d0b6f0e

Please sign in to comment.