diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cee44a..f58b5b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [0.2.0] - 2023-07-10 + +### Changed + +- Breaking: Ontology-related slots are constraint by regular expression ([#8](https://github.com/FAIR-MI/miiid-schema/issues/8)) + +### Added + +- Add recommended properties (in increasing constraint order: `sequence_id`, `env_exp`, `participant_outcomes`) ([#12](https://github.com/FAIR-MI/miiid-schema/issues/12)) + ## [0.1.1] - 2023-07-05 ### Added @@ -18,6 +28,8 @@ :seedling: Initial release. +[0.2.0]: https://fair-mi.github.io/miiid-schema/releases/tag/v0.2.0 + [0.1.1]: https://fair-mi.github.io/miiid-schema/releases/tag/v0.1.1 [0.1.0]: https://fair-mi.github.io/miiid-schema/releases/tag/v0.1.0 diff --git a/project/excel/miiid_schema.xlsx b/project/excel/miiid_schema.xlsx index 64756dc..732a77c 100644 Binary files a/project/excel/miiid_schema.xlsx and b/project/excel/miiid_schema.xlsx differ diff --git a/project/graphql/miiid_schema.graphql b/project/graphql/miiid_schema.graphql index 97c5e25..59d3766 100644 --- a/project/graphql/miiid_schema.graphql +++ b/project/graphql/miiid_schema.graphql @@ -5,8 +5,11 @@ type IntermicrobialInteraction description: String participants: [String]! taxId: [NCBITaxId]! + sequenceId: [SequenceId] evidenceType: String! + methodType: [MethodType] reference: String! + participantOutcomes: [ParticipantOutcome] } type IntermicrobialInteractionCollection diff --git a/project/jsonld/miiid_schema.context.jsonld b/project/jsonld/miiid_schema.context.jsonld index e55b43d..cb232ba 100644 --- a/project/jsonld/miiid_schema.context.jsonld +++ b/project/jsonld/miiid_schema.context.jsonld @@ -1,14 +1,35 @@ { "comments": { "description": "Auto generated by LinkML jsonld context generator", - "generation_date": "2023-06-20T17:04:24", + "generation_date": "2023-07-10T22:44:48", "source": "miiid_schema.yaml" }, "@context": { + "EDAM_DATA": { + "@id": "http://edamontology.org/data_", + "@prefix": true + }, + "EDAM_TOPIC": { + "@id": "http://edamontology.org/topic_", + "@prefix": true + }, + "GENEPIO": { + "@id": "http://purl.obolibrary.org/obo/GENEPIO_", + "@prefix": true + }, + "NCIT": { + "@id": "http://purl.obolibrary.org/obo/NCIT_", + "@prefix": true + }, + "OBI": { + "@id": "http://purl.obolibrary.org/obo/OBI_", + "@prefix": true + }, "WIKIDATA_PROPERTY": "https://www.wikidata.org/prop/", "linkml": "https://w3id.org/linkml/", "miiid": "https://w3id.org/FAIR-MI/miiid/", "schema": "http://schema.org/", + "skos": "http://www.w3.org/2004/02/skos/core#", "@vocab": "https://w3id.org/FAIR-MI/miiid/", "description": { "@id": "schema:description" @@ -17,9 +38,25 @@ "entries": { "@type": "@id" }, + "method_type": { + "@context": { + "@vocab": "@null", + "text": "skos:notation", + "description": "skos:prefLabel", + "meaning": "@id" + } + }, "name": { "@id": "schema:name" }, + "participant_outcomes": { + "@context": { + "@vocab": "@null", + "text": "skos:notation", + "description": "skos:prefLabel", + "meaning": "@id" + } + }, "tax_id": { "@type": "xsd:integer" }, diff --git a/project/jsonld/miiid_schema.jsonld b/project/jsonld/miiid_schema.jsonld index c129753..ef60884 100644 --- a/project/jsonld/miiid_schema.jsonld +++ b/project/jsonld/miiid_schema.jsonld @@ -6,6 +6,7 @@ "https://FAIR-MI.github.io/miiid-schema" ], "id": "https://w3id.org/FAIR-MI/miiid-schema", + "version": "0.2.0", "imports": [ "linkml:types" ], @@ -26,6 +27,26 @@ { "prefix_prefix": "WIKIDATA_PROPERTY", "prefix_reference": "https://www.wikidata.org/prop/" + }, + { + "prefix_prefix": "EDAM_TOPIC", + "prefix_reference": "http://edamontology.org/topic_" + }, + { + "prefix_prefix": "EDAM_DATA", + "prefix_reference": "http://edamontology.org/data_" + }, + { + "prefix_prefix": "NCIT", + "prefix_reference": "http://purl.obolibrary.org/obo/NCIT_" + }, + { + "prefix_prefix": "OBI", + "prefix_reference": "http://purl.obolibrary.org/obo/OBI_" + }, + { + "prefix_prefix": "GENEPIO", + "prefix_reference": "http://purl.obolibrary.org/obo/GENEPIO_" } ], "default_prefix": "miiid", @@ -54,6 +75,43 @@ "minimum_value": 2, "@type": "TypeDefinition" }, + { + "name": "SequenceId", + "definition_uri": "https://w3id.org/FAIR-MI/miiid/SequenceId", + "description": "Sequence identifier to a (preferrably INSDC) database", + "examples": [ + { + "value": "FJ627005.1", + "@type": "Example" + }, + { + "value": "NZ_CP022412.2", + "@type": "Example" + } + ], + "from_schema": "https://w3id.org/FAIR-MI/miiid-schema", + "exact_mappings": [ + "EDAM_DATA:1063" + ], + "base": "str", + "uri": "http://www.w3.org/2001/XMLSchema#string", + "@type": "TypeDefinition" + }, + { + "name": "EnvExpId", + "definition_uri": "https://w3id.org/FAIR-MI/miiid/EnvExpId", + "description": "Term from the Environment Ontology following by their machine-actionable identifier.", + "examples": [ + { + "value": "leaf [ENVO:0025034]", + "@type": "Example" + } + ], + "from_schema": "https://w3id.org/FAIR-MI/miiid-schema", + "base": "str", + "uri": "http://www.w3.org/2001/XMLSchema#string", + "@type": "TypeDefinition" + }, { "name": "string", "definition_uri": "https://w3id.org/linkml/String", @@ -310,6 +368,90 @@ "@type": "TypeDefinition" } ], + "enums": [ + { + "name": "MethodType", + "definition_uri": "https://w3id.org/FAIR-MI/miiid/MethodType", + "description": "List of methods used to determine interactions", + "from_schema": "https://w3id.org/FAIR-MI/miiid-schema", + "permissible_values": [ + { + "text": "simulation", + "description": "Any type of biological computational model experiments", + "meaning": "EDAM_TOPIC:3524", + "examples": [ + { + "value": "generalized Lotka-Volterra model" + }, + { + "value": "genome-scale metabolic model" + } + ] + }, + { + "text": "microscopy", + "description": "Any type of imaging-related experiments", + "meaning": "EDAM_TOPIC:3382", + "examples": [ + { + "value": "co-localization with fluorescent markers" + }, + { + "value": "assisted motility" + } + ] + }, + { + "text": "cultivation", + "description": "Any laboratory procedure for growing microorganisms", + "meaning": "NCIT:C25300", + "examples": [ + { + "value": "continuous co-culture in bioreactor" + }, + { + "value": "co-plating on solid media" + } + ] + }, + { + "text": "sample", + "description": "Any type of experiments based on the analysis of a sample", + "meaning": "OBI:0000659", + "examples": [ + { + "value": "co-occurrences drawn from analyses of abundances obtained from in situ or in vivo sampling" + } + ] + } + ] + }, + { + "name": "ParticipantOutcome", + "definition_uri": "https://w3id.org/FAIR-MI/miiid/ParticipantOutcome", + "description": "Outcome indicating how each participant was affected", + "from_schema": "https://w3id.org/FAIR-MI/miiid-schema", + "permissible_values": [ + { + "text": "not_affected", + "description": "usually encoded with numerical 0" + }, + { + "text": "positively", + "description": "usually encoded with +1" + }, + { + "text": "negatively", + "description": "usually encoded with -1" + }, + { + "text": "not_applicable", + "description": "The information is inappropriate to report, this can indicate that the standard itself fails to model or represent the information appropriately", + "meaning": "GENEPIO:0001619" + } + ] + } + ], "slots": [ { "name": "id", @@ -391,6 +533,21 @@ "required": true, "@type": "SlotDefinition" }, + { + "name": "sequence_id", + "definition_uri": "https://w3id.org/FAIR-MI/miiid/sequence_id", + "description": "Accession to the matching sequence data (e.g., genome, marker gene sequence).", + "from_schema": "https://w3id.org/FAIR-MI/miiid-schema", + "slot_uri": "https://w3id.org/FAIR-MI/miiid/sequence_id", + "multivalued": true, + "owner": "IntermicrobialInteraction", + "domain_of": [ + "IntermicrobialInteraction" + ], + "range": "SequenceId", + "recommended": true, + "@type": "SlotDefinition" + }, { "name": "evidence_type", "definition_uri": "https://w3id.org/FAIR-MI/miiid/evidence_type", @@ -403,6 +560,22 @@ ], "range": "string", "required": true, + "pattern": "[^\\:\\n\\r]+\\:[^\\:\\n\\r]+", + "@type": "SlotDefinition" + }, + { + "name": "method_type", + "definition_uri": "https://w3id.org/FAIR-MI/miiid/method_type", + "description": "One or several of the types of methods used to determine the interaction.", + "from_schema": "https://w3id.org/FAIR-MI/miiid-schema", + "slot_uri": "https://w3id.org/FAIR-MI/miiid/method_type", + "multivalued": true, + "owner": "IntermicrobialInteraction", + "domain_of": [ + "IntermicrobialInteraction" + ], + "range": "MethodType", + "recommended": true, "@type": "SlotDefinition" }, { @@ -422,6 +595,32 @@ "required": true, "@type": "SlotDefinition" }, + { + "name": "env_exp", + "definition_uri": "https://w3id.org/FAIR-MI/miiid/env_exp", + "description": "Biome term (from the Environmental Ontology) used in the experiment. Engineered ecosystems such as bioreactors, agar plates or computational models use N/A.", + "from_schema": "https://w3id.org/FAIR-MI/miiid-schema", + "slot_uri": "https://w3id.org/FAIR-MI/miiid/env_exp", + "range": "EnvExpId", + "recommended": true, + "pattern": "[^\\:\\n\\r]+\\:[^\\:\\n\\r]+", + "@type": "SlotDefinition" + }, + { + "name": "participant_outcomes", + "definition_uri": "https://w3id.org/FAIR-MI/miiid/participant_outcomes", + "description": "Outcomes of each of the participants described in the interaction when known.", + "from_schema": "https://w3id.org/FAIR-MI/miiid-schema", + "slot_uri": "https://w3id.org/FAIR-MI/miiid/participant_outcomes", + "multivalued": true, + "owner": "IntermicrobialInteraction", + "domain_of": [ + "IntermicrobialInteraction" + ], + "range": "ParticipantOutcome", + "recommended": true, + "@type": "SlotDefinition" + }, { "name": "intermicrobialInteractionCollection__entries", "description": "An IntermicrobialInteraction object", @@ -469,8 +668,11 @@ "description", "participants", "tax_id", + "sequence_id", "evidence_type", - "reference" + "method_type", + "reference", + "participant_outcomes" ], "slot_usage": {}, "class_uri": "https://w3id.org/FAIR-MI/miiid/IntermicrobialInteraction", @@ -502,9 +704,9 @@ ], "metamodel_version": "1.7.0", "source_file": "miiid_schema.yaml", - "source_file_date": "2023-06-20T16:44:02", - "source_file_size": 2699, - "generation_date": "2023-06-20T17:04:24", + "source_file_date": "2023-07-10T22:43:36", + "source_file_size": 5975, + "generation_date": "2023-07-10T22:44:49", "@type": "SchemaDefinition", "@context": [ "project/jsonld/miiid_schema.context.jsonld", diff --git a/project/jsonschema/miiid_schema.schema.json b/project/jsonschema/miiid_schema.schema.json index 35079be..d1f9c01 100644 --- a/project/jsonschema/miiid_schema.schema.json +++ b/project/jsonschema/miiid_schema.schema.json @@ -10,16 +10,31 @@ }, "evidence_type": { "description": "Type of evidence used to determine the interaction using the Evidence and Conclusion Ontology.", + "pattern": "[^\\:\\n\\r]+\\:[^\\:\\n\\r]+", "type": "string" }, "id": { "description": "A unique identifier for a thing", "type": "string" }, + "method_type": { + "description": "One or several of the types of methods used to determine the interaction.", + "items": { + "$ref": "#/$defs/MethodType" + }, + "type": "array" + }, "name": { "description": "A human-readable name for a thing", "type": "string" }, + "participant_outcomes": { + "description": "Outcomes of each of the participants described in the interaction when known.", + "items": { + "$ref": "#/$defs/ParticipantOutcome" + }, + "type": "array" + }, "participants": { "description": "Names of the microbial entities, with descriptions of any genetic manipulations performed.", "items": { @@ -31,6 +46,13 @@ "description": "Persistent identifier (e.g. DOI or URL) to a resource, script, or article, documenting the method.", "type": "string" }, + "sequence_id": { + "description": "Accession to the matching sequence data (e.g., genome, marker gene sequence).", + "items": { + "type": "string" + }, + "type": "array" + }, "tax_id": { "description": "NCBI Taxonomy identifiers at the relevant taxonomic level. Novel taxa lacking identifiers are denoted by N/A.", "items": { @@ -64,6 +86,17 @@ "title": "IntermicrobialInteractionCollection", "type": "object" }, + "MethodType": { + "description": "List of methods used to determine interactions", + "enum": [ + "simulation", + "microscopy", + "cultivation", + "sample" + ], + "title": "MethodType", + "type": "string" + }, "NamedThing": { "additionalProperties": false, "description": "A generic grouping for any identifiable entity", @@ -86,6 +119,17 @@ ], "title": "NamedThing", "type": "object" + }, + "ParticipantOutcome": { + "description": "Outcome indicating how each participant was affected", + "enum": [ + "not_affected", + "positively", + "negatively", + "not_applicable" + ], + "title": "ParticipantOutcome", + "type": "string" } }, "$id": "https://w3id.org/FAIR-MI/miiid-schema", @@ -104,5 +148,5 @@ }, "title": "miiid-schema", "type": "object", - "version": null + "version": "0.2.0" } \ No newline at end of file diff --git a/project/owl/miiid_schema.owl.ttl b/project/owl/miiid_schema.owl.ttl index f3090e9..2fc03c3 100644 --- a/project/owl/miiid_schema.owl.ttl +++ b/project/owl/miiid_schema.owl.ttl @@ -1,4 +1,8 @@ +@prefix EDAM_TOPIC: . +@prefix GENEPIO: . @prefix IAO: . +@prefix NCIT: . +@prefix OBI: . @prefix linkml: . @prefix miiid: . @prefix owl: . @@ -15,8 +19,22 @@ linkml:id "https://w3id.org/FAIR-MI/miiid-schema" ; linkml:imports "linkml:types" . +miiid:env_exp a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "env_exp" ; + rdfs:range miiid:EnvExpId ; + skos:definition "Biome term (from the Environmental Ontology) used in the experiment. Engineered ecosystems such as bioreactors, agar plates or computational models use N/A." . + linkml:SubsetDefinition a owl:Class . +miiid:EnvExpId a owl:Class, + linkml:TypeDefinition ; + rdfs:label "EnvExpId" ; + rdfs:subClassOf [ a owl:Restriction ; + owl:onDataRange xsd:string ; + owl:onProperty linkml:topValue ; + owl:qualifiedCardinality 1 ] . + miiid:IntermicrobialInteractionCollection a owl:Class, linkml:ClassDefinition ; rdfs:label "IntermicrobialInteractionCollection" ; @@ -37,6 +55,18 @@ miiid:evidence_type a owl:ObjectProperty, rdfs:range linkml:String ; skos:definition "Type of evidence used to determine the interaction using the Evidence and Conclusion Ontology." . +miiid:method_type a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "method_type" ; + rdfs:range miiid:MethodType ; + skos:definition "One or several of the types of methods used to determine the interaction." . + +miiid:participant_outcomes a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "participant_outcomes" ; + rdfs:range miiid:ParticipantOutcome ; + skos:definition "Outcomes of each of the participants described in the interaction when known." . + miiid:reference a owl:ObjectProperty, linkml:SlotDefinition ; rdfs:label "reference" ; @@ -44,10 +74,31 @@ miiid:reference a owl:ObjectProperty, skos:definition "Persistent identifier (e.g. DOI or URL) to a resource, script, or article, documenting the method." ; skos:exactMatch schema1:url . -linkml:TypeDefinition a owl:Class . +miiid:sequence_id a owl:ObjectProperty, + linkml:SlotDefinition ; + rdfs:label "sequence_id" ; + rdfs:range miiid:SequenceId ; + skos:definition "Accession to the matching sequence data (e.g., genome, marker gene sequence)." . -linkml:topValue a owl:DatatypeProperty ; - rdfs:label "value" . +EDAM_TOPIC:3382 a owl:Class, + miiid:MethodType ; + rdfs:label "microscopy" . + +EDAM_TOPIC:3524 a owl:Class, + miiid:MethodType ; + rdfs:label "simulation" . + +GENEPIO:0001619 a owl:Class, + miiid:ParticipantOutcome ; + rdfs:label "not_applicable" . + +NCIT:C25300 a owl:Class, + miiid:MethodType ; + rdfs:label "cultivation" . + +OBI:0000659 a owl:Class, + miiid:MethodType ; + rdfs:label "sample" . schema1:description a owl:ObjectProperty, linkml:SlotDefinition ; @@ -74,25 +125,34 @@ miiid:IntermicrobialInteraction a owl:Class, linkml:ClassDefinition ; rdfs:label "IntermicrobialInteraction" ; rdfs:subClassOf [ a owl:Restriction ; - owl:onClass linkml:String ; - owl:onProperty miiid:evidence_type ; - owl:qualifiedCardinality 1 ], + owl:allValuesFrom miiid:MethodType ; + owl:onProperty miiid:method_type ], + [ a owl:Restriction ; + owl:allValuesFrom miiid:SequenceId ; + owl:onProperty miiid:sequence_id ], + [ a owl:Class ; + owl:intersectionOf ( [ a owl:Restriction ; + owl:allValuesFrom miiid:NCBITaxId ; + owl:onProperty miiid:tax_id ] [ a owl:Restriction ; + owl:onProperty miiid:tax_id ; + owl:someValuesFrom miiid:NCBITaxId ] ) ], [ a owl:Class ; owl:intersectionOf ( [ a owl:Restriction ; owl:allValuesFrom linkml:String ; owl:onProperty miiid:participants ] [ a owl:Restriction ; owl:onProperty miiid:participants ; owl:someValuesFrom linkml:String ] ) ], + [ a owl:Restriction ; + owl:onClass linkml:String ; + owl:onProperty miiid:evidence_type ; + owl:qualifiedCardinality 1 ], [ a owl:Restriction ; owl:onClass linkml:String ; owl:onProperty miiid:reference ; owl:qualifiedCardinality 1 ], - [ a owl:Class ; - owl:intersectionOf ( [ a owl:Restriction ; - owl:allValuesFrom miiid:NCBITaxId ; - owl:onProperty miiid:tax_id ] [ a owl:Restriction ; - owl:onProperty miiid:tax_id ; - owl:someValuesFrom miiid:NCBITaxId ] ) ], + [ a owl:Restriction ; + owl:allValuesFrom miiid:ParticipantOutcome ; + owl:onProperty miiid:participant_outcomes ], miiid:NamedThing ; skos:definition "Represents an interaction between microbial entities" . @@ -106,14 +166,34 @@ miiid:NamedThing a owl:Class, [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty schema1:description ], + owl:onProperty schema1:name ], [ a owl:Restriction ; owl:maxQualifiedCardinality 1 ; owl:onClass linkml:String ; - owl:onProperty schema1:name ] ; + owl:onProperty schema1:description ] ; skos:definition "A generic grouping for any identifiable entity" ; skos:exactMatch schema1:Thing . + a owl:Class, + miiid:ParticipantOutcome ; + rdfs:label "negatively" . + + a owl:Class, + miiid:ParticipantOutcome ; + rdfs:label "not_affected" . + + a owl:Class, + miiid:ParticipantOutcome ; + rdfs:label "positively" . + +miiid:SequenceId a owl:Class, + linkml:TypeDefinition ; + rdfs:label "SequenceId" ; + rdfs:subClassOf [ a owl:Restriction ; + owl:onDataRange xsd:string ; + owl:onProperty linkml:topValue ; + owl:qualifiedCardinality 1 ] . + miiid:participants a owl:ObjectProperty, linkml:SlotDefinition ; rdfs:label "participants" ; @@ -136,6 +216,29 @@ miiid:NCBITaxId a owl:Class, linkml:ClassDefinition a owl:Class . +linkml:TypeDefinition a owl:Class . + +linkml:topValue a owl:DatatypeProperty ; + rdfs:label "value" . + +miiid:MethodType a owl:Class, + linkml:EnumDefinition ; + rdfs:label "MethodType" ; + owl:unionOf ( EDAM_TOPIC:3524 EDAM_TOPIC:3382 NCIT:C25300 OBI:0000659 ) ; + linkml:permissible_values EDAM_TOPIC:3382, + EDAM_TOPIC:3524, + NCIT:C25300, + OBI:0000659 . + +miiid:ParticipantOutcome a owl:Class, + linkml:EnumDefinition ; + rdfs:label "ParticipantOutcome" ; + owl:unionOf ( GENEPIO:0001619 ) ; + linkml:permissible_values GENEPIO:0001619, + , + , + . + linkml:SlotDefinition a owl:Class . diff --git a/project/prefixmap/miiid_schema.yaml b/project/prefixmap/miiid_schema.yaml index 2f75723..ca7ba78 100644 --- a/project/prefixmap/miiid_schema.yaml +++ b/project/prefixmap/miiid_schema.yaml @@ -1,4 +1,9 @@ { + "EDAM_DATA": "http://edamontology.org/data_", + "EDAM_TOPIC": "http://edamontology.org/topic_", + "GENEPIO": "http://purl.obolibrary.org/obo/GENEPIO_", + "NCIT": "http://purl.obolibrary.org/obo/NCIT_", + "OBI": "http://purl.obolibrary.org/obo/OBI_", "WIKIDATA_PROPERTY": "https://www.wikidata.org/prop/", "linkml": "https://w3id.org/linkml/", "miiid": "https://w3id.org/FAIR-MI/miiid/", diff --git a/project/protobuf/miiid_schema.proto b/project/protobuf/miiid_schema.proto index a2ff610..bec396f 100644 --- a/project/protobuf/miiid_schema.proto +++ b/project/protobuf/miiid_schema.proto @@ -6,8 +6,11 @@ message IntermicrobialInteraction string description = 0 repeated string participants = 0 repeated nCBITaxId taxId = 0 + repeated sequenceId sequenceId = 0 string evidenceType = 0 + repeated methodType methodType = 0 string reference = 0 + repeated participantOutcome participantOutcomes = 0 } // A holder for IntermicrobialInteraction objects message IntermicrobialInteractionCollection diff --git a/project/shacl/miiid_schema.shacl.ttl b/project/shacl/miiid_schema.shacl.ttl index 1d23df9..b0cbe57 100644 --- a/project/shacl/miiid_schema.shacl.ttl +++ b/project/shacl/miiid_schema.shacl.ttl @@ -1,3 +1,7 @@ +@prefix EDAM_TOPIC: . +@prefix GENEPIO: . +@prefix NCIT: . +@prefix OBI: . @prefix miiid: . @prefix rdf: . @prefix schema1: . @@ -12,14 +16,14 @@ schema1:Thing a sh:NodeShape ; sh:maxCount 1 ; sh:order 2 ; sh:path schema1:description ], - [ sh:description "A unique identifier for a thing" ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:identifier ], [ sh:description "A human-readable name for a thing" ; sh:maxCount 1 ; sh:order 1 ; - sh:path schema1:name ] ; + sh:path schema1:name ], + [ sh:description "A unique identifier for a thing" ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:identifier ] ; sh:targetClass schema1:Thing . miiid:IntermicrobialInteractionCollection a sh:NodeShape ; @@ -37,36 +41,48 @@ miiid:IntermicrobialInteraction a sh:NodeShape ; sh:closed true ; sh:description "Represents an interaction between microbial entities" ; sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:description "A unique identifier for a thing" ; + sh:property [ sh:description "Accession to the matching sequence data (e.g., genome, marker gene sequence)." ; + sh:order 2 ; + sh:path miiid:sequence_id ], + [ sh:description "Type of evidence used to determine the interaction using the Evidence and Conclusion Ontology." ; sh:maxCount 1 ; sh:minCount 1 ; - sh:order 4 ; - sh:path schema1:identifier ], - [ sh:description "A human-readable name for a thing" ; + sh:order 3 ; + sh:path miiid:evidence_type ; + sh:pattern "[^\\:\\n\\r]+\\:[^\\:\\n\\r]+" ], + [ sh:description "Outcomes of each of the participants described in the interaction when known." ; + sh:in ( "not_affected" "positively" "negatively" GENEPIO:0001619 ) ; + sh:order 6 ; + sh:path miiid:participant_outcomes ], + [ sh:description "A unique identifier for a thing" ; sh:maxCount 1 ; - sh:order 5 ; - sh:path schema1:name ], - [ sh:description "Names of the microbial entities, with descriptions of any genetic manipulations performed." ; sh:minCount 1 ; - sh:order 0 ; - sh:path miiid:participants ], - [ sh:description "Type of evidence used to determine the interaction using the Evidence and Conclusion Ontology." ; + sh:order 7 ; + sh:path schema1:identifier ], + [ sh:description "One or several of the types of methods used to determine the interaction." ; + sh:in ( EDAM_TOPIC:3524 EDAM_TOPIC:3382 NCIT:C25300 OBI:0000659 ) ; + sh:order 4 ; + sh:path miiid:method_type ], + [ sh:description "Persistent identifier (e.g. DOI or URL) to a resource, script, or article, documenting the method." ; sh:maxCount 1 ; sh:minCount 1 ; - sh:order 2 ; - sh:path miiid:evidence_type ], + sh:order 5 ; + sh:path miiid:reference ], [ sh:description "A human-readable description for a thing" ; sh:maxCount 1 ; - sh:order 6 ; + sh:order 9 ; sh:path schema1:description ], - [ sh:description "Persistent identifier (e.g. DOI or URL) to a resource, script, or article, documenting the method." ; - sh:maxCount 1 ; - sh:minCount 1 ; - sh:order 3 ; - sh:path miiid:reference ], [ sh:description "NCBI Taxonomy identifiers at the relevant taxonomic level. Novel taxa lacking identifiers are denoted by N/A." ; sh:minCount 1 ; sh:order 1 ; - sh:path miiid:tax_id ] ; + sh:path miiid:tax_id ], + [ sh:description "A human-readable name for a thing" ; + sh:maxCount 1 ; + sh:order 8 ; + sh:path schema1:name ], + [ sh:description "Names of the microbial entities, with descriptions of any genetic manipulations performed." ; + sh:minCount 1 ; + sh:order 0 ; + sh:path miiid:participants ] ; sh:targetClass miiid:IntermicrobialInteraction . diff --git a/project/shex/miiid_schema.shex b/project/shex/miiid_schema.shex index 7a74fc0..dd7414c 100644 --- a/project/shex/miiid_schema.shex +++ b/project/shex/miiid_schema.shex @@ -7,6 +7,10 @@ PREFIX schema1: xsd:integer + xsd:string + + xsd:string + linkml:String xsd:string linkml:Integer xsd:integer @@ -50,8 +54,11 @@ linkml:Sparqlpath xsd:string rdf:type [ schema1:Thing ] ? ; @linkml:String + ; @ + ; + @ * ; @linkml:String ; - @linkml:String + @ * ; + @linkml:String ; + @ * ) ; rdf:type [ ] ) diff --git a/project/sqlschema/miiid_schema.sql b/project/sqlschema/miiid_schema.sql index b0fdc06..e111e52 100644 --- a/project/sqlschema/miiid_schema.sql +++ b/project/sqlschema/miiid_schema.sql @@ -34,3 +34,24 @@ CREATE TABLE "IntermicrobialInteraction_tax_id" ( PRIMARY KEY (backref_id, tax_id), FOREIGN KEY(backref_id) REFERENCES "IntermicrobialInteraction" (id) ); + +CREATE TABLE "IntermicrobialInteraction_sequence_id" ( + backref_id TEXT, + sequence_id TEXT, + PRIMARY KEY (backref_id, sequence_id), + FOREIGN KEY(backref_id) REFERENCES "IntermicrobialInteraction" (id) +); + +CREATE TABLE "IntermicrobialInteraction_method_type" ( + backref_id TEXT, + method_type VARCHAR(11), + PRIMARY KEY (backref_id, method_type), + FOREIGN KEY(backref_id) REFERENCES "IntermicrobialInteraction" (id) +); + +CREATE TABLE "IntermicrobialInteraction_participant_outcomes" ( + backref_id TEXT, + participant_outcomes VARCHAR(14), + PRIMARY KEY (backref_id, participant_outcomes), + FOREIGN KEY(backref_id) REFERENCES "IntermicrobialInteraction" (id) +); diff --git a/src/miiid_schema/datamodel/miiid_schema.py b/src/miiid_schema/datamodel/miiid_schema.py index c15c82a..cd6a410 100644 --- a/src/miiid_schema/datamodel/miiid_schema.py +++ b/src/miiid_schema/datamodel/miiid_schema.py @@ -1,5 +1,5 @@ # Auto generated from miiid_schema.yaml by pythongen.py version: 0.9.0 -# Generation date: 2023-06-20T17:04:30 +# Generation date: 2023-07-10T22:44:55 # Schema: miiid-schema # # id: https://w3id.org/FAIR-MI/miiid-schema @@ -25,12 +25,17 @@ from linkml_runtime.utils.metamodelcore import URIorCURIE metamodel_version = "1.7.0" -version = None +version = "0.2.0" # Overwrite dataclasses _init_fn to add **kwargs in __init__ dataclasses._init_fn = dataclasses_init_fn_with_kwargs # Namespaces +EDAM_DATA = CurieNamespace('EDAM_DATA', 'http://edamontology.org/data_') +EDAM_TOPIC = CurieNamespace('EDAM_TOPIC', 'http://edamontology.org/topic_') +GENEPIO = CurieNamespace('GENEPIO', 'http://purl.obolibrary.org/obo/GENEPIO_') +NCIT = CurieNamespace('NCIT', 'http://purl.obolibrary.org/obo/NCIT_') +OBI = CurieNamespace('OBI', 'http://purl.obolibrary.org/obo/OBI_') WIKIDATA_PROPERTY = CurieNamespace('WIKIDATA_PROPERTY', 'https://www.wikidata.org/prop/') LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/') MIIID = CurieNamespace('miiid', 'https://w3id.org/FAIR-MI/miiid/') @@ -48,6 +53,22 @@ class NCBITaxId(int): type_model_uri = MIIID.NCBITaxId +class SequenceId(str): + """ Sequence identifier to a (preferrably INSDC) database """ + type_class_uri = XSD.string + type_class_curie = "xsd:string" + type_name = "SequenceId" + type_model_uri = MIIID.SequenceId + + +class EnvExpId(str): + """ Term from the Environment Ontology following by their machine-actionable identifier. """ + type_class_uri = XSD.string + type_class_curie = "xsd:string" + type_name = "EnvExpId" + type_model_uri = MIIID.EnvExpId + + # Class references class NamedThingId(URIorCURIE): pass @@ -105,6 +126,9 @@ class IntermicrobialInteraction(NamedThing): tax_id: Union[int, List[int]] = None evidence_type: str = None reference: str = None + sequence_id: Optional[Union[str, List[str]]] = empty_list() + method_type: Optional[Union[Union[str, "MethodType"], List[Union[str, "MethodType"]]]] = empty_list() + participant_outcomes: Optional[Union[Union[str, "ParticipantOutcome"], List[Union[str, "ParticipantOutcome"]]]] = empty_list() def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if self._is_empty(self.id): @@ -134,6 +158,18 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if not isinstance(self.reference, str): self.reference = str(self.reference) + if not isinstance(self.sequence_id, list): + self.sequence_id = [self.sequence_id] if self.sequence_id is not None else [] + self.sequence_id = [v if isinstance(v, str) else str(v) for v in self.sequence_id] + + if not isinstance(self.method_type, list): + self.method_type = [self.method_type] if self.method_type is not None else [] + self.method_type = [v if isinstance(v, MethodType) else MethodType(v) for v in self.method_type] + + if not isinstance(self.participant_outcomes, list): + self.participant_outcomes = [self.participant_outcomes] if self.participant_outcomes is not None else [] + self.participant_outcomes = [v if isinstance(v, ParticipantOutcome) else ParticipantOutcome(v) for v in self.participant_outcomes] + super().__post_init__(**kwargs) @@ -158,7 +194,54 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): # Enumerations - +class MethodType(EnumDefinitionImpl): + """ + List of methods used to determine interactions + """ + simulation = PermissibleValue( + text="simulation", + description="Any type of biological computational model experiments", + meaning=EDAM_TOPIC["3524"]) + microscopy = PermissibleValue( + text="microscopy", + description="Any type of imaging-related experiments", + meaning=EDAM_TOPIC["3382"]) + cultivation = PermissibleValue( + text="cultivation", + description="Any laboratory procedure for growing microorganisms", + meaning=NCIT.C25300) + sample = PermissibleValue( + text="sample", + description="Any type of experiments based on the analysis of a sample", + meaning=OBI["0000659"]) + + _defn = EnumDefinition( + name="MethodType", + description="List of methods used to determine interactions", + ) + +class ParticipantOutcome(EnumDefinitionImpl): + """ + Outcome indicating how each participant was affected + """ + not_affected = PermissibleValue( + text="not_affected", + description="usually encoded with numerical 0") + positively = PermissibleValue( + text="positively", + description="usually encoded with +1") + negatively = PermissibleValue( + text="negatively", + description="usually encoded with -1") + not_applicable = PermissibleValue( + text="not_applicable", + description="""The information is inappropriate to report, this can indicate that the standard itself fails to model or represent the information appropriately""", + meaning=GENEPIO["0001619"]) + + _defn = EnumDefinition( + name="ParticipantOutcome", + description="Outcome indicating how each participant was affected", + ) # Slots class slots: @@ -179,11 +262,25 @@ class slots: slots.tax_id = Slot(uri=MIIID.tax_id, name="tax_id", curie=MIIID.curie('tax_id'), model_uri=MIIID.tax_id, domain=None, range=Union[int, List[int]]) +slots.sequence_id = Slot(uri=MIIID.sequence_id, name="sequence_id", curie=MIIID.curie('sequence_id'), + model_uri=MIIID.sequence_id, domain=None, range=Optional[Union[str, List[str]]]) + slots.evidence_type = Slot(uri=MIIID.evidence_type, name="evidence_type", curie=MIIID.curie('evidence_type'), - model_uri=MIIID.evidence_type, domain=None, range=str) + model_uri=MIIID.evidence_type, domain=None, range=str, + pattern=re.compile(r'[^\:\n\r]+\:[^\:\n\r]+')) + +slots.method_type = Slot(uri=MIIID.method_type, name="method_type", curie=MIIID.curie('method_type'), + model_uri=MIIID.method_type, domain=None, range=Optional[Union[Union[str, "MethodType"], List[Union[str, "MethodType"]]]]) slots.reference = Slot(uri=MIIID.reference, name="reference", curie=MIIID.curie('reference'), model_uri=MIIID.reference, domain=None, range=str) +slots.env_exp = Slot(uri=MIIID.env_exp, name="env_exp", curie=MIIID.curie('env_exp'), + model_uri=MIIID.env_exp, domain=None, range=Optional[str], + pattern=re.compile(r'[^\:\n\r]+\:[^\:\n\r]+')) + +slots.participant_outcomes = Slot(uri=MIIID.participant_outcomes, name="participant_outcomes", curie=MIIID.curie('participant_outcomes'), + model_uri=MIIID.participant_outcomes, domain=None, range=Optional[Union[Union[str, "ParticipantOutcome"], List[Union[str, "ParticipantOutcome"]]]]) + slots.intermicrobialInteractionCollection__entries = Slot(uri=MIIID.entries, name="intermicrobialInteractionCollection__entries", curie=MIIID.curie('entries'), model_uri=MIIID.intermicrobialInteractionCollection__entries, domain=None, range=Optional[Union[Dict[Union[str, IntermicrobialInteractionId], Union[dict, IntermicrobialInteraction]], List[Union[dict, IntermicrobialInteraction]]]]) \ No newline at end of file diff --git a/src/miiid_schema/schema/miiid_schema.yaml b/src/miiid_schema/schema/miiid_schema.yaml index 1aa9129..66900d4 100644 --- a/src/miiid_schema/schema/miiid_schema.yaml +++ b/src/miiid_schema/schema/miiid_schema.yaml @@ -2,7 +2,7 @@ id: https://w3id.org/FAIR-MI/miiid-schema name: miiid-schema title: miiid-schema -version: 0.1.1 +version: 0.2.0 description: |- Minimal Information about Intermicrobial Interaction Data schema license: GNU GPL v3.0