diff --git a/src/SoftwareApplication.ts b/src/SoftwareApplication.ts index 19e6f48e9d..14d79589b6 100644 --- a/src/SoftwareApplication.ts +++ b/src/SoftwareApplication.ts @@ -7,7 +7,7 @@ import { Text } from './dataTypes' /** * A software application. - * + * * @see {@link https://schema.org/SoftwareApplication} */ @type('schema:SoftwareApplication') @@ -15,7 +15,7 @@ export default class SoftwareApplication extends CreativeWork { /** * Type of software application, e.g. 'Game, Multimedia'. - * + * * @see {@link https://schema.org/applicationCategory} */ @property('schema:applicationCategory') @@ -23,7 +23,7 @@ export default class SoftwareApplication extends CreativeWork { /** * Subcategory of the application, e.g. 'Arcade Game'. - * + * * @see {@link https://schema.org/applicationSubCategory} */ @property('schema:applicationSubCategory') @@ -31,7 +31,7 @@ export default class SoftwareApplication extends CreativeWork { /** * Operating systems supported (Windows 7, OSX 10.6, Android 1.6). - * + * * @see {@link https://schema.org/operatingSystem} */ @property('schema:operatingSystem') @@ -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 = [] - - // 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 = [] - - @property('schema:runtimePlatform') - runtimePlatform: Text = '' } diff --git a/src/SoftwarePackage.ts b/src/SoftwarePackage.ts index 43c2a689f6..7368420c95 100644 --- a/src/SoftwarePackage.ts +++ b/src/SoftwarePackage.ts @@ -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 = [] + + /** + * Subcategory of the application, e.g. 'Arcade Game'. + * + * @see {@link https://schema.org/applicationSubCategory} + */ + @property('schema:applicationSubCategory') + applicationSubCategories: Array = [] + + /** + * Operating systems supported (Windows 7, OSX 10.6, Android 1.6). + * + * @see {@link https://schema.org/operatingSystem} + */ + @property('schema:operatingSystem') + operatingSystems: Array = [] + + /** + * 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 = [] - }