From 7c711a3facf0f03157b41354b7b480adaee01c5a Mon Sep 17 00:00:00 2001 From: cmungall Date: Thu, 19 Aug 2021 14:52:04 -0700 Subject: [PATCH 1/3] linkml-1.0.4 --- Makefile | 10 +- graphql/kgcl.graphql | 20 ++ jsonschema/kgcl.schema.json | 99 ++++++++- kgcl/model/kgcl.py | 81 +++++++- ldcontext/kgcl.context.jsonld | 2 +- owl/kgcl.owl.ttl | 373 ++++++++++++++++++++-------------- python/kgcl.py | 81 +++++++- requirements.txt | 2 +- shex/kgcl.shex | 16 +- tests/test_conversion.py | 24 +-- 10 files changed, 502 insertions(+), 206 deletions(-) diff --git a/Makefile b/Makefile index 15e70104..2e41152f 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ SCHEMA_NAMES = $(patsubst $(SCHEMA_DIR)/%.yaml, %, $(SOURCE_FILES)) SCHEMA_NAME = kgcl SCHEMA_SRC = $(SCHEMA_DIR)/$(SCHEMA_NAME).yaml -TGTS = graphql jsonschema ldcontext docs owl csv graphql python shex +TGTS = graphql jsonschema ldcontext docs owl csv graphql python shex sql #GEN_OPTS = --no-mergeimports GEN_OPTS = @@ -22,10 +22,10 @@ t: echo: echo $(patsubst %,gen-%,$(TGTS)) -test: all pytest +test: all test_framework -pytest: - pytest +test_framework: + pipenv run python -m unittest discover -p 'test_*.py' install: . environment.sh @@ -80,7 +80,7 @@ target/ldcontext/%.context.jsonld: $(SCHEMA_DIR)/%.yaml tdir-ldcontext ### -- SQL schema -- # TODO: modularize imports. For now imports are merged. -gen-sqlddl: target/sql/$(SCHEMA_NAME).schema.sql +gen-sql: target/sql/$(SCHEMA_NAME).schema.sql target/sql/%.schema.sql: $(SCHEMA_DIR)/%.yaml tdir-sql gen-sqlddl $(GEN_OPTS) --dialect sqlite $< > $@ diff --git a/graphql/kgcl.graphql b/graphql/kgcl.graphql index ab810ab1..bff8529f 100644 --- a/graphql/kgcl.graphql +++ b/graphql/kgcl.graphql @@ -293,6 +293,26 @@ type LogicalDefinition { } +type MappingCreation implements Creation + { + id: String! + wasGeneratedBy: Activity + seeAlso: String + pullRequest: String + creator: String + changeDate: String + contributor: String + hasUndo: Change + oldValue: String + newValue: String + aboutEdge: Edge + subject: Node + predicate: Node + object: Node + annotationSet: Annotation + changeDescription: String + } + type MultiNodeObsoletion { id: String! diff --git a/jsonschema/kgcl.schema.json b/jsonschema/kgcl.schema.json index b2707351..12e255c5 100644 --- a/jsonschema/kgcl.schema.json +++ b/jsonschema/kgcl.schema.json @@ -1,6 +1,7 @@ { "$id": "https://w3id.org/kgcl", "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": true, "definitions": { "Activity": { "additionalProperties": false, @@ -190,7 +191,7 @@ "type": "string" }, "owl_type": { - "type": "string" + "$ref": "#/definitions/OwlTypeEnum" }, "pull_request": { "type": "string" @@ -225,7 +226,7 @@ "type": "string" }, "owl_type": { - "type": "string" + "$ref": "#/definitions/OwlTypeEnum" } }, "required": [ @@ -260,7 +261,7 @@ "type": "string" }, "synonym_predicates": { - "$ref": "string" + "$ref": null } }, "required": [], @@ -636,7 +637,7 @@ "type": "string" }, "owl_type": { - "type": "string" + "$ref": "#/definitions/OwlTypeEnum" } }, "required": [ @@ -697,6 +698,71 @@ "title": "LogicalDefinition", "type": "object" }, + "MappingCreation": { + "additionalProperties": false, + "description": "A specific kind of edge creation in which the created edge is a mapping.", + "properties": { + "about_edge": { + "$ref": "#/definitions/Edge" + }, + "annotation_set": { + "$ref": "#/definitions/Annotation" + }, + "change_date": { + "type": "string" + }, + "change_description": { + "type": "string" + }, + "contributor": { + "type": "string" + }, + "creator": { + "type": "string" + }, + "has_undo": { + "description": "A change that reverses this change", + "type": "string" + }, + "id": { + "type": "string" + }, + "new_value": { + "description": "The value of a property held in the new instance of the ontology", + "type": "string" + }, + "object": { + "description": "This corresponds to object_id in SSSOM", + "type": "string" + }, + "old_value": { + "description": "The value of a property held in the old instance of the ontology", + "type": "string" + }, + "predicate": { + "description": "This corresponds to predicate_id in SSSOM. The value of this is typically a predicate from SKOS", + "type": "string" + }, + "pull_request": { + "type": "string" + }, + "see_also": { + "type": "string" + }, + "subject": { + "description": "This corresponds to subject_id in SSSOM", + "type": "string" + }, + "was_generated_by": { + "type": "string" + } + }, + "required": [ + "id" + ], + "title": "MappingCreation", + "type": "object" + }, "MultiNodeObsoletion": { "additionalProperties": false, "description": "A complex change consisting of multiple obsoletions.", @@ -913,7 +979,7 @@ "type": "string" }, "owl_type": { - "type": "string" + "$ref": "#/definitions/OwlTypeEnum" } }, "required": [ @@ -1061,7 +1127,7 @@ "type": "string" }, "owl_type": { - "type": "string" + "$ref": "#/definitions/OwlTypeEnum" }, "pull_request": { "type": "string" @@ -1747,6 +1813,16 @@ "title": "OntologySubset", "type": "object" }, + "OwlTypeEnum": { + "description": "", + "enum": [ + "CLASS", + "OBJECT_PROPERTY", + "NAMED_INDIVIDUAL" + ], + "title": "OwlTypeEnum", + "type": "string" + }, "PlaceUnder": { "additionalProperties": false, "description": "An edge creation where the predicate is owl:subClassOf", @@ -2154,6 +2230,17 @@ "title": "SynonymReplacement", "type": "object" }, + "SynonymScopeEnum": { + "description": "", + "enum": [ + "related", + "broad", + "narrow", + "exact" + ], + "title": "SynonymScopeEnum", + "type": "string" + }, "TextDefinitionReplacement": { "additionalProperties": false, "description": "A node change where a text definition is modified", diff --git a/kgcl/model/kgcl.py b/kgcl/model/kgcl.py index fec75fcd..92ac3117 100644 --- a/kgcl/model/kgcl.py +++ b/kgcl/model/kgcl.py @@ -1,5 +1,5 @@ # Auto generated from kgcl.yaml by pythongen.py version: 0.9.0 -# Generation date: 2021-07-16 20:38 +# Generation date: 2021-08-19 14:44 # Schema: kgcl # # id: https://w3id.org/kgcl @@ -12,7 +12,7 @@ import dataclasses import sys import re -from jsonasobj2 import JsonObj +from jsonasobj2 import JsonObj, as_dict from typing import Optional, List, Union, Dict, ClassVar, Any from dataclasses import dataclass from linkml_runtime.linkml_model.meta import EnumDefinition, PermissibleValue, PvFormulaOptions @@ -100,6 +100,10 @@ class EdgeRewiringId(EdgeChangeId): pass +class MappingCreationId(EdgeCreationId): + pass + + class NodeMoveId(EdgeChangeId): pass @@ -407,7 +411,7 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if not isinstance(self.property_value_set, list): self.property_value_set = [self.property_value_set] if self.property_value_set is not None else [] - self.property_value_set = [v if isinstance(v, PropertyValue) else PropertyValue(**v) for v in self.property_value_set] + self.property_value_set = [v if isinstance(v, PropertyValue) else PropertyValue(**as_dict(v)) for v in self.property_value_set] super().__post_init__(**kwargs) @@ -444,7 +448,7 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.about = OntologyElement() if self.has_undo is not None and not isinstance(self.has_undo, Obsoletion): - self.has_undo = Obsoletion(**self.has_undo) + self.has_undo = Obsoletion(**as_dict(self.has_undo)) super().__post_init__(**kwargs) @@ -478,7 +482,7 @@ class Unobsoletion(ChangeMixin): def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if self.has_undo is not None and not isinstance(self.has_undo, Obsoletion): - self.has_undo = Obsoletion(**self.has_undo) + self.has_undo = Obsoletion(**as_dict(self.has_undo)) super().__post_init__(**kwargs) @@ -578,7 +582,7 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.in_subset = OntologySubset() if self.has_undo is not None and not isinstance(self.has_undo, AddToSubset): - self.has_undo = AddToSubset(**self.has_undo) + self.has_undo = AddToSubset(**as_dict(self.has_undo)) super().__post_init__(**kwargs) @@ -601,7 +605,7 @@ class EdgeChange(SimpleChange): def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if self.about_edge is not None and not isinstance(self.about_edge, Edge): - self.about_edge = Edge(**self.about_edge) + self.about_edge = Edge(**as_dict(self.about_edge)) if self.subject is not None and not isinstance(self.subject, NodeId): self.subject = NodeId(self.subject) @@ -644,7 +648,7 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.object = NodeId(self.object) if self.annotation_set is not None and not isinstance(self.annotation_set, Annotation): - self.annotation_set = Annotation(**self.annotation_set) + self.annotation_set = Annotation(**as_dict(self.annotation_set)) if self.change_description is not None and not isinstance(self.change_description, str): self.change_description = str(self.change_description) @@ -710,7 +714,7 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.object = NodeId(self.object) if self.annotation_set is not None and not isinstance(self.annotation_set, Annotation): - self.annotation_set = Annotation(**self.annotation_set) + self.annotation_set = Annotation(**as_dict(self.annotation_set)) if self.change_description is not None and not isinstance(self.change_description, str): self.change_description = str(self.change_description) @@ -754,7 +758,7 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.object = NodeId(self.object) if self.annotation_set is not None and not isinstance(self.annotation_set, Annotation): - self.annotation_set = Annotation(**self.annotation_set) + self.annotation_set = Annotation(**as_dict(self.annotation_set)) if self.change_description is not None and not isinstance(self.change_description, str): self.change_description = str(self.change_description) @@ -788,6 +792,49 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): super().__post_init__(**kwargs) +@dataclass +class MappingCreation(EdgeCreation): + """ + A specific kind of edge creation in which the created edge is a mapping. + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = KGCL.MappingCreation + class_class_curie: ClassVar[str] = "kgcl:MappingCreation" + class_name: ClassVar[str] = "mapping creation" + class_model_uri: ClassVar[URIRef] = KGCL.MappingCreation + + id: Union[str, MappingCreationId] = None + subject: Optional[Union[str, NodeId]] = None + predicate: Optional[Union[str, NodeId]] = None + object: Optional[Union[str, NodeId]] = None + annotation_set: Optional[Union[dict, Annotation]] = None + change_description: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self._is_empty(self.id): + self.MissingRequiredField("id") + if not isinstance(self.id, MappingCreationId): + self.id = MappingCreationId(self.id) + + if self.subject is not None and not isinstance(self.subject, NodeId): + self.subject = NodeId(self.subject) + + if self.predicate is not None and not isinstance(self.predicate, NodeId): + self.predicate = NodeId(self.predicate) + + if self.object is not None and not isinstance(self.object, NodeId): + self.object = NodeId(self.object) + + if self.annotation_set is not None and not isinstance(self.annotation_set, Annotation): + self.annotation_set = Annotation(**as_dict(self.annotation_set)) + + if self.change_description is not None and not isinstance(self.change_description, str): + self.change_description = str(self.change_description) + + super().__post_init__(**kwargs) + + @dataclass class NodeMove(EdgeChange): """ @@ -1535,7 +1582,7 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.owl_type = OwlTypeEnum(self.owl_type) if self.annotation_set is not None and not isinstance(self.annotation_set, Annotation): - self.annotation_set = Annotation(**self.annotation_set) + self.annotation_set = Annotation(**as_dict(self.annotation_set)) if self.change_description is not None and not isinstance(self.change_description, str): self.change_description = str(self.change_description) @@ -1976,6 +2023,18 @@ class slots: slots.edge_obsoletion_change_description = Slot(uri=KGCL.change_description, name="edge obsoletion_change description", curie=KGCL.curie('change_description'), model_uri=KGCL.edge_obsoletion_change_description, domain=EdgeObsoletion, range=Optional[str]) +slots.mapping_creation_change_description = Slot(uri=KGCL.change_description, name="mapping creation_change description", curie=KGCL.curie('change_description'), + model_uri=KGCL.mapping_creation_change_description, domain=MappingCreation, range=Optional[str]) + +slots.mapping_creation_subject = Slot(uri=KGCL.subject, name="mapping creation_subject", curie=KGCL.curie('subject'), + model_uri=KGCL.mapping_creation_subject, domain=MappingCreation, range=Optional[Union[str, NodeId]]) + +slots.mapping_creation_predicate = Slot(uri=KGCL.predicate, name="mapping creation_predicate", curie=KGCL.curie('predicate'), + model_uri=KGCL.mapping_creation_predicate, domain=MappingCreation, range=Optional[Union[str, NodeId]]) + +slots.mapping_creation_object = Slot(uri=KGCL.object, name="mapping creation_object", curie=KGCL.curie('object'), + model_uri=KGCL.mapping_creation_object, domain=MappingCreation, range=Optional[Union[str, NodeId]]) + slots.node_move_change_description = Slot(uri=KGCL.change_description, name="node move_change description", curie=KGCL.curie('change_description'), model_uri=KGCL.node_move_change_description, domain=NodeMove, range=Optional[str]) diff --git a/ldcontext/kgcl.context.jsonld b/ldcontext/kgcl.context.jsonld index a1aae40f..d19d9731 100644 --- a/ldcontext/kgcl.context.jsonld +++ b/ldcontext/kgcl.context.jsonld @@ -1,5 +1,5 @@ { - "_comments": "Auto generated from kgcl.yaml by jsonldcontextgen.py version: 0.1.1\n Generation date: 2021-07-16 20:38\n Schema: kgcl\n \n id: https://w3id.org/kgcl\n description: A data model for describing change operations at a high level on an ontology or ontology-like artefact, such as a Knowledge Graph.\n\n* [Browse Schema](https://cmungall.github.io/knowledge-graph-change-language/)\n* [GitHub](https://github.com/cmungall/knowledge-graph-change-language)\n license: https://creativecommons.org/publicdomain/zero/1.0/\n ", + "_comments": "Auto generated from kgcl.yaml by jsonldcontextgen.py version: 0.1.1\n Generation date: 2021-08-19 14:44\n Schema: kgcl\n \n id: https://w3id.org/kgcl\n description: A data model for describing change operations at a high level on an ontology or ontology-like artefact, such as a Knowledge Graph.\n\n* [Browse Schema](https://cmungall.github.io/knowledge-graph-change-language/)\n* [GitHub](https://github.com/cmungall/knowledge-graph-change-language)\n license: https://creativecommons.org/publicdomain/zero/1.0/\n ", "@context": { "IAO": { "@id": "http://purl.obolibrary.org/obo/IAO_", diff --git a/owl/kgcl.owl.ttl b/owl/kgcl.owl.ttl index 109cab90..014037f6 100644 --- a/owl/kgcl.owl.ttl +++ b/owl/kgcl.owl.ttl @@ -1,6 +1,7 @@ @prefix dcterms: . @prefix linkml: . @prefix owl: . +@prefix pav: . @prefix rdf: . @prefix rdfs: . @prefix skos: . @@ -23,10 +24,6 @@ linkml:ClassDefinition ; rdfs:label "configuration" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty linkml:definition_predicate ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; owl:onProperty linkml:creator_predicate ], @@ -37,11 +34,15 @@ [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty linkml:contributor_predicate ], + owl:onProperty linkml:definition_predicate ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; owl:onProperty linkml:name_predicate ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty linkml:obsoletion_workflow ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; @@ -49,7 +50,7 @@ [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty linkml:obsoletion_workflow ], + owl:onProperty linkml:contributor_predicate ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; @@ -202,15 +203,16 @@ rdfs:label "kgcl" ; dcterms:license "https://creativecommons.org/publicdomain/zero/1.0/" ; dcterms:title "Knowledge Graph Change Language" ; + pav:version "0.0.1" ; skos:definition """A data model for describing change operations at a high level on an ontology or ontology-like artefact, such as a Knowledge Graph. * [Browse Schema](https://cmungall.github.io/knowledge-graph-change-language/) * [GitHub](https://github.com/cmungall/knowledge-graph-change-language)""" ; - linkml:generation_date "2021-07-16 20:38" ; + linkml:generation_date "2021-08-19 14:44" ; linkml:metamodel_version "1.7.0" ; linkml:source_file "kgcl.yaml" ; - linkml:source_file_date "Fri Jul 16 20:38:20 2021" ; - linkml:source_file_size 25096 . + linkml:source_file_date "Thu Aug 19 14:44:35 2021" ; + linkml:source_file_size 25851 . linkml:Boolean a owl:Class, linkml:TypeDefinition ; @@ -450,13 +452,6 @@ linkml:edge_change_subject a owl:ObjectProperty, rdfs:subPropertyOf ; skos:note "if subject is empty, use the about field of the last node change" . -linkml:edge_creation_change_description a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "edge creation_change description" ; - rdfs:domain ; - rdfs:range linkml:String ; - rdfs:subPropertyOf . - linkml:edge_deletion_change_description a owl:ObjectProperty, linkml:SlotDefinition ; rdfs:label "edge deletion_change description" ; @@ -471,6 +466,37 @@ linkml:edge_obsoletion_change_description a owl:ObjectProperty, rdfs:range linkml:String ; rdfs:subPropertyOf . +linkml:mapping_creation_change_description a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "mapping creation_change description" ; + rdfs:domain ; + rdfs:range linkml:String ; + rdfs:subPropertyOf linkml:edge_creation_change_description . + +linkml:mapping_creation_object a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "mapping creation_object" ; + rdfs:domain ; + rdfs:range ; + rdfs:subPropertyOf ; + skos:definition "This corresponds to object_id in SSSOM" . + +linkml:mapping_creation_predicate a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "mapping creation_predicate" ; + rdfs:domain ; + rdfs:range ; + rdfs:subPropertyOf ; + skos:definition "This corresponds to predicate_id in SSSOM. The value of this is typically a predicate from SKOS" . + +linkml:mapping_creation_subject a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "mapping creation_subject" ; + rdfs:domain ; + rdfs:range ; + rdfs:subPropertyOf ; + skos:definition "This corresponds to subject_id in SSSOM" . + linkml:multi_node_obsoletion_associated_change_set a owl:ObjectProperty, linkml:SlotDefinition ; rdfs:label "multi node obsoletion_associated change set" ; @@ -708,13 +734,13 @@ linkml:unobsoletion_has_undo a owl:ObjectProperty, linkml:ClassDefinition ; rdfs:label "class creation" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], ; skos:definition "A node creation where the owl type is 'class'" . @@ -741,15 +767,15 @@ linkml:unobsoletion_has_undo a owl:ObjectProperty, [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ], + owl:onProperty ], , ; skos:altLabel "relationship deletion" ; @@ -762,27 +788,27 @@ linkml:unobsoletion_has_undo a owl:ObjectProperty, rdfs:subClassOf [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass linkml:String ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], + owl:onClass ; + owl:onProperty ], , ; skos:altLabel "relationship obsoletion" ; @@ -922,6 +948,13 @@ linkml:Uriorcurie a owl:Class, owl:qualifiedCardinality 1 ] ; skos:definition "a URI or a CURIE" . +linkml:edge_creation_change_description a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "edge creation_change description" ; + rdfs:domain ; + rdfs:range linkml:String ; + rdfs:subPropertyOf . + linkml:node_creation_change_description a owl:ObjectProperty, linkml:SlotDefinition ; rdfs:label "node creation_change description" ; @@ -936,15 +969,11 @@ linkml:node_creation_change_description a owl:ObjectProperty, linkml:mixin ; skos:definition "Applies to an obsoletion in which annotations or edges pointing at the obsoleted node can be automatically rewired to point to a target" . - a owl:Class, + a owl:Class, linkml:ClassDefinition ; - rdfs:label "edge creation" ; - rdfs:seeAlso "http://wiki.geneontology.org/index.php/Guidelines_for_creating_relationships_between_terms" ; + rdfs:label "node creation" ; + rdfs:seeAlso "http://wiki.geneontology.org/index.php/Guidelines_for_creating_a_GO_term" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], @@ -955,40 +984,15 @@ linkml:node_creation_change_description a owl:ObjectProperty, [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], - , - ; - skos:altLabel "relationship creation" ; - skos:definition "An edge change in which a de-novo edge is created. The edge is potentially annotated in the same action." . - - a owl:Class, - linkml:ClassDefinition ; - rdfs:label "node creation" ; - rdfs:seeAlso "http://wiki.geneontology.org/index.php/Guidelines_for_creating_a_GO_term" ; - rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass linkml:String ; + owl:onProperty ], , ; skos:definition "a node change in which a new node is created" . @@ -1013,16 +1017,16 @@ linkml:node_creation_change_description a owl:ObjectProperty, a owl:Class, linkml:ClassDefinition ; rdfs:label "node obsoletion with no direct replacement" ; - rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], - [ a owl:Class ; + rdfs:subClassOf [ a owl:Class ; owl:intersectionOf ( [ a owl:Restriction ; owl:allValuesFrom ; owl:onProperty ] [ a owl:Restriction ; owl:onProperty ; owl:someValuesFrom ] ) ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], ; skos:definition "An obsoletion change in which there is no direct replacement" . @@ -1064,8 +1068,8 @@ linkml:node_creation_change_description a owl:ObjectProperty, rdfs:label "edge" ; rdfs:subClassOf [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; @@ -1073,11 +1077,11 @@ linkml:node_creation_change_description a owl:ObjectProperty, [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass ; + owl:onProperty ], ; skos:altLabel "axiom", "relationship", @@ -1184,43 +1188,61 @@ linkml:subset a owl:ObjectProperty, linkml:ClassDefinition ; rdfs:label "change set summary statistic" ; rdfs:subClassOf [ a owl:Restriction ; - owl:allValuesFrom ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty linkml:change_type ], + [ a owl:Restriction ; + owl:allValuesFrom ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:Integer ; owl:onProperty linkml:count ] ; skos:definition "A summary statistic for a set of changes of the same type, grouped by zero or more node properties" . - a owl:Class, + a owl:Class, linkml:ClassDefinition ; - rdfs:label "creation" ; + rdfs:label "edge creation" ; + rdfs:seeAlso "http://wiki.geneontology.org/index.php/Guidelines_for_creating_relationships_between_terms" ; rdfs:subClassOf [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], - , - linkml:mixin ; - skos:definition "Creation of an element." . + owl:onClass linkml:String ; + owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], + , + ; + skos:altLabel "relationship creation" ; + skos:definition "An edge change in which a de-novo edge is created. The edge is potentially annotated in the same action." . a owl:Class, linkml:ClassDefinition ; rdfs:label "multi node obsoletion" ; rdfs:seeAlso "https://github.com/cmungall/obo-scripts/blob/master/obo-obsoletify.pl" ; rdfs:subClassOf [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], + [ a owl:Restriction ; owl:allValuesFrom ; owl:onProperty ], [ a owl:Restriction ; owl:allValuesFrom ; owl:onProperty linkml:associated_change_set ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], ; skos:altLabel "multi class obsoletion", "multi concept obsoletion", @@ -1232,13 +1254,13 @@ linkml:subset a owl:ObjectProperty, linkml:ClassDefinition ; rdfs:label "name becomes synonym" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty linkml:change_2 ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; @@ -1258,17 +1280,17 @@ linkml:subset a owl:ObjectProperty, rdfs:seeAlso "http://wiki.geneontology.org/index.php/Merging_Ontology_Terms", "http://wiki.geneontology.org/index.php/Principles_for_merging_terms" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ], + owl:onProperty ; + owl:qualifiedCardinality 1 ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; owl:onProperty ], [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ; - owl:qualifiedCardinality 1 ], + owl:onProperty ], , ; skos:definition "An obsoletion change in which all metadata (including name/label) from the source node is deleted and added to the target node, and edges can automatically be rewired to point to the target node" ; @@ -1335,8 +1357,8 @@ linkml:subset a owl:ObjectProperty, rdfs:label "removed node from subset" ; rdfs:subClassOf [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass linkml:String ; + owl:onProperty linkml:subset ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; @@ -1347,8 +1369,8 @@ linkml:subset a owl:ObjectProperty, owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty linkml:subset ], + owl:onClass ; + owl:onProperty ], , ; skos:altLabel "remove term from slim" ; @@ -1393,6 +1415,17 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, linkml:mixin ; skos:definition "placing an element inside a subset" . + a owl:Class, + linkml:ClassDefinition ; + rdfs:label "creation" ; + rdfs:subClassOf [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], + , + linkml:mixin ; + skos:definition "Creation of an element." . + a owl:Class, linkml:ClassDefinition ; rdfs:label "deletion" ; @@ -1401,6 +1434,30 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, skos:definition "Removal of an element." ; skos:note "In general, for OBO ontologies, node elements should never be deleted, always obsolete. However, edge deletion is more common." . + a owl:Class, + linkml:ClassDefinition ; + rdfs:label "mapping creation" ; + rdfs:subClassOf [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], + , + ; + skos:altLabel "xref creation" ; + skos:definition "A specific kind of edge creation in which the created edge is a mapping." . + a owl:Class, linkml:ClassDefinition ; rdfs:label "simple change" ; @@ -1436,26 +1493,16 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, linkml:ClassDefinition ; rdfs:label "property value" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], ; skos:definition "a property-value pair" . - a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "object" ; - rdfs:range . - - a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "predicate" ; - rdfs:range . - a owl:ObjectProperty, linkml:SlotDefinition ; rdfs:label "id" ; @@ -1496,20 +1543,20 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, rdfs:label "node rename" ; rdfs:subClassOf [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass linkml:String ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], + owl:onClass ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty ], + owl:onProperty ], ; skos:definition "A node change where the name (aka rdfs:label) of the node changes" ; linkml:examples "Example(value=\"rename UBERON:0002398 from 'manus' to 'hand'\", description=\"replacing the rdfs:label of 'manus' on an uberon class with the rdfs:label 'hand'\")" . @@ -1520,26 +1567,31 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, rdfs:range ; skos:definition "The 'focus' entity on which the change operates" . - a owl:ObjectProperty, + a owl:ObjectProperty, linkml:SlotDefinition ; - rdfs:label "subject" ; + rdfs:label "object" ; + rdfs:range . + + a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "predicate" ; rdfs:range . a owl:Class, linkml:ClassDefinition ; rdfs:label "agent" ; rdfs:subClassOf [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], + [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], [ a owl:Restriction ; owl:onClass linkml:String ; owl:onProperty ; - owl:qualifiedCardinality 1 ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ] ; + owl:qualifiedCardinality 1 ] ; skos:definition "a provence-generating agent" ; skos:exactMatch . @@ -1558,13 +1610,13 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, linkml:ClassDefinition ; rdfs:label "edge change" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], ; skos:altLabel "axiom change", "triple change" ; @@ -1583,15 +1635,15 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, owl:onClass linkml:String ; owl:onProperty ], [ a owl:Restriction ; - owl:allValuesFrom ; - owl:onProperty linkml:associated_change_set ], + owl:allValuesFrom ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], [ a owl:Restriction ; - owl:allValuesFrom ; - owl:onProperty ], + owl:allValuesFrom ; + owl:onProperty linkml:associated_change_set ], , ; skos:altLabel "class obsoletion", @@ -1622,6 +1674,11 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, rdfs:label "ontology subset" ; rdfs:subClassOf . + a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "subject" ; + rdfs:range . + a owl:Class, linkml:ClassDefinition ; rdfs:label "obsoletion" ; @@ -1674,20 +1731,20 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass linkml:String ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], + owl:onClass ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; @@ -1711,16 +1768,20 @@ linkml:TypeDefinition a owl:Class ; rdfs:label "change" ; rdfs:subClassOf [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty ], + owl:onProperty ], + [ a owl:Restriction ; + owl:onClass linkml:String ; + owl:onProperty ; + owl:qualifiedCardinality 1 ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; @@ -1729,14 +1790,10 @@ linkml:TypeDefinition a owl:Class ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; owl:onProperty ], - [ a owl:Restriction ; - owl:onClass linkml:String ; - owl:onProperty ; - owl:qualifiedCardinality 1 ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; @@ -1760,10 +1817,6 @@ linkml:TypeDefinition a owl:Class ; linkml:ClassDefinition ; rdfs:label "node" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], @@ -1775,6 +1828,10 @@ linkml:TypeDefinition a owl:Class ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], ; skos:altLabel "entity", "term" ; diff --git a/python/kgcl.py b/python/kgcl.py index fec75fcd..92ac3117 100644 --- a/python/kgcl.py +++ b/python/kgcl.py @@ -1,5 +1,5 @@ # Auto generated from kgcl.yaml by pythongen.py version: 0.9.0 -# Generation date: 2021-07-16 20:38 +# Generation date: 2021-08-19 14:44 # Schema: kgcl # # id: https://w3id.org/kgcl @@ -12,7 +12,7 @@ import dataclasses import sys import re -from jsonasobj2 import JsonObj +from jsonasobj2 import JsonObj, as_dict from typing import Optional, List, Union, Dict, ClassVar, Any from dataclasses import dataclass from linkml_runtime.linkml_model.meta import EnumDefinition, PermissibleValue, PvFormulaOptions @@ -100,6 +100,10 @@ class EdgeRewiringId(EdgeChangeId): pass +class MappingCreationId(EdgeCreationId): + pass + + class NodeMoveId(EdgeChangeId): pass @@ -407,7 +411,7 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if not isinstance(self.property_value_set, list): self.property_value_set = [self.property_value_set] if self.property_value_set is not None else [] - self.property_value_set = [v if isinstance(v, PropertyValue) else PropertyValue(**v) for v in self.property_value_set] + self.property_value_set = [v if isinstance(v, PropertyValue) else PropertyValue(**as_dict(v)) for v in self.property_value_set] super().__post_init__(**kwargs) @@ -444,7 +448,7 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.about = OntologyElement() if self.has_undo is not None and not isinstance(self.has_undo, Obsoletion): - self.has_undo = Obsoletion(**self.has_undo) + self.has_undo = Obsoletion(**as_dict(self.has_undo)) super().__post_init__(**kwargs) @@ -478,7 +482,7 @@ class Unobsoletion(ChangeMixin): def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if self.has_undo is not None and not isinstance(self.has_undo, Obsoletion): - self.has_undo = Obsoletion(**self.has_undo) + self.has_undo = Obsoletion(**as_dict(self.has_undo)) super().__post_init__(**kwargs) @@ -578,7 +582,7 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.in_subset = OntologySubset() if self.has_undo is not None and not isinstance(self.has_undo, AddToSubset): - self.has_undo = AddToSubset(**self.has_undo) + self.has_undo = AddToSubset(**as_dict(self.has_undo)) super().__post_init__(**kwargs) @@ -601,7 +605,7 @@ class EdgeChange(SimpleChange): def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if self.about_edge is not None and not isinstance(self.about_edge, Edge): - self.about_edge = Edge(**self.about_edge) + self.about_edge = Edge(**as_dict(self.about_edge)) if self.subject is not None and not isinstance(self.subject, NodeId): self.subject = NodeId(self.subject) @@ -644,7 +648,7 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.object = NodeId(self.object) if self.annotation_set is not None and not isinstance(self.annotation_set, Annotation): - self.annotation_set = Annotation(**self.annotation_set) + self.annotation_set = Annotation(**as_dict(self.annotation_set)) if self.change_description is not None and not isinstance(self.change_description, str): self.change_description = str(self.change_description) @@ -710,7 +714,7 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.object = NodeId(self.object) if self.annotation_set is not None and not isinstance(self.annotation_set, Annotation): - self.annotation_set = Annotation(**self.annotation_set) + self.annotation_set = Annotation(**as_dict(self.annotation_set)) if self.change_description is not None and not isinstance(self.change_description, str): self.change_description = str(self.change_description) @@ -754,7 +758,7 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.object = NodeId(self.object) if self.annotation_set is not None and not isinstance(self.annotation_set, Annotation): - self.annotation_set = Annotation(**self.annotation_set) + self.annotation_set = Annotation(**as_dict(self.annotation_set)) if self.change_description is not None and not isinstance(self.change_description, str): self.change_description = str(self.change_description) @@ -788,6 +792,49 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): super().__post_init__(**kwargs) +@dataclass +class MappingCreation(EdgeCreation): + """ + A specific kind of edge creation in which the created edge is a mapping. + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = KGCL.MappingCreation + class_class_curie: ClassVar[str] = "kgcl:MappingCreation" + class_name: ClassVar[str] = "mapping creation" + class_model_uri: ClassVar[URIRef] = KGCL.MappingCreation + + id: Union[str, MappingCreationId] = None + subject: Optional[Union[str, NodeId]] = None + predicate: Optional[Union[str, NodeId]] = None + object: Optional[Union[str, NodeId]] = None + annotation_set: Optional[Union[dict, Annotation]] = None + change_description: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self._is_empty(self.id): + self.MissingRequiredField("id") + if not isinstance(self.id, MappingCreationId): + self.id = MappingCreationId(self.id) + + if self.subject is not None and not isinstance(self.subject, NodeId): + self.subject = NodeId(self.subject) + + if self.predicate is not None and not isinstance(self.predicate, NodeId): + self.predicate = NodeId(self.predicate) + + if self.object is not None and not isinstance(self.object, NodeId): + self.object = NodeId(self.object) + + if self.annotation_set is not None and not isinstance(self.annotation_set, Annotation): + self.annotation_set = Annotation(**as_dict(self.annotation_set)) + + if self.change_description is not None and not isinstance(self.change_description, str): + self.change_description = str(self.change_description) + + super().__post_init__(**kwargs) + + @dataclass class NodeMove(EdgeChange): """ @@ -1535,7 +1582,7 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.owl_type = OwlTypeEnum(self.owl_type) if self.annotation_set is not None and not isinstance(self.annotation_set, Annotation): - self.annotation_set = Annotation(**self.annotation_set) + self.annotation_set = Annotation(**as_dict(self.annotation_set)) if self.change_description is not None and not isinstance(self.change_description, str): self.change_description = str(self.change_description) @@ -1976,6 +2023,18 @@ class slots: slots.edge_obsoletion_change_description = Slot(uri=KGCL.change_description, name="edge obsoletion_change description", curie=KGCL.curie('change_description'), model_uri=KGCL.edge_obsoletion_change_description, domain=EdgeObsoletion, range=Optional[str]) +slots.mapping_creation_change_description = Slot(uri=KGCL.change_description, name="mapping creation_change description", curie=KGCL.curie('change_description'), + model_uri=KGCL.mapping_creation_change_description, domain=MappingCreation, range=Optional[str]) + +slots.mapping_creation_subject = Slot(uri=KGCL.subject, name="mapping creation_subject", curie=KGCL.curie('subject'), + model_uri=KGCL.mapping_creation_subject, domain=MappingCreation, range=Optional[Union[str, NodeId]]) + +slots.mapping_creation_predicate = Slot(uri=KGCL.predicate, name="mapping creation_predicate", curie=KGCL.curie('predicate'), + model_uri=KGCL.mapping_creation_predicate, domain=MappingCreation, range=Optional[Union[str, NodeId]]) + +slots.mapping_creation_object = Slot(uri=KGCL.object, name="mapping creation_object", curie=KGCL.curie('object'), + model_uri=KGCL.mapping_creation_object, domain=MappingCreation, range=Optional[Union[str, NodeId]]) + slots.node_move_change_description = Slot(uri=KGCL.change_description, name="node move_change description", curie=KGCL.curie('change_description'), model_uri=KGCL.node_move_change_description, domain=NodeMove, range=Optional[str]) diff --git a/requirements.txt b/requirements.txt index d8b12ea5..7b54c6c2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -linkml >= 1.0.1 +linkml >= 1.0.4 mkdocs diff --git a/shex/kgcl.shex b/shex/kgcl.shex index ddc2fbf2..2065aec9 100644 --- a/shex/kgcl.shex +++ b/shex/kgcl.shex @@ -240,7 +240,7 @@ om:Edge CLOSED { ) ; rdf:type [ ] ) - } OR @ + } OR @ OR @ ) CLOSED { @@ -314,6 +314,20 @@ om:LogicalDefinition CLOSED { ) } + CLOSED { + ( $ ( & ; + rdf:type [ ] ? ; + & ; + rdf:type [ ] ? ; + @om:Node ? ; + @om:Node ? ; + @om:Node ? ; + @linkml:String ? + ) ; + rdf:type [ ] + ) +} + CLOSED { ( $ ( & ; rdf:type [ ] ? ; diff --git a/tests/test_conversion.py b/tests/test_conversion.py index 81cd11f9..7423901c 100644 --- a/tests/test_conversion.py +++ b/tests/test_conversion.py @@ -16,16 +16,16 @@ class ConversionTestSuite(unittest.TestCase): def setUp(self) -> None: self.session = from_yaml(f'{EXAMPLE_DIR}/de-novo.yaml') - #def test_convert(self): - # session = from_yaml(f'{EXAMPLE_DIR}/de-novo.yaml') - # print(f'Session: {session}') - # json = to_json(session) - # ofn = os.path.join(OUTPUT_DIR, "test.json") - # with open(ofn, "w") as stream: - # stream.write(json) - # with open(os.path.join(OUTPUT_DIR, "test.jsonld"), "w") as stream: - # stream.write(to_jsonld(session)) - # G: Graph - # G = to_rdf(session) - # G.serialize(os.path.join(OUTPUT_DIR, "test.rdf"), format='turtle') + def test_convert(self): + session = from_yaml(f'{EXAMPLE_DIR}/de-novo.yaml') + print(f'Session: {session}') + json = to_json(session) + ofn = os.path.join(OUTPUT_DIR, "test.json") + with open(ofn, "w") as stream: + stream.write(json) + with open(os.path.join(OUTPUT_DIR, "test.jsonld"), "w") as stream: + stream.write(to_jsonld(session)) + G: Graph + G = to_rdf(session) + G.serialize(os.path.join(OUTPUT_DIR, "test.rdf"), format='turtle') From ab93670c8529edcea2044c4bc86b80053faca1b8 Mon Sep 17 00:00:00 2001 From: cmungall Date: Thu, 19 Aug 2021 16:47:42 -0700 Subject: [PATCH 2/3] languages --- examples/de-novo.yaml | 2 + graphql/kgcl.graphql | 61 +++++- jsonschema/kgcl.schema.json | 174 +++++++++++---- kgcl/model/basics.py | 13 +- kgcl/model/kgcl.py | 125 ++++++++--- ldcontext/kgcl.context.jsonld | 5 +- owl/kgcl.owl.ttl | 401 ++++++++++++++++++++-------------- python/basics.py | 13 +- python/kgcl.py | 125 ++++++++--- shex/basics.shex | 3 + shex/kgcl.shex | 52 ++++- src/schema/basics.yaml | 5 + src/schema/kgcl.yaml | 42 +++- 13 files changed, 739 insertions(+), 282 deletions(-) diff --git a/examples/de-novo.yaml b/examples/de-novo.yaml index c8fe7ac6..8e6ce26f 100644 --- a/examples/de-novo.yaml +++ b/examples/de-novo.yaml @@ -11,6 +11,8 @@ change_set: - {type: NewSynonym, about_node: ANAT:Forelimb, new_value: "upper limb"} - {type: ClassCreation, node_id: ANAT:Hindlimb, name: "hindlimb", superclass: ANAT:Limb} - {type: NewSynonym, about_node: ANAT:Hindlimb, new_value: "lower limb"} +- {type: SetLanguageForName, about_node: ANAT:Hindlimb, new_value: "en"} +- {type: NewSynonym, about_node: ANAT:Mouse, new_value: "bouche", language: "fr"} #- {type: ClassCreation, node_id: ANAT:Foot, name: "foot", superclass: ANAT:BodyPart, relationship: {predicate: ANAT:part-of, filler: ANAT:Hindlimb}} #- {type: ClassCreation, node_id: ANAT:Hand, name: "hand", superclass: ANAT:BodyPart, relationship: {predicate: ANAT:part-of, filler: ANAT:Hindlimb}, was_generated_by: uuid:e887d3aac33f} ## deliberate mistake #- {type: NodeMove, about_node: ANAT:Hand, old_predicate: ANAT:part-of, new_predicate: ANAT:Hindlimb, new_parent: ANAT:Forelimb} diff --git a/graphql/kgcl.graphql b/graphql/kgcl.graphql index bff8529f..24773560 100644 --- a/graphql/kgcl.graphql +++ b/graphql/kgcl.graphql @@ -22,6 +22,7 @@ type AddNodeToSubset implements AddToSubset oldValue: String newValue: String aboutNode: Node + language: LanguageTag inSubset: OntologySubset } @@ -86,6 +87,7 @@ type ClassCreation oldValue: String newValue: String aboutNode: Node + language: LanguageTag nodeId: Node name: String owlType: OwlTypeEnum @@ -134,16 +136,10 @@ interface Creation type DatatypeChange { - id: String! - wasGeneratedBy: Activity - seeAlso: String - pullRequest: String - creator: String - changeDate: String - contributor: String - hasUndo: Change - oldValue: String - newValue: String + } + +interface DatatypeOrLanguageTagChange + { } interface Deletion @@ -275,6 +271,12 @@ type InstanceNode owlType: OwlTypeEnum } +type LanguageTagChange + { + oldValue: LanguageTag + newValue: LanguageTag + } + type LogicalAxiomChange { id: String! @@ -341,6 +343,7 @@ type NameBecomesSynonym oldValue: String newValue: String aboutNode: Node + language: LanguageTag change1: NodeRename change2: NewSynonym changeDescription: String @@ -358,6 +361,7 @@ type NewSynonym hasUndo: Change oldValue: String aboutNode: Node + language: LanguageTag newValue: String } @@ -373,6 +377,7 @@ type NewTextDefinition hasUndo: Change oldValue: String aboutNode: Node + language: LanguageTag newValue: String } @@ -397,6 +402,7 @@ type NodeAnnotationChange oldValue: String newValue: String aboutNode: Node + language: LanguageTag } type NodeAnnotationReplacement @@ -412,6 +418,7 @@ type NodeAnnotationReplacement oldValue: String newValue: String aboutNode: Node + language: LanguageTag } interface NodeChange @@ -427,6 +434,7 @@ interface NodeChange oldValue: String newValue: String aboutNode: Node + language: LanguageTag } type NodeCreation implements Creation @@ -442,6 +450,7 @@ type NodeCreation implements Creation oldValue: String newValue: String aboutNode: Node + language: LanguageTag nodeId: Node name: String owlType: OwlTypeEnum @@ -479,6 +488,7 @@ type NodeDeletion implements Deletion oldValue: String newValue: String aboutNode: Node + language: LanguageTag changeDescription: String } @@ -494,6 +504,7 @@ type NodeDirectMerge implements AllowsAutomaticReplacementOfEdges hasUndo: Change oldValue: String newValue: String + language: LanguageTag hasNondirectReplacement: [Node] associatedChangeSet: [Change] about: OntologyElement @@ -532,6 +543,7 @@ type NodeObsoletion implements Obsoletion oldValue: String newValue: String aboutNode: Node + language: LanguageTag hasDirectReplacement: Node hasNondirectReplacement: [Node] changeDescription: String @@ -552,6 +564,7 @@ type NodeObsoletionWithDirectReplacement implements AllowsAutomaticReplacementOf oldValue: String newValue: String aboutNode: Node + language: LanguageTag hasNondirectReplacement: [Node] associatedChangeSet: [Change] about: OntologyElement @@ -572,6 +585,7 @@ type NodeObsoletionWithNoDirectReplacement oldValue: String newValue: String aboutNode: Node + language: LanguageTag hasDirectReplacement: Node associatedChangeSet: [Change] about: OntologyElement @@ -590,6 +604,7 @@ type NodeRename contributor: String hasUndo: Change aboutNode: Node + language: LanguageTag oldValue: String newValue: String hasTextualDiff: TextualDiff @@ -626,6 +641,7 @@ type NodeSynonymChange oldValue: String newValue: String aboutNode: Node + language: LanguageTag } interface NodeTextDefinitionChange @@ -641,6 +657,7 @@ interface NodeTextDefinitionChange oldValue: String newValue: String aboutNode: Node + language: LanguageTag } type NodeUnobsoletion implements Unobsoletion @@ -656,6 +673,7 @@ type NodeUnobsoletion implements Unobsoletion oldValue: String newValue: String aboutNode: Node + language: LanguageTag changeDescription: String replacedBy: Node consider: Node @@ -736,6 +754,7 @@ type RemoveSynonym hasUndo: Change newValue: String aboutNode: Node + language: LanguageTag oldValue: String } @@ -751,6 +770,7 @@ type RemoveTextDefinition hasUndo: Change newValue: String aboutNode: Node + language: LanguageTag oldValue: String } @@ -766,6 +786,7 @@ type RemovedNodeFromSubset implements RemoveFromSubset hasUndo: Change oldValue: String newValue: String + language: LanguageTag changeDescription: String aboutNode: Node subset: String @@ -778,6 +799,23 @@ type Session activitySet: [Activity] } +type SetLanguageForName implements LanguageTagChange + { + id: String! + wasGeneratedBy: Activity + seeAlso: String + pullRequest: String + creator: String + changeDate: String + contributor: String + hasUndo: Change + aboutNode: Node + language: LanguageTag + oldValue: String + newValue: String + changeDescription: String + } + interface SimpleChange { id: String! @@ -808,6 +846,7 @@ type SynonymPredicateChange contributor: String hasUndo: Change aboutNode: Node + language: LanguageTag oldValue: String newValue: String hasTextualDiff: TextualDiff @@ -824,6 +863,7 @@ type SynonymReplacement contributor: String hasUndo: Change aboutNode: Node + language: LanguageTag oldValue: String newValue: String hasTextualDiff: TextualDiff @@ -840,6 +880,7 @@ type TextDefinitionReplacement contributor: String hasUndo: Change aboutNode: Node + language: LanguageTag oldValue: String newValue: String hasTextualDiff: TextualDiff diff --git a/jsonschema/kgcl.schema.json b/jsonschema/kgcl.schema.json index 12e255c5..c64902c8 100644 --- a/jsonschema/kgcl.schema.json +++ b/jsonschema/kgcl.schema.json @@ -62,6 +62,9 @@ "$ref": "#/definitions/OntologySubset", "description": "subset that the element is being placed inside." }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -175,6 +178,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "name": { "type": "string" }, @@ -271,44 +277,8 @@ "DatatypeChange": { "additionalProperties": false, "description": "", - "properties": { - "change_date": { - "type": "string" - }, - "contributor": { - "type": "string" - }, - "creator": { - "type": "string" - }, - "has_undo": { - "description": "A change that reverses this change", - "type": "string" - }, - "id": { - "type": "string" - }, - "new_value": { - "description": "The value of a property held in the new instance of the ontology", - "type": "string" - }, - "old_value": { - "description": "The value of a property held in the old instance of the ontology", - "type": "string" - }, - "pull_request": { - "type": "string" - }, - "see_also": { - "type": "string" - }, - "was_generated_by": { - "type": "string" - } - }, - "required": [ - "id" - ], + "properties": {}, + "required": [], "title": "DatatypeChange", "type": "object" }, @@ -646,6 +616,21 @@ "title": "InstanceNode", "type": "object" }, + "LanguageTagChange": { + "additionalProperties": false, + "description": "", + "properties": { + "new_value": { + "type": "string" + }, + "old_value": { + "type": "string" + } + }, + "required": [], + "title": "LanguageTagChange", + "type": "object" + }, "LogicalAxiomChange": { "additionalProperties": false, "description": "A simple change where a logical axiom is changed, where the logical axiom cannot be represented as an edge", @@ -847,6 +832,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -894,6 +882,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -941,6 +932,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -1011,6 +1005,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -1058,6 +1055,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -1111,6 +1111,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "name": { "type": "string" }, @@ -1224,6 +1227,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -1295,6 +1301,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -1421,6 +1430,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -1492,6 +1504,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -1564,6 +1579,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -1619,6 +1637,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "type": "string" }, @@ -1717,6 +1738,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -1770,6 +1794,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -1976,6 +2003,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -2023,6 +2053,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -2078,6 +2111,9 @@ "$ref": "#/definitions/OntologySubset", "description": "subset that the element is being removed from" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -2128,6 +2164,59 @@ "title": "Session", "type": "object" }, + "SetLanguageForName": { + "additionalProperties": false, + "description": "A node change where the string value for the name is unchanged but the language tag is set", + "properties": { + "about_node": { + "type": "string" + }, + "change_date": { + "type": "string" + }, + "change_description": { + "type": "string" + }, + "contributor": { + "type": "string" + }, + "creator": { + "type": "string" + }, + "has_undo": { + "description": "A change that reverses this change", + "type": "string" + }, + "id": { + "type": "string" + }, + "language": { + "type": "string" + }, + "new_value": { + "description": "The value of a property held in the new instance of the ontology", + "type": "string" + }, + "old_value": { + "description": "The value of a property held in the old instance of the ontology", + "type": "string" + }, + "pull_request": { + "type": "string" + }, + "see_also": { + "type": "string" + }, + "was_generated_by": { + "type": "string" + } + }, + "required": [ + "id" + ], + "title": "SetLanguageForName", + "type": "object" + }, "SynonymPredicateChange": { "additionalProperties": false, "description": "A node synonym change where the predicate of a synonym is changed. Background: synonyms can be represented by a variety of predicates. For example, many OBO ontologies make use of predicates such as oio:hasExactSynonym, oio:hasRelatedSynonym, etc", @@ -2155,6 +2244,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -2206,6 +2298,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" @@ -2268,6 +2363,9 @@ "id": { "type": "string" }, + "language": { + "type": "string" + }, "new_value": { "description": "The value of a property held in the new instance of the ontology", "type": "string" diff --git a/kgcl/model/basics.py b/kgcl/model/basics.py index 09f15109..165d74b8 100644 --- a/kgcl/model/basics.py +++ b/kgcl/model/basics.py @@ -1,5 +1,5 @@ # Auto generated from basics.yaml by pythongen.py version: 0.9.0 -# Generation date: 2021-05-11 09:08 +# Generation date: 2021-08-19 15:44 # Schema: basics # # id: https://w3id.org/kgcl/basics @@ -9,7 +9,7 @@ import dataclasses import sys import re -from jsonasobj2 import JsonObj +from jsonasobj2 import JsonObj, as_dict from typing import Optional, List, Union, Dict, ClassVar, Any from dataclasses import dataclass from linkml_runtime.linkml_model.meta import EnumDefinition, PermissibleValue, PvFormulaOptions @@ -22,7 +22,7 @@ from linkml_runtime.utils.enumerations import EnumDefinitionImpl from rdflib import Namespace, URIRef from linkml_runtime.utils.curienamespace import CurieNamespace -from linkml_model.types import String +from linkml_runtime.linkml_model.types import String metamodel_version = "1.7.0" @@ -33,10 +33,17 @@ BASICS = CurieNamespace('basics', 'https://w3id.org/kgcl/basics/') DCTERMS = CurieNamespace('dcterms', 'http://purl.org/dc/terms/') LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/') +XML = CurieNamespace('xml', 'http://example.org/UNKNOWN/xml/') DEFAULT_ = BASICS # Types +class LanguageTag(str): + type_class_uri = XML.lang + type_class_curie = "xml:lang" + type_name = "language tag" + type_model_uri = BASICS.LanguageTag + # Class references diff --git a/kgcl/model/kgcl.py b/kgcl/model/kgcl.py index 92ac3117..b231a08c 100644 --- a/kgcl/model/kgcl.py +++ b/kgcl/model/kgcl.py @@ -1,5 +1,5 @@ # Auto generated from kgcl.yaml by pythongen.py version: 0.9.0 -# Generation date: 2021-08-19 14:44 +# Generation date: 2021-08-19 15:44 # Schema: kgcl # # id: https://w3id.org/kgcl @@ -25,6 +25,7 @@ from linkml_runtime.utils.enumerations import EnumDefinitionImpl from rdflib import Namespace, URIRef from linkml_runtime.utils.curienamespace import CurieNamespace +from . basics import LanguageTag from . ontology_model import Annotation, Edge, NodeId, OntologyElement, OntologySubset, OwlTypeEnum, PropertyValue from . prov import Activity, ActivityId from linkml_runtime.linkml_model.types import Integer, String, Uriorcurie @@ -136,6 +137,10 @@ class NodeRenameId(NodeChangeId): pass +class SetLanguageForNameId(NodeChangeId): + pass + + class NodeAnnotationChangeId(NodeChangeId): pass @@ -184,10 +189,6 @@ class TextDefinitionReplacementId(NodeTextDefinitionChangeId): pass -class DatatypeChangeId(SimpleChangeId): - pass - - class AddNodeToSubsetId(NodeChangeId): pass @@ -453,6 +454,49 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): super().__post_init__(**kwargs) +class DatatypeOrLanguageTagChange(ChangeMixin): + """ + A change in a value assertion where the value remain unchanged but either the datatype or language changes + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = KGCL.DatatypeOrLanguageTagChange + class_class_curie: ClassVar[str] = "kgcl:DatatypeOrLanguageTagChange" + class_name: ClassVar[str] = "datatype or language tag change" + class_model_uri: ClassVar[URIRef] = KGCL.DatatypeOrLanguageTagChange + + +@dataclass +class LanguageTagChange(DatatypeOrLanguageTagChange): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = KGCL.LanguageTagChange + class_class_curie: ClassVar[str] = "kgcl:LanguageTagChange" + class_name: ClassVar[str] = "language tag change" + class_model_uri: ClassVar[URIRef] = KGCL.LanguageTagChange + + old_value: Optional[str] = None + new_value: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.old_value is not None and not isinstance(self.old_value, str): + self.old_value = str(self.old_value) + + if self.new_value is not None and not isinstance(self.new_value, str): + self.new_value = str(self.new_value) + + super().__post_init__(**kwargs) + + +class DatatypeChange(DatatypeOrLanguageTagChange): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = KGCL.DatatypeChange + class_class_curie: ClassVar[str] = "kgcl:DatatypeChange" + class_name: ClassVar[str] = "datatype change" + class_model_uri: ClassVar[URIRef] = KGCL.DatatypeChange + + class AllowsAutomaticReplacementOfEdges(Obsoletion): """ Applies to an obsoletion in which annotations or edges pointing at the obsoleted node can be automatically rewired @@ -1005,11 +1049,15 @@ class NodeChange(SimpleChange): id: Union[str, NodeChangeId] = None about_node: Optional[Union[str, NodeId]] = None + language: Optional[str] = None def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if self.about_node is not None and not isinstance(self.about_node, NodeId): self.about_node = NodeId(self.about_node) + if self.language is not None and not isinstance(self.language, str): + self.language = str(self.language) + super().__post_init__(**kwargs) @@ -1052,6 +1100,41 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): super().__post_init__(**kwargs) +@dataclass +class SetLanguageForName(NodeChange): + """ + A node change where the string value for the name is unchanged but the language tag is set + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = KGCL.SetLanguageForName + class_class_curie: ClassVar[str] = "kgcl:SetLanguageForName" + class_name: ClassVar[str] = "set language for name" + class_model_uri: ClassVar[URIRef] = KGCL.SetLanguageForName + + id: Union[str, SetLanguageForNameId] = None + old_value: Optional[str] = None + new_value: Optional[str] = None + change_description: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self._is_empty(self.id): + self.MissingRequiredField("id") + if not isinstance(self.id, SetLanguageForNameId): + self.id = SetLanguageForNameId(self.id) + + if self.old_value is not None and not isinstance(self.old_value, str): + self.old_value = str(self.old_value) + + if self.new_value is not None and not isinstance(self.new_value, str): + self.new_value = str(self.new_value) + + if self.change_description is not None and not isinstance(self.change_description, str): + self.change_description = str(self.change_description) + + super().__post_init__(**kwargs) + + @dataclass class NodeAnnotationChange(NodeChange): """ @@ -1383,26 +1466,6 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): super().__post_init__(**kwargs) -@dataclass -class DatatypeChange(SimpleChange): - _inherited_slots: ClassVar[List[str]] = [] - - class_class_uri: ClassVar[URIRef] = KGCL.DatatypeChange - class_class_curie: ClassVar[str] = "kgcl:DatatypeChange" - class_name: ClassVar[str] = "datatype change" - class_model_uri: ClassVar[URIRef] = KGCL.DatatypeChange - - id: Union[str, DatatypeChangeId] = None - - def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): - if self._is_empty(self.id): - self.MissingRequiredField("id") - if not isinstance(self.id, DatatypeChangeId): - self.id = DatatypeChangeId(self.id) - - super().__post_init__(**kwargs) - - @dataclass class AddNodeToSubset(NodeChange): """ @@ -1870,6 +1933,9 @@ class slots: slots.superclass = Slot(uri=KGCL.superclass, name="superclass", curie=KGCL.curie('superclass'), model_uri=KGCL.superclass, domain=None, range=Optional[Union[str, NodeId]]) +slots.language = Slot(uri=KGCL.language, name="language", curie=KGCL.curie('language'), + model_uri=KGCL.language, domain=None, range=Optional[str]) + slots.about = Slot(uri=KGCL.about, name="about", curie=KGCL.curie('about'), model_uri=KGCL.about, domain=None, range=Optional[Union[dict, OntologyElement]]) @@ -1996,6 +2062,12 @@ class slots: slots.obsoletion_has_undo = Slot(uri=KGCL.has_undo, name="obsoletion_has undo", curie=KGCL.curie('has_undo'), model_uri=KGCL.obsoletion_has_undo, domain=None, range=Optional[Union[dict, "Obsoletion"]]) +slots.language_tag_change_old_value = Slot(uri=KGCL.old_value, name="language tag change_old value", curie=KGCL.curie('old_value'), + model_uri=KGCL.language_tag_change_old_value, domain=LanguageTagChange, range=Optional[str]) + +slots.language_tag_change_new_value = Slot(uri=KGCL.new_value, name="language tag change_new value", curie=KGCL.curie('new_value'), + model_uri=KGCL.language_tag_change_new_value, domain=LanguageTagChange, range=Optional[str]) + slots.unobsoletion_has_undo = Slot(uri=KGCL.has_undo, name="unobsoletion_has undo", curie=KGCL.curie('has_undo'), model_uri=KGCL.unobsoletion_has_undo, domain=None, range=Optional[Union[dict, Obsoletion]]) @@ -2056,6 +2128,9 @@ class slots: slots.node_rename_change_description = Slot(uri=KGCL.change_description, name="node rename_change description", curie=KGCL.curie('change_description'), model_uri=KGCL.node_rename_change_description, domain=NodeRename, range=Optional[str]) +slots.set_language_for_name_change_description = Slot(uri=KGCL.change_description, name="set language for name_change description", curie=KGCL.curie('change_description'), + model_uri=KGCL.set_language_for_name_change_description, domain=SetLanguageForName, range=Optional[str]) + slots.name_becomes_synonym_change_1 = Slot(uri=KGCL.change_1, name="name becomes synonym_change 1", curie=KGCL.curie('change_1'), model_uri=KGCL.name_becomes_synonym_change_1, domain=NameBecomesSynonym, range=Optional[Union[str, NodeRenameId]]) diff --git a/ldcontext/kgcl.context.jsonld b/ldcontext/kgcl.context.jsonld index d19d9731..36f07b20 100644 --- a/ldcontext/kgcl.context.jsonld +++ b/ldcontext/kgcl.context.jsonld @@ -1,5 +1,5 @@ { - "_comments": "Auto generated from kgcl.yaml by jsonldcontextgen.py version: 0.1.1\n Generation date: 2021-08-19 14:44\n Schema: kgcl\n \n id: https://w3id.org/kgcl\n description: A data model for describing change operations at a high level on an ontology or ontology-like artefact, such as a Knowledge Graph.\n\n* [Browse Schema](https://cmungall.github.io/knowledge-graph-change-language/)\n* [GitHub](https://github.com/cmungall/knowledge-graph-change-language)\n license: https://creativecommons.org/publicdomain/zero/1.0/\n ", + "_comments": "Auto generated from kgcl.yaml by jsonldcontextgen.py version: 0.1.1\n Generation date: 2021-08-19 15:44\n Schema: kgcl\n \n id: https://w3id.org/kgcl\n description: A data model for describing change operations at a high level on an ontology or ontology-like artefact, such as a Knowledge Graph.\n\n* [Browse Schema](https://cmungall.github.io/knowledge-graph-change-language/)\n* [GitHub](https://github.com/cmungall/knowledge-graph-change-language)\n license: https://creativecommons.org/publicdomain/zero/1.0/\n ", "@context": { "IAO": { "@id": "http://purl.obolibrary.org/obo/IAO_", @@ -99,6 +99,9 @@ "in_subset": { "@type": "@id" }, + "language": { + "@type": "xml:lang" + }, "name": { "@id": "om:name" }, diff --git a/owl/kgcl.owl.ttl b/owl/kgcl.owl.ttl index 014037f6..56742075 100644 --- a/owl/kgcl.owl.ttl +++ b/owl/kgcl.owl.ttl @@ -30,7 +30,7 @@ [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty linkml:obsoletion_policy ], + owl:onProperty linkml:name_predicate ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; @@ -38,19 +38,19 @@ [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty linkml:name_predicate ], + owl:onProperty linkml:contributor_predicate ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty linkml:obsoletion_workflow ], + owl:onProperty linkml:synonym_predicates ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty linkml:synonym_predicates ], + owl:onProperty linkml:obsoletion_workflow ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty linkml:contributor_predicate ], + owl:onProperty linkml:obsoletion_policy ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; @@ -60,7 +60,7 @@ a owl:Class, linkml:ClassDefinition ; rdfs:label "datatype change" ; - rdfs:subClassOf . + rdfs:subClassOf . a owl:Class, linkml:ClassDefinition ; @@ -117,11 +117,11 @@ linkml:ClassDefinition ; rdfs:label "session" ; rdfs:subClassOf [ a owl:Restriction ; - owl:allValuesFrom ; - owl:onProperty ], - [ a owl:Restriction ; owl:allValuesFrom ; - owl:onProperty ] ; + owl:onProperty ], + [ a owl:Restriction ; + owl:allValuesFrom ; + owl:onProperty ] ; skos:definition "A session consists of a set of change sets bundled with the activities that generated those change sets" . a owl:Class, @@ -208,11 +208,11 @@ * [Browse Schema](https://cmungall.github.io/knowledge-graph-change-language/) * [GitHub](https://github.com/cmungall/knowledge-graph-change-language)""" ; - linkml:generation_date "2021-08-19 14:44" ; + linkml:generation_date "2021-08-19 15:44" ; linkml:metamodel_version "1.7.0" ; linkml:source_file "kgcl.yaml" ; - linkml:source_file_date "Thu Aug 19 14:44:35 2021" ; - linkml:source_file_size 25851 . + linkml:source_file_date "Thu Aug 19 15:44:26 2021" ; + linkml:source_file_size 26735 . linkml:Boolean a owl:Class, linkml:TypeDefinition ; @@ -466,6 +466,20 @@ linkml:edge_obsoletion_change_description a owl:ObjectProperty, rdfs:range linkml:String ; rdfs:subPropertyOf . +linkml:language_tag_change_new_value a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "language tag change_new value" ; + rdfs:domain ; + rdfs:range ; + rdfs:subPropertyOf . + +linkml:language_tag_change_old_value a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "language tag change_old value" ; + rdfs:domain ; + rdfs:range ; + rdfs:subPropertyOf . + linkml:mapping_creation_change_description a owl:ObjectProperty, linkml:SlotDefinition ; rdfs:label "mapping creation_change description" ; @@ -723,6 +737,13 @@ linkml:removed_node_from_subset_subset a owl:ObjectProperty, rdfs:subPropertyOf linkml:subset ; skos:definition "The subset from which the node is to be removed" . +linkml:set_language_for_name_change_description a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "set language for name_change description" ; + rdfs:domain ; + rdfs:range linkml:String ; + rdfs:subPropertyOf . + linkml:unobsoletion_has_undo a owl:ObjectProperty, linkml:SlotDefinition ; rdfs:label "unobsoletion_has undo" ; @@ -734,13 +755,13 @@ linkml:unobsoletion_has_undo a owl:ObjectProperty, linkml:ClassDefinition ; rdfs:label "class creation" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], ; skos:definition "A node creation where the owl type is 'class'" . @@ -760,6 +781,10 @@ linkml:unobsoletion_has_undo a owl:ObjectProperty, owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; @@ -767,15 +792,11 @@ linkml:unobsoletion_has_undo a owl:ObjectProperty, [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], , ; skos:altLabel "relationship deletion" ; @@ -786,17 +807,9 @@ linkml:unobsoletion_has_undo a owl:ObjectProperty, rdfs:label "edge obsoletion" ; rdfs:seeAlso "https://mondo.readthedocs.io/en/latest/editors-guide/g-logical-axioms/#excluded-subclassof" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; @@ -805,6 +818,14 @@ linkml:unobsoletion_has_undo a owl:ObjectProperty, owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; @@ -865,6 +886,17 @@ linkml:unobsoletion_has_undo a owl:ObjectProperty, skos:definition "An edge change where the predicate (relationship type) is modified." ; linkml:examples "Example(value='changing a is-a b to a part-of b', description=None)" . + a owl:Class, + linkml:ClassDefinition ; + rdfs:label "set language for name" ; + rdfs:subClassOf [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], + , + ; + skos:definition "A node change where the string value for the name is unchanged but the language tag is set" . + a owl:ObjectProperty, linkml:SlotDefinition ; rdfs:label "about edge" ; @@ -876,6 +908,11 @@ linkml:unobsoletion_has_undo a owl:ObjectProperty, rdfs:label "contributor" ; rdfs:range linkml:String . + a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "language" ; + rdfs:range . + a owl:ObjectProperty, linkml:SlotDefinition ; rdfs:label "node id" ; @@ -969,19 +1006,18 @@ linkml:node_creation_change_description a owl:ObjectProperty, linkml:mixin ; skos:definition "Applies to an obsoletion in which annotations or edges pointing at the obsoleted node can be automatically rewired to point to a target" . + a owl:Class, + linkml:ClassDefinition ; + rdfs:label "datatype or language tag change" ; + rdfs:subClassOf , + linkml:mixin ; + skos:definition "A change in a value assertion where the value remain unchanged but either the datatype or language changes" . + a owl:Class, linkml:ClassDefinition ; rdfs:label "node creation" ; rdfs:seeAlso "http://wiki.geneontology.org/index.php/Guidelines_for_creating_a_GO_term" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], @@ -993,6 +1029,14 @@ linkml:node_creation_change_description a owl:ObjectProperty, owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], , ; skos:definition "a node change in which a new node is created" . @@ -1003,13 +1047,13 @@ linkml:node_creation_change_description a owl:ObjectProperty, rdfs:seeAlso "http://wiki.geneontology.org/index.php/Merging_Ontology_Terms", "http://wiki.geneontology.org/index.php/Principles_for_merging_terms" ; rdfs:subClassOf [ a owl:Restriction ; - owl:onClass ; - owl:onProperty ; - owl:qualifiedCardinality 1 ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; owl:onProperty ], + [ a owl:Restriction ; + owl:onClass ; + owl:onProperty ; + owl:qualifiedCardinality 1 ], , ; skos:definition "An obsoletion change in which information from the obsoleted node is selectively copied to a single target, and edges can automatically be rewired to point to the target node" . @@ -1017,16 +1061,16 @@ linkml:node_creation_change_description a owl:ObjectProperty, a owl:Class, linkml:ClassDefinition ; rdfs:label "node obsoletion with no direct replacement" ; - rdfs:subClassOf [ a owl:Class ; + rdfs:subClassOf [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], + [ a owl:Class ; owl:intersectionOf ( [ a owl:Restriction ; owl:allValuesFrom ; owl:onProperty ] [ a owl:Restriction ; owl:onProperty ; owl:someValuesFrom ] ) ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], ; skos:definition "An obsoletion change in which there is no direct replacement" . @@ -1068,20 +1112,20 @@ linkml:node_creation_change_description a owl:ObjectProperty, rdfs:label "edge" ; rdfs:subClassOf [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass ; + owl:onProperty ], ; skos:altLabel "axiom", "relationship", @@ -1191,13 +1235,13 @@ linkml:subset a owl:ObjectProperty, owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty linkml:change_type ], - [ a owl:Restriction ; - owl:allValuesFrom ; - owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:Integer ; - owl:onProperty linkml:count ] ; + owl:onProperty linkml:count ], + [ a owl:Restriction ; + owl:allValuesFrom ; + owl:onProperty ] ; skos:definition "A summary statistic for a set of changes of the same type, grouped by zero or more node properties" . a owl:Class, @@ -1205,13 +1249,13 @@ linkml:subset a owl:ObjectProperty, rdfs:label "edge creation" ; rdfs:seeAlso "http://wiki.geneontology.org/index.php/Guidelines_for_creating_relationships_between_terms" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; @@ -1219,16 +1263,29 @@ linkml:subset a owl:ObjectProperty, [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ], + owl:onProperty ], , ; skos:altLabel "relationship creation" ; skos:definition "An edge change in which a de-novo edge is created. The edge is potentially annotated in the same action." . + a owl:Class, + linkml:ClassDefinition ; + rdfs:label "language tag change" ; + rdfs:subClassOf [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], + . + a owl:Class, linkml:ClassDefinition ; rdfs:label "multi node obsoletion" ; @@ -1280,17 +1337,17 @@ linkml:subset a owl:ObjectProperty, rdfs:seeAlso "http://wiki.geneontology.org/index.php/Merging_Ontology_Terms", "http://wiki.geneontology.org/index.php/Principles_for_merging_terms" ; rdfs:subClassOf [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ; - owl:qualifiedCardinality 1 ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; owl:onProperty ], [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ], + owl:onProperty ; + owl:qualifiedCardinality 1 ], , ; skos:definition "An obsoletion change in which all metadata (including name/label) from the source node is deleted and added to the target node, and edges can automatically be rewired to point to the target node" ; @@ -1318,6 +1375,10 @@ linkml:subset a owl:ObjectProperty, rdfs:label "node unobsoletion" ; rdfs:seeAlso "http://wiki.geneontology.org/index.php/Restoring_an_Obsolete_Ontology_Term" ; rdfs:subClassOf [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], + [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty linkml:consider ], @@ -1325,10 +1386,6 @@ linkml:subset a owl:ObjectProperty, owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty linkml:replaced_by ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], , ; skos:altLabel "class unobsoletion", @@ -1341,13 +1398,13 @@ linkml:subset a owl:ObjectProperty, linkml:ClassDefinition ; rdfs:label "remove from subset" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], , linkml:mixin ; skos:definition "removing an element from a subset" . @@ -1356,14 +1413,6 @@ linkml:subset a owl:ObjectProperty, linkml:ClassDefinition ; rdfs:label "removed node from subset" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty linkml:subset ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], @@ -1371,22 +1420,33 @@ linkml:subset a owl:ObjectProperty, owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty linkml:subset ], , ; skos:altLabel "remove term from slim" ; skos:definition "Removes a node from a subset, by removing an annotation" . - a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "new value" ; - rdfs:range linkml:String ; - skos:definition "The value of a property held in the new instance of the ontology" . - - a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "old value" ; - rdfs:range linkml:String ; - skos:definition "The value of a property held in the old instance of the ontology" . + a owl:Class, + linkml:ClassDefinition ; + rdfs:label "simple change" ; + rdfs:subClassOf [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], + ; + skos:altLabel "atomic change" ; + skos:definition "A change that is about a single ontology element" . linkml:Integer a owl:Class, linkml:TypeDefinition ; @@ -1439,40 +1499,25 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, rdfs:label "mapping creation" ; rdfs:subClassOf [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], + owl:onClass ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass linkml:String ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; - owl:onProperty ], + owl:onProperty ], , ; skos:altLabel "xref creation" ; skos:definition "A specific kind of edge creation in which the created edge is a mapping." . - a owl:Class, - linkml:ClassDefinition ; - rdfs:label "simple change" ; - rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], - ; - skos:altLabel "atomic change" ; - skos:definition "A change that is about a single ontology element" . - a owl:ObjectProperty, linkml:SlotDefinition ; rdfs:label "has nondirect replacement" ; @@ -1493,13 +1538,13 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, linkml:ClassDefinition ; rdfs:label "property value" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], ; skos:definition "a property-value pair" . @@ -1508,12 +1553,6 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, rdfs:label "id" ; rdfs:range linkml:String . - a owl:Class, - linkml:ClassDefinition ; - rdfs:label "change mixin" ; - rdfs:subClassOf linkml:mixin ; - skos:definition "root class for all change mixins" . - a owl:Class, linkml:ClassDefinition ; rdfs:label "node synonym change" ; @@ -1538,13 +1577,31 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, skos:note "if a node obsoletion C C about N1, and Chas direct replacement N2, then N1 IAO:0100001 N2", "if a node obsoletion C, C about N1, and C has direct replacement N2, and there exists an edge with an edge property referencing N1, it is possible to replace with N2" . + a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "new value" ; + rdfs:range linkml:String ; + skos:definition "The value of a property held in the new instance of the ontology" . + + a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "old value" ; + rdfs:range linkml:String ; + skos:definition "The value of a property held in the old instance of the ontology" . + + a owl:Class, + linkml:ClassDefinition ; + rdfs:label "change mixin" ; + rdfs:subClassOf linkml:mixin ; + skos:definition "root class for all change mixins" . + a owl:Class, linkml:ClassDefinition ; rdfs:label "node rename" ; rdfs:subClassOf [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; @@ -1552,7 +1609,7 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; @@ -1595,6 +1652,14 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, skos:definition "a provence-generating agent" ; skos:exactMatch . + a owl:Class, + linkml:TypeDefinition ; + rdfs:label "language tag" ; + rdfs:subClassOf [ a owl:Restriction ; + owl:onDataRange ; + owl:onProperty linkml:topValue ; + owl:qualifiedCardinality 1 ] . + a owl:ObjectProperty, linkml:SlotDefinition ; rdfs:label "in subset" ; @@ -1610,13 +1675,13 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, linkml:ClassDefinition ; rdfs:label "edge change" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], ; skos:altLabel "axiom change", "triple change" ; @@ -1627,6 +1692,10 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, rdfs:label "node obsoletion" ; rdfs:seeAlso "http://wiki.geneontology.org/index.php/Obsoleting_an_Existing_Ontology_Term" ; rdfs:subClassOf [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], + [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], @@ -1637,10 +1706,6 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, [ a owl:Restriction ; owl:allValuesFrom ; owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], [ a owl:Restriction ; owl:allValuesFrom ; owl:onProperty linkml:associated_change_set ], @@ -1685,13 +1750,13 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, rdfs:seeAlso "http://wiki.geneontology.org/index.php/Obsoleting_an_Existing_Ontology_Term", "https://mondo.readthedocs.io/en/latest/editors-guide/merging-and-obsoleting/" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], - [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], , linkml:mixin ; skos:altLabel "deprecation", @@ -1706,16 +1771,6 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, rdfs:range ; skos:definition "A change that reverses this change" . - a owl:Class, - linkml:ClassDefinition ; - rdfs:label "node change" ; - rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], - ; - skos:definition "A simple change where the change is about a node" . - a owl:Class, linkml:ClassDefinition ; rdfs:label "ontology element" ; @@ -1729,18 +1784,18 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], + [ a owl:Restriction ; + owl:onClass linkml:String ; + owl:onProperty ; + owl:qualifiedCardinality 1 ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; @@ -1748,14 +1803,28 @@ linkml:node_obsoletion_change_description a owl:ObjectProperty, [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty ], + owl:onProperty ], [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty ; - owl:qualifiedCardinality 1 ] ; + owl:onProperty ] ; skos:definition "a provence-generating activity" ; skos:exactMatch . + a owl:Class, + linkml:ClassDefinition ; + rdfs:label "node change" ; + rdfs:subClassOf [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], + [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass ; + owl:onProperty ], + ; + skos:definition "A simple change where the change is about a node" . + linkml:topValue a owl:DatatypeProperty ; rdfs:label "value" . @@ -1767,6 +1836,10 @@ linkml:TypeDefinition a owl:Class ; linkml:ClassDefinition ; rdfs:label "change" ; rdfs:subClassOf [ a owl:Restriction ; + owl:maxQualifiedCardinality 1 ; + owl:onClass linkml:String ; + owl:onProperty ], + [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; owl:onProperty ], @@ -1786,10 +1859,6 @@ linkml:TypeDefinition a owl:Class ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass ; @@ -1797,7 +1866,7 @@ linkml:TypeDefinition a owl:Class ; [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty ] ; + owl:onProperty ] ; skos:definition "Any change perform on an ontology or knowledge graph" . a owl:ObjectProperty, @@ -1818,16 +1887,16 @@ linkml:TypeDefinition a owl:Class ; rdfs:label "node" ; rdfs:subClassOf [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass ; + owl:onProperty ], [ a owl:Restriction ; owl:onClass linkml:String ; owl:onProperty ; owl:qualifiedCardinality 1 ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; - owl:onClass ; - owl:onProperty ], + owl:onClass ; + owl:onProperty ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; diff --git a/python/basics.py b/python/basics.py index 09f15109..165d74b8 100644 --- a/python/basics.py +++ b/python/basics.py @@ -1,5 +1,5 @@ # Auto generated from basics.yaml by pythongen.py version: 0.9.0 -# Generation date: 2021-05-11 09:08 +# Generation date: 2021-08-19 15:44 # Schema: basics # # id: https://w3id.org/kgcl/basics @@ -9,7 +9,7 @@ import dataclasses import sys import re -from jsonasobj2 import JsonObj +from jsonasobj2 import JsonObj, as_dict from typing import Optional, List, Union, Dict, ClassVar, Any from dataclasses import dataclass from linkml_runtime.linkml_model.meta import EnumDefinition, PermissibleValue, PvFormulaOptions @@ -22,7 +22,7 @@ from linkml_runtime.utils.enumerations import EnumDefinitionImpl from rdflib import Namespace, URIRef from linkml_runtime.utils.curienamespace import CurieNamespace -from linkml_model.types import String +from linkml_runtime.linkml_model.types import String metamodel_version = "1.7.0" @@ -33,10 +33,17 @@ BASICS = CurieNamespace('basics', 'https://w3id.org/kgcl/basics/') DCTERMS = CurieNamespace('dcterms', 'http://purl.org/dc/terms/') LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/') +XML = CurieNamespace('xml', 'http://example.org/UNKNOWN/xml/') DEFAULT_ = BASICS # Types +class LanguageTag(str): + type_class_uri = XML.lang + type_class_curie = "xml:lang" + type_name = "language tag" + type_model_uri = BASICS.LanguageTag + # Class references diff --git a/python/kgcl.py b/python/kgcl.py index 92ac3117..b231a08c 100644 --- a/python/kgcl.py +++ b/python/kgcl.py @@ -1,5 +1,5 @@ # Auto generated from kgcl.yaml by pythongen.py version: 0.9.0 -# Generation date: 2021-08-19 14:44 +# Generation date: 2021-08-19 15:44 # Schema: kgcl # # id: https://w3id.org/kgcl @@ -25,6 +25,7 @@ from linkml_runtime.utils.enumerations import EnumDefinitionImpl from rdflib import Namespace, URIRef from linkml_runtime.utils.curienamespace import CurieNamespace +from . basics import LanguageTag from . ontology_model import Annotation, Edge, NodeId, OntologyElement, OntologySubset, OwlTypeEnum, PropertyValue from . prov import Activity, ActivityId from linkml_runtime.linkml_model.types import Integer, String, Uriorcurie @@ -136,6 +137,10 @@ class NodeRenameId(NodeChangeId): pass +class SetLanguageForNameId(NodeChangeId): + pass + + class NodeAnnotationChangeId(NodeChangeId): pass @@ -184,10 +189,6 @@ class TextDefinitionReplacementId(NodeTextDefinitionChangeId): pass -class DatatypeChangeId(SimpleChangeId): - pass - - class AddNodeToSubsetId(NodeChangeId): pass @@ -453,6 +454,49 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): super().__post_init__(**kwargs) +class DatatypeOrLanguageTagChange(ChangeMixin): + """ + A change in a value assertion where the value remain unchanged but either the datatype or language changes + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = KGCL.DatatypeOrLanguageTagChange + class_class_curie: ClassVar[str] = "kgcl:DatatypeOrLanguageTagChange" + class_name: ClassVar[str] = "datatype or language tag change" + class_model_uri: ClassVar[URIRef] = KGCL.DatatypeOrLanguageTagChange + + +@dataclass +class LanguageTagChange(DatatypeOrLanguageTagChange): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = KGCL.LanguageTagChange + class_class_curie: ClassVar[str] = "kgcl:LanguageTagChange" + class_name: ClassVar[str] = "language tag change" + class_model_uri: ClassVar[URIRef] = KGCL.LanguageTagChange + + old_value: Optional[str] = None + new_value: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.old_value is not None and not isinstance(self.old_value, str): + self.old_value = str(self.old_value) + + if self.new_value is not None and not isinstance(self.new_value, str): + self.new_value = str(self.new_value) + + super().__post_init__(**kwargs) + + +class DatatypeChange(DatatypeOrLanguageTagChange): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = KGCL.DatatypeChange + class_class_curie: ClassVar[str] = "kgcl:DatatypeChange" + class_name: ClassVar[str] = "datatype change" + class_model_uri: ClassVar[URIRef] = KGCL.DatatypeChange + + class AllowsAutomaticReplacementOfEdges(Obsoletion): """ Applies to an obsoletion in which annotations or edges pointing at the obsoleted node can be automatically rewired @@ -1005,11 +1049,15 @@ class NodeChange(SimpleChange): id: Union[str, NodeChangeId] = None about_node: Optional[Union[str, NodeId]] = None + language: Optional[str] = None def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if self.about_node is not None and not isinstance(self.about_node, NodeId): self.about_node = NodeId(self.about_node) + if self.language is not None and not isinstance(self.language, str): + self.language = str(self.language) + super().__post_init__(**kwargs) @@ -1052,6 +1100,41 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): super().__post_init__(**kwargs) +@dataclass +class SetLanguageForName(NodeChange): + """ + A node change where the string value for the name is unchanged but the language tag is set + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = KGCL.SetLanguageForName + class_class_curie: ClassVar[str] = "kgcl:SetLanguageForName" + class_name: ClassVar[str] = "set language for name" + class_model_uri: ClassVar[URIRef] = KGCL.SetLanguageForName + + id: Union[str, SetLanguageForNameId] = None + old_value: Optional[str] = None + new_value: Optional[str] = None + change_description: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self._is_empty(self.id): + self.MissingRequiredField("id") + if not isinstance(self.id, SetLanguageForNameId): + self.id = SetLanguageForNameId(self.id) + + if self.old_value is not None and not isinstance(self.old_value, str): + self.old_value = str(self.old_value) + + if self.new_value is not None and not isinstance(self.new_value, str): + self.new_value = str(self.new_value) + + if self.change_description is not None and not isinstance(self.change_description, str): + self.change_description = str(self.change_description) + + super().__post_init__(**kwargs) + + @dataclass class NodeAnnotationChange(NodeChange): """ @@ -1383,26 +1466,6 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): super().__post_init__(**kwargs) -@dataclass -class DatatypeChange(SimpleChange): - _inherited_slots: ClassVar[List[str]] = [] - - class_class_uri: ClassVar[URIRef] = KGCL.DatatypeChange - class_class_curie: ClassVar[str] = "kgcl:DatatypeChange" - class_name: ClassVar[str] = "datatype change" - class_model_uri: ClassVar[URIRef] = KGCL.DatatypeChange - - id: Union[str, DatatypeChangeId] = None - - def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): - if self._is_empty(self.id): - self.MissingRequiredField("id") - if not isinstance(self.id, DatatypeChangeId): - self.id = DatatypeChangeId(self.id) - - super().__post_init__(**kwargs) - - @dataclass class AddNodeToSubset(NodeChange): """ @@ -1870,6 +1933,9 @@ class slots: slots.superclass = Slot(uri=KGCL.superclass, name="superclass", curie=KGCL.curie('superclass'), model_uri=KGCL.superclass, domain=None, range=Optional[Union[str, NodeId]]) +slots.language = Slot(uri=KGCL.language, name="language", curie=KGCL.curie('language'), + model_uri=KGCL.language, domain=None, range=Optional[str]) + slots.about = Slot(uri=KGCL.about, name="about", curie=KGCL.curie('about'), model_uri=KGCL.about, domain=None, range=Optional[Union[dict, OntologyElement]]) @@ -1996,6 +2062,12 @@ class slots: slots.obsoletion_has_undo = Slot(uri=KGCL.has_undo, name="obsoletion_has undo", curie=KGCL.curie('has_undo'), model_uri=KGCL.obsoletion_has_undo, domain=None, range=Optional[Union[dict, "Obsoletion"]]) +slots.language_tag_change_old_value = Slot(uri=KGCL.old_value, name="language tag change_old value", curie=KGCL.curie('old_value'), + model_uri=KGCL.language_tag_change_old_value, domain=LanguageTagChange, range=Optional[str]) + +slots.language_tag_change_new_value = Slot(uri=KGCL.new_value, name="language tag change_new value", curie=KGCL.curie('new_value'), + model_uri=KGCL.language_tag_change_new_value, domain=LanguageTagChange, range=Optional[str]) + slots.unobsoletion_has_undo = Slot(uri=KGCL.has_undo, name="unobsoletion_has undo", curie=KGCL.curie('has_undo'), model_uri=KGCL.unobsoletion_has_undo, domain=None, range=Optional[Union[dict, Obsoletion]]) @@ -2056,6 +2128,9 @@ class slots: slots.node_rename_change_description = Slot(uri=KGCL.change_description, name="node rename_change description", curie=KGCL.curie('change_description'), model_uri=KGCL.node_rename_change_description, domain=NodeRename, range=Optional[str]) +slots.set_language_for_name_change_description = Slot(uri=KGCL.change_description, name="set language for name_change description", curie=KGCL.curie('change_description'), + model_uri=KGCL.set_language_for_name_change_description, domain=SetLanguageForName, range=Optional[str]) + slots.name_becomes_synonym_change_1 = Slot(uri=KGCL.change_1, name="name becomes synonym_change 1", curie=KGCL.curie('change_1'), model_uri=KGCL.name_becomes_synonym_change_1, domain=NameBecomesSynonym, range=Optional[Union[str, NodeRenameId]]) diff --git a/shex/basics.shex b/shex/basics.shex index b0b07b3c..518d9cec 100644 --- a/shex/basics.shex +++ b/shex/basics.shex @@ -1,8 +1,11 @@ BASE PREFIX xsd: PREFIX linkml: +PREFIX xml1: + xml1:lang + linkml:String xsd:string linkml:Integer xsd:integer diff --git a/shex/kgcl.shex b/shex/kgcl.shex index 2065aec9..eff1d3e6 100644 --- a/shex/kgcl.shex +++ b/shex/kgcl.shex @@ -6,6 +6,8 @@ PREFIX om: PREFIX prov: PREFIX dc: PREFIX owl: +PREFIX basics: +PREFIX xml1: IRI @@ -38,6 +40,8 @@ linkml:Objectidentifier IRI linkml:Nodeidentifier NONLITERAL +basics:LanguageTag xml1:lang + prov:Activity CLOSED { ( $prov:Activity_tes ( prov:startedAtTime @linkml:String ? ; prov:endedAtTime @linkml:String ? ; @@ -113,7 +117,7 @@ om:Annotation CLOSED { } ( - @ OR @ OR @ OR @ OR @ + @ OR @ OR @ OR @ OR @ OR @ ) { @@ -184,10 +188,22 @@ om:ClassNode CLOSED { } CLOSED { - ( $ ( & ; - rdf:type [ ] ? + ( $ ( & ; + rdf:type [ ] ? + ) ; + rdf:type [ ] ? + ) +} + + ( + @ OR @ +) + + { + ( $ ( & ; + rdf:type [ ] ? ) ; - rdf:type [ ] + rdf:type [ ] ? ) } @@ -298,6 +314,16 @@ om:InstanceNode CLOSED { ) } + CLOSED { + ( $ ( & ; + rdf:type [ ] ? ; + @basics:LanguageTag ? ; + @basics:LanguageTag ? + ) ; + rdf:type [ ] ? + ) +} + CLOSED { ( $ ( & ; rdf:type [ ] ? @@ -399,13 +425,14 @@ om:Node ( ( @ OR @ OR @ OR @ OR @ OR @ OR - @ OR @ OR @ OR @ + @ OR @ OR @ OR @ OR @ ) { ( $ ( & ; rdf:type [ ] ? ; - @om:Node ? + @om:Node ? ; + @basics:LanguageTag ? ) ; rdf:type [ ] ) @@ -672,8 +699,19 @@ om:PropertyValue ( ) } + CLOSED { + ( $ ( & ; + rdf:type [ ] ? ; + & ; + rdf:type [ ] ? ; + @linkml:String ? + ) ; + rdf:type [ ] + ) +} + ( - @ OR @ OR @ OR @ + @ OR @ OR @ ) { diff --git a/src/schema/basics.yaml b/src/schema/basics.yaml index afc5073e..644e0e99 100644 --- a/src/schema/basics.yaml +++ b/src/schema/basics.yaml @@ -18,6 +18,11 @@ default_curi_maps: imports: - linkml:types +types: + language tag: + base: str + uri: xml:lang + slots: id: identifier: true diff --git a/src/schema/kgcl.yaml b/src/schema/kgcl.yaml index a048346e..cb9aef93 100644 --- a/src/schema/kgcl.yaml +++ b/src/schema/kgcl.yaml @@ -158,6 +158,27 @@ classes: has undo: range: obsoletion + datatype or language tag change: + is_a: change mixin + mixin: true + description: >- + A change in a value assertion where the value remain unchanged but either the datatype or language changes + + language tag change: + is_a: datatype or language tag change + slot_usage: + old value: + multivalued: false + range: language tag + new value: + multivalued: false + range: language tag + + datatype change: + is_a: datatype or language tag change + + + allows automatic replacement of edges: is_a: obsoletion mixin: true @@ -398,6 +419,7 @@ classes: A simple change where the change is about a node slots: - about node + - language node rename: is_a: node change @@ -418,6 +440,19 @@ classes: - value: "rename UBERON:0002398 from 'manus' to 'hand'" description: "replacing the rdfs:label of 'manus' on an uberon class with the rdfs:label 'hand'" + set language for name: + is_a: node change + mixins: + - language tag change + description: + A node change where the string value for the name is unchanged but the language tag is set + slots: + - old value + - new value + slot_usage: + change description: + string_serialization: "changed {about} name language from {old value} to {new value}" + node annotation change: description: >- A node change where the change alters node properties/annotations. TODO @@ -510,10 +545,6 @@ classes: - new value - has textual diff - - datatype change: - is_a: simple change - add node to subset: aliases: - add term to slim @@ -736,6 +767,9 @@ slots: range: node superclass: range: node + + language: + range: language tag about: description: >- From 436e7237e452cc8516f7cd067bd4847b65d328b8 Mon Sep 17 00:00:00 2001 From: cmungall Date: Fri, 20 Aug 2021 17:14:24 -0700 Subject: [PATCH 3/3] fix travis tho will be replaced by gha --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cec0eabc..2241c94b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,5 +14,5 @@ install: # command to run tests script: - - touch src/schema/ocl.yaml && make test + - touch src/schema/kgcl.yaml && make test