diff --git a/src/demo-empirical-data/unreleased.yaml b/src/demo-empirical-data/unreleased.yaml index 8890dac..af3c950 100644 --- a/src/demo-empirical-data/unreleased.yaml +++ b/src/demo-empirical-data/unreleased.yaml @@ -66,6 +66,7 @@ emit_prefixes: imports: - dlschemas:flat/unreleased + - dlschemas:types/unreleased enums: @@ -176,8 +177,7 @@ slots: title: ORCID description: >- Associated ORCID identifier (see https://orcid.org). - range: string - pattern: '^\d{4}-\d{4}-\d{4}-\d{3}[0-9X]{1}$' + range: OrcidNotation organization_type: title: Organization type diff --git a/src/demo-research-assets/unreleased.yaml b/src/demo-research-assets/unreleased.yaml index 335f3bf..b5b9d9d 100644 --- a/src/demo-research-assets/unreleased.yaml +++ b/src/demo-research-assets/unreleased.yaml @@ -139,6 +139,7 @@ imports: - dlschemas:flat-social/unreleased - dlschemas:flat-study/unreleased - dlschemas:prov-mixin/unreleased + - dlschemas:types/unreleased types: @@ -178,8 +179,7 @@ slots: title: ORCID description: >- ORCID identifier of a person (see https://orcid.org). - range: string - pattern: '^\d{4}-\d{4}-\d{4}-\d{3}[0-9X]{1}$' + range: OrcidNotation # TODO: this better becomes an access method (through landing page) landing_page: diff --git a/src/demo-research-information/unreleased.yaml b/src/demo-research-information/unreleased.yaml index 31525f9..f9e4c10 100644 --- a/src/demo-research-information/unreleased.yaml +++ b/src/demo-research-information/unreleased.yaml @@ -119,6 +119,7 @@ imports: - dlschemas:things-social/v1 - dlschemas:things-study/v1 - dlschemas:things-rules/v1 + - dlschemas:types/unreleased slots: application_deadline: @@ -826,7 +827,7 @@ classes: description: >- The identifier notation is specified without a URL-prefix, or a `orcid:` prefix. - pattern: '^\d{4}-\d{4}-\d{4}-\d{3}[0-9X]{1}$' + range: OrcidNotation unique_keys: value: description: The ORCID notation is globally unique within the scope of ORCIDs diff --git a/src/demo-rse-group/unreleased.yaml b/src/demo-rse-group/unreleased.yaml index d357ddf..7873c73 100644 --- a/src/demo-rse-group/unreleased.yaml +++ b/src/demo-rse-group/unreleased.yaml @@ -144,6 +144,7 @@ imports: - dlschemas:flat-social/unreleased - dlschemas:flat-study/unreleased - dlschemas:prov-mixin/unreleased + - dlschemas:types/unreleased slots: application_deadline: @@ -732,7 +733,7 @@ classes: description: >- The identifier notation is specified without a URL-prefix, or a `orcid:` prefix. - pattern: '^\d{4}-\d{4}-\d{4}-\d{3}[0-9X]{1}$' + range: OrcidNotation schema_agency: ifabsent: string(Open Researcher and Contributor ID) description: >- diff --git a/src/flat-files/unreleased.yaml b/src/flat-files/unreleased.yaml index a13519a..4f2a249 100644 --- a/src/flat-files/unreleased.yaml +++ b/src/flat-files/unreleased.yaml @@ -63,6 +63,7 @@ emit_prefixes: imports: - dlschemas:flat/unreleased + - dlschemas:types/unreleased - dlschemas:common-mixin/unreleased - dlschemas:relations-mixin/unreleased - dlschemas:spatial-mixin/unreleased @@ -145,7 +146,7 @@ classes: description: A relative path in POSIX notation. key: true # ensure no leading slash - pattern: '^[^/]+.*$' + range: RelativePath object: # this must be required, if we want to support key-based # access to the named distribution parts. this also diff --git a/src/things-files/unreleased.yaml b/src/things-files/unreleased.yaml index 1df6a64..d9a3d3c 100644 --- a/src/things-files/unreleased.yaml +++ b/src/things-files/unreleased.yaml @@ -172,7 +172,7 @@ classes: description: A relative path in POSIX notation. key: true # ensure no leading slash - pattern: '^[^/]+.*$' + range: RelativePath object: # this must be required, if we want to support key-based # access to the named distribution parts. this also diff --git a/src/things-properties/unreleased.yaml b/src/things-properties/unreleased.yaml index f3c73ce..5f53dad 100644 --- a/src/things-properties/unreleased.yaml +++ b/src/things-properties/unreleased.yaml @@ -58,25 +58,6 @@ imports: - dlschemas:things/unreleased - linkml:types -types: - W3CISO8601: - uri: dlthings:w3ctr-datetime - base: str - typeof: string - description: - W3C variant/subset of IS08601 for specifying date(times). - Supported are - - YYYY (eg 1997) - - YYYY-MM (eg 1997-07) - - YYYY-MM-DD (eg 1997-07-16) - - YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00) - - YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00) - - YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00) - where TZD is the time zone designator (Z or +hh:mm or -hh:mm) - pattern: '^([-+]\d+)|(\d{4})|(\d{4}-[01]\d)|(\d{4}-[01]\d-[0-3]\d)|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))$' - see_also: - - https://www.w3.org/TR/NOTE-datetime - slots: at_location: description: >- diff --git a/src/things-publications/unreleased.yaml b/src/things-publications/unreleased.yaml index 897798a..5cdb637 100644 --- a/src/things-publications/unreleased.yaml +++ b/src/things-publications/unreleased.yaml @@ -81,7 +81,7 @@ classes: notation: description: >- The identifier notation is specified without a URL-prefix, or a `doi:` prefix. - pattern: '(?i)^(?!(?:https?://|doi:)).+$' + range: DoiNotation unique_keys: value: description: The DOI notation is globally unique within the scope of DOIs @@ -96,7 +96,7 @@ classes: notation: description: >- The identifier notation is specified without any prefix. - pattern: '^\d{4}-\d{3}[\dX]$' + range: IssnNotation unique_keys: value: description: The ISSN notation is globally unique within the scope of ISSNs diff --git a/src/things/unreleased.yaml b/src/things/unreleased.yaml index 595ad08..72ede90 100644 --- a/src/things/unreleased.yaml +++ b/src/things/unreleased.yaml @@ -36,9 +36,14 @@ description: | See the [things-data schema](/s/things-data) for an example that is built on this schema. - This schema also incorporates a few fundamental type definitions, such as - [`HexBinary`](HexBinary) (for checksum-like identifiers), and - [`NonNegativeInteger`](NonNegativeInteger) for counts. + This schema also incorporates fundamental type definitions, such as + [`HexBinary`](HexBinary) (for checksum-like identifiers), + [`NonNegativeInteger`](NonNegativeInteger) for counts, and + [`W3CISO8601`](W3CISO8601) for date(time) specifications. + Additional reusable types (e.g., [`OrcidNotation`](OrcidNotation), + [`DoiNotation`](DoiNotation), [`IssnNotation`](IssnNotation), + [`RelativePath`](RelativePath)) are available via the + [`types/unreleased`](../../types/unreleased) import. The schema definition is available as @@ -110,6 +115,7 @@ emit_prefixes: - xsd imports: + - dlschemas:types/unreleased - linkml:types types: @@ -152,6 +158,28 @@ types: broad_mappings: - schema:Integer + # Defined here (not in types/unreleased) because things-properties/v1 + # and temporal-mixin/unreleased each define W3CISO8601 with different URIs + # (dlthings:w3ctr-datetime vs w3ctr:NOTE-datetime). Placing it in + # types/unreleased causes merge conflicts for schemas importing both chains. + W3CISO8601: + uri: dlthings:w3ctr-datetime + base: str + typeof: string + description: + W3C variant/subset of IS08601 for specifying date(times). + Supported are + - YYYY (eg 1997) + - YYYY-MM (eg 1997-07) + - YYYY-MM-DD (eg 1997-07-16) + - YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00) + - YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00) + - YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00) + where TZD is the time zone designator (Z or +hh:mm or -hh:mm) + pattern: '^([-+]\d+)|(\d{4})|(\d{4}-[01]\d)|(\d{4}-[01]\d-[0-3]\d)|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))$' + see_also: + - https://www.w3.org/TR/NOTE-datetime + slots: about: slot_uri: dcterms:subject diff --git a/src/types/unreleased.yaml b/src/types/unreleased.yaml index 4818e5e..f66324a 100644 --- a/src/types/unreleased.yaml +++ b/src/types/unreleased.yaml @@ -1,21 +1,12 @@ id: https://concepts.datalad.org/s/types/unreleased -name: types-schema +name: types-development-schema version: UNRELEASED -status: eunal:concept-status/DEPRECATED +status: eunal:concept-status/DRAFT title: Collection of common types and a type-designator description: | - This schema provides a collection of common types for use in other - schemas. It can be imported directly into other linkml schemas, or - any of its individual property definitions can be used by their - URI as vocabulary components or definitions (e.g., `dltypes:EmailAddress` - identified by this [URI](EmailAddress)). - - With the [`schema_type`](schema_type) slot and its `range` type - [`NodeUriOrCurie`](NodeUriOrCurie), this schema provides an essential - building block for other schemas. This slot can be used as a - [type designator](https://linkml.io/linkml/schemas/type-designators.html), - to enable precise validation of sub-types, with an adequate - representation in an RDF data export. + This schema extends [types/v1](../../types/v1) with additional reusable + type definitions. It can be imported by any schema that needs these types, + regardless of whether it goes through the `things` or `flat` schema chain. The schema definition is available as @@ -31,80 +22,53 @@ comments: license: MIT prefixes: - dcterms: http://purl.org/dc/terms/ dlschemas: https://concepts.datalad.org/s/ - dltypes: https://concepts.datalad.org/s/types/unreleased/ + dltypes: https://concepts.datalad.org/s/types/v1/ eunal: http://publications.europa.eu/resource/authority/ linkml: https://w3id.org/linkml/ - rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# - rdfs: http://www.w3.org/2000/01/rdf-schema# - schema: http://schema.org/ xsd: http://www.w3.org/2001/XMLSchema# default_prefix: dltypes emit_prefixes: - dltypes - - rdf - - rdfs - xsd imports: - linkml:types types: - EmailAddress: - uri: dltypes:EmailAddress + OrcidNotation: + uri: dltypes:OrcidNotation base: str typeof: string - description: RFC 5322 compliant email address - pattern: '(?:[A-Za-z0-9!#$%&''*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&''*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[A-Za-z0-9-]*[A-Za-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])' - notes: - - The validation regex is taken from https://stackoverflow.com/a/201378 - - The regex is single-quoted for YAML encoding, hence all inner "'" have been doubled + description: >- + ORCID identifier notation (without URL prefix). + Format: four groups of four digits separated by hyphens, + with the last character being a digit or X. + pattern: '^\d{4}-\d{4}-\d{4}-\d{3}[0-9X]{1}$' - HexBinary: - uri: xsd:hexBinary + DoiNotation: + uri: dltypes:DoiNotation base: str typeof: string - pattern: "^[a-fA-F0-9]+$" description: >- - hex-encoded binary data. + DOI identifier notation (without URL or doi: prefix). + pattern: '(?i)^(?!(?:https?://|doi:)).+$' - NodeUriOrCurie: - typeof: uriorcurie - description: >- - A type referencing an graph node. This is like `uriorcurie`, but in - an RDF export leads to the desirable `rdf.type` declaration, rather - then an `rdf.literal` of the corresponding URI. + IssnNotation: + uri: dltypes:IssnNotation base: str - uri: rdfs:Resource - - NonNegativeInteger: - uri: xsd:nonNegativeInteger - base: int - typeof: integer - description: An integer - notes: - - >- - Integer with minimum (inclusive) value of zero, i.e. the standard - mathematical concept of the non-negative integers. - broad_mappings: - - schema:Integer - - -slots: - schema_type: - slot_uri: rdf:type - designates_type: true + typeof: string description: >- - State that the subject is an instance of a particular schema class. - Typically, no explicit value needs to be assigned to this slot, - because it matches the class type of a particular record. - However, this slots can be used as a type designator of a schema - element for validation and schema structure handling purposes. - This is used to indicate specialized schema classes for properties - that accept a hierarchy of classes as their range. - range: NodeUriOrCurie - exact_mappings: - - dcterms:type + ISSN identifier notation. Format: four digits, hyphen, + three digits, and a check character (digit or X). + pattern: '^\d{4}-\d{3}[\dX]$' + + RelativePath: + uri: dltypes:RelativePath + base: str + typeof: string + description: >- + A relative file path (no leading slash). + pattern: '^[^/]+.*$'