From 81fe996bbfff7d7786289d605f76f03a670bdc68 Mon Sep 17 00:00:00 2001 From: Damien Goutte-Gattat Date: Tue, 6 Aug 2024 21:16:00 +0100 Subject: [PATCH] Add `curie_map` to the model (#376) This commit makes the `curie_map` a _bona fide_ slot of the `MappingSet` class, that exists independently of the serialisation format. --------- Co-authored-by: Nico Matentzoglu --- CHANGELOG.md | 1 + examples/schema/curie_map.sssom.tsv | 14 + project/excel/sssom_schema.xlsx | Bin 9466 -> 9343 bytes project/graphql/sssom_schema.graphql | 56 +- project/jsonld/sssom_schema.context.jsonld | 47 +- project/jsonld/sssom_schema.jsonld | 563 ++++++-------- project/jsonschema/sssom_schema.schema.json | 295 ++------ project/prefixmap/sssom_schema.yaml | 3 - project/protobuf/sssom_schema.proto | 51 +- project/shacl/sssom_schema.shacl.ttl | 697 +++++++----------- project/shex/sssom_schema.shex | 68 +- project/sqlschema/sssom_schema.sql | 184 +---- src/docs/spec-formats-tsv.md | 7 +- src/docs/spec-model.md | 9 + .../context/sssom_schema.context.jsonld | 47 +- src/sssom_schema/context/sssom_schema.jsonld | 563 ++++++-------- src/sssom_schema/datamodel/sssom_schema.py | 271 ++----- src/sssom_schema/schema/sssom_schema.yaml | 19 + 18 files changed, 956 insertions(+), 1939 deletions(-) create mode 100644 examples/schema/curie_map.sssom.tsv diff --git a/CHANGELOG.md b/CHANGELOG.md index 14db1dbe..0fbf32c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Next - Add the concept of "propagatable slots". +- Add the `curie_map` to the model (instead of it being a specificity of the SSSOM/TSV format). - Add the concept of "extension slots". - Add the entity reference `sssom:NoTermFound` to express the concept of an "unmapped entity" ([issue](https://github.com/mapping-commons/sssom/issues/28)) - Replace `semantic_similarity_score` with `similarity_score` and `semantic_similarity_measure` with `similarity_measure` in the data model ([issue](https://github.com/mapping-commons/sssom/issues/385)) diff --git a/examples/schema/curie_map.sssom.tsv b/examples/schema/curie_map.sssom.tsv new file mode 100644 index 00000000..1dfc3549 --- /dev/null +++ b/examples/schema/curie_map.sssom.tsv @@ -0,0 +1,14 @@ +#curie_map: +# HP: http://purl.obolibrary.org/obo/HP_ +# MP: http://purl.obolibrary.org/obo/MP_ +# orcid: https://orcid.org/ +#mapping_set_id: https://w3id.org/sssom/commons/examples/curie_map.sssom.tsv +#license: "https://creativecommons.org/publicdomain/zero/1.0/" +#creator_id: +# - orcid:0000-0002-7356-1779 +#mapping_provider: "https://w3id.org/sssom/core_team" +#comment: This is an example file for the SSSOM for illustration only. Its contents are entirely fabricated. +subject_id predicate_id object_id mapping_justification +HP:0009124 skos:exactMatch MP:0000003 semapv:ManualMappingCuration +HP:0008551 skos:exactMatch MP:0000018 semapv:ManualMappingCuration +HP:0000411 skos:exactMatch MP:0000021 semapv:ManualMappingCuration diff --git a/project/excel/sssom_schema.xlsx b/project/excel/sssom_schema.xlsx index 7216460e6894a41774b8a0100f504efe2ad3c44d..ad3f85808e8d48d3b743c69cf29310f56932e1e7 100644 GIT binary patch delta 4395 zcmZ8kc|4Tu_Z~ZqWiYm}4>HMEB762^?4;}_+4r$$>!B=_C5$DzLDnddHQ9HvW(^@x zwh(2@Z}R=U@B7j7&;5Mv=Q^Kr-`8`_xz0I6ovKsmX%Z1bK_C!0$Sj34o~jJMFDCk8 z2hLmg%{~GUh!(%vxLfOax?{YAt=&Csh3>h!B*nM5wTe(iph@=TWRQtC#OEvRj@XM- zj-zh+cXLcf)gBin*Py4Btfqz7mQHu=&1k1RW&?t@%T#n3B23)ZE@C#ud*Zu2LUNuu z-0Fr8w`1l5N)hrW1R20c_O}o{k!s?o{Af7ILlGaWsPyHSti;W}iM(cqW*AZe$~EX& z`#Nkc0$}a5fgkB<8&3F`NOIQI>QiqG>b_jsar{7R5Ywr8A+K(~sA$i#wmb9Cv{_p} z!~PUH)W1lq!ymc!IpOU9r(}aG9DG~QpjuYS+I)aWB~f+j0k0OlZMbBn`0o6 zZ)25TcC+Qc! zH;OiGHKw?ZnMp78s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qZy00#-9gQ_d~ug}kdpwJN&meKz?<+W zQ~h%tfXDO5|8fXJJTTC2sV^P^RpdUG{2t;HjqUFe`oIA11r_2s$NWD!I8OuqUqTrfIr7oL`17=FGT|Jp1i0KoJcD4QDqxT)#s;p^hz eYi}Op<>F&|?q^Nl CLOSED { - ( $ ( owl:annotatedTarget @linkml:String ; - rdf:datatype @linkml:Uri ? ; - owl:annotatedProperty @ ; - @linkml:String ? ; - [ ] ? ; - owl:annotatedTarget @ ; - @linkml:String ? ; - @linkml:String ? ; - @ ; - pav:authoredBy @ * ; - @linkml:String * ; - @ * ; - @linkml:String * ; - dc1:creator @ * ; - @linkml:String * ; - dc1:license @linkml:Uri ? ; - @ ? ; - @linkml:String ? ; - [ owl:Class owl:ObjectProperty owl:DataProperty owl:AnnotationProperty owl:NamedIndividual skos:Concept - rdfs:Resource rdfs:Class rdfs:Literal rdfs:Datatype rdf:Property ] ? ; - @ ? ; - @linkml:String ? ; - @linkml:Uri ? ; - @ ? ; - [ - - - ] ? ; - @linkml:String ? ; - @linkml:String ? ; - pav:authoredOn @linkml:Date ? ; - @linkml:Double ? ; - @ * ; - @linkml:String * ; - @ * ; - @ * ; - @linkml:Double ? ; - @linkml:String ? ; - rdfs:seeAlso @linkml:String * ; - @linkml:String ? ; - rdfs:comment @linkml:String ? - ) ; - rdf:type [ owl:Axiom ] ? - ) -} - CLOSED { ( $ ( owl:annotatedSource @ ; @linkml:String ? ; @@ -150,8 +103,8 @@ linkml:Sparqlpath xsd:string @linkml:String * ; @ * ; @ * ; - @linkml:Double ? ; - @linkml:String ? ; + @linkml:Double ? ; + @linkml:String ? ; rdfs:seeAlso @linkml:String * ; @ ? ; @linkml:String ? ; @@ -176,7 +129,8 @@ linkml:Sparqlpath xsd:string } CLOSED { - ( $ ( @ * ; + ( $ ( @ * ; + @ * ; @linkml:Uri ; owl:versionInfo @linkml:String ? ; prov:wasDerivedFrom @linkml:Uri * ; @@ -224,6 +178,20 @@ linkml:Sparqlpath xsd:string ) } + CLOSED { + ( $ rdf:type . * ; + rdf:type [ ] ? + ) +} + + CLOSED { + ( $ ( @linkml:Ncname ; + @linkml:Uri ? + ) ; + rdf:type [ ] + ) +} + CLOSED { ( $ @linkml:Boolean ? ; rdf:type [ ] ? diff --git a/project/sqlschema/sssom_schema.sql b/project/sqlschema/sssom_schema.sql index b69eaa2d..7aa0506f 100644 --- a/project/sqlschema/sssom_schema.sql +++ b/project/sqlschema/sssom_schema.sql @@ -26,7 +26,7 @@ -- * Slot: subject_category Description: The conceptual category to which the subject belongs to. This can be a string denoting the category or a term from a controlled vocabulary. This slot is deliberately underspecified. Conceptual categories can range from those that are found in general upper ontologies such as BFO (e.g. process, temporal region, etc) to those that serve as upper ontologies in specific domains, such as COB or BioLink (e.g. gene, disease, chemical entity). The purpose of this optional field is documentation for human reviewers - when a category is known and documented clearly, the cost of interpreting and evaluating the mapping decreases. -- * Slot: predicate_id Description: The ID of the predicate or relation that relates the subject and object of this match. -- * Slot: predicate_label Description: The label of the predicate/relation of the mapping --- * Slot: predicate_modifier Description: A modifier for negating the prediate. See https://github.com/mapping-commons/sssom/issues/40 for discussion +-- * Slot: predicate_modifier Description: A modifier for negating the predicate. See https://github.com/mapping-commons/sssom/issues/40 for discussion -- * Slot: object_id Description: The ID of the object of the mapping. -- * Slot: object_label Description: The label of object of the mapping -- * Slot: object_category Description: The conceptual category to which the subject belongs to. This can be a string denoting the category or a term from a controlled vocabulary. This slot is deliberately underspecified. Conceptual categories can range from those that are found in general upper ontologies such as BFO (e.g. process, temporal region, etc) to those that serve as upper ontologies in specific domains, such as COB or BioLink (e.g. gene, disease, chemical entity). The purpose of this optional field is documentation for human reviewers - when a category is known and documented clearly, the cost of interpreting and evaluating the mapping decreases. @@ -46,40 +46,12 @@ -- * Slot: mapping_date Description: The date the mapping was asserted. This is different from the date the mapping was published or compiled in a SSSOM file. -- * Slot: publication_date Description: The date the mapping was published. This is different from the date the mapping was asserted. -- * Slot: confidence Description: A score between 0 and 1 to denote the confidence or probability that the match is correct, where 1 denotes total confidence. --- * Slot: semantic_similarity_score Description: A score between 0 and 1 to denote the semantic similarity, where 1 denotes equivalence. --- * Slot: semantic_similarity_measure Description: The measure used for computing the the semantic similarity score. To make processing this field as unambiguous as possible, we recommend using wikidata identifiers, but wikipedia pages could also be acceptable. +-- * Slot: similarity_score Description: A score between 0 and 1 to denote the similarity between two entities, where 1 denotes equivalence, and 0 denotes disjointness. The score is meant to be used in conjunction with the similarity_measure field, to document, for example, the lexical or semantic match of a matching algorithm. +-- * Slot: similarity_measure Description: The measure used for computing a similarity score. This field is meant to be used in conjunction with the similarity_score field, to document, for example, the lexical or semantic match of a matching algorithm. To make processing this field as unambiguous as possible, we recommend using wikidata CURIEs, but the type of this field is deliberately unspecified. -- * Slot: issue_tracker_item Description: The issue tracker item discussing this mapping. -- * Slot: other Description: Pipe separated list of key value pairs for properties not part of the SSSOM spec. Can be used to encode additional provenance data. -- * Slot: comment Description: Free text field containing either curator notes or text generated by tool providing additional informative information. -- * Slot: mapping set_id Description: Autocreated FK slot --- # Class: "literal mapping" Description: "Represents an individual mapping between a literal and an entity. Note that this schema has been created on 01.08.2023 and is subject to change." --- * Slot: id Description: --- * Slot: literal Description: The literal being mapped --- * Slot: literal_datatype Description: The datatype of the literal being mapped --- * Slot: predicate_id Description: The ID of the predicate or relation that relates the subject and object of this match. --- * Slot: predicate_label Description: The label of the predicate/relation of the mapping --- * Slot: predicate_modifier Description: A modifier for negating the prediate. See https://github.com/mapping-commons/sssom/issues/40 for discussion --- * Slot: object_id Description: The ID of the object of the mapping. --- * Slot: object_label Description: The label of object of the mapping --- * Slot: object_category Description: The conceptual category to which the subject belongs to. This can be a string denoting the category or a term from a controlled vocabulary. This slot is deliberately underspecified. Conceptual categories can range from those that are found in general upper ontologies such as BFO (e.g. process, temporal region, etc) to those that serve as upper ontologies in specific domains, such as COB or BioLink (e.g. gene, disease, chemical entity). The purpose of this optional field is documentation for human reviewers - when a category is known and documented clearly, the cost of interpreting and evaluating the mapping decreases. --- * Slot: mapping_justification Description: A mapping justification is an action (or the written representation of that action) of showing a mapping to be right or reasonable. --- * Slot: license Description: A url to the license of the mapping. In absence of a license we assume no license. --- * Slot: literal_source Description: URI of ontology source for the literal. --- * Slot: literal_source_version Description: Version IRI or version string of the source of the literal. --- * Slot: object_type Description: The type of entity that is being mapped. --- * Slot: object_source Description: URI of vocabulary or identifier source for the object. --- * Slot: object_source_version Description: Version IRI or version string of the source of the object term. --- * Slot: mapping_provider Description: URL pointing to the source that provided the mapping, for example an ontology that already contains the mappings, or a database from which it was derived. --- * Slot: mapping_source Description: The mapping set this mapping was originally defined in. mapping_source is used for example when merging multiple mapping sets or deriving one mapping set from another. --- * Slot: mapping_cardinality Description: A string indicating whether this mapping is from a 1:1 (the subject_id maps to a single object_id), 1:n (the subject maps to more than one object_id), n:1, 1:0, 0:1 or n:n group. Note that this is a convenience field that should be derivable from the mapping set. --- * Slot: mapping_tool Description: A reference to the tool or algorithm that was used to generate the mapping. Should be a URL pointing to more info about it, but can be free text. --- * Slot: mapping_tool_version Description: Version string that denotes the version of the mapping tool used. --- * Slot: mapping_date Description: The date the mapping was asserted. This is different from the date the mapping was published or compiled in a SSSOM file. --- * Slot: confidence Description: A score between 0 and 1 to denote the confidence or probability that the match is correct, where 1 denotes total confidence. --- * Slot: similarity_score Description: A score between 0 and 1 to denote the similarity, where 1 denotes equivalence. --- * Slot: similarity_measure Description: The measure used for computing the the similarity score. To make processing this field as unambiguous as possible, we recommend using wikidata identifiers, but wikipedia pages could also be acceptable. --- * Slot: other Description: Pipe separated list of key value pairs for properties not part of the SSSOM spec. Can be used to encode additional provenance data. --- * Slot: comment Description: Free text field containing either curator notes or text generated by tool providing additional informative information. -- # Class: "mapping registry" Description: "A registry for managing mapping sets. It holds a set of mapping set references, and can import other registries." -- * Slot: id Description: -- * Slot: mapping_registry_id Description: The unique identifier of a mapping registry. @@ -96,6 +68,10 @@ -- * Slot: mapping_set_group Description: Set by the owners of the mapping registry. A way to group . -- * Slot: last_updated Description: The date this reference was last updated. -- * Slot: local_name Description: The local name assigned to file that corresponds to the downloaded mapping set. +-- # Class: "prefix" Description: "" +-- * Slot: prefix_name Description: +-- * Slot: prefix_url Description: +-- * Slot: mapping set_id Description: Autocreated FK slot -- # Class: "extension definition" Description: "A definition of an extension (non-standard) slot." -- * Slot: id Description: -- * Slot: slot_name Description: The name of the extension slot. @@ -104,6 +80,8 @@ -- # Class: "Propagatable" Description: "Metamodel extension class to describe slots whose value can be propagated down from the MappingSet class to the Mapping class." -- * Slot: id Description: -- * Slot: propagated Description: Indicates whether a slot can be propagated from a mapping down to individual mappings. +-- # Class: "NoTermFound" Description: "sssom:NoTermFound can be used in place of a subject_id or object_id when the corresponding entity could not be found. It SHOULD be used in conjuction with a corresponding subject_source or object_source to signify where the term was not found." +-- * Slot: id Description: -- # Class: "mapping set_mapping_set_source" Description: "" -- * Slot: mapping set_id Description: Autocreated FK slot -- * Slot: mapping_set_source Description: A mapping set or set of mapping set that was used to derive the mapping set. @@ -173,39 +151,6 @@ -- # Class: "mapping_see_also" Description: "" -- * Slot: mapping_id Description: Autocreated FK slot -- * Slot: see_also Description: A URL specific for the mapping instance. E.g. for kboom we have a per-mapping image that shows surrounding axioms that drive probability. Could also be a github issue URL that discussed a complicated alignment --- # Class: "literal mapping_author_id" Description: "" --- * Slot: literal mapping_id Description: Autocreated FK slot --- * Slot: author_id Description: Identifies the persons or groups responsible for asserting the mappings. Recommended to be a list of ORCIDs or otherwise identifying URIs. --- # Class: "literal mapping_author_label" Description: "" --- * Slot: literal mapping_id Description: Autocreated FK slot --- * Slot: author_label Description: A string identifying the author of this mapping. In the spirit of provenance, consider using author_id instead. --- # Class: "literal mapping_reviewer_id" Description: "" --- * Slot: literal mapping_id Description: Autocreated FK slot --- * Slot: reviewer_id Description: Identifies the persons or groups that reviewed and confirmed the mapping. Recommended to be a list of ORCIDs or otherwise identifying URIs. --- # Class: "literal mapping_reviewer_label" Description: "" --- * Slot: literal mapping_id Description: Autocreated FK slot --- * Slot: reviewer_label Description: A string identifying the reviewer of this mapping. In the spirit of provenance, consider using reviewer_id instead. --- # Class: "literal mapping_creator_id" Description: "" --- * Slot: literal mapping_id Description: Autocreated FK slot --- * Slot: creator_id Description: Identifies the persons or groups responsible for the creation of the mapping. The creator is the agent that put the mapping in its published form, which may be different from the author, which is a person that was actively involved in the assertion of the mapping. Recommended to be a list of ORCIDs or otherwise identifying URIs. --- # Class: "literal mapping_creator_label" Description: "" --- * Slot: literal mapping_id Description: Autocreated FK slot --- * Slot: creator_label Description: A string identifying the creator of this mapping. In the spirit of provenance, consider using creator_id instead. --- # Class: "literal mapping_object_match_field" Description: "" --- * Slot: literal mapping_id Description: Autocreated FK slot --- * Slot: object_match_field Description: A list of properties (term annotations on the object) that was used for the match. --- # Class: "literal mapping_match_string" Description: "" --- * Slot: literal mapping_id Description: Autocreated FK slot --- * Slot: match_string Description: String that is shared by subj/obj. It is recommended to indicate the fields for the match using the object and subject_match_field slots. --- # Class: "literal mapping_literal_preprocessing" Description: "" --- * Slot: literal mapping_id Description: Autocreated FK slot --- * Slot: literal_preprocessing Description: Method of preprocessing applied to the literal. --- # Class: "literal mapping_object_preprocessing" Description: "" --- * Slot: literal mapping_id Description: Autocreated FK slot --- * Slot: object_preprocessing Description: Method of preprocessing applied to the fields of the object. If different preprocessing steps were performed on different fields, it is recommended to store the match in separate rows. --- # Class: "literal mapping_see_also" Description: "" --- * Slot: literal mapping_id Description: Autocreated FK slot --- * Slot: see_also Description: A URL specific for the mapping instance. E.g. for kboom we have a per-mapping image that shows surrounding axioms that drive probability. Could also be a github issue URL that discussed a complicated alignment -- # Class: "mapping registry_imports" Description: "" -- * Slot: mapping registry_id Description: Autocreated FK slot -- * Slot: imports Description: A list of registries that should be imported into this one. @@ -236,36 +181,6 @@ CREATE TABLE "mapping set" ( comment TEXT, PRIMARY KEY (id) ); -CREATE TABLE "literal mapping" ( - id INTEGER NOT NULL, - literal TEXT NOT NULL, - literal_datatype TEXT, - predicate_id TEXT NOT NULL, - predicate_label TEXT, - predicate_modifier VARCHAR(3), - object_id TEXT NOT NULL, - object_label TEXT, - object_category TEXT, - mapping_justification TEXT NOT NULL, - license TEXT, - literal_source TEXT, - literal_source_version TEXT, - object_type VARCHAR(23), - object_source TEXT, - object_source_version TEXT, - mapping_provider TEXT, - mapping_source TEXT, - mapping_cardinality VARCHAR(3), - mapping_tool TEXT, - mapping_tool_version TEXT, - mapping_date DATE, - confidence FLOAT, - similarity_score FLOAT, - similarity_measure TEXT, - other TEXT, - comment TEXT, - PRIMARY KEY (id) -); CREATE TABLE "mapping registry" ( id INTEGER NOT NULL, mapping_registry_id TEXT NOT NULL, @@ -298,6 +213,10 @@ CREATE TABLE "Propagatable" ( propagated BOOLEAN, PRIMARY KEY (id) ); +CREATE TABLE "NoTermFound" ( + id INTEGER NOT NULL, + PRIMARY KEY (id) +); CREATE TABLE mapping ( id INTEGER NOT NULL, subject_id TEXT NOT NULL, @@ -325,8 +244,8 @@ CREATE TABLE mapping ( mapping_date DATE, publication_date DATE, confidence FLOAT, - semantic_similarity_score FLOAT, - semantic_similarity_measure TEXT, + similarity_score FLOAT, + similarity_measure TEXT, issue_tracker_item TEXT, other TEXT, comment TEXT, @@ -334,6 +253,13 @@ CREATE TABLE mapping ( PRIMARY KEY (id), FOREIGN KEY("mapping set_id") REFERENCES "mapping set" (id) ); +CREATE TABLE prefix ( + prefix_name TEXT NOT NULL, + prefix_url TEXT, + "mapping set_id" INTEGER, + PRIMARY KEY (prefix_name, prefix_url, "mapping set_id"), + FOREIGN KEY("mapping set_id") REFERENCES "mapping set" (id) +); CREATE TABLE "mapping set_mapping_set_source" ( "mapping set_id" INTEGER, mapping_set_source TEXT, @@ -389,72 +315,6 @@ CREATE TABLE "mapping set_extension_definitions" ( FOREIGN KEY("mapping set_id") REFERENCES "mapping set" (id), FOREIGN KEY(extension_definitions_id) REFERENCES "extension definition" (id) ); -CREATE TABLE "literal mapping_author_id" ( - "literal mapping_id" INTEGER, - author_id TEXT, - PRIMARY KEY ("literal mapping_id", author_id), - FOREIGN KEY("literal mapping_id") REFERENCES "literal mapping" (id) -); -CREATE TABLE "literal mapping_author_label" ( - "literal mapping_id" INTEGER, - author_label TEXT, - PRIMARY KEY ("literal mapping_id", author_label), - FOREIGN KEY("literal mapping_id") REFERENCES "literal mapping" (id) -); -CREATE TABLE "literal mapping_reviewer_id" ( - "literal mapping_id" INTEGER, - reviewer_id TEXT, - PRIMARY KEY ("literal mapping_id", reviewer_id), - FOREIGN KEY("literal mapping_id") REFERENCES "literal mapping" (id) -); -CREATE TABLE "literal mapping_reviewer_label" ( - "literal mapping_id" INTEGER, - reviewer_label TEXT, - PRIMARY KEY ("literal mapping_id", reviewer_label), - FOREIGN KEY("literal mapping_id") REFERENCES "literal mapping" (id) -); -CREATE TABLE "literal mapping_creator_id" ( - "literal mapping_id" INTEGER, - creator_id TEXT, - PRIMARY KEY ("literal mapping_id", creator_id), - FOREIGN KEY("literal mapping_id") REFERENCES "literal mapping" (id) -); -CREATE TABLE "literal mapping_creator_label" ( - "literal mapping_id" INTEGER, - creator_label TEXT, - PRIMARY KEY ("literal mapping_id", creator_label), - FOREIGN KEY("literal mapping_id") REFERENCES "literal mapping" (id) -); -CREATE TABLE "literal mapping_object_match_field" ( - "literal mapping_id" INTEGER, - object_match_field TEXT, - PRIMARY KEY ("literal mapping_id", object_match_field), - FOREIGN KEY("literal mapping_id") REFERENCES "literal mapping" (id) -); -CREATE TABLE "literal mapping_match_string" ( - "literal mapping_id" INTEGER, - match_string TEXT, - PRIMARY KEY ("literal mapping_id", match_string), - FOREIGN KEY("literal mapping_id") REFERENCES "literal mapping" (id) -); -CREATE TABLE "literal mapping_literal_preprocessing" ( - "literal mapping_id" INTEGER, - literal_preprocessing TEXT, - PRIMARY KEY ("literal mapping_id", literal_preprocessing), - FOREIGN KEY("literal mapping_id") REFERENCES "literal mapping" (id) -); -CREATE TABLE "literal mapping_object_preprocessing" ( - "literal mapping_id" INTEGER, - object_preprocessing TEXT, - PRIMARY KEY ("literal mapping_id", object_preprocessing), - FOREIGN KEY("literal mapping_id") REFERENCES "literal mapping" (id) -); -CREATE TABLE "literal mapping_see_also" ( - "literal mapping_id" INTEGER, - see_also TEXT, - PRIMARY KEY ("literal mapping_id", see_also), - FOREIGN KEY("literal mapping_id") REFERENCES "literal mapping" (id) -); CREATE TABLE "mapping registry_imports" ( "mapping registry_id" INTEGER, imports TEXT, diff --git a/src/docs/spec-formats-tsv.md b/src/docs/spec-formats-tsv.md index c500676f..16b2420c 100644 --- a/src/docs/spec-formats-tsv.md +++ b/src/docs/spec-formats-tsv.md @@ -106,11 +106,9 @@ SSSOM/TSV files MUST be encoded in UTF-8 ([RFC 3629](https://datatracker.ietf.or All identifiers in a SSSOM/TSV file, that is, all the values of slots typed as [EntityReference](EntityReference.md), MUST be serialised in [CURIE syntax](https://www.w3.org/TR/curie/). SSSOM/TSV parsers SHOULD reject files containing identifiers serialised as IRIs. -To allow unambiguous resolution of all CURIEs present in a SSSOM/TSV file, the metadata block MUST contain an additional `curie_map` field, which is a map of prefix names to IRI prefixes. The `curie_map` field SHOULD appear at the beginning of the metadata block. +As stated in the description of the model ([Identifiers section](spec-model.md#identifiers)), all prefix names used in CURIEs MUST be declared in the `curie_map` slot of the mapping set object, unless the prefix is a “built-in” prefix (in which case it MAY be omitted). SSSOM/TSV parsers MUST reject a file with undeclared, non-built-in prefix names. -Any prefix name used in a SSSOM/TSV file MUST be declared with a corresponding entry in the CURIE map. SSSOM/TSV parsers MUST reject a file with undeclared prefix names. - -Prefix names listed in the table found in the [IRI prefixes](spec-intro.md#iri-prefixes) section are considered “built-in”. As such, they MAY be omitted from the CURIE map. If they are not omitted, they MUST point to the same IRI prefixes as in the aforementioned table. +A SSSOM/TSV writer SHOULD refuse to serialise a mapping set that contains IRIs that cannot be contracted into CURIEs because there is no suitable prefix declaration in its CURIE map. The use of a custom, ad-hoc logic to infer a possible prefix name where none has been provided (e.g., “if the IRI ends with a `ZZZ_NNNNNNN` pattern, turn it into a `ZZZ:NNNNNNN` CURIE”) is strongly discouraged. ## Propagatable slots @@ -230,7 +228,6 @@ When writing the metadata block, a canonical SSSOM/TSV writer: * MUST serialise multi-valued slots as YAML “block sequences” ([YAML Specification §8.2.1](https://yaml.org/spec/1.2.2/#821-block-sequences)) – even when the list of values contains only one item; * MUST serialise scalar values in YAML “plain style” ([YAML Specification §7.3.3](https://yaml.org/spec/1.2.2/#733-plain-style)) whenever possible, otherwise in “double-quoted style” ([YAML Specification §7.3.1](https://yaml.org/spec/1.2.2/#731-double-quoted-style)); * MUST serialise the slots in the order they appear in the [“Slots” table](MappingSet.md#slots), in the documentation for the `MappingSet` class; -* MUST write the `curie_map` at the beginning of the block, before any other slots; * MUST NOT include in the CURIE map the prefix names that are considered “built-in”; * MUST NOT include in the CURIE map any prefix name that is not used anywhere in the set; * MUST sort the prefix names in the CURIE map in lexicographical order. diff --git a/src/docs/spec-model.md b/src/docs/spec-model.md index e06637a4..5a0e491b 100644 --- a/src/docs/spec-model.md +++ b/src/docs/spec-model.md @@ -23,6 +23,15 @@ The `MappingSet` class represents, well, a set of individual mappings, which are Of note, within a set, a mapping may not necessarily be uniquely identified by the combination of its four mandatory slots (`subject_id`, `predicate_id`, `object_id`, and `mapping_justification`). A set may very well contain several mappings with the same subject, predicate, object, and justification, but that differ on some of the other, complementary slots. +## Identifiers + +Throughout the model, identifiers to external resources are represented using the custom type [`EntityReference`](EntityReference.md) (based on the LinkML type [`uriorcurie`](https://w3id.org/linkml/Uriorcurie)), which accepts both full-length IRIs and [CURIEs](https://www.w3.org/TR/curie/) as possible identifier formats. (Note however that serialisation formats may mandate the use of one identifier format over the other; for example, the [SSSOM/TSV](spec-formats-tsv.md) format requires the systematic use of CURIEs, whereas the [OWL/RDF](spec-formats-owl.md) format conversely requires the systematic use of IRIs). + +Whenever the CURIE syntax is used in a mapping set (whether this is by choice of the SSSOM producer, or because it is mandated by the serialisation format), all CURIEs MUST be unambiguously resolvable into corresponding full-length IRIs without requiring any external resources. This means that any prefix name used MUST be properly declared in the set’s `curie_map` slot, which is a dictionary associating a prefix name to an IRI prefix. + +By exception, prefix names listed in the table found in the [IRI prefixes](spec-intro.md#iri-prefixes) section are considered “built-in”. As such, they MAY be omitted from the `curie_map`. If they are not omitted, they MUST point to the same IRI prefixes as in the aforementioned table. + + ## Propagation of mapping set slots As mentioned briefly above, there are two different types of slots in the `MappingSet` class: diff --git a/src/sssom_schema/context/sssom_schema.context.jsonld b/src/sssom_schema/context/sssom_schema.context.jsonld index e1851867..390edf8f 100644 --- a/src/sssom_schema/context/sssom_schema.context.jsonld +++ b/src/sssom_schema/context/sssom_schema.context.jsonld @@ -1,7 +1,7 @@ { "comments": { "description": "Auto generated by LinkML jsonld context generator", - "generation_date": "2024-08-05T10:18:22", + "generation_date": "2024-08-06T18:58:48", "source": "sssom_schema.yaml" }, "@context": { @@ -46,6 +46,10 @@ "curation_rule_text": { "@id": "curation_rule_text" }, + "curie_map": { + "@type": "@id", + "@id": "curie_map" + }, "documentation": { "@type": "@id", "@id": "documentation" @@ -89,24 +93,6 @@ "@type": "@id", "@id": "dcterms:license" }, - "literal": { - "@id": "owl:annotatedTarget" - }, - "literal_datatype": { - "@type": "@id", - "@id": "rdf:datatype" - }, - "literal_preprocessing": { - "@type": "rdfs:Resource", - "@id": "literal_preprocessing" - }, - "literal_source": { - "@type": "rdfs:Resource", - "@id": "literal_source" - }, - "literal_source_version": { - "@id": "literal_source_version" - }, "local_name": { "@id": "local_name" }, @@ -248,6 +234,13 @@ }, "@id": "predicate_type" }, + "prefix_name": { + "@id": "prefix_name" + }, + "prefix_url": { + "@type": "@id", + "@id": "prefix_url" + }, "propagated": { "@type": "xsd:boolean", "@id": "propagated" @@ -270,13 +263,6 @@ "see_also": { "@id": "rdfs:seeAlso" }, - "semantic_similarity_measure": { - "@id": "semantic_similarity_measure" - }, - "semantic_similarity_score": { - "@type": "xsd:double", - "@id": "semantic_similarity_score" - }, "similarity_measure": { "@id": "similarity_measure" }, @@ -321,9 +307,6 @@ "ExtensionDefinition": { "@id": "ExtensionDefinition" }, - "LiteralMapping": { - "@id": "owl:Axiom" - }, "Mapping": { "@id": "owl:Axiom" }, @@ -336,6 +319,12 @@ "MappingSetReference": { "@id": "MappingSetReference" }, + "NoTermFound": { + "@id": "NoTermFound" + }, + "Prefix": { + "@id": "Prefix" + }, "Propagatable": { "@id": "Propagatable" } diff --git a/src/sssom_schema/context/sssom_schema.jsonld b/src/sssom_schema/context/sssom_schema.jsonld index a0a43e18..f894b457 100644 --- a/src/sssom_schema/context/sssom_schema.jsonld +++ b/src/sssom_schema/context/sssom_schema.jsonld @@ -482,6 +482,52 @@ } ], "slots": [ + { + "name": "prefix_name", + "definition_uri": "https://w3id.org/sssom/prefix_name", + "from_schema": "https://w3id.org/sssom/schema/", + "slot_uri": "https://w3id.org/sssom/prefix_name", + "key": true, + "owner": "Prefix", + "domain_of": [ + "Prefix" + ], + "range": "ncname", + "required": true, + "@type": "SlotDefinition" + }, + { + "name": "prefix_url", + "definition_uri": "https://w3id.org/sssom/prefix_url", + "from_schema": "https://w3id.org/sssom/schema/", + "slot_uri": "https://w3id.org/sssom/prefix_url", + "owner": "Prefix", + "domain_of": [ + "Prefix" + ], + "range": "uri", + "@type": "SlotDefinition" + }, + { + "name": "curie_map", + "definition_uri": "https://w3id.org/sssom/curie_map", + "description": "A dictionary that contains prefixes as keys and their URI expansions as values.", + "from_schema": "https://w3id.org/sssom/schema/", + "see_also": [ + "https://github.com/mapping-commons/sssom/issues/225", + "https://github.com/mapping-commons/sssom/pull/349", + "https://github.com/mapping-commons/sssom/blob/master/examples/schema/curie_map.sssom.tsv" + ], + "slot_uri": "https://w3id.org/sssom/curie_map", + "multivalued": true, + "owner": "MappingSet", + "domain_of": [ + "MappingSet" + ], + "range": "Prefix", + "inlined": true, + "@type": "SlotDefinition" + }, { "name": "mirror_from", "definition_uri": "https://w3id.org/sssom/mirror_from", @@ -672,55 +718,6 @@ "required": true, "@type": "SlotDefinition" }, - { - "name": "literal", - "definition_uri": "https://w3id.org/sssom/literal", - "description": "The literal being mapped", - "examples": [ - { - "value": "Alzheimer", - "description": "A string referring to some thing.", - "@type": "Example" - } - ], - "from_schema": "https://w3id.org/sssom/schema/", - "mappings": [ - "http://www.w3.org/2002/07/owl#annotatedTarget", - "http://www.w3.org/2002/07/owl#annotatedSource" - ], - "slot_uri": "http://www.w3.org/2002/07/owl#annotatedTarget", - "owner": "LiteralMapping", - "domain_of": [ - "LiteralMapping" - ], - "range": "string", - "required": true, - "@type": "SlotDefinition" - }, - { - "name": "literal_datatype", - "definition_uri": "https://w3id.org/sssom/literal_datatype", - "description": "The datatype of the literal being mapped", - "examples": [ - { - "value": "xsd:string", - "description": "A string referring to some thing.", - "@type": "Example" - } - ], - "from_schema": "https://w3id.org/sssom/schema/", - "mappings": [ - "http://www.w3.org/1999/02/22-rdf-syntax-ns#datatype", - "http://www.w3.org/1999/02/22-rdf-syntax-ns#datatype" - ], - "slot_uri": "http://www.w3.org/1999/02/22-rdf-syntax-ns#datatype", - "owner": "LiteralMapping", - "domain_of": [ - "LiteralMapping" - ], - "range": "uri", - "@type": "SlotDefinition" - }, { "name": "subject_label", "definition_uri": "https://w3id.org/sssom/subject_label", @@ -809,55 +806,6 @@ "name": "predicate_id", "definition_uri": "https://w3id.org/sssom/predicate_id", "description": "The ID of the predicate or relation that relates the subject and object of this match.", - "examples": [ - { - "value": "skos:exactMatch", - "@type": "Example" - } - ], - "from_schema": "https://w3id.org/sssom/schema/", - "mappings": [ - "http://www.w3.org/2002/07/owl#annotatedProperty", - "http://www.w3.org/2002/07/owl#annotatedProperty" - ], - "slot_uri": "http://www.w3.org/2002/07/owl#annotatedProperty", - "owner": "LiteralMapping", - "domain_of": [ - "Mapping", - "LiteralMapping" - ], - "range": "EntityReference", - "required": true, - "@type": "SlotDefinition" - }, - { - "name": "predicate_modifier", - "definition_uri": "https://w3id.org/sssom/predicate_modifier", - "description": "A modifier for negating the prediate. See https://github.com/mapping-commons/sssom/issues/40 for discussion", - "examples": [ - { - "value": "Not", - "description": "Negates the predicate, see documentation of predicate_modifier_enum", - "@type": "Example" - } - ], - "from_schema": "https://w3id.org/sssom/schema/", - "see_also": [ - "https://github.com/mapping-commons/sssom/issues/107" - ], - "slot_uri": "https://w3id.org/sssom/predicate_modifier", - "owner": "LiteralMapping", - "domain_of": [ - "Mapping", - "LiteralMapping" - ], - "range": "predicate_modifier_enum", - "@type": "SlotDefinition" - }, - { - "name": "predicate_label", - "definition_uri": "https://w3id.org/sssom/predicate_label", - "description": "The label of the predicate/relation of the mapping", "examples": [ { "value": "owl:sameAs", @@ -921,11 +869,58 @@ } ], "from_schema": "https://w3id.org/sssom/schema/", + "mappings": [ + "http://www.w3.org/2002/07/owl#annotatedProperty", + "http://www.w3.org/2002/07/owl#annotatedProperty" + ], + "slot_uri": "http://www.w3.org/2002/07/owl#annotatedProperty", + "owner": "Mapping", + "domain_of": [ + "Mapping" + ], + "range": "EntityReference", + "required": true, + "@type": "SlotDefinition" + }, + { + "name": "predicate_modifier", + "definition_uri": "https://w3id.org/sssom/predicate_modifier", + "description": "A modifier for negating the predicate. See https://github.com/mapping-commons/sssom/issues/40 for discussion", + "examples": [ + { + "value": "Not", + "description": "Negates the predicate, see documentation of predicate_modifier_enum", + "@type": "Example" + } + ], + "from_schema": "https://w3id.org/sssom/schema/", + "see_also": [ + "https://github.com/mapping-commons/sssom/issues/107" + ], + "slot_uri": "https://w3id.org/sssom/predicate_modifier", + "owner": "Mapping", + "domain_of": [ + "Mapping" + ], + "range": "predicate_modifier_enum", + "@type": "SlotDefinition" + }, + { + "name": "predicate_label", + "definition_uri": "https://w3id.org/sssom/predicate_label", + "description": "The label of the predicate/relation of the mapping", + "examples": [ + { + "value": "has cross-reference", + "description": "The label of the oboInOwl:hasDbXref property to represent cross-references.", + "@type": "Example" + } + ], + "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/predicate_label", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "string", "@type": "SlotDefinition" @@ -966,10 +961,9 @@ "http://www.w3.org/2002/07/owl#annotatedTarget" ], "slot_uri": "http://www.w3.org/2002/07/owl#annotatedTarget", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "EntityReference", "required": true, @@ -987,10 +981,9 @@ ], "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/object_label", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "string", "recommended": true, @@ -1023,10 +1016,9 @@ "https://github.com/mapping-commons/sssom/issues/256" ], "slot_uri": "https://w3id.org/sssom/object_category", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "string", "@type": "SlotDefinition" @@ -1047,10 +1039,9 @@ ], "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/mapping_justification", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "EntityReference", "required": true, @@ -1117,11 +1108,10 @@ ], "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/object_type", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ "MappingSet", - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "entity_type_enum", "@type": "SlotDefinition" @@ -1243,11 +1233,10 @@ ], "slot_uri": "http://purl.org/dc/terms/creator", "multivalued": true, - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ "MappingSet", - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "EntityReference", "@type": "SlotDefinition" @@ -1259,11 +1248,10 @@ "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/creator_label", "multivalued": true, - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ "MappingSet", - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "string", "@type": "SlotDefinition" @@ -1278,10 +1266,9 @@ ], "slot_uri": "http://purl.org/pav/authoredBy", "multivalued": true, - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "EntityReference", "@type": "SlotDefinition" @@ -1293,10 +1280,9 @@ "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/author_label", "multivalued": true, - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "string", "@type": "SlotDefinition" @@ -1308,10 +1294,9 @@ "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/reviewer_id", "multivalued": true, - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "EntityReference", "@type": "SlotDefinition" @@ -1323,10 +1308,9 @@ "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/reviewer_label", "multivalued": true, - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "string", "@type": "SlotDefinition" @@ -1340,11 +1324,10 @@ "http://purl.org/dc/terms/license" ], "slot_uri": "http://purl.org/dc/terms/license", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ "MappingSet", - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "uri", "@type": "SlotDefinition" @@ -1416,51 +1399,6 @@ "range": "string", "@type": "SlotDefinition" }, - { - "name": "literal_source", - "definition_uri": "https://w3id.org/sssom/literal_source", - "description": "URI of ontology source for the literal.", - "examples": [ - { - "value": "obo:mondo.owl", - "description": "A persistent OBO CURIE pointing to the latest version of the Mondo ontology.", - "@type": "Example" - }, - { - "value": "wikidata:Q7876491", - "description": "A Wikidata identifier for the Uberon ontology resource.", - "@type": "Example" - } - ], - "from_schema": "https://w3id.org/sssom/schema/", - "slot_uri": "https://w3id.org/sssom/literal_source", - "owner": "LiteralMapping", - "domain_of": [ - "LiteralMapping" - ], - "range": "EntityReference", - "@type": "SlotDefinition" - }, - { - "name": "literal_source_version", - "definition_uri": "https://w3id.org/sssom/literal_source_version", - "description": "Version IRI or version string of the source of the literal.", - "examples": [ - { - "value": "http://purl.obolibrary.org/obo/mondo/releases/2021-01-30/mondo.owl", - "description": "(A persistent Version IRI pointing to the Mondo version '2021-01-30')", - "@type": "Example" - } - ], - "from_schema": "https://w3id.org/sssom/schema/", - "slot_uri": "https://w3id.org/sssom/literal_source_version", - "owner": "LiteralMapping", - "domain_of": [ - "LiteralMapping" - ], - "range": "string", - "@type": "SlotDefinition" - }, { "name": "object_source", "definition_uri": "https://w3id.org/sssom/object_source", @@ -1489,11 +1427,10 @@ ], "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/object_source", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ "MappingSet", - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "EntityReference", "@type": "SlotDefinition" @@ -1521,11 +1458,10 @@ ], "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/object_source_version", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ "MappingSet", - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "string", "@type": "SlotDefinition" @@ -1546,11 +1482,10 @@ "description": "URL pointing to the source that provided the mapping, for example an ontology that already contains the mappings, or a database from which it was derived.", "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/mapping_provider", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ "MappingSet", - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "uri", "@type": "SlotDefinition" @@ -1591,10 +1526,9 @@ ], "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/mapping_source", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "EntityReference", "@type": "SlotDefinition" @@ -1605,10 +1539,9 @@ "description": "A string indicating whether this mapping is from a 1:1 (the subject_id maps to a single object_id), 1:n (the subject maps to more than one object_id), n:1, 1:0, 0:1 or n:n group. Note that this is a convenience field that should be derivable from the mapping set.", "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/mapping_cardinality", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "mapping_cardinality_enum", "@type": "SlotDefinition" @@ -1635,11 +1568,10 @@ ], "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/mapping_tool", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ "MappingSet", - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "string", "@type": "SlotDefinition" @@ -1666,11 +1598,10 @@ ], "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/mapping_tool_version", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ "MappingSet", - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "string", "@type": "SlotDefinition" @@ -1694,11 +1625,10 @@ "http://purl.org/pav/authoredOn" ], "slot_uri": "http://purl.org/pav/authoredOn", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ "MappingSet", - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "date", "@type": "SlotDefinition" @@ -1726,10 +1656,9 @@ "description": "A score between 0 and 1 to denote the confidence or probability that the match is correct, where 1 denotes total confidence.", "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/confidence", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "double", "minimum_value": 0.0, @@ -1778,11 +1707,10 @@ "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/object_match_field", "multivalued": true, - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ "MappingSet", - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "EntityReference", "@type": "SlotDefinition" @@ -1794,10 +1722,9 @@ "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/match_string", "multivalued": true, - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "string", "@type": "SlotDefinition" @@ -1864,35 +1791,10 @@ "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/object_preprocessing", "multivalued": true, - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ "MappingSet", - "Mapping", - "LiteralMapping" - ], - "range": "EntityReference", - "@type": "SlotDefinition" - }, - { - "name": "literal_preprocessing", - "definition_uri": "https://w3id.org/sssom/literal_preprocessing", - "description": "Method of preprocessing applied to the literal.", - "examples": [ - { - "value": "semapv:Stemming", - "@type": "Example" - }, - { - "value": "semapv:StopWordRemoval", - "@type": "Example" - } - ], - "from_schema": "https://w3id.org/sssom/schema/", - "slot_uri": "https://w3id.org/sssom/literal_preprocessing", - "multivalued": true, - "owner": "LiteralMapping", - "domain_of": [ - "LiteralMapping" + "Mapping" ], "range": "EntityReference", "@type": "SlotDefinition" @@ -1935,50 +1837,20 @@ "range": "string", "@type": "SlotDefinition" }, - { - "name": "semantic_similarity_score", - "definition_uri": "https://w3id.org/sssom/semantic_similarity_score", - "description": "A score between 0 and 1 to denote the semantic similarity, where 1 denotes equivalence.", - "from_schema": "https://w3id.org/sssom/schema/", - "slot_uri": "https://w3id.org/sssom/semantic_similarity_score", - "owner": "Mapping", - "domain_of": [ - "Mapping" - ], - "range": "double", - "minimum_value": 0.0, - "maximum_value": 1.0, - "@type": "SlotDefinition" - }, - { - "name": "semantic_similarity_measure", - "definition_uri": "https://w3id.org/sssom/semantic_similarity_measure", - "description": "The measure used for computing the the semantic similarity score. To make processing this field as unambiguous as possible, we recommend using wikidata identifiers, but wikipedia pages could also be acceptable.", - "examples": [ - { - "value": "https://www.wikidata.org/wiki/Q865360", - "description": "(the Wikidata identifier for the Jaccard index measure).", - "@type": "Example" - } - ], - "from_schema": "https://w3id.org/sssom/schema/", - "slot_uri": "https://w3id.org/sssom/semantic_similarity_measure", - "owner": "Mapping", - "domain_of": [ - "Mapping" - ], - "range": "string", - "@type": "SlotDefinition" - }, { "name": "similarity_score", "definition_uri": "https://w3id.org/sssom/similarity_score", - "description": "A score between 0 and 1 to denote the similarity, where 1 denotes equivalence.", + "description": "A score between 0 and 1 to denote the similarity between two entities, where 1 denotes equivalence, and 0 denotes disjointness. The score is meant to be used in conjunction with the similarity_measure field, to document, for example, the lexical or semantic match of a matching algorithm.", "from_schema": "https://w3id.org/sssom/schema/", + "see_also": [ + "https://github.com/mapping-commons/sssom/issues/385", + "https://github.com/mapping-commons/sssom/pull/386", + "https://github.com/mapping-commons/sssom/blob/master/examples/schema/similarity_score.sssom.tsv" + ], "slot_uri": "https://w3id.org/sssom/similarity_score", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ - "LiteralMapping" + "Mapping" ], "range": "double", "minimum_value": 0.0, @@ -1988,19 +1860,34 @@ { "name": "similarity_measure", "definition_uri": "https://w3id.org/sssom/similarity_measure", - "description": "The measure used for computing the the similarity score. To make processing this field as unambiguous as possible, we recommend using wikidata identifiers, but wikipedia pages could also be acceptable.", + "description": "The measure used for computing a similarity score. This field is meant to be used in conjunction with the similarity_score field, to document, for example, the lexical or semantic match of a matching algorithm. To make processing this field as unambiguous as possible, we recommend using wikidata CURIEs, but the type of this field is deliberately unspecified.", "examples": [ { - "value": "https://www.wikidata.org/wiki/Q865360", - "description": "(the Wikidata identifier for the Jaccard index measure).", + "value": "https://www.wikidata.org/entity/Q865360", + "description": "(the Wikidata IRI for the Jaccard index measure).", + "@type": "Example" + }, + { + "value": "wikidata:Q865360", + "description": "(the Wikidata CURIE for the Jaccard index measure).", + "@type": "Example" + }, + { + "value": "Levenshtein distance", + "description": "(a score to measure the distance between two character sequences).", "@type": "Example" } ], "from_schema": "https://w3id.org/sssom/schema/", + "see_also": [ + "https://github.com/mapping-commons/sssom/issues/385", + "https://github.com/mapping-commons/sssom/pull/386", + "https://github.com/mapping-commons/sssom/blob/master/examples/schema/similarity_score.sssom.tsv" + ], "slot_uri": "https://w3id.org/sssom/similarity_measure", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ - "LiteralMapping" + "Mapping" ], "range": "string", "@type": "SlotDefinition" @@ -2066,11 +1953,10 @@ ], "slot_uri": "http://www.w3.org/2000/01/rdf-schema#seeAlso", "multivalued": true, - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ "MappingSet", - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "string", "@type": "SlotDefinition" @@ -2081,11 +1967,10 @@ "description": "Pipe separated list of key value pairs for properties not part of the SSSOM spec. Can be used to encode additional provenance data.", "from_schema": "https://w3id.org/sssom/schema/", "slot_uri": "https://w3id.org/sssom/other", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ "MappingSet", - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "string", "@type": "SlotDefinition" @@ -2099,11 +1984,10 @@ "http://www.w3.org/2000/01/rdf-schema#comment" ], "slot_uri": "http://www.w3.org/2000/01/rdf-schema#comment", - "owner": "LiteralMapping", + "owner": "Mapping", "domain_of": [ "MappingSet", - "Mapping", - "LiteralMapping" + "Mapping" ], "range": "string", "@type": "SlotDefinition" @@ -2210,6 +2094,7 @@ "description": "Represents a set of mappings", "from_schema": "https://w3id.org/sssom/schema/", "slots": [ + "curie_map", "mappings", "mapping_set_id", "mapping_set_version", @@ -2291,64 +2176,10 @@ "match_string", "subject_preprocessing", "object_preprocessing", - "semantic_similarity_score", - "semantic_similarity_measure", - "see_also", - "issue_tracker_item", - "other", - "comment" - ], - "slot_usage": {}, - "class_uri": "http://www.w3.org/2002/07/owl#Axiom", - "@type": "ClassDefinition" - }, - { - "name": "LiteralMapping", - "definition_uri": "https://w3id.org/sssom/LiteralMapping", - "description": "Represents an individual mapping between a literal and an entity. Note that this schema has been created on 01.08.2023 and is subject to change.", - "from_schema": "https://w3id.org/sssom/schema/", - "see_also": [ - "https://mapping-commons.github.io/sssom/sssom-profiles/" - ], - "mappings": [ - "owl:Axiom" - ], - "slots": [ - "literal", - "literal_datatype", - "predicate_id", - "predicate_label", - "predicate_modifier", - "object_id", - "object_label", - "object_category", - "mapping_justification", - "author_id", - "author_label", - "reviewer_id", - "reviewer_label", - "creator_id", - "creator_label", - "license", - "literal_source", - "literal_source_version", - "object_type", - "object_source", - "object_source_version", - "mapping_provider", - "mapping_source", - "mapping_cardinality", - "mapping_tool", - "mapping_tool_version", - "mapping_date", - "confidence", - "object_match_field", - "match_string", - "literal_preprocessing", - "object_preprocessing", "similarity_score", "similarity_measure", "see_also", + "issue_tracker_item", "other", "comment" ], @@ -2392,6 +2223,18 @@ "class_uri": "https://w3id.org/sssom/MappingSetReference", "@type": "ClassDefinition" }, + { + "name": "Prefix", + "definition_uri": "https://w3id.org/sssom/Prefix", + "from_schema": "https://w3id.org/sssom/schema/", + "slots": [ + "prefix_name", + "prefix_url" + ], + "slot_usage": {}, + "class_uri": "https://w3id.org/sssom/Prefix", + "@type": "ClassDefinition" + }, { "name": "ExtensionDefinition", "definition_uri": "https://w3id.org/sssom/ExtensionDefinition", @@ -2452,13 +2295,29 @@ ], "class_uri": "https://w3id.org/sssom/Propagatable", "@type": "ClassDefinition" + }, + { + "name": "NoTermFound", + "definition_uri": "https://w3id.org/sssom/NoTermFound", + "description": "sssom:NoTermFound can be used in place of a subject_id or object_id when the corresponding entity could not be found. It SHOULD be used in conjuction with a corresponding subject_source or object_source to signify where the term was not found.", + "from_schema": "https://w3id.org/sssom/schema/", + "see_also": [ + "https://github.com/mapping-commons/sssom/issues/28", + "https://github.com/mapping-commons/sssom/blob/master/examples/schema/no_term_found.sssom.tsv" + ], + "mappings": [ + "sssom:NoTermFound" + ], + "slot_usage": {}, + "class_uri": "https://w3id.org/sssom/NoTermFound", + "@type": "ClassDefinition" } ], "metamodel_version": "1.7.0", "source_file": "sssom_schema.yaml", - "source_file_date": "2024-08-04T07:56:31", - "source_file_size": 32305, - "generation_date": "2024-08-05T10:18:22", + "source_file_date": "2024-08-06T18:58:28", + "source_file_size": 31410, + "generation_date": "2024-08-06T18:58:48", "@type": "SchemaDefinition", "@context": [ "project/jsonld/sssom_schema.context.jsonld", diff --git a/src/sssom_schema/datamodel/sssom_schema.py b/src/sssom_schema/datamodel/sssom_schema.py index 9367487c..aee3262c 100644 --- a/src/sssom_schema/datamodel/sssom_schema.py +++ b/src/sssom_schema/datamodel/sssom_schema.py @@ -1,5 +1,5 @@ # Auto generated from sssom_schema.yaml by pythongen.py version: 0.0.1 -# Generation date: 2024-08-05T10:18:23 +# Generation date: 2024-08-06T18:58:49 # Schema: sssom # # id: https://w3id.org/sssom/schema/ @@ -58,7 +58,8 @@ class EntityReference(Uriorcurie): # Class references - +class PrefixPrefixName(NCName): + pass @dataclass @@ -75,6 +76,7 @@ class MappingSet(YAMLRoot): mapping_set_id: Union[str, URI] = None license: Union[str, URI] = None + curie_map: Optional[Union[Dict[Union[str, PrefixPrefixName], Union[dict, "Prefix"]], List[Union[dict, "Prefix"]]]] = empty_dict() mappings: Optional[Union[Union[dict, "Mapping"], List[Union[dict, "Mapping"]]]] = empty_list() mapping_set_version: Optional[str] = None mapping_set_source: Optional[Union[Union[str, URI], List[Union[str, URI]]]] = empty_list() @@ -114,6 +116,8 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if not isinstance(self.license, URI): self.license = URI(self.license) + self._normalize_inlined_as_dict(slot_name="curie_map", slot_type=Prefix, key_name="prefix_name", keyed=True) + if not isinstance(self.mappings, list): self.mappings = [self.mappings] if self.mappings is not None else [] self.mappings = [v if isinstance(v, Mapping) else Mapping(**as_dict(v)) for v in self.mappings] @@ -256,8 +260,8 @@ class Mapping(YAMLRoot): match_string: Optional[Union[str, List[str]]] = empty_list() subject_preprocessing: Optional[Union[Union[str, EntityReference], List[Union[str, EntityReference]]]] = empty_list() object_preprocessing: Optional[Union[Union[str, EntityReference], List[Union[str, EntityReference]]]] = empty_list() - semantic_similarity_score: Optional[float] = None - semantic_similarity_measure: Optional[str] = None + similarity_score: Optional[float] = None + similarity_measure: Optional[str] = None see_also: Optional[Union[str, List[str]]] = empty_list() issue_tracker_item: Optional[Union[str, EntityReference]] = None other: Optional[str] = None @@ -399,194 +403,6 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.object_preprocessing = [self.object_preprocessing] if self.object_preprocessing is not None else [] self.object_preprocessing = [v if isinstance(v, EntityReference) else EntityReference(v) for v in self.object_preprocessing] - if self.semantic_similarity_score is not None and not isinstance(self.semantic_similarity_score, float): - self.semantic_similarity_score = float(self.semantic_similarity_score) - - if self.semantic_similarity_measure is not None and not isinstance(self.semantic_similarity_measure, str): - self.semantic_similarity_measure = str(self.semantic_similarity_measure) - - if not isinstance(self.see_also, list): - self.see_also = [self.see_also] if self.see_also is not None else [] - self.see_also = [v if isinstance(v, str) else str(v) for v in self.see_also] - - if self.issue_tracker_item is not None and not isinstance(self.issue_tracker_item, EntityReference): - self.issue_tracker_item = EntityReference(self.issue_tracker_item) - - if self.other is not None and not isinstance(self.other, str): - self.other = str(self.other) - - if self.comment is not None and not isinstance(self.comment, str): - self.comment = str(self.comment) - - super().__post_init__(**kwargs) - - -@dataclass -class LiteralMapping(YAMLRoot): - """ - Represents an individual mapping between a literal and an entity. Note that this schema has been created on - 01.08.2023 and is subject to change. - """ - _inherited_slots: ClassVar[List[str]] = [] - - class_class_uri: ClassVar[URIRef] = OWL["Axiom"] - class_class_curie: ClassVar[str] = "owl:Axiom" - class_name: ClassVar[str] = "literal mapping" - class_model_uri: ClassVar[URIRef] = SSSOM.LiteralMapping - - literal: str = None - predicate_id: Union[str, EntityReference] = None - object_id: Union[str, EntityReference] = None - mapping_justification: Union[str, EntityReference] = None - literal_datatype: Optional[Union[str, URI]] = None - predicate_label: Optional[str] = None - predicate_modifier: Optional[Union[str, "PredicateModifierEnum"]] = None - object_label: Optional[str] = None - object_category: Optional[str] = None - author_id: Optional[Union[Union[str, EntityReference], List[Union[str, EntityReference]]]] = empty_list() - author_label: Optional[Union[str, List[str]]] = empty_list() - reviewer_id: Optional[Union[Union[str, EntityReference], List[Union[str, EntityReference]]]] = empty_list() - reviewer_label: Optional[Union[str, List[str]]] = empty_list() - creator_id: Optional[Union[Union[str, EntityReference], List[Union[str, EntityReference]]]] = empty_list() - creator_label: Optional[Union[str, List[str]]] = empty_list() - license: Optional[Union[str, URI]] = None - literal_source: Optional[Union[str, EntityReference]] = None - literal_source_version: Optional[str] = None - object_type: Optional[Union[str, "EntityTypeEnum"]] = None - object_source: Optional[Union[str, EntityReference]] = None - object_source_version: Optional[str] = None - mapping_provider: Optional[Union[str, URI]] = None - mapping_source: Optional[Union[str, EntityReference]] = None - mapping_cardinality: Optional[Union[str, "MappingCardinalityEnum"]] = None - mapping_tool: Optional[str] = None - mapping_tool_version: Optional[str] = None - mapping_date: Optional[Union[str, XSDDate]] = None - confidence: Optional[float] = None - object_match_field: Optional[Union[Union[str, EntityReference], List[Union[str, EntityReference]]]] = empty_list() - match_string: Optional[Union[str, List[str]]] = empty_list() - literal_preprocessing: Optional[Union[Union[str, EntityReference], List[Union[str, EntityReference]]]] = empty_list() - object_preprocessing: Optional[Union[Union[str, EntityReference], List[Union[str, EntityReference]]]] = empty_list() - similarity_score: Optional[float] = None - similarity_measure: Optional[str] = None - see_also: Optional[Union[str, List[str]]] = empty_list() - other: Optional[str] = None - comment: Optional[str] = None - - def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): - if self._is_empty(self.literal): - self.MissingRequiredField("literal") - if not isinstance(self.literal, str): - self.literal = str(self.literal) - - if self._is_empty(self.predicate_id): - self.MissingRequiredField("predicate_id") - if not isinstance(self.predicate_id, EntityReference): - self.predicate_id = EntityReference(self.predicate_id) - - if self._is_empty(self.object_id): - self.MissingRequiredField("object_id") - if not isinstance(self.object_id, EntityReference): - self.object_id = EntityReference(self.object_id) - - if self._is_empty(self.mapping_justification): - self.MissingRequiredField("mapping_justification") - if not isinstance(self.mapping_justification, EntityReference): - self.mapping_justification = EntityReference(self.mapping_justification) - - if self.literal_datatype is not None and not isinstance(self.literal_datatype, URI): - self.literal_datatype = URI(self.literal_datatype) - - if self.predicate_label is not None and not isinstance(self.predicate_label, str): - self.predicate_label = str(self.predicate_label) - - if self.predicate_modifier is not None and not isinstance(self.predicate_modifier, PredicateModifierEnum): - self.predicate_modifier = PredicateModifierEnum(self.predicate_modifier) - - if self.object_label is not None and not isinstance(self.object_label, str): - self.object_label = str(self.object_label) - - if self.object_category is not None and not isinstance(self.object_category, str): - self.object_category = str(self.object_category) - - if not isinstance(self.author_id, list): - self.author_id = [self.author_id] if self.author_id is not None else [] - self.author_id = [v if isinstance(v, EntityReference) else EntityReference(v) for v in self.author_id] - - if not isinstance(self.author_label, list): - self.author_label = [self.author_label] if self.author_label is not None else [] - self.author_label = [v if isinstance(v, str) else str(v) for v in self.author_label] - - if not isinstance(self.reviewer_id, list): - self.reviewer_id = [self.reviewer_id] if self.reviewer_id is not None else [] - self.reviewer_id = [v if isinstance(v, EntityReference) else EntityReference(v) for v in self.reviewer_id] - - if not isinstance(self.reviewer_label, list): - self.reviewer_label = [self.reviewer_label] if self.reviewer_label is not None else [] - self.reviewer_label = [v if isinstance(v, str) else str(v) for v in self.reviewer_label] - - if not isinstance(self.creator_id, list): - self.creator_id = [self.creator_id] if self.creator_id is not None else [] - self.creator_id = [v if isinstance(v, EntityReference) else EntityReference(v) for v in self.creator_id] - - if not isinstance(self.creator_label, list): - self.creator_label = [self.creator_label] if self.creator_label is not None else [] - self.creator_label = [v if isinstance(v, str) else str(v) for v in self.creator_label] - - if self.license is not None and not isinstance(self.license, URI): - self.license = URI(self.license) - - if self.literal_source is not None and not isinstance(self.literal_source, EntityReference): - self.literal_source = EntityReference(self.literal_source) - - if self.literal_source_version is not None and not isinstance(self.literal_source_version, str): - self.literal_source_version = str(self.literal_source_version) - - if self.object_type is not None and not isinstance(self.object_type, EntityTypeEnum): - self.object_type = EntityTypeEnum(self.object_type) - - if self.object_source is not None and not isinstance(self.object_source, EntityReference): - self.object_source = EntityReference(self.object_source) - - if self.object_source_version is not None and not isinstance(self.object_source_version, str): - self.object_source_version = str(self.object_source_version) - - if self.mapping_provider is not None and not isinstance(self.mapping_provider, URI): - self.mapping_provider = URI(self.mapping_provider) - - if self.mapping_source is not None and not isinstance(self.mapping_source, EntityReference): - self.mapping_source = EntityReference(self.mapping_source) - - if self.mapping_cardinality is not None and not isinstance(self.mapping_cardinality, MappingCardinalityEnum): - self.mapping_cardinality = MappingCardinalityEnum(self.mapping_cardinality) - - if self.mapping_tool is not None and not isinstance(self.mapping_tool, str): - self.mapping_tool = str(self.mapping_tool) - - if self.mapping_tool_version is not None and not isinstance(self.mapping_tool_version, str): - self.mapping_tool_version = str(self.mapping_tool_version) - - if self.mapping_date is not None and not isinstance(self.mapping_date, XSDDate): - self.mapping_date = XSDDate(self.mapping_date) - - if self.confidence is not None and not isinstance(self.confidence, float): - self.confidence = float(self.confidence) - - if not isinstance(self.object_match_field, list): - self.object_match_field = [self.object_match_field] if self.object_match_field is not None else [] - self.object_match_field = [v if isinstance(v, EntityReference) else EntityReference(v) for v in self.object_match_field] - - if not isinstance(self.match_string, list): - self.match_string = [self.match_string] if self.match_string is not None else [] - self.match_string = [v if isinstance(v, str) else str(v) for v in self.match_string] - - if not isinstance(self.literal_preprocessing, list): - self.literal_preprocessing = [self.literal_preprocessing] if self.literal_preprocessing is not None else [] - self.literal_preprocessing = [v if isinstance(v, EntityReference) else EntityReference(v) for v in self.literal_preprocessing] - - if not isinstance(self.object_preprocessing, list): - self.object_preprocessing = [self.object_preprocessing] if self.object_preprocessing is not None else [] - self.object_preprocessing = [v if isinstance(v, EntityReference) else EntityReference(v) for v in self.object_preprocessing] - if self.similarity_score is not None and not isinstance(self.similarity_score, float): self.similarity_score = float(self.similarity_score) @@ -597,6 +413,9 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.see_also = [self.see_also] if self.see_also is not None else [] self.see_also = [v if isinstance(v, str) else str(v) for v in self.see_also] + if self.issue_tracker_item is not None and not isinstance(self.issue_tracker_item, EntityReference): + self.issue_tracker_item = EntityReference(self.issue_tracker_item) + if self.other is not None and not isinstance(self.other, str): self.other = str(self.other) @@ -701,6 +520,30 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): super().__post_init__(**kwargs) +@dataclass +class Prefix(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = SSSOM["Prefix"] + class_class_curie: ClassVar[str] = "sssom:Prefix" + class_name: ClassVar[str] = "prefix" + class_model_uri: ClassVar[URIRef] = SSSOM.Prefix + + prefix_name: Union[str, PrefixPrefixName] = None + prefix_url: Optional[Union[str, URI]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self._is_empty(self.prefix_name): + self.MissingRequiredField("prefix_name") + if not isinstance(self.prefix_name, PrefixPrefixName): + self.prefix_name = PrefixPrefixName(self.prefix_name) + + if self.prefix_url is not None and not isinstance(self.prefix_url, URI): + self.prefix_url = URI(self.prefix_url) + + super().__post_init__(**kwargs) + + @dataclass class ExtensionDefinition(YAMLRoot): """ @@ -754,6 +597,20 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): super().__post_init__(**kwargs) +class NoTermFound(YAMLRoot): + """ + sssom:NoTermFound can be used in place of a subject_id or object_id when the corresponding entity could not be + found. It SHOULD be used in conjuction with a corresponding subject_source or object_source to signify where the + term was not found. + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = SSSOM["NoTermFound"] + class_class_curie: ClassVar[str] = "sssom:NoTermFound" + class_name: ClassVar[str] = "NoTermFound" + class_model_uri: ClassVar[URIRef] = SSSOM.NoTermFound + + # Enumerations class EntityTypeEnum(EnumDefinitionImpl): @@ -855,6 +712,15 @@ def _addvals(cls): class slots: pass +slots.prefix_name = Slot(uri=SSSOM.prefix_name, name="prefix_name", curie=SSSOM.curie('prefix_name'), + model_uri=SSSOM.prefix_name, domain=None, range=URIRef) + +slots.prefix_url = Slot(uri=SSSOM.prefix_url, name="prefix_url", curie=SSSOM.curie('prefix_url'), + model_uri=SSSOM.prefix_url, domain=None, range=Optional[Union[str, URI]]) + +slots.curie_map = Slot(uri=SSSOM.curie_map, name="curie_map", curie=SSSOM.curie('curie_map'), + model_uri=SSSOM.curie_map, domain=None, range=Optional[Union[Dict[Union[str, PrefixPrefixName], Union[dict, Prefix]], List[Union[dict, Prefix]]]]) + slots.mirror_from = Slot(uri=SSSOM.mirror_from, name="mirror_from", curie=SSSOM.curie('mirror_from'), model_uri=SSSOM.mirror_from, domain=None, range=Optional[Union[str, URI]]) @@ -894,12 +760,6 @@ class slots: slots.subject_id = Slot(uri=OWL.annotatedSource, name="subject_id", curie=OWL.curie('annotatedSource'), model_uri=SSSOM.subject_id, domain=None, range=Union[str, EntityReference]) -slots.literal = Slot(uri=OWL.annotatedTarget, name="literal", curie=OWL.curie('annotatedTarget'), - model_uri=SSSOM.literal, domain=None, range=str, mappings = [OWL["annotatedSource"]]) - -slots.literal_datatype = Slot(uri=RDF.datatype, name="literal_datatype", curie=RDF.curie('datatype'), - model_uri=SSSOM.literal_datatype, domain=None, range=Optional[Union[str, URI]]) - slots.subject_label = Slot(uri=SSSOM.subject_label, name="subject_label", curie=SSSOM.curie('subject_label'), model_uri=SSSOM.subject_label, domain=None, range=Optional[str]) @@ -979,12 +839,6 @@ class slots: slots.subject_source_version = Slot(uri=SSSOM.subject_source_version, name="subject_source_version", curie=SSSOM.curie('subject_source_version'), model_uri=SSSOM.subject_source_version, domain=None, range=Optional[str]) -slots.literal_source = Slot(uri=SSSOM.literal_source, name="literal_source", curie=SSSOM.curie('literal_source'), - model_uri=SSSOM.literal_source, domain=None, range=Optional[Union[str, EntityReference]]) - -slots.literal_source_version = Slot(uri=SSSOM.literal_source_version, name="literal_source_version", curie=SSSOM.curie('literal_source_version'), - model_uri=SSSOM.literal_source_version, domain=None, range=Optional[str]) - slots.object_source = Slot(uri=SSSOM.object_source, name="object_source", curie=SSSOM.curie('object_source'), model_uri=SSSOM.object_source, domain=None, range=Optional[Union[str, EntityReference]]) @@ -1033,21 +887,12 @@ class slots: slots.object_preprocessing = Slot(uri=SSSOM.object_preprocessing, name="object_preprocessing", curie=SSSOM.curie('object_preprocessing'), model_uri=SSSOM.object_preprocessing, domain=None, range=Optional[Union[Union[str, EntityReference], List[Union[str, EntityReference]]]]) -slots.literal_preprocessing = Slot(uri=SSSOM.literal_preprocessing, name="literal_preprocessing", curie=SSSOM.curie('literal_preprocessing'), - model_uri=SSSOM.literal_preprocessing, domain=None, range=Optional[Union[Union[str, EntityReference], List[Union[str, EntityReference]]]]) - slots.curation_rule = Slot(uri=SSSOM.curation_rule, name="curation_rule", curie=SSSOM.curie('curation_rule'), model_uri=SSSOM.curation_rule, domain=None, range=Optional[Union[Union[str, EntityReference], List[Union[str, EntityReference]]]]) slots.curation_rule_text = Slot(uri=SSSOM.curation_rule_text, name="curation_rule_text", curie=SSSOM.curie('curation_rule_text'), model_uri=SSSOM.curation_rule_text, domain=None, range=Optional[Union[str, List[str]]]) -slots.semantic_similarity_score = Slot(uri=SSSOM.semantic_similarity_score, name="semantic_similarity_score", curie=SSSOM.curie('semantic_similarity_score'), - model_uri=SSSOM.semantic_similarity_score, domain=None, range=Optional[float]) - -slots.semantic_similarity_measure = Slot(uri=SSSOM.semantic_similarity_measure, name="semantic_similarity_measure", curie=SSSOM.curie('semantic_similarity_measure'), - model_uri=SSSOM.semantic_similarity_measure, domain=None, range=Optional[str]) - slots.similarity_score = Slot(uri=SSSOM.similarity_score, name="similarity_score", curie=SSSOM.curie('similarity_score'), model_uri=SSSOM.similarity_score, domain=None, range=Optional[float]) diff --git a/src/sssom_schema/schema/sssom_schema.yaml b/src/sssom_schema/schema/sssom_schema.yaml index 0f58e3d3..e30103dd 100644 --- a/src/sssom_schema/schema/sssom_schema.yaml +++ b/src/sssom_schema/schema/sssom_schema.yaml @@ -72,6 +72,20 @@ types: - https://mapping-commons.github.io/sssom/spec/#tsv slots: + prefix_name: + key: true + range: ncname + prefix_url: + range: uri + curie_map: + description: A dictionary that contains prefixes as keys and their URI expansions as values. + range: prefix + multivalued: true + inlined: true + see_also: + - https://github.com/mapping-commons/sssom/issues/225 + - https://github.com/mapping-commons/sssom/pull/349 + - https://github.com/mapping-commons/sssom/blob/master/examples/schema/curie_map.sssom.tsv mirror_from: description: A URL location from which to obtain a resource, such as a mapping set. range: uri @@ -597,6 +611,7 @@ classes: license: required: true slots: + - curie_map - mappings - mapping_set_id - mapping_set_version @@ -697,6 +712,10 @@ classes: - mapping_set_group - last_updated - local_name + prefix: + slots: + - prefix_name + - prefix_url extension definition: description: A definition of an extension (non-standard) slot. attributes: