diff --git a/py/stencila/schema/types.py b/py/stencila/schema/types.py index d684b686..412b11b2 100644 --- a/py/stencila/schema/types.py +++ b/py/stencila/schema/types.py @@ -9,9 +9,11 @@ Enum1 = Enum("1", ["ascending", "descending", "unordered"]) -Enum2 = Enum("2", ["data", "header"]) +Enum2 = Enum("2", ["string", "int", "float", "boolean", "json"]) -Enum3 = Enum("3", ["header", "footer"]) +Enum3 = Enum("3", ["data", "header"]) + +Enum4 = Enum("4", ["header", "footer"]) class Entity: @@ -39,7 +41,6 @@ class Cite(Entity): target: str citationMode: Optional["Enum0"] - content: Optional[Array["InlineContent"]] pageEnd: Optional[Union[str, int]] pageStart: Optional[Union[str, int]] pagination: Optional[str] @@ -50,7 +51,6 @@ def __init__( self, target: str, citationMode: Optional["Enum0"] = None, - content: Optional[Array["InlineContent"]] = None, id: Optional[str] = None, meta: Optional[Dict[str, Any]] = None, pageEnd: Optional[Union[str, int]] = None, @@ -67,8 +67,6 @@ def __init__( self.target = target if citationMode is not None: self.citationMode = citationMode - if content is not None: - self.content = content if pageEnd is not None: self.pageEnd = pageEnd if pageStart is not None: @@ -126,25 +124,6 @@ def __init__( self.uniqueItems = uniqueItems -class Date(Entity): - """A date encoded as a ISO 8601 string.""" - - value: str - - def __init__( - self, - value: str, - id: Optional[str] = None, - meta: Optional[Dict[str, Any]] = None - ) -> None: - super().__init__( - id=id, - meta=meta - ) - if value is not None: - self.value = value - - class Mark(Entity): """ A base class for nodes that mark some other inline content in some way @@ -273,7 +252,7 @@ class Code(Thing): """Inline code.""" value: str - programmingLanguage: Optional[str] + language: Optional[str] def __init__( self, @@ -281,9 +260,9 @@ def __init__( alternateNames: Optional[Array[str]] = None, description: Optional[str] = None, id: Optional[str] = None, + language: Optional[str] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, - programmingLanguage: Optional[str] = None, url: Optional[str] = None ) -> None: super().__init__( @@ -296,8 +275,8 @@ def __init__( ) if value is not None: self.value = value - if programmingLanguage is not None: - self.programmingLanguage = programmingLanguage + if language is not None: + self.language = language class CodeBlock(Code): @@ -309,9 +288,9 @@ def __init__( alternateNames: Optional[Array[str]] = None, description: Optional[str] = None, id: Optional[str] = None, + language: Optional[str] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, - programmingLanguage: Optional[str] = None, url: Optional[str] = None ) -> None: super().__init__( @@ -319,20 +298,20 @@ def __init__( alternateNames=alternateNames, description=description, id=id, + language=language, meta=meta, name=name, - programmingLanguage=programmingLanguage, url=url ) class ContactPoint(Thing): - """A contact point, for example, a R&D department.""" + """A contact point—for example, a R&D department.""" availableLanguages: Optional[Array[str]] emails: Optional[Array[str]] - telephoneNumbers: Optional[Array[str]] + telephone: Optional[str] def __init__( self, @@ -343,7 +322,7 @@ def __init__( id: Optional[str] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, - telephoneNumbers: Optional[Array[str]] = None, + telephone: Optional[str] = None, url: Optional[str] = None ) -> None: super().__init__( @@ -358,8 +337,8 @@ def __init__( self.availableLanguages = availableLanguages if emails is not None: self.emails = emails - if telephoneNumbers is not None: - self.telephoneNumbers = telephoneNumbers + if telephone is not None: + self.telephone = telephone class CreativeWork(Thing): @@ -370,13 +349,12 @@ class CreativeWork(Thing): authors: Optional[Array[Union["Person", "Organization"]]] content: Optional[Array["Node"]] - dateCreated: Optional[Union["Date", str]] - dateModified: Optional[Union["Date", str]] - datePublished: Optional[Union["Date", str]] + dateCreated: Optional[str] + dateModified: Optional[str] + datePublished: Optional[str] editors: Optional[Array["Person"]] funders: Optional[Array[Union["Person", "Organization"]]] isPartOf: Optional["CreativeWorkTypes"] - keywords: Optional[Array[str]] licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] parts: Optional[Array["CreativeWorkTypes"]] publisher: Optional[Union["Person", "Organization"]] @@ -390,15 +368,14 @@ def __init__( alternateNames: Optional[Array[str]] = None, authors: Optional[Array[Union["Person", "Organization"]]] = None, content: Optional[Array["Node"]] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, @@ -434,8 +411,6 @@ def __init__( self.funders = funders if isPartOf is not None: self.isPartOf = isPartOf - if keywords is not None: - self.keywords = keywords if licenses is not None: self.licenses = licenses if parts is not None: @@ -465,16 +440,15 @@ def __init__( title: str, alternateNames: Optional[Array[str]] = None, content: Optional[Array["Node"]] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, environment: Optional["Environment"] = None, funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, @@ -498,7 +472,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, meta=meta, name=name, @@ -528,15 +501,14 @@ def __init__( alternateNames: Optional[Array[str]] = None, authors: Optional[Array[Union["Person", "Organization"]]] = None, content: Optional[Array["Node"]] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, @@ -560,7 +532,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, meta=meta, name=name, @@ -586,15 +557,14 @@ def __init__( alternateNames: Optional[Array[str]] = None, authors: Optional[Array[Union["Person", "Organization"]]] = None, content: Optional[Array["Node"]] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, @@ -618,7 +588,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, meta=meta, name=name, @@ -654,9 +623,9 @@ def __init__( bitrate: Optional[float] = None, content: Optional[Array["Node"]] = None, contentSize: Optional[float] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, embedUrl: Optional[str] = None, @@ -664,7 +633,6 @@ def __init__( funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, @@ -688,7 +656,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, meta=meta, name=name, @@ -727,9 +694,9 @@ def __init__( caption: Optional[str] = None, content: Optional[Array["Node"]] = None, contentSize: Optional[float] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, embedUrl: Optional[str] = None, @@ -737,7 +704,6 @@ def __init__( funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, @@ -767,7 +733,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, meta=meta, name=name, @@ -806,15 +771,14 @@ def __init__( codeRepository: Optional[str] = None, codeSampleType: Optional[str] = None, content: Optional[Array["Node"]] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, maintainers: Optional[Array[Union["Organization", "Person"]]] = None, meta: Optional[Dict[str, Any]] = None, @@ -843,7 +807,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, meta=meta, name=name, @@ -883,15 +846,14 @@ def __init__( codeRepository: Optional[str] = None, codeSampleType: Optional[str] = None, content: Optional[Array["Node"]] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, maintainers: Optional[Array[Union["Organization", "Person"]]] = None, meta: Optional[Dict[str, Any]] = None, @@ -923,7 +885,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, maintainers=maintainers, meta=meta, @@ -956,15 +917,14 @@ def __init__( codeRepository: Optional[str] = None, codeSampleType: Optional[str] = None, content: Optional[Array["Node"]] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, maintainers: Optional[Array[Union["Organization", "Person"]]] = None, meta: Optional[Dict[str, Any]] = None, @@ -996,7 +956,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, maintainers=maintainers, meta=meta, @@ -1058,6 +1017,7 @@ class Environment(Thing): adds: Optional[Array["SoftwareSourceCode"]] extends: Optional[Array["Environment"]] removes: Optional[Array["SoftwareSourceCode"]] + source: Optional[str] def __init__( self, @@ -1069,6 +1029,7 @@ def __init__( id: Optional[str] = None, meta: Optional[Dict[str, Any]] = None, removes: Optional[Array["SoftwareSourceCode"]] = None, + source: Optional[str] = None, url: Optional[str] = None ) -> None: super().__init__( @@ -1087,6 +1048,8 @@ def __init__( self.extends = extends if removes is not None: self.removes = removes + if source is not None: + self.source = source class Figure(CreativeWork): @@ -1104,15 +1067,14 @@ def __init__( authors: Optional[Array[Union["Person", "Organization"]]] = None, caption: Optional[Array["Node"]] = None, content: Optional[Array["Node"]] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, - keywords: Optional[Array[str]] = None, label: Optional[str] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, meta: Optional[Dict[str, Any]] = None, @@ -1137,7 +1099,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, meta=meta, name=name, @@ -1193,9 +1154,9 @@ def __init__( caption: Optional[str] = None, content: Optional[Array["Node"]] = None, contentSize: Optional[float] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, embedUrl: Optional[str] = None, @@ -1203,7 +1164,6 @@ def __init__( funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, @@ -1233,7 +1193,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, meta=meta, name=name, @@ -1474,11 +1433,34 @@ def __init__( self.content = content +class Parameter(Entity): + """A parameter that can be set and used in evaluated code.""" + + dataType: "Enum2" + name: str + + def __init__( + self, + dataType: "Enum2", + name: str, + id: Optional[str] = None, + meta: Optional[Dict[str, Any]] = None + ) -> None: + super().__init__( + id=id, + meta=meta + ) + if dataType is not None: + self.dataType = dataType + if name is not None: + self.name = name + + class Periodical(CreativeWork): """A periodical publication.""" - dateEnd: Optional[Union["Date", str]] - dateStart: Optional[Union["Date", str]] + dateEnd: Optional[str] + dateStart: Optional[str] issn: Optional[Array[str]] def __init__( @@ -1486,18 +1468,17 @@ def __init__( alternateNames: Optional[Array[str]] = None, authors: Optional[Array[Union["Person", "Organization"]]] = None, content: Optional[Array["Node"]] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateEnd: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, - dateStart: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateEnd: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, + dateStart: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, issn: Optional[Array[str]] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, @@ -1521,7 +1502,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, meta=meta, name=name, @@ -1614,14 +1594,14 @@ class Product(Thing): an episode of a TV show streamed online. """ - brands: Optional[Array["Brand"]] + brand: Optional["Brand"] logo: Optional[Union[str, "ImageObject"]] productID: Optional[str] def __init__( self, alternateNames: Optional[Array[str]] = None, - brands: Optional[Array["Brand"]] = None, + brand: Optional["Brand"] = None, description: Optional[str] = None, id: Optional[str] = None, logo: Optional[Union[str, "ImageObject"]] = None, @@ -1638,8 +1618,8 @@ def __init__( name=name, url=url ) - if brands is not None: - self.brands = brands + if brand is not None: + self.brand = brand if logo is not None: self.logo = logo if productID is not None: @@ -1649,7 +1629,7 @@ def __init__( class PublicationIssue(CreativeWork): """ A part of a successively published publication such as a periodical or - publication volume, often numbered. + publication volume, often numbered. """ issueNumber: Optional[Union[str, int]] @@ -1662,16 +1642,15 @@ def __init__( alternateNames: Optional[Array[str]] = None, authors: Optional[Array[Union["Person", "Organization"]]] = None, content: Optional[Array["Node"]] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, issueNumber: Optional[Union[str, int]] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, @@ -1698,7 +1677,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, meta=meta, name=name, @@ -1736,15 +1714,14 @@ def __init__( alternateNames: Optional[Array[str]] = None, authors: Optional[Array[Union["Person", "Organization"]]] = None, content: Optional[Array["Node"]] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, @@ -1772,7 +1749,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, meta=meta, name=name, @@ -1797,12 +1773,12 @@ def __init__( class Quote(Mark): """Inline, quoted content.""" - cite: Optional[Union["Cite", str]] + citation: Optional[str] def __init__( self, content: Array["InlineContent"], - cite: Optional[Union["Cite", str]] = None, + citation: Optional[str] = None, id: Optional[str] = None, meta: Optional[Dict[str, Any]] = None ) -> None: @@ -1811,20 +1787,20 @@ def __init__( id=id, meta=meta ) - if cite is not None: - self.cite = cite + if citation is not None: + self.citation = citation class QuoteBlock(Entity): """A section quoted from somewhere else.""" content: Array["BlockContent"] - cite: Optional[Union["Cite", str]] + citation: Optional[str] def __init__( self, content: Array["BlockContent"], - cite: Optional[Union["Cite", str]] = None, + citation: Optional[str] = None, id: Optional[str] = None, meta: Optional[Dict[str, Any]] = None ) -> None: @@ -1834,8 +1810,8 @@ def __init__( ) if content is not None: self.content = content - if cite is not None: - self.cite = cite + if citation is not None: + self.citation = citation class ResourceParameters(Thing): @@ -1883,15 +1859,14 @@ def __init__( alternateNames: Optional[Array[str]] = None, authors: Optional[Array[Union["Person", "Organization"]]] = None, content: Optional[Array["Node"]] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, @@ -1917,7 +1892,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, meta=meta, name=name, @@ -2039,15 +2013,14 @@ def __init__( alternateNames: Optional[Array[str]] = None, authors: Optional[Array[Union["Person", "Organization"]]] = None, content: Optional[Array["Node"]] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, @@ -2071,7 +2044,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, meta=meta, name=name, @@ -2091,17 +2063,17 @@ class TableCell(Entity): """A cell within a `Table`.""" content: Array["InlineContent"] - cellType: Optional["Enum2"] colspan: Optional[int] + kind: Optional["Enum3"] name: Optional[str] rowspan: Optional[int] def __init__( self, content: Array["InlineContent"], - cellType: Optional["Enum2"] = None, colspan: Optional[int] = None, id: Optional[str] = None, + kind: Optional["Enum3"] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, rowspan: Optional[int] = None @@ -2112,10 +2084,10 @@ def __init__( ) if content is not None: self.content = content - if cellType is not None: - self.cellType = cellType if colspan is not None: self.colspan = colspan + if kind is not None: + self.kind = kind if name is not None: self.name = name if rowspan is not None: @@ -2126,14 +2098,14 @@ class TableRow(Entity): """A row within a Table.""" cells: Array["TableCell"] - rowType: Optional["Enum3"] + kind: Optional["Enum4"] def __init__( self, cells: Array["TableCell"], id: Optional[str] = None, - meta: Optional[Dict[str, Any]] = None, - rowType: Optional["Enum3"] = None + kind: Optional["Enum4"] = None, + meta: Optional[Dict[str, Any]] = None ) -> None: super().__init__( id=id, @@ -2141,8 +2113,8 @@ def __init__( ) if cells is not None: self.cells = cells - if rowType is not None: - self.rowType = rowType + if kind is not None: + self.kind = kind class ThematicBreak(Entity): @@ -2179,9 +2151,9 @@ def __init__( caption: Optional[str] = None, content: Optional[Array["Node"]] = None, contentSize: Optional[float] = None, - dateCreated: Optional[Union["Date", str]] = None, - dateModified: Optional[Union["Date", str]] = None, - datePublished: Optional[Union["Date", str]] = None, + dateCreated: Optional[str] = None, + dateModified: Optional[str] = None, + datePublished: Optional[str] = None, description: Optional[str] = None, editors: Optional[Array["Person"]] = None, embedUrl: Optional[str] = None, @@ -2189,7 +2161,6 @@ def __init__( funders: Optional[Array[Union["Person", "Organization"]]] = None, id: Optional[str] = None, isPartOf: Optional["CreativeWorkTypes"] = None, - keywords: Optional[Array[str]] = None, licenses: Optional[Array[Union[str, "CreativeWorkTypes"]]] = None, meta: Optional[Dict[str, Any]] = None, name: Optional[str] = None, @@ -2220,7 +2191,6 @@ def __init__( funders=funders, id=id, isPartOf=isPartOf, - keywords=keywords, licenses=licenses, meta=meta, name=name, diff --git a/r/R/types.R b/r/R/types.R index b3014a9a..c87fcfa5 100644 --- a/r/R/types.R +++ b/r/R/types.R @@ -1795,6 +1795,33 @@ Paragraph <- function( } +#' A parameter that can be set and used in evaluated code. +#' +#' @name Parameter +#' @param dataType The type of data this parameter accepts. \bold{Required}. +#' @param name The name the parameter is referred to in code. Should be in the format ([A-z_][A-z0-9_]+) \bold{Required}. +#' @param id The identifier for this item. +#' @param meta Metadata associated with this item. +#' @seealso \code{\link{Entity}} +#' @export +Parameter <- function( + dataType, + name, + id, + meta +){ + self <- Entity( + id = id, + meta = meta + ) + self$type <- as_scalar("Parameter") + self[["dataType"]] <- check_property("Parameter", "dataType", TRUE, missing(dataType), Enum("string", "int", "float", "boolean", "json"), dataType) + self[["name"]] <- check_property("Parameter", "name", TRUE, missing(name), "character", name) + class(self) <- c(class(self), "Entity") + self +} + + #' A periodical publication. #' #' @name Periodical diff --git a/schema/Parameter.schema.yaml b/schema/Parameter.schema.yaml new file mode 100644 index 00000000..9522d0e9 --- /dev/null +++ b/schema/Parameter.schema.yaml @@ -0,0 +1,26 @@ +title: Parameter +'@id': stencila:Parameter +extends: Entity +role: secondary +status: unstable +category: code +description: A parameter that can be set and used in evaluated code. +properties: + name: + '@id': stencila:name + description: The name the parameter is referred to in code. Should be in the format ([A-z_][A-z0-9_]+) + type: string + # todo: can we have `format: ` here? + dataType: + '@id': stencila:dataType + description: The type of data this parameter accepts. + type: string + enum: + - string + - int + - float + - boolean + - json +required: + - name + - dataType