diff --git a/dandischema/consts.py b/dandischema/consts.py index 595e5789..5d1146ed 100644 --- a/dandischema/consts.py +++ b/dandischema/consts.py @@ -1,4 +1,4 @@ -DANDI_SCHEMA_VERSION = "0.6.9" +DANDI_SCHEMA_VERSION = "0.6.10" ALLOWED_INPUT_SCHEMAS = [ "0.4.4", "0.5.1", @@ -12,6 +12,7 @@ "0.6.6", "0.6.7", "0.6.8", + "0.6.9", DANDI_SCHEMA_VERSION, ] diff --git a/dandischema/models.py b/dandischema/models.py index bef8cf2a..6bda4805 100644 --- a/dandischema/models.py +++ b/dandischema/models.py @@ -1580,6 +1580,20 @@ class CommonModel(DandiBaseModel): wasGeneratedBy: Optional[Sequence[Activity]] = Field( None, json_schema_extra={"nskey": "prov"} ) + + # Our current draft dandisets could be coming from Published ones, + # and thus carry their attributes. So we would need to define them here as well + # but make them optional, and `Publishable` would overload to make + # them mandatory. + publishedBy: Optional[Union[AnyHttpUrl, PublishActivity]] = Field( + default=None, + description="The URL should contain the provenance of the publishing process.", + json_schema_extra={"readOnly": True, "nskey": "dandi"}, + ) + datePublished: Optional[datetime] = Field( + default=None, json_schema_extra={"readOnly": True, "nskey": "schema"} + ) + schemaKey: str = Field( "CommonModel", validate_default=True, json_schema_extra={"readOnly": True} ) @@ -1667,6 +1681,12 @@ def contributor_musthave_contact( version: str = Field(json_schema_extra={"nskey": "schema", "readOnly": True}) + doi: Optional[str] = Field( + None, + title="DOI", + pattern=DANDI_DOI_PATTERN, + json_schema_extra={"readOnly": True, "nskey": "dandi"}, + ) wasGeneratedBy: Optional[Sequence[Project]] = Field( None, title="Associated projects",