From afdfe53a86854b9263b1cfde30e575529f28371b Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Mon, 9 Dec 2024 21:16:03 +0100 Subject: [PATCH] Introduce a `properties` schema This is a library component that carries properties that have previously lived in the `things` schema. --- Makefile | 9 +- extra-docs/index.md | 1 + mkdocs.yml | 2 + src/properties/unreleased.yaml | 172 ++++++++++++++++++ .../examples/Identifier-01-minimal.json | 5 + .../examples/Identifier-01-minimal.yaml | 4 + src/properties/unreleased/extra-docs/about.md | 0 .../validation/Identifier.valid.cfg.yaml | 9 + 8 files changed, 199 insertions(+), 3 deletions(-) create mode 100644 src/properties/unreleased.yaml create mode 100644 src/properties/unreleased/examples/Identifier-01-minimal.json create mode 100644 src/properties/unreleased/examples/Identifier-01-minimal.yaml create mode 100644 src/properties/unreleased/extra-docs/about.md create mode 100644 src/properties/unreleased/validation/Identifier.valid.cfg.yaml diff --git a/Makefile b/Makefile index 19cda13..7c30db1 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ try: all: build/mkdocs-site build/linkml-docs: \ + build/linkml-docs/s/properties/unreleased \ build/linkml-docs/s/thing/unreleased \ build/linkml-docs/s/prov/unreleased \ build/linkml-docs/s/distribution/unreleased \ @@ -51,11 +52,12 @@ check: check-models check-validation # add additional schemas to lint here check-models: \ + checkmodel/properties/unreleased \ checkmodel/thing/unreleased \ checkmodel/prov/unreleased \ checkmodel/distribution/unreleased \ - checkmodel/datalad-dataset/unreleased -# checkmodel/sdd/unreleased + checkmodel/datalad-dataset/unreleased \ + checkmodel/sdd/unreleased checkmodel/%: src/%.yaml @echo [Check $<] @echo "Run linter" @@ -83,7 +85,7 @@ checkmodel/%: src/%.yaml # respective validation targets, because some tests rely on these # converted formats check-validation: \ - convertexamples/thing/unreleased \ + convertexamples/properties/unreleased \ checkvalidation/thing/unreleased \ convertexamples/prov/unreleased \ checkvalidation/prov/unreleased \ @@ -107,6 +109,7 @@ checkinvalid/%: src/%/validation src/%.yaml done convert-examples: \ + convertexamples/properties/unreleased \ convertexamples/thing/unreleased \ convertexamples/prov/unreleased \ convertexamples/distribution/unreleased \ diff --git a/extra-docs/index.md b/extra-docs/index.md index fd72588..3052bbe 100644 --- a/extra-docs/index.md +++ b/extra-docs/index.md @@ -1,6 +1,7 @@ ALL CONTENT HERE IS UNRELEASED AND MAY CHANGE ANY TIME - [Thing schema](s/thing/unreleased/index.md) +- [Properties schema](s/properties/unreleased/index.md) - [Provenance schema](s/prov/unreleased/index.md) - [Data distribution schema](s/distribution/unreleased/index.md) - [DataLad dataset schema](s/datalad-dataset/unreleased/index.md) diff --git a/mkdocs.yml b/mkdocs.yml index 4e8a13f..0968c7c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,6 +5,7 @@ nav: - About: about.md - Schemas: - Thing (unreleased): s/thing/unreleased/index.md + - Properties (unreleased): s/properties/unreleased/index.md - Provenance (unreleased): s/prov/unreleased/index.md - Distribution (unreleased): s/distribution/unreleased/index.md - DataLad dataset (unreleased): s/datalad-dataset/unreleased/index.md @@ -15,6 +16,7 @@ plugins: redirect_maps: # map unversioned URLs to the latest version 's/thing/index.md': 's/thing/unreleased/index.md' + 's/properties/index.md': 's/properties/unreleased/index.md' 's/prov/index.md': 's/prov/unreleased/index.md' 's/distribution/index.md': 's/distribution/unreleased/index.md' 's/datalad-dataset/index.md': 's/datalad-dataset/unreleased/index.md' diff --git a/src/properties/unreleased.yaml b/src/properties/unreleased.yaml new file mode 100644 index 0000000..f63506f --- /dev/null +++ b/src/properties/unreleased.yaml @@ -0,0 +1,172 @@ +id: https://concepts.datalad.org/s/properties/unreleased +name: properties +version: UNRELEASED +status: bibo:status/draft +title: Collection of common properties for use in schemas +description: | + This schema provides a collection of common properties 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., `dlprops:name` + identified by this [URI](`name`)). + + Class definitions are only included insofar as they define ranges + for particular property slots. + + Slot names use the plural form whenever they are directly declared as + "multivalued" in this schema, otherwise the singular form is used for + the slot name. The `slot_uri` always uses the singular form. + + Every property declared here is mapped to standard/established vocabularies. + + The schema definition is available as + + - [JSON-LD context](../unreleased.jsonld) + - [LinkML YAML](../unreleased.yaml) + - [OWL TTL](../unreleased.owl.ttl) + +comments: + - ALL CONTENT HERE IS UNRELEASED AND MAY CHANGE ANY TIME + +license: MIT + +prefixes: + ADMS: http://www.w3.org/ns/adms# + bibo: http://purl.org/ontology/bibo/ + dcterms: http://purl.org/dc/terms/ + dlprops: https://concepts.datalad.org/s/properties/unreleased/ + foaf: http://xmlns.com/foaf/0.1/ + linkml: https://w3id.org/linkml/ + obo: http://purl.obolibrary.org/obo/ + owl: http://www.w3.org/2002/07/owl# + rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# + rdfs: http://www.w3.org/2000/01/rdf-schema# + sio: http://semanticscience.org/resource/ + skos: http://www.w3.org/2004/02/skos/core# + +default_prefix: dlprops + +imports: + - linkml:types + +slots: + conforms_to: + slot_uri: dlprops:conforms_to + description: >- + An established standard to which the subject conforms. + range: uriorcurie + comments: + - This property SHOULD be used to indicate a model, schema, ontology, view or profile that the subject conforms to. + exact_mappings: + - dcterms:conformsTo + + description: + slot_uri: dlprops:description + description: A free-text account of the subject. + exact_mappings: + - dcterms:description + - rdfs:comment + range: string + + identifiers: + slot_uri: dlprops:identifier + description: An unambiguous reference to the subject within a given context. + exact_mappings: + - dcterms:identifier + - schema:identifier + - ADMS:identifier + range: Identifier + inlined: true + inlined_as_list: true + multivalued: true + + is_about: + slot_uri: dlprops:is_about + description: >- + A relation of an information artifact to the subject, such as + a URL identifying the topic of a document. + range: uriorcurie + exact_mappings: + - schema:about + - obo:IAO_0000136 + + name: + slot_uri: dlprops:name + description: >- + Name of the subject. A name is closely related to a `title`, but often + more compact and identifier-like, but without the implication of + uniqueness of an identifier. A name is often used by technical systems + to display an item in an organizational structure, such as a file + in a directory hierarchy. + exact_mappings: + - rdfs:label + - schema:name + - foaf:name + close_mappings: + - dlprops:title + range: string + + notation: + slot_uri: dlprops:notation + description: >- + String of characters such as "T58:5" or "30:4833" used to uniquely + identify a concept within the scope of a given concept scheme. + range: string + exact_mappings: + - skos:notation + + same_as: + slot_uri: dlprops:same_as + description: >- + Declares that the subject and an object are equal. + Can be used to indicate a URL of a reference Web page that unambiguously + indicates the subject's identity. For example, the URL of the subject's + Wikipedia page, Wikidata entry, or official website. + range: uriorcurie + exact_mappings: + - owl:sameAs + close_mappings: + - schema:sameAs + + schema_agency: + slot_uri: dlprops:schema_agency + description: >- + Name of the agency that issued an identifier. + range: uriorcurie + exact_mappings: + - ADMS:schemaAgency + + title: + slot_uri: dlprops:title + description: >- + A summarily description of the subject. It is closely related to + a `name`, but often less compact and more descriptive. Typically used for + documents. + exact_mappings: + - dcterms:title + - sio:SIO_000185 + related_mappings: + - schema:name + range: string + + +classes: + Identifier: + class_uri: dlprops:Identifier + description: >- + An identifier is a label that uniquely identifies an item in a + particular context. Some identifiers are globally unique. All + identifiers are unique within the scope of their issuing + agency. + slots: + - notation + - schema_agency + slot_usage: + notation: + required: true + schema_agency: + required: true + exact_mappings: + - ADMS:Identifier + see_also: + - https://semiceu.github.io/ADMS/releases/2.00/#Identifier diff --git a/src/properties/unreleased/examples/Identifier-01-minimal.json b/src/properties/unreleased/examples/Identifier-01-minimal.json new file mode 100644 index 0000000..d0c9061 --- /dev/null +++ b/src/properties/unreleased/examples/Identifier-01-minimal.json @@ -0,0 +1,5 @@ +{ + "notation": "0000-0001-6398-6370", + "schema_agency": "https://orcid.org", + "@type": "Identifier" +} diff --git a/src/properties/unreleased/examples/Identifier-01-minimal.yaml b/src/properties/unreleased/examples/Identifier-01-minimal.yaml new file mode 100644 index 0000000..211d269 --- /dev/null +++ b/src/properties/unreleased/examples/Identifier-01-minimal.yaml @@ -0,0 +1,4 @@ +# For any identifier, the actual notation and the issuing agency +# must be specified. +notation: 0000-0001-6398-6370 +schema_agency: https://orcid.org diff --git a/src/properties/unreleased/extra-docs/about.md b/src/properties/unreleased/extra-docs/about.md new file mode 100644 index 0000000..e69de29 diff --git a/src/properties/unreleased/validation/Identifier.valid.cfg.yaml b/src/properties/unreleased/validation/Identifier.valid.cfg.yaml new file mode 100644 index 0000000..771d99e --- /dev/null +++ b/src/properties/unreleased/validation/Identifier.valid.cfg.yaml @@ -0,0 +1,9 @@ +schema: src/properties/unreleased.yaml +target_class: Identifier +data_sources: + - src/properties/unreleased/examples/Identifier-01-minimal.yaml +plugins: + JsonschemaValidationPlugin: + closed: true + include_range_class_descendants: false + RecommendedSlotsPlugin: