From 9b889ee8d4b4227403ce9ae59dc6c2c84ccfbfa6 Mon Sep 17 00:00:00 2001 From: David Linke Date: Tue, 7 May 2024 23:21:00 +0200 Subject: [PATCH] Fix range for related_identifiers slot --- project/excel/pid4cat_model.xlsx | Bin 8290 -> 8290 bytes project/graphql/pid4cat_model.graphql | 2 +- project/jsonld/pid4cat_model.context.jsonld | 4 +- project/jsonld/pid4cat_model.jsonld | 29 +- project/jsonschema/pid4cat_model.schema.json | 4 +- project/owl/pid4cat_model.owl.ttl | 308 +++++++++--------- project/prefixmap/pid4cat_model.yaml | 2 +- project/protobuf/pid4cat_model.proto | 2 +- project/shacl/pid4cat_model.shacl.ttl | 158 ++++----- project/shex/pid4cat_model.shex | 2 +- project/sqlschema/pid4cat_model.sql | 21 +- src/pid4cat_model/datamodel/pid4cat_model.py | 26 +- .../datamodel/pid4cat_model_pydantic.py | 2 +- src/pid4cat_model/schema/pid4cat_model.yaml | 20 +- 14 files changed, 289 insertions(+), 291 deletions(-) diff --git a/project/excel/pid4cat_model.xlsx b/project/excel/pid4cat_model.xlsx index b79a1ffb2e2fd782bd467db09161f49bd48abe95..a159d693fd569e1ee6e43fdeedd7f43cb02ca9b2 100644 GIT binary patch delta 509 zcmaFl@W_ETz?+#xgn@y9gF$`A@`=1_Ie=8ePUhBy6Ax+CU*esxNKaf~xvx`_P)GEW zifGr%Zk>UAA(!;d_EmewiTA9SwWoRcV$mT1G*x@Y zCZCJT?WLEcsQnH(8&ZG0v~v5L9f``U>u;a^yrm}0v@^F^#ph)}vdZaPlgF+PuUuEH z(Vq7FW;|m-F|nmL90&K%snTc++7zCrL{IJfAMSg|Di9U!{4s1 zm(XVlKD55xcs`2PBWA|TQ5IlhV3?!Mz#t3^kcu4r&94}>*qDI_c z&`)NPH3zAmY$Iz2rfX%L!SrD$%_#@r`$OreQ2I8MR+P5@tB;X41JhIGt-$mpc~>wk HrQiVo#5>Nm delta 509 zcmaFl@W_ETz?+#xgn@y9gF$d_?zisL`xCn$E`iDnVTN`VUwA(ZI+48AtfERvaqPl8i(EAq&1p0$Xb1wvOr6F z$EKExOYNnfr6?Z1qIad(bvu`<|jgudrbsQzXtk>w_d(s z`eE&jIqCJH7uJ1Z@m$^zUFI40>h|utw!ux^r3YOV&8!ul%sO55*=%Rsm-yCo+u!c{ z+x}50fcMWY^RJvJUXPd=Ge=o~je%i~Is=0+FhDAD^f$j^)M8@>2FPY{jx;7Pqk-!t zgb~AQ0bxw%SAj703Gzc27lex$!HV5PtH2_Y4~sto3#^e?0g(xpVumncrQ^Yj$@^uj z;Xyx{N!A>sezJ|M9hk0_bq3Rip){u)gzpcfr$Xu5P+C#m0<1np-V97nmA3-Zm*ic+ Iw3LDe08|LeS^xk5 diff --git a/project/graphql/pid4cat_model.graphql b/project/graphql/pid4cat_model.graphql index b6ce1bb..96941f1 100644 --- a/project/graphql/pid4cat_model.graphql +++ b/project/graphql/pid4cat_model.graphql @@ -30,7 +30,7 @@ type PID4CatRecord dcRights: String curationContact: String resourceInfo: ResourceInfo - relatedIdentifiers: [Uriorcurie] + relatedIdentifiers: [PID4CatRelation] changeLog: [LogRecord]! } diff --git a/project/jsonld/pid4cat_model.context.jsonld b/project/jsonld/pid4cat_model.context.jsonld index c2220ee..c8154a5 100644 --- a/project/jsonld/pid4cat_model.context.jsonld +++ b/project/jsonld/pid4cat_model.context.jsonld @@ -1,13 +1,13 @@ { "comments": { "description": "Auto generated by LinkML jsonld context generator", - "generation_date": "2024-02-25T23:40:28", + "generation_date": "2024-05-07T23:00:58", "source": "pid4cat_model.yaml" }, "@context": { "DCAT": "http://www.w3.org/ns/dcat#", "DataCite": "http://purl.org/spar/datacite/", - "dct": "http://purl.org/dc/terms/", + "dcterms": "http://purl.org/dc/terms/", "linkml": "https://w3id.org/linkml/", "pid4cat_model": "https://w3id.org/nfdi4cat/pid4cat-model/", "schema": "http://schema.org/", diff --git a/project/jsonld/pid4cat_model.jsonld b/project/jsonld/pid4cat_model.jsonld index 33fe625..53177a1 100644 --- a/project/jsonld/pid4cat_model.jsonld +++ b/project/jsonld/pid4cat_model.jsonld @@ -1,6 +1,6 @@ { "name": "pid4cat-model", - "description": "A LinkML model for PIDs for resources in catalysis (PID4Cat). PID4Cat is a handle system based persistent identifier (PID) for digital or physical resources used in the catalysis research process. The handle record is used to store metadata about the PID besides the obligatory landing page URL.\nThe model describes metadata for the PID itself and how to access the identified resource. It does not describe the resource itself with the exception of the resource category, which is a high-level description of what is identified by the PID4Cat handle, e.g. a sample or a device.", + "description": "A LinkML model for PIDs for resources in catalysis (PID4Cat). PID4Cat is a handle system based persistent identifier (PID) for digital or physical resources used in the catalysis research process. The handle record is used to store additional metadata about the PID besides the obligatory landing page URL.\nThe model describes metadata for the PID itself and how to access the identified resource. It does not describe the resource itself with the exception of the resource category, which is a high-level description of what is identified by the PID4Cat handle, e.g. a sample or a device.", "title": "pid4cat-model", "todos": [ "Refine slots in slot_usage of class instead of globally in slot definitions", @@ -29,7 +29,7 @@ "prefix_reference": "http://schema.org/" }, { - "prefix_prefix": "dct", + "prefix_prefix": "dcterms", "prefix_reference": "http://purl.org/dc/terms/" }, { @@ -434,12 +434,12 @@ { "text": "HAS_VERSION", "description": "The resource has a version.", - "meaning": "dct:hasVersion" + "meaning": "dcterms:hasVersion" }, { "text": "IS_VERSION_OF", "description": "The resource is a version of.", - "meaning": "dct:isVersionOf" + "meaning": "dcterms:isVersionOf" }, { "text": "IS_NEW_VERSION_OF", @@ -452,12 +452,12 @@ { "text": "IS_PART_OF", "description": "The resource is part of another resource.", - "meaning": "dct:isPartOf" + "meaning": "dcterms:isPartOf" }, { "text": "HAS_PART", "description": "The resource has part another resource.", - "meaning": "dct:hasPart" + "meaning": "dcterms:hasPart" }, { "text": "IS_DESCRIBED_BY", @@ -474,7 +474,7 @@ { "text": "IS_REFERENCED_BY", "description": "The resource is referenced by another resource.", - "meaning": "dct:isReferencedBy" + "meaning": "dcterms:isReferencedBy" }, { "text": "REFERENCES", @@ -527,12 +527,12 @@ { "text": "IS_REQUIRED_BY", "description": "The resource is required by another resource.", - "meaning": "dct:isRequiredBy" + "meaning": "dcterms:isRequiredBy" }, { "text": "REQUIRES", "description": "The resource requires another resource.", - "meaning": "dct:requires" + "meaning": "dcterms:requires" }, { "text": "IS_OBSOLETED_BY", @@ -711,7 +711,7 @@ { "name": "related_identifiers", "definition_uri": "https://w3id.org/nfdi4cat/pid4cat-model/related_identifiers", - "description": "Alternate identifiers for the resource", + "description": "Relations of the resource to other identifiers", "from_schema": "https://w3id.org/nfdi4cat/pid4cat-model", "mappings": [ "http://schema.org/identifier" @@ -722,7 +722,8 @@ "domain_of": [ "PID4CatRecord" ], - "range": "uriorcurie", + "range": "PID4CatRelation", + "inlined": true, "@type": "SlotDefinition" }, { @@ -1204,9 +1205,9 @@ ], "metamodel_version": "1.7.0", "source_file": "pid4cat_model.yaml", - "source_file_date": "2024-02-25T18:17:54", - "source_file_size": 12852, - "generation_date": "2024-02-25T23:40:29", + "source_file_date": "2024-05-07T22:57:23", + "source_file_size": 12910, + "generation_date": "2024-05-07T23:00:59", "@type": "SchemaDefinition", "@context": [ "project/jsonld/pid4cat_model.context.jsonld", diff --git a/project/jsonschema/pid4cat_model.schema.json b/project/jsonschema/pid4cat_model.schema.json index 2770f5e..e14b516 100644 --- a/project/jsonschema/pid4cat_model.schema.json +++ b/project/jsonschema/pid4cat_model.schema.json @@ -125,9 +125,9 @@ "type": "string" }, "related_identifiers": { - "description": "Alternate identifiers for the resource", + "description": "Relations of the resource to other identifiers", "items": { - "type": "string" + "$ref": "#/$defs/PID4CatRelation" }, "type": "array" }, diff --git a/project/owl/pid4cat_model.owl.ttl b/project/owl/pid4cat_model.owl.ttl index c9bb6a9..2873083 100644 --- a/project/owl/pid4cat_model.owl.ttl +++ b/project/owl/pid4cat_model.owl.ttl @@ -1,5 +1,5 @@ @prefix dcmitype: . -@prefix dct: . +@prefix dcterms: . @prefix linkml: . @prefix owl: . @prefix pid4cat_model: . @@ -22,134 +22,95 @@ pid4cat_model:Container a owl:Class, skos:definition "A container for all PID4Cat instances." ; skos:inScheme . -pid4cat_model:PID4CatRelation a owl:Class, +pid4cat_model:PID4CatRecord a owl:Class, linkml:ClassDefinition ; - rdfs:label "PID4CatRelation" ; + rdfs:label "PID4CatRecord" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:has_agent ], - [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty pid4cat_model:related_identifier ], + owl:onProperty pid4cat_model:curation_contact ], [ a owl:Restriction ; - owl:minCardinality 0 ; - owl:onProperty pid4cat_model:has_agent ], + owl:allValuesFrom linkml:String ; + owl:onProperty pid4cat_model:record_version ], [ a owl:Restriction ; owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:related_identifier ], - [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty pid4cat_model:related_identifier ], + owl:onProperty pid4cat_model:status ], [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty pid4cat_model:datetime_log ], + owl:onProperty pid4cat_model:related_identifiers ], [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty pid4cat_model:datetime_log ], + owl:minCardinality 0 ; + owl:onProperty pid4cat_model:record_version ], [ a owl:Restriction ; owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:datetime_log ], - [ a owl:Restriction ; - owl:allValuesFrom pid4cat_model:RelationType ; - owl:onProperty pid4cat_model:relation_type ], - [ a owl:Restriction ; - owl:allValuesFrom pid4cat_model:Agent ; - owl:onProperty pid4cat_model:has_agent ], + owl:onProperty pid4cat_model:pid_schema_version ], [ a owl:Restriction ; - owl:minCardinality 0 ; - owl:onProperty pid4cat_model:relation_type ] ; - skos:definition "A relation between PID4CatRecords or between a PID4CatRecord and other resources with a PID." ; - skos:inScheme . - -pid4cat_model:PID4CatRecord a owl:Class, - linkml:ClassDefinition ; - rdfs:label "PID4CatRecord" ; - rdfs:subClassOf [ a owl:Restriction ; - owl:minCardinality 0 ; - owl:onProperty pid4cat_model:record_version ], + owl:allValuesFrom pid4cat_model:LogRecord ; + owl:onProperty pid4cat_model:change_log ], [ a owl:Restriction ; owl:allValuesFrom linkml:String ; - owl:onProperty pid4cat_model:landing_page_url ], - [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:landing_page_url ], + owl:onProperty pid4cat_model:pid_schema_version ], [ a owl:Restriction ; owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:record_version ], + owl:onProperty pid4cat_model:id ], [ a owl:Restriction ; owl:maxCardinality 1 ; owl:onProperty pid4cat_model:resource_info ], [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:id ], + owl:allValuesFrom pid4cat_model:ResourceInfo ; + owl:onProperty pid4cat_model:resource_info ], [ a owl:Restriction ; - owl:minCardinality 1 ; - owl:onProperty pid4cat_model:change_log ], + owl:minCardinality 0 ; + owl:onProperty pid4cat_model:resource_info ], [ a owl:Restriction ; owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:curation_contact ], + owl:onProperty pid4cat_model:record_version ], [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty pid4cat_model:pid_schema_version ], + owl:onProperty pid4cat_model:dc_rights ], [ a owl:Restriction ; - owl:minCardinality 0 ; + owl:allValuesFrom linkml:String ; owl:onProperty pid4cat_model:landing_page_url ], [ a owl:Restriction ; owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:status ], - [ a owl:Restriction ; - owl:minCardinality 0 ; - owl:onProperty pid4cat_model:status ], + owl:onProperty pid4cat_model:curation_contact ], [ a owl:Restriction ; owl:maxCardinality 1 ; owl:onProperty pid4cat_model:dc_rights ], [ a owl:Restriction ; - owl:allValuesFrom pid4cat_model:LogRecord ; - owl:onProperty pid4cat_model:change_log ], + owl:minCardinality 0 ; + owl:onProperty pid4cat_model:landing_page_url ], [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty pid4cat_model:record_version ], + owl:allValuesFrom pid4cat_model:PID4CatRelation ; + owl:onProperty pid4cat_model:related_identifiers ], [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:pid_schema_version ], + owl:allValuesFrom linkml:String ; + owl:onProperty pid4cat_model:dc_rights ], [ a owl:Restriction ; - owl:minCardinality 0 ; - owl:onProperty pid4cat_model:curation_contact ], + owl:minCardinality 1 ; + owl:onProperty pid4cat_model:change_log ], [ a owl:Restriction ; owl:allValuesFrom [ a rdfs:Datatype ; owl:onDatatype xsd:string ; owl:withRestrictions ( [ xsd:pattern "^\\S+@[\\S+\\.]+\\S+" ] ) ] ; owl:onProperty pid4cat_model:curation_contact ], [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty pid4cat_model:pid_schema_version ], - [ a owl:Restriction ; - owl:allValuesFrom pid4cat_model:PID4CatStatus ; - owl:onProperty pid4cat_model:status ], - [ a owl:Restriction ; - owl:minCardinality 1 ; - owl:onProperty pid4cat_model:id ], + owl:maxCardinality 1 ; + owl:onProperty pid4cat_model:landing_page_url ], [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty pid4cat_model:dc_rights ], - [ a owl:Restriction ; - owl:allValuesFrom pid4cat_model:ResourceInfo ; - owl:onProperty pid4cat_model:resource_info ], + owl:onProperty pid4cat_model:pid_schema_version ], [ a owl:Restriction ; - owl:allValuesFrom linkml:Uriorcurie ; + owl:minCardinality 1 ; owl:onProperty pid4cat_model:id ], [ a owl:Restriction ; - owl:allValuesFrom linkml:Uriorcurie ; - owl:onProperty pid4cat_model:related_identifiers ], - [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty pid4cat_model:dc_rights ], + owl:allValuesFrom pid4cat_model:PID4CatStatus ; + owl:onProperty pid4cat_model:status ], [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty pid4cat_model:related_identifiers ], + owl:onProperty pid4cat_model:status ], [ a owl:Restriction ; - owl:minCardinality 0 ; - owl:onProperty pid4cat_model:resource_info ] ; + owl:allValuesFrom linkml:Uriorcurie ; + owl:onProperty pid4cat_model:id ] ; skos:definition "Represents a PID4CatRecord" ; skos:inScheme . @@ -158,37 +119,37 @@ dcmitype:Collection a owl:Class, rdfs:label "COLLECTION" ; rdfs:subClassOf pid4cat_model:ResourceCategory . -dct:hasPart a owl:Class, +dcterms:hasPart a owl:Class, pid4cat_model:RelationType ; rdfs:label "HAS_PART" ; rdfs:subClassOf pid4cat_model:RelationType . -dct:hasVersion a owl:Class, +dcterms:hasVersion a owl:Class, pid4cat_model:RelationType ; rdfs:label "HAS_VERSION" ; rdfs:subClassOf pid4cat_model:RelationType . -dct:isPartOf a owl:Class, +dcterms:isPartOf a owl:Class, pid4cat_model:RelationType ; rdfs:label "IS_PART_OF" ; rdfs:subClassOf pid4cat_model:RelationType . -dct:isReferencedBy a owl:Class, +dcterms:isReferencedBy a owl:Class, pid4cat_model:RelationType ; rdfs:label "IS_REFERENCED_BY" ; rdfs:subClassOf pid4cat_model:RelationType . -dct:isRequiredBy a owl:Class, +dcterms:isRequiredBy a owl:Class, pid4cat_model:RelationType ; rdfs:label "IS_REQUIRED_BY" ; rdfs:subClassOf pid4cat_model:RelationType . -dct:isVersionOf a owl:Class, +dcterms:isVersionOf a owl:Class, pid4cat_model:RelationType ; rdfs:label "IS_VERSION_OF" ; rdfs:subClassOf pid4cat_model:RelationType . -dct:requires a owl:Class, +dcterms:requires a owl:Class, pid4cat_model:RelationType ; rdfs:label "REQUIRES" ; rdfs:subClassOf pid4cat_model:RelationType . @@ -227,41 +188,41 @@ pid4cat_model:LogRecord a owl:Class, linkml:ClassDefinition ; rdfs:label "LogRecord" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:changed_field ], - [ a owl:Restriction ; owl:minCardinality 0 ; owl:onProperty pid4cat_model:datetime_log ], + [ a owl:Restriction ; + owl:maxCardinality 1 ; + owl:onProperty pid4cat_model:has_agent ], + [ a owl:Restriction ; + owl:allValuesFrom pid4cat_model:Agent ; + owl:onProperty pid4cat_model:has_agent ], + [ a owl:Restriction ; + owl:maxCardinality 1 ; + owl:onProperty pid4cat_model:changed_field ], [ a owl:Restriction ; owl:allValuesFrom pid4cat_model:ChangeLogField ; owl:onProperty pid4cat_model:changed_field ], [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:datetime_log ], + owl:minCardinality 0 ; + owl:onProperty pid4cat_model:changed_field ], [ a owl:Restriction ; owl:allValuesFrom linkml:String ; - owl:onProperty pid4cat_model:description ], + owl:onProperty pid4cat_model:datetime_log ], [ a owl:Restriction ; - owl:minCardinality 0 ; + owl:allValuesFrom linkml:String ; owl:onProperty pid4cat_model:description ], [ a owl:Restriction ; owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:description ], + owl:onProperty pid4cat_model:datetime_log ], [ a owl:Restriction ; owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:has_agent ], + owl:onProperty pid4cat_model:description ], [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty pid4cat_model:has_agent ], + owl:onProperty pid4cat_model:description ], [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty pid4cat_model:changed_field ], - [ a owl:Restriction ; - owl:allValuesFrom pid4cat_model:Agent ; - owl:onProperty pid4cat_model:has_agent ], - [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty pid4cat_model:datetime_log ] ; + owl:onProperty pid4cat_model:has_agent ] ; skos:definition "A log record for changes made on a PID4CatRecord starting from registration." ; skos:inScheme . @@ -275,6 +236,45 @@ pid4cat_model:LogRecord a owl:Class, rdfs:label "TRUSTEE" ; rdfs:subClassOf pid4cat_model:PID4CatAgentRole . +pid4cat_model:PID4CatRelation a owl:Class, + linkml:ClassDefinition ; + rdfs:label "PID4CatRelation" ; + rdfs:subClassOf [ a owl:Restriction ; + owl:allValuesFrom linkml:String ; + owl:onProperty pid4cat_model:datetime_log ], + [ a owl:Restriction ; + owl:maxCardinality 1 ; + owl:onProperty pid4cat_model:has_agent ], + [ a owl:Restriction ; + owl:allValuesFrom pid4cat_model:Agent ; + owl:onProperty pid4cat_model:has_agent ], + [ a owl:Restriction ; + owl:minCardinality 0 ; + owl:onProperty pid4cat_model:has_agent ], + [ a owl:Restriction ; + owl:maxCardinality 1 ; + owl:onProperty pid4cat_model:datetime_log ], + [ a owl:Restriction ; + owl:minCardinality 0 ; + owl:onProperty pid4cat_model:related_identifier ], + [ a owl:Restriction ; + owl:allValuesFrom linkml:String ; + owl:onProperty pid4cat_model:related_identifier ], + [ a owl:Restriction ; + owl:minCardinality 0 ; + owl:onProperty pid4cat_model:datetime_log ], + [ a owl:Restriction ; + owl:allValuesFrom pid4cat_model:RelationType ; + owl:onProperty pid4cat_model:relation_type ], + [ a owl:Restriction ; + owl:maxCardinality 1 ; + owl:onProperty pid4cat_model:related_identifier ], + [ a owl:Restriction ; + owl:minCardinality 0 ; + owl:onProperty pid4cat_model:relation_type ] ; + skos:definition "A relation between PID4CatRecords or between a PID4CatRecord and other resources with a PID." ; + skos:inScheme . + a owl:Class, pid4cat_model:PID4CatStatus ; rdfs:label "DEPRECATED" ; @@ -453,64 +453,64 @@ pid4cat_model:ResourceInfo a owl:Class, owl:onProperty pid4cat_model:schema_type ], [ a owl:Restriction ; owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:description ], - [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty pid4cat_model:rdf_type ], + owl:onProperty pid4cat_model:schema_url ], [ a owl:Restriction ; owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:label ], + owl:onProperty pid4cat_model:rdf_url ], [ a owl:Restriction ; owl:allValuesFrom linkml:String ; owl:onProperty pid4cat_model:schema_type ], - [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:resource_category ], - [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:rdf_url ], [ a owl:Restriction ; owl:minCardinality 0 ; owl:onProperty pid4cat_model:rdf_url ], + [ a owl:Restriction ; + owl:allValuesFrom linkml:String ; + owl:onProperty pid4cat_model:description ], [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty pid4cat_model:schema_type ], + owl:onProperty pid4cat_model:label ], [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:schema_url ], + owl:allValuesFrom linkml:String ; + owl:onProperty pid4cat_model:rdf_type ], [ a owl:Restriction ; - owl:allValuesFrom pid4cat_model:ResourceCategory ; + owl:maxCardinality 1 ; owl:onProperty pid4cat_model:resource_category ], [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty pid4cat_model:resource_category ], + owl:onProperty pid4cat_model:schema_url ], [ a owl:Restriction ; owl:allValuesFrom linkml:String ; + owl:onProperty pid4cat_model:schema_url ], + [ a owl:Restriction ; + owl:maxCardinality 1 ; owl:onProperty pid4cat_model:description ], [ a owl:Restriction ; - owl:minCardinality 0 ; - owl:onProperty pid4cat_model:schema_url ], + owl:allValuesFrom pid4cat_model:ResourceCategory ; + owl:onProperty pid4cat_model:resource_category ], [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty pid4cat_model:label ], + owl:onProperty pid4cat_model:rdf_type ], [ a owl:Restriction ; owl:maxCardinality 1 ; owl:onProperty pid4cat_model:rdf_type ], [ a owl:Restriction ; owl:allValuesFrom linkml:String ; - owl:onProperty pid4cat_model:schema_url ], + owl:onProperty pid4cat_model:rdf_url ], [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty pid4cat_model:description ], + owl:onProperty pid4cat_model:schema_type ], [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty pid4cat_model:rdf_url ], + owl:maxCardinality 1 ; + owl:onProperty pid4cat_model:label ], [ a owl:Restriction ; owl:allValuesFrom linkml:String ; owl:onProperty pid4cat_model:label ], [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty pid4cat_model:rdf_type ] ; + owl:onProperty pid4cat_model:description ], + [ a owl:Restriction ; + owl:minCardinality 0 ; + owl:onProperty pid4cat_model:resource_category ] ; skos:definition "Data object to hold information about the resource and its representation." ; skos:inScheme . @@ -530,8 +530,8 @@ pid4cat_model:contains_pids a owl:ObjectProperty, pid4cat_model:related_identifiers a owl:ObjectProperty, linkml:SlotDefinition ; rdfs:label "related_identifiers" ; - rdfs:range linkml:Uriorcurie ; - skos:definition "Alternate identifiers for the resource" ; + rdfs:range pid4cat_model:PID4CatRelation ; + skos:definition "Relations of the resource to other identifiers" ; skos:inScheme . pid4cat_model:relation_type a owl:ObjectProperty, @@ -546,22 +546,22 @@ pid4cat_model:Agent a owl:Class, rdfs:label "Agent" ; rdfs:subClassOf [ a owl:Restriction ; owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:affiliation_ror ], - [ a owl:Restriction ; - owl:minCardinality 0 ; owl:onProperty pid4cat_model:contact_information ], [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:person_orcid ], + owl:allValuesFrom linkml:String ; + owl:onProperty pid4cat_model:contact_information ], [ a owl:Restriction ; owl:allValuesFrom linkml:String ; owl:onProperty pid4cat_model:affiliation_ror ], + [ a owl:Restriction ; + owl:maxCardinality 1 ; + owl:onProperty pid4cat_model:affiliation_ror ], [ a owl:Restriction ; owl:allValuesFrom linkml:String ; - owl:onProperty pid4cat_model:contact_information ], + owl:onProperty pid4cat_model:name ], [ a owl:Restriction ; - owl:allValuesFrom pid4cat_model:PID4CatAgentRole ; - owl:onProperty pid4cat_model:role ], + owl:allValuesFrom linkml:String ; + owl:onProperty pid4cat_model:person_orcid ], [ a owl:Restriction ; owl:maxCardinality 1 ; owl:onProperty pid4cat_model:role ], @@ -573,21 +573,21 @@ pid4cat_model:Agent a owl:Class, owl:onProperty pid4cat_model:name ], [ a owl:Restriction ; owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:contact_information ], + owl:onProperty pid4cat_model:person_orcid ], [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty pid4cat_model:name ], + owl:allValuesFrom pid4cat_model:PID4CatAgentRole ; + owl:onProperty pid4cat_model:role ], [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty pid4cat_model:person_orcid ], + owl:onProperty pid4cat_model:contact_information ], [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; + owl:maxCardinality 1 ; owl:onProperty pid4cat_model:name ], [ a owl:Restriction ; owl:minCardinality 0 ; owl:onProperty pid4cat_model:role ], [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; + owl:minCardinality 0 ; owl:onProperty pid4cat_model:person_orcid ] ; skos:definition "Person who plays a role relative to PID creation or curation." ; skos:inScheme . @@ -778,22 +778,22 @@ pid4cat_model:ResourceCategory a owl:Class, a owl:Ontology ; rdfs:label "pid4cat-model" ; - dct:license "MIT" ; - dct:title "pid4cat-model" ; + dcterms:license "MIT" ; + dcterms:title "pid4cat-model" ; rdfs:seeAlso ; - skos:definition """A LinkML model for PIDs for resources in catalysis (PID4Cat). PID4Cat is a handle system based persistent identifier (PID) for digital or physical resources used in the catalysis research process. The handle record is used to store metadata about the PID besides the obligatory landing page URL. + skos:definition """A LinkML model for PIDs for resources in catalysis (PID4Cat). PID4Cat is a handle system based persistent identifier (PID) for digital or physical resources used in the catalysis research process. The handle record is used to store additional metadata about the PID besides the obligatory landing page URL. The model describes metadata for the PID itself and how to access the identified resource. It does not describe the resource itself with the exception of the resource category, which is a high-level description of what is identified by the PID4Cat handle, e.g. a sample or a device.""" . pid4cat_model:RelationType a owl:Class, linkml:EnumDefinition ; - owl:unionOf ( dct:hasVersion dct:isVersionOf dct:isPartOf dct:hasPart dct:isReferencedBy dct:isRequiredBy dct:requires ) ; - linkml:permissible_values dct:hasPart, - dct:hasVersion, - dct:isPartOf, - dct:isReferencedBy, - dct:isRequiredBy, - dct:isVersionOf, - dct:requires, + owl:unionOf ( dcterms:hasVersion dcterms:isVersionOf dcterms:isPartOf dcterms:hasPart dcterms:isReferencedBy dcterms:isRequiredBy dcterms:requires ) ; + linkml:permissible_values dcterms:hasPart, + dcterms:hasVersion, + dcterms:isPartOf, + dcterms:isReferencedBy, + dcterms:isRequiredBy, + dcterms:isVersionOf, + dcterms:requires, , , , diff --git a/project/prefixmap/pid4cat_model.yaml b/project/prefixmap/pid4cat_model.yaml index 0425dc5..49636ee 100644 --- a/project/prefixmap/pid4cat_model.yaml +++ b/project/prefixmap/pid4cat_model.yaml @@ -1,7 +1,7 @@ { "DCAT": "http://www.w3.org/ns/dcat#", "DataCite": "http://purl.org/spar/datacite/", - "dct": "http://purl.org/dc/terms/", + "dcterms": "http://purl.org/dc/terms/", "linkml": "https://w3id.org/linkml/", "pid4cat_model": "https://w3id.org/nfdi4cat/pid4cat-model/", "schema": "http://schema.org/" diff --git a/project/protobuf/pid4cat_model.proto b/project/protobuf/pid4cat_model.proto index 2a2102e..02ec6ed 100644 --- a/project/protobuf/pid4cat_model.proto +++ b/project/protobuf/pid4cat_model.proto @@ -31,7 +31,7 @@ message PID4CatRecord string dcRights = 0 string curationContact = 0 resourceInfo resourceInfo = 0 - repeated uriorcurie relatedIdentifiers = 0 + repeated pID4CatRelation relatedIdentifiers = 0 repeated logRecord changeLog = 0 } // A relation between PID4CatRecords or between a PID4CatRecord and other resources with a PID. diff --git a/project/shacl/pid4cat_model.shacl.ttl b/project/shacl/pid4cat_model.shacl.ttl index 72f0578..177c373 100644 --- a/project/shacl/pid4cat_model.shacl.ttl +++ b/project/shacl/pid4cat_model.shacl.ttl @@ -1,5 +1,5 @@ @prefix dcmitype: . -@prefix dct: . +@prefix dcterms: . @prefix pid4cat_model: . @prefix rdf: . @prefix schema1: . @@ -18,32 +18,6 @@ pid4cat_model:Container a sh:NodeShape ; sh:path pid4cat_model:contains_pids ] ; sh:targetClass pid4cat_model:Container . -pid4cat_model:PID4CatRelation a sh:NodeShape ; - sh:closed true ; - sh:description "A relation between PID4CatRecords or between a PID4CatRecord and other resources with a PID." ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:class pid4cat_model:Agent ; - sh:description "The person who registered the resource" ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNode ; - sh:order 3 ; - sh:path schema1:Agent ], - [ sh:datatype xsd:string ; - sh:description "Related identifiers for the resource" ; - sh:maxCount 1 ; - sh:order 1 ; - sh:path schema1:identifier ], - [ sh:description "Relation type between the resources" ; - sh:in ( "IS_CITED_BY" "CITES" "IS_SUPPLEMENT_TO" "IS_SUPPLEMENTED_BY" "IS_CONTINUED_BY" "CONTINUES" "HAS_METADATA" "IS_METADATA_FOR" dct:hasVersion dct:isVersionOf "IS_NEW_VERSION_OF" "IS_PREVIOUS_VERSION_OF" dct:isPartOf dct:hasPart "IS_DESCRIBED_BY" "DESCRIBES" "IS_PUBLISHED_IN" dct:isReferencedBy "REFERENCES" "IS_DOCUMENTED_BY" "DOCUMENTS" "IS_COMPILED_BY" "COMPILES" "IS_VARIANT_FORM_OF" "IS_ORIGINAL_FORM_OF" "IS_IDENTICAL_TO" "IS_DERIVED_FROM" "IS_SOURCE_OF" "IS_COLLECTED_BY" "COLLECTS" dct:isRequiredBy dct:requires "IS_OBSOLETED_BY" "OBSOLETES" ) ; - sh:order 0 ; - sh:path schema1:identifier ], - [ sh:datatype xsd:string ; - sh:description "The date and time of a log record" ; - sh:maxCount 1 ; - sh:order 2 ; - sh:path schema1:DateTime ] ; - sh:targetClass pid4cat_model:PID4CatRelation . - pid4cat_model:LogRecord a sh:NodeShape ; sh:closed true ; sh:description "A log record for changes made on a PID4CatRecord starting from registration." ; @@ -76,44 +50,35 @@ pid4cat_model:PID4CatRecord a sh:NodeShape ; sh:description "Represents a PID4CatRecord" ; sh:ignoredProperties ( rdf:type ) ; sh:property [ sh:datatype xsd:string ; - sh:description "The version of the PID4Cat schema used for the PID4CatRecord." ; + sh:description "Date-based version string of the PID4CatRecord (e.g. 20240219v0, 20240219v1, ...). The version should be incremented with every change of the PID4CatRecord." ; sh:maxCount 1 ; - sh:order 4 ; + sh:order 3 ; + sh:path schema1:identifier ], + [ sh:description "A unique identifier for a thing" ; + sh:maxCount 1 ; + sh:order 0 ; sh:path schema1:identifier ], [ sh:datatype xsd:string ; sh:description "The URL of the landing page for the resource" ; sh:maxCount 1 ; sh:order 1 ; sh:path schema1:url ], - [ sh:class pid4cat_model:ResourceInfo ; - sh:description "Information about the resource." ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNode ; - sh:order 7 ; - sh:path pid4cat_model:resource_info ], [ sh:datatype xsd:string ; - sh:description "The license for the metadata contained in the PID4Cat record." ; - sh:maxCount 1 ; - sh:order 5 ; - sh:path schema1:license ], - [ sh:description "Alternate identifiers for the resource" ; - sh:order 8 ; - sh:path schema1:identifier ], - [ sh:description "A unique identifier for a thing" ; + sh:description "The version of the PID4Cat schema used for the PID4CatRecord." ; sh:maxCount 1 ; - sh:order 0 ; + sh:order 4 ; sh:path schema1:identifier ], - [ sh:description "The status of the PID4CatRecord." ; - sh:in ( "SUBMITTED" "REGISTERED" "OBSOLETED" "DEPRECATED" ) ; - sh:maxCount 1 ; - sh:order 2 ; - sh:path pid4cat_model:status ], [ sh:datatype xsd:string ; sh:description "The email address of a person or institution responsible for curation of the resource." ; sh:maxCount 1 ; sh:order 6 ; sh:path schema1:email ; sh:pattern "^\\S+@[\\S+\\.]+\\S+" ], + [ sh:class pid4cat_model:PID4CatRelation ; + sh:description "Relations of the resource to other identifiers" ; + sh:nodeKind sh:BlankNode ; + sh:order 8 ; + sh:path schema1:identifier ], [ sh:class pid4cat_model:LogRecord ; sh:description "Change log of PID4Cat record" ; sh:minCount 1 ; @@ -121,35 +86,67 @@ pid4cat_model:PID4CatRecord a sh:NodeShape ; sh:order 9 ; sh:path schema1:identifier ], [ sh:datatype xsd:string ; - sh:description "Date-based version string of the PID4CatRecord (e.g. 20240219v0, 20240219v1, ...). The version should be incremented with every change of the PID4CatRecord." ; + sh:description "The license for the metadata contained in the PID4Cat record." ; sh:maxCount 1 ; - sh:order 3 ; - sh:path schema1:identifier ] ; + sh:order 5 ; + sh:path schema1:license ], + [ sh:class pid4cat_model:ResourceInfo ; + sh:description "Information about the resource." ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNode ; + sh:order 7 ; + sh:path pid4cat_model:resource_info ], + [ sh:description "The status of the PID4CatRecord." ; + sh:in ( "SUBMITTED" "REGISTERED" "OBSOLETED" "DEPRECATED" ) ; + sh:maxCount 1 ; + sh:order 2 ; + sh:path pid4cat_model:status ] ; sh:targetClass pid4cat_model:PID4CatRecord . -pid4cat_model:ResourceInfo a sh:NodeShape ; +pid4cat_model:PID4CatRelation a sh:NodeShape ; sh:closed true ; - sh:description "Data object to hold information about the resource and its representation." ; + sh:description "A relation between PID4CatRecords or between a PID4CatRecord and other resources with a PID." ; sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype xsd:string ; - sh:description "The type of the scheme used to describe the resource. Examples: XSD, DDT, Turtle Same property as in DataCite:schemeType." ; + sh:property [ sh:class pid4cat_model:Agent ; + sh:description "The person who registered the resource" ; sh:maxCount 1 ; - sh:order 6 ; - sh:path schema1:additionalType ], + sh:nodeKind sh:BlankNode ; + sh:order 3 ; + sh:path schema1:Agent ], + [ sh:description "Relation type between the resources" ; + sh:in ( "IS_CITED_BY" "CITES" "IS_SUPPLEMENT_TO" "IS_SUPPLEMENTED_BY" "IS_CONTINUED_BY" "CONTINUES" "HAS_METADATA" "IS_METADATA_FOR" dcterms:hasVersion dcterms:isVersionOf "IS_NEW_VERSION_OF" "IS_PREVIOUS_VERSION_OF" dcterms:isPartOf dcterms:hasPart "IS_DESCRIBED_BY" "DESCRIBES" "IS_PUBLISHED_IN" dcterms:isReferencedBy "REFERENCES" "IS_DOCUMENTED_BY" "DOCUMENTS" "IS_COMPILED_BY" "COMPILES" "IS_VARIANT_FORM_OF" "IS_ORIGINAL_FORM_OF" "IS_IDENTICAL_TO" "IS_DERIVED_FROM" "IS_SOURCE_OF" "IS_COLLECTED_BY" "COLLECTS" dcterms:isRequiredBy dcterms:requires "IS_OBSOLETED_BY" "OBSOLETES" ) ; + sh:order 0 ; + sh:path schema1:identifier ], [ sh:datatype xsd:string ; - sh:description "The format of the rdf representation of the resource (xml, turlte, json-ld, ...)." ; + sh:description "Related identifiers for the resource" ; sh:maxCount 1 ; - sh:order 4 ; - sh:path schema1:additionalType ], + sh:order 1 ; + sh:path schema1:identifier ], [ sh:datatype xsd:string ; + sh:description "The date and time of a log record" ; + sh:maxCount 1 ; + sh:order 2 ; + sh:path schema1:DateTime ] ; + sh:targetClass pid4cat_model:PID4CatRelation . + +pid4cat_model:ResourceInfo a sh:NodeShape ; + sh:closed true ; + sh:description "Data object to hold information about the resource and its representation." ; + sh:ignoredProperties ( rdf:type ) ; + sh:property [ sh:datatype xsd:string ; sh:description "A human-readable name for a thing" ; sh:maxCount 1 ; sh:order 0 ; sh:path schema1:name ], - [ sh:description "The category of the resource" ; - sh:in ( dcmitype:Collection sosa:Sample "MATERIAL" "DEVICE" "DATAOBJECT" ) ; + [ sh:datatype xsd:string ; + sh:description "The type of the scheme used to describe the resource. Examples: XSD, DDT, Turtle Same property as in DataCite:schemeType." ; sh:maxCount 1 ; - sh:order 2 ; + sh:order 6 ; + sh:path schema1:additionalType ], + [ sh:datatype xsd:string ; + sh:description "The URI of the schema used to describe the resource. Same property as in DataCite:schemeURI." ; + sh:maxCount 1 ; + sh:order 5 ; sh:path schema1:additionalType ], [ sh:datatype xsd:string ; sh:description "A human-readable description for a thing" ; @@ -157,14 +154,19 @@ pid4cat_model:ResourceInfo a sh:NodeShape ; sh:order 1 ; sh:path schema1:description ], [ sh:datatype xsd:string ; - sh:description "The URI of the schema used to describe the resource. Same property as in DataCite:schemeURI." ; + sh:description "The URI of the rdf represenation of the resource." ; sh:maxCount 1 ; - sh:order 5 ; + sh:order 3 ; sh:path schema1:additionalType ], [ sh:datatype xsd:string ; - sh:description "The URI of the rdf represenation of the resource." ; + sh:description "The format of the rdf representation of the resource (xml, turlte, json-ld, ...)." ; sh:maxCount 1 ; - sh:order 3 ; + sh:order 4 ; + sh:path schema1:additionalType ], + [ sh:description "The category of the resource" ; + sh:in ( dcmitype:Collection sosa:Sample "MATERIAL" "DEVICE" "DATAOBJECT" ) ; + sh:maxCount 1 ; + sh:order 2 ; sh:path schema1:additionalType ] ; sh:targetClass pid4cat_model:ResourceInfo . @@ -173,25 +175,25 @@ pid4cat_model:Agent a sh:NodeShape ; sh:description "Person who plays a role relative to PID creation or curation." ; sh:ignoredProperties ( rdf:type ) ; sh:property [ sh:datatype xsd:string ; - sh:description "Identification of the agent that registered the PID, with contact information. Should include person name and affiliation, or position name and affiliation, or just organization name. e-mail address is preferred contact information." ; - sh:maxCount 1 ; - sh:order 1 ; - sh:path schema1:email ], - [ sh:description "The role of the agent relative to the resource" ; - sh:in ( "TRUSTEE" "OWNER" ) ; + sh:description "The ORCID of the person" ; sh:maxCount 1 ; - sh:order 4 ; + sh:order 2 ; sh:path schema1:identifier ], [ sh:datatype xsd:string ; sh:description "The name of the agent" ; sh:maxCount 1 ; sh:order 0 ; sh:path schema1:name ], - [ sh:datatype xsd:string ; - sh:description "The ORCID of the person" ; + [ sh:description "The role of the agent relative to the resource" ; + sh:in ( "TRUSTEE" "OWNER" ) ; sh:maxCount 1 ; - sh:order 2 ; + sh:order 4 ; sh:path schema1:identifier ], + [ sh:datatype xsd:string ; + sh:description "Identification of the agent that registered the PID, with contact information. Should include person name and affiliation, or position name and affiliation, or just organization name. e-mail address is preferred contact information." ; + sh:maxCount 1 ; + sh:order 1 ; + sh:path schema1:email ], [ sh:datatype xsd:string ; sh:description "The ROR of the affiliation" ; sh:maxCount 1 ; diff --git a/project/shex/pid4cat_model.shex b/project/shex/pid4cat_model.shex index 3c29f7d..da8e85e 100644 --- a/project/shex/pid4cat_model.shex +++ b/project/shex/pid4cat_model.shex @@ -78,7 +78,7 @@ linkml:Sparqlpath xsd:string schema1:license @linkml:String ? ; schema1:email @linkml:String ? ; @ ? ; - schema1:identifier @linkml:Uriorcurie * ; + schema1:identifier @ * ; schema1:identifier @ + ) ; rdf:type [ ] diff --git a/project/sqlschema/pid4cat_model.sql b/project/sqlschema/pid4cat_model.sql index abceacf..4d8ad07 100644 --- a/project/sqlschema/pid4cat_model.sql +++ b/project/sqlschema/pid4cat_model.sql @@ -26,14 +26,6 @@ CREATE TABLE "PID4CatRecord" ( PRIMARY KEY (id) ); -CREATE TABLE "PID4CatRelation" ( - relation_type VARCHAR(22), - related_identifier TEXT, - datetime_log TEXT, - has_agent TEXT, - PRIMARY KEY (relation_type, related_identifier, datetime_log, has_agent) -); - CREATE TABLE "ResourceInfo" ( label TEXT, description TEXT, @@ -55,9 +47,12 @@ CREATE TABLE "LogRecord" ( FOREIGN KEY("PID4CatRecord_id") REFERENCES "PID4CatRecord" (id) ); -CREATE TABLE "PID4CatRecord_related_identifiers" ( - backref_id TEXT, - related_identifiers TEXT, - PRIMARY KEY (backref_id, related_identifiers), - FOREIGN KEY(backref_id) REFERENCES "PID4CatRecord" (id) +CREATE TABLE "PID4CatRelation" ( + relation_type VARCHAR(22), + related_identifier TEXT, + datetime_log TEXT, + has_agent TEXT, + "PID4CatRecord_id" TEXT, + PRIMARY KEY (relation_type, related_identifier, datetime_log, has_agent, "PID4CatRecord_id"), + FOREIGN KEY("PID4CatRecord_id") REFERENCES "PID4CatRecord" (id) ); diff --git a/src/pid4cat_model/datamodel/pid4cat_model.py b/src/pid4cat_model/datamodel/pid4cat_model.py index 7838a05..7a04b0b 100644 --- a/src/pid4cat_model/datamodel/pid4cat_model.py +++ b/src/pid4cat_model/datamodel/pid4cat_model.py @@ -1,9 +1,9 @@ # Auto generated from pid4cat_model.yaml by pythongen.py version: 0.0.1 -# Generation date: 2024-02-25T23:40:32 +# Generation date: 2024-05-07T23:01:06 # Schema: pid4cat-model # # id: https://w3id.org/nfdi4cat/pid4cat-model -# description: A LinkML model for PIDs for resources in catalysis (PID4Cat). PID4Cat is a handle system based persistent identifier (PID) for digital or physical resources used in the catalysis research process. The handle record is used to store metadata about the PID besides the obligatory landing page URL. +# description: A LinkML model for PIDs for resources in catalysis (PID4Cat). PID4Cat is a handle system based persistent identifier (PID) for digital or physical resources used in the catalysis research process. The handle record is used to store additional metadata about the PID besides the obligatory landing page URL. # The model describes metadata for the PID itself and how to access the identified resource. It does not describe the resource itself with the exception of the resource category, which is a high-level description of what is identified by the PID4Cat handle, e.g. a sample or a device. # license: MIT @@ -34,7 +34,7 @@ # Namespaces DCAT = CurieNamespace('DCAT', 'http://www.w3.org/ns/dcat#') DATACITE = CurieNamespace('DataCite', 'http://purl.org/spar/datacite/') -DCT = CurieNamespace('dct', 'http://purl.org/dc/terms/') +DCTERMS = CurieNamespace('dcterms', 'http://purl.org/dc/terms/') LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/') PID4CAT_MODEL = CurieNamespace('pid4cat_model', 'https://w3id.org/nfdi4cat/pid4cat-model/') SCHEMA = CurieNamespace('schema', 'http://schema.org/') @@ -69,7 +69,7 @@ class PID4CatRecord(YAMLRoot): dc_rights: Optional[str] = None curation_contact: Optional[str] = None resource_info: Optional[Union[dict, "ResourceInfo"]] = None - related_identifiers: Optional[Union[Union[str, URIorCURIE], List[Union[str, URIorCURIE]]]] = empty_list() + related_identifiers: Optional[Union[Union[dict, "PID4CatRelation"], List[Union[dict, "PID4CatRelation"]]]] = empty_list() def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if self._is_empty(self.id): @@ -106,7 +106,7 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if not isinstance(self.related_identifiers, list): self.related_identifiers = [self.related_identifiers] if self.related_identifiers is not None else [] - self.related_identifiers = [v if isinstance(v, URIorCURIE) else URIorCURIE(v) for v in self.related_identifiers] + self.related_identifiers = [v if isinstance(v, PID4CatRelation) else PID4CatRelation(**as_dict(v)) for v in self.related_identifiers] super().__post_init__(**kwargs) @@ -339,11 +339,11 @@ class RelationType(EnumDefinitionImpl): HAS_VERSION = PermissibleValue( text="HAS_VERSION", description="The resource has a version.", - meaning=DCT["hasVersion"]) + meaning=DCTERMS["hasVersion"]) IS_VERSION_OF = PermissibleValue( text="IS_VERSION_OF", description="The resource is a version of.", - meaning=DCT["isVersionOf"]) + meaning=DCTERMS["isVersionOf"]) IS_NEW_VERSION_OF = PermissibleValue( text="IS_NEW_VERSION_OF", description="The resource is a new version of.") @@ -353,11 +353,11 @@ class RelationType(EnumDefinitionImpl): IS_PART_OF = PermissibleValue( text="IS_PART_OF", description="The resource is part of another resource.", - meaning=DCT["isPartOf"]) + meaning=DCTERMS["isPartOf"]) HAS_PART = PermissibleValue( text="HAS_PART", description="The resource has part another resource.", - meaning=DCT["hasPart"]) + meaning=DCTERMS["hasPart"]) IS_DESCRIBED_BY = PermissibleValue( text="IS_DESCRIBED_BY", description="The resource is documented by another resource.") @@ -370,7 +370,7 @@ class RelationType(EnumDefinitionImpl): IS_REFERENCED_BY = PermissibleValue( text="IS_REFERENCED_BY", description="The resource is referenced by another resource.", - meaning=DCT["isReferencedBy"]) + meaning=DCTERMS["isReferencedBy"]) REFERENCES = PermissibleValue( text="REFERENCES", description="The resource references another resource.") @@ -410,11 +410,11 @@ class RelationType(EnumDefinitionImpl): IS_REQUIRED_BY = PermissibleValue( text="IS_REQUIRED_BY", description="The resource is required by another resource.", - meaning=DCT["isRequiredBy"]) + meaning=DCTERMS["isRequiredBy"]) REQUIRES = PermissibleValue( text="REQUIRES", description="The resource requires another resource.", - meaning=DCT["requires"]) + meaning=DCTERMS["requires"]) IS_OBSOLETED_BY = PermissibleValue( text="IS_OBSOLETED_BY", description="The resource or PID4Cat is obsoleted by another resource or PID4Cat.") @@ -513,7 +513,7 @@ class slots: model_uri=PID4CAT_MODEL.resource_info, domain=None, range=Optional[Union[dict, ResourceInfo]]) slots.related_identifiers = Slot(uri=SCHEMA.identifier, name="related_identifiers", curie=SCHEMA.curie('identifier'), - model_uri=PID4CAT_MODEL.related_identifiers, domain=None, range=Optional[Union[Union[str, URIorCURIE], List[Union[str, URIorCURIE]]]]) + model_uri=PID4CAT_MODEL.related_identifiers, domain=None, range=Optional[Union[Union[dict, PID4CatRelation], List[Union[dict, PID4CatRelation]]]]) slots.dc_rights = Slot(uri=SCHEMA.license, name="dc_rights", curie=SCHEMA.curie('license'), model_uri=PID4CAT_MODEL.dc_rights, domain=None, range=Optional[str]) diff --git a/src/pid4cat_model/datamodel/pid4cat_model_pydantic.py b/src/pid4cat_model/datamodel/pid4cat_model_pydantic.py index a525179..61205c5 100644 --- a/src/pid4cat_model/datamodel/pid4cat_model_pydantic.py +++ b/src/pid4cat_model/datamodel/pid4cat_model_pydantic.py @@ -169,7 +169,7 @@ class PID4CatRecord(ConfiguredBaseModel): dc_rights: Optional[str] = Field(None, description="""The license for the metadata contained in the PID4Cat record.""") curation_contact: Optional[str] = Field(None, description="""The email address of a person or institution responsible for curation of the resource.""") resource_info: Optional[ResourceInfo] = Field(None, description="""Information about the resource.""") - related_identifiers: Optional[List[str]] = Field(default_factory=list, description="""Alternate identifiers for the resource""") + related_identifiers: Optional[List[PID4CatRelation]] = Field(default_factory=list, description="""Relations of the resource to other identifiers""") change_log: List[LogRecord] = Field(default_factory=list, description="""Change log of PID4Cat record""") diff --git a/src/pid4cat_model/schema/pid4cat_model.yaml b/src/pid4cat_model/schema/pid4cat_model.yaml index 2ff9e12..8044c37 100644 --- a/src/pid4cat_model/schema/pid4cat_model.yaml +++ b/src/pid4cat_model/schema/pid4cat_model.yaml @@ -27,7 +27,7 @@ prefixes: schema: http://schema.org/ # outer metadata of research data objects - dct: http://purl.org/dc/terms/ + dcterms: http://purl.org/dc/terms/ DCAT: http://www.w3.org/ns/dcat# DataCite: http://purl.org/spar/datacite/ @@ -137,9 +137,9 @@ slots: description: Information about the resource. related_identifiers: slot_uri: schema:identifier - range: uriorcurie + range: PID4CatRelation multivalued: true - description: Alternate identifiers for the resource + description: Relations of the resource to other identifiers dc_rights: slot_uri: schema:license description: The license for the metadata contained in the PID4Cat record. @@ -285,20 +285,20 @@ enums: # Enumerations use singular form for names description: The resource is metadata for. HAS_VERSION: description: The resource has a version. - meaning: dct:hasVersion + meaning: dcterms:hasVersion IS_VERSION_OF: description: The resource is a version of. - meaning: dct:isVersionOf + meaning: dcterms:isVersionOf IS_NEW_VERSION_OF: description: The resource is a new version of. IS_PREVIOUS_VERSION_OF: description: The resource is a previous version of. IS_PART_OF: description: The resource is part of another resource. - meaning: dct:isPartOf + meaning: dcterms:isPartOf HAS_PART: description: The resource has part another resource. - meaning: dct:hasPart + meaning: dcterms:hasPart IS_DESCRIBED_BY: description: The resource is documented by another resource. DESCRIBES: @@ -307,7 +307,7 @@ enums: # Enumerations use singular form for names description: The resource is published in another resource. IS_REFERENCED_BY: description: The resource is referenced by another resource. - meaning: dct:isReferencedBy + meaning: dcterms:isReferencedBy REFERENCES: description: The resource references another resource. IS_DOCUMENTED_BY: @@ -334,10 +334,10 @@ enums: # Enumerations use singular form for names description: The resource collects another resource. IS_REQUIRED_BY: description: The resource is required by another resource. - meaning: dct:isRequiredBy + meaning: dcterms:isRequiredBy REQUIRES: description: The resource requires another resource. - meaning: dct:requires + meaning: dcterms:requires IS_OBSOLETED_BY: description: >- The resource or PID4Cat is obsoleted by another resource or PID4Cat.