From c77400cf7898e44e55a433b5c8d45e2e3a0d4d59 Mon Sep 17 00:00:00 2001 From: Jim Balhoff Date: Thu, 11 Jan 2024 18:12:23 -0500 Subject: [PATCH] Update tests to run properly (#536) * Remove references to CL:0000003. * Replace CHEBI term for validation. * Update ShEx. * Update test model. --- .../BlazegraphOntologyManagerTest.java | 8 +- .../validation/go-cam-shapes.shapeMap | 2 + .../resources/validation/go-cam-shapes.shex | 141 ++++++++++++++---- .../Test027-has_input_2_MolecularEntity.ttl | 2 +- .../Test027-has_input_2_MolecularEntity.ttl | 6 +- 5 files changed, 121 insertions(+), 38 deletions(-) diff --git a/minerva-core/src/test/java/org/geneontology/minerva/BlazegraphOntologyManagerTest.java b/minerva-core/src/test/java/org/geneontology/minerva/BlazegraphOntologyManagerTest.java index 9eed2fa3..e64d8bc5 100644 --- a/minerva-core/src/test/java/org/geneontology/minerva/BlazegraphOntologyManagerTest.java +++ b/minerva-core/src/test/java/org/geneontology/minerva/BlazegraphOntologyManagerTest.java @@ -108,10 +108,10 @@ public void testGetSubClasses() throws IOException { assertTrue("ECO_0000314 not subclass of ECO_0000000", subs.contains("http://purl.obolibrary.org/obo/ECO_0000314")); //Anatomy //worm anatomy - note that it needs parts of the cl ontology in there - uri = "http://purl.obolibrary.org/obo/CL_0000003"; + uri = "http://purl.obolibrary.org/obo/CL_0000000"; subs = onto_repo.getAllSubClasses(uri); - //GO native cell - used a lot in shex - assertTrue("WBbt_0005753 not subclass of CL_0000003", subs.contains("http://purl.obolibrary.org/obo/WBbt_0005753")); + //GO cell - used a lot in shex + assertTrue("WBbt_0005753 not subclass of CL_0000000", subs.contains("http://purl.obolibrary.org/obo/WBbt_0005753")); //Cell component uri = "http://purl.obolibrary.org/obo/GO_0110165"; subs = onto_repo.getAllSubClasses(uri); @@ -159,7 +159,7 @@ public void testGetSuperClasses() throws IOException { uri = "http://purl.obolibrary.org/obo/WBbt_0005753"; supers = onto_repo.getAllSuperClasses(uri); //GO native cell - used a lot in shex - assertTrue("WBbt_0005753 not subclass of CL_0000003", supers.contains("http://purl.obolibrary.org/obo/CL_0000003")); + assertTrue("WBbt_0005753 not subclass of CL_0000000", supers.contains("http://purl.obolibrary.org/obo/CL_0000000")); //anatomy - also used a lot in shex assertTrue("WBbt_0005753 not subclass of UBERON_0001062", supers.contains("http://purl.obolibrary.org/obo/UBERON_0001062")); //Cell component diff --git a/minerva-core/src/test/resources/validation/go-cam-shapes.shapeMap b/minerva-core/src/test/resources/validation/go-cam-shapes.shapeMap index 59b9b5ca..d4b3126e 100644 --- a/minerva-core/src/test/resources/validation/go-cam-shapes.shapeMap +++ b/minerva-core/src/test/resources/validation/go-cam-shapes.shapeMap @@ -1,4 +1,6 @@ SPARQL 'SELECT ?x WHERE { ?x a }' @ , +SPARQL 'SELECT ?x WHERE { ?x a/ }' @ , +SPARQL 'SELECT ?x WHERE { ?x a/ }' @ , SPARQL 'SELECT ?x WHERE { ?x a/ }' @ , SPARQL 'SELECT ?x WHERE { ?x a/ }' @ , SPARQL 'SELECT ?x WHERE { ?x a/ }' @ , diff --git a/minerva-core/src/test/resources/validation/go-cam-shapes.shex b/minerva-core/src/test/resources/validation/go-cam-shapes.shex index ade391bc..47201c56 100644 --- a/minerva-core/src/test/resources/validation/go-cam-shapes.shex +++ b/minerva-core/src/test/resources/validation/go-cam-shapes.shex @@ -5,11 +5,14 @@ PREFIX rdfs: PREFIX owl: PREFIX xsd: PREFIX skos: +PREFIX prov: #metadata PREFIX bl: PREFIX contributor: PREFIX provided_by: -PREFIX date: +PREFIX modification_date: +PREFIX creation_date: +PREFIX import_date: PREFIX xref: PREFIX exact_match: PREFIX source: @@ -21,6 +24,7 @@ PREFIX y: PREFIX ontology: PREFIX taxon: PREFIX modelstate: +PREFIX templatestate: PREFIX oboinowlid: ###contributor, date, providedBy reused PREFIX title: @@ -48,16 +52,17 @@ PREFIX GoDevelopmentalMaturation: PREFIX GoGrowth: PREFIX GoLocalization: PREFIX GoLocomotion: -PREFIX GoMovementOfCellOrSubcellularComponent: PREFIX GoProteinContainingComplexRemodeling: PREFIX GoPatternSpecificationProcess: +PREFIX GoMetabolicProcess: +PREFIX GoTransport: PREFIX GoMolecularFunction: prefix GoMolecularEvent: PREFIX GoTransporterActivity: PREFIX GoChemicalEntity: PREFIX GoEvidence: PREFIX GoAnatomicalEntity: -PREFIX GoNativeCell: +PREFIX GoCell: PREFIX GoOrganism: PREFIX GoBiologicalPhase: PREFIX GoLifeCycleStage: @@ -68,16 +73,28 @@ PREFIX has_part: PREFIX occurs_in: PREFIX adjacent_to: PREFIX overlaps: +PREFIX existence_overlaps: +PREFIX existence_starts_and_ends_during: PREFIX enabled_by: +PREFIX contributes_to: PREFIX has_input: PREFIX has_output: +PREFIX has_primary_input: +PREFIX has_primary_output: PREFIX has_target_end_location: PREFIX has_target_start_location: PREFIX transports_or_maintains_localization_of: PREFIX directly_provides_input_for: PREFIX directly_positively_regulates: +PREFIX has_small_molecule_regulator: +PREFIX has_small_molecule_activator: +PREFIX has_small_molecule_inhibitor: +PREFIX is_small_molecule_regulator_of: +PREFIX is_small_molecule_activator_of: +PREFIX is_small_molecule_inhibitor_of: PREFIX located_in: PREFIX location_of: +PREFIX is_active_in: PREFIX happens_during: PREFIX regulates: PREFIX negatively_regulates: @@ -85,12 +102,18 @@ PREFIX positively_regulates: PREFIX directly_regulates: PREFIX directly_negatively_regulates: PREFIX directly_activates: +PREFIX indirectly_regulates: +PREFIX indirectly_positively_regulates: +PREFIX indirectly_negatively_regulates: +PREFIX constitutively_upstream_of: +PREFIX removes_input_for: PREFIX causally_upstream_of_or_within: PREFIX causally_upstream_of_or_within_negative_effect: PREFIX causally_upstream_of_or_within_positive_effect: PREFIX causally_upstream_of: PREFIX causally_upstream_of_negative_effect: PREFIX causally_upstream_of_positive_effect: +PREFIX acts_on_population_of: PREFIX results_in_development_of: PREFIX results_in_formation_of: PREFIX results_in_morphogenesis_of: @@ -109,20 +132,26 @@ PREFIX results_in_remodeling_of: { a [owl:Ontology] + ; contributor: xsd:string +; #TODO would be better as an IRI - date: xsd:string {1}; #TODO can we make this an xsd:date? + modification_date: xsd:string {1}; #Use ISO 8601 as a standard. + creation_date: xsd:string {0,1}; #Use ISO 8601 as a standard. + import_date: xsd:string {0,1}; #Use ISO 8601 as a standard. provided_by: xsd:string +; #TODO would be better as an IRI rdfs:comment xsd:string *; modelstate: xsd:string {1}; #TODO would be better as an IRI + templatestate: xsd:string {0,1}; #TODO should be modeled as xsd:boolean but currently a string. No value means false. in_taxon: . *; title: xsd:string {1}; imports: . *; oboinowlid: . *; #TODO not sure if we really want this? owl:versionIRI . *; + prov:wasDerivedFrom IRI {0,1}; # for model copy } { - contributor: xsd:string *; #TODO would be better as an IRI - date: xsd:string *; #TODO can we make this an xsd:date? + contributor: xsd:string +; #TODO would be better as an IRI + modification_date: xsd:string {1}; #Use ISO 8601 as a standard. + creation_date: xsd:string {0,1}; #Use ISO 8601 as a standard. + import_date: xsd:string {0,1}; #Use ISO 8601 as a standard. provided_by: xsd:string *; #TODO would be better as an IRI rdfs:comment xsd:string *; skos:note xsd:string *; @@ -130,11 +159,13 @@ PREFIX results_in_remodeling_of: IRI @ AND EXTRA a { a [owl:NamedIndividual] * // rdfs:comment "Every entity we care about is a named individual"; - xref: . *; - rdfs:label . {0,1} //rdfs:comment "the name" ; + xref: . * // rdfs:comment "mappings for the entity. Value is typically a CURIE string. Currently this is only used for Reactome-derived models." ; + rdfs:label . {0,1} // rdfs:comment "the name of the entity. Currently this is only used for Reactome-derived models." ; exact_match: . *; - x: . {0,1} // rdfs:comment "X coordinate for node"; - y: . {0,1} // rdfs:comment "Y coordinate for node"; + x: . {0,1} // rdfs:comment "X coordinate for node. This is used for caching layouts in the Noctua Graph Editor."; + y: . {0,1} // rdfs:comment "Y coordinate for node. This is used for caching layouts in the Noctua Graph Editor."; + skos:narrower . * // rdfs:comment "This entity (e.g. a node representing a pathway) represents a narrower (in any sense) concept then the target node. "; + skos:broader . * // rdfs:comment "This entity (e.g. a node representing a pathway) represents a broader (in any sense) concept then the target node. "; } // rdfs:comment "Default allowable metadata for GO-CAM entities" { @@ -149,10 +180,18 @@ PREFIX results_in_remodeling_of: owl:complementOf @ } + IRI @ AND EXTRA rdfs:subClassOf { + rdfs:subClassOf [ GoOrganism: ] ; +} + + @ AND EXTRA a { + a @ ; +} // rdfs:comment "A member of a class of organisms defined in the NCBI taxonomy" + @ AND EXTRA a { a ( @ OR @ ) {1}; - part_of: @ {0,1}; - has_input: ( @ OR @ OR @ ) *; + part_of: @ *; + has_input: ( @ OR @ OR @ OR @ ) *; has_output: ( @ OR @ OR @ ) *; occurs_in: @ {0,1}; transports_or_maintains_localization_of: ( @ OR @ ) *; @@ -164,6 +203,8 @@ PREFIX results_in_remodeling_of: regulates: @ *; negatively_regulates: @ *; positively_regulates: @ *; + acts_on_population_of: ( @ OR @ ) *; + happens_during: ( @ OR @ OR @ ) *; } // rdfs:comment "A biological process" @@ -200,7 +241,7 @@ PREFIX results_in_remodeling_of: @ AND EXTRA a { a @ {1}; - results_in_acquisition_of_features_of: @ {0,1}; + results_in_acquisition_of_features_of: @ {0,1}; } // rdfs:comment "a cell differentiation GO biological process or child" IRI @ AND EXTRA rdfs:subClassOf { @@ -209,7 +250,7 @@ PREFIX results_in_remodeling_of: @ AND EXTRA a { a @ {1}; - has_input: @ {0,1}; + has_input: @ {0,1}; } // rdfs:comment "a cell division GO biological process or child" IRI @ AND EXTRA rdfs:subClassOf { @@ -218,7 +259,7 @@ PREFIX results_in_remodeling_of: @ AND EXTRA a { a @ {1}; - results_in_commitment_to: @ {0,1}; + results_in_commitment_to: @ {0,1}; } // rdfs:comment "a cell fate commitment GO biological process or child" IRI @ AND EXTRA rdfs:subClassOf { @@ -227,7 +268,7 @@ PREFIX results_in_remodeling_of: @ AND EXTRA a { a @ {1}; - results_in_determination_of: @ {0,1}; + results_in_determination_of: @ {0,1}; } // rdfs:comment "a cell fate determination GO biological process or child" IRI @ AND EXTRA rdfs:subClassOf { @@ -236,7 +277,7 @@ PREFIX results_in_remodeling_of: @ AND EXTRA a { a @ {1}; - results_in_specification_of: @ {0,1}; + results_in_specification_of: @ {0,1}; } // rdfs:comment "a cell fate specification GO biological process or child" IRI @ AND EXTRA rdfs:subClassOf { @@ -304,14 +345,15 @@ PREFIX results_in_remodeling_of: results_in_movement_of: @ {0,1}; } // rdfs:comment "a locomotion GO biological process or child" - IRI @ AND EXTRA rdfs:subClassOf { - rdfs:subClassOf [ GoMovementOfCellOrSubcellularComponent: ] ; + IRI @ AND EXTRA rdfs:subClassOf { + rdfs:subClassOf [ GoMetabolicProcess: ] ; } - @ AND EXTRA a { - a @ {1}; - results_in_movement_of: ( @ OR @ ) {0,1}; -} // rdfs:comment "a movement of cell or subcellular component GO biological process or child" + @ AND EXTRA a { + a @ {1}; + has_primary_input: @ *; + has_primary_output: @ *; +} // rdfs:comment "a metabolic process GO biological process or child" IRI @ AND EXTRA rdfs:subClassOf { rdfs:subClassOf [ GoProteinContainingComplexRemodeling: ] ; @@ -331,6 +373,16 @@ PREFIX results_in_remodeling_of: results_in_specification_of: @ {0,1}; } // rdfs:comment "a pattern specification process GO biological process or child" + IRI @ AND EXTRA rdfs:subClassOf { + rdfs:subClassOf [ GoTransport: ] ; +} + + @ AND EXTRA a { + a @ {1}; + has_primary_input: ( @ OR @ OR @ ) *; + has_primary_output: ( @ OR @ OR @ ) *; +} // rdfs:comment "a transport GO biological process or child" + IRI @ AND EXTRA rdfs:subClassOf { rdfs:subClassOf [ GoMolecularFunction: ] ; } @@ -353,11 +405,14 @@ PREFIX results_in_remodeling_of: @ AND EXTRA a { a ( @ OR @ ) {1}; - enabled_by: ( @ OR @ ) {0,1}; - part_of: @ {0,1}; + enabled_by: ( @ OR @ ) *; + part_of: @ *; + has_part: @ *; occurs_in: @ {0,1}; has_output: ( @ OR @ ) *; has_input: ( @ OR @ ) *; + has_primary_input: ( @ OR @ ) *; + has_primary_output: ( @ OR @ ) *; directly_provides_input_for: ( @ OR @ ) *; regulates: ( @ OR @ ) *; negatively_regulates: ( @ OR @ ) *; @@ -365,6 +420,14 @@ PREFIX results_in_remodeling_of: directly_regulates: ( @ OR @ ) *; directly_negatively_regulates: ( @ OR @ ) *; directly_positively_regulates: ( @ OR @ ) *; + indirectly_regulates: ( @ OR @) *; + indirectly_positively_regulates: ( @ OR @ ) *; + indirectly_negatively_regulates: ( @ OR @ ) *; + constitutively_upstream_of: ( @ OR @ ) *; + removes_input_for: ( @ OR @ ) *; + has_small_molecule_regulator: @ *; + has_small_molecule_activator: @ *; + has_small_molecule_inhibitor: @ *; causally_upstream_of_or_within: ( @ OR @ OR @ ) *; causally_upstream_of_or_within_negative_effect: @ *; causally_upstream_of_or_within_positive_effect: @ *; @@ -381,6 +444,8 @@ PREFIX results_in_remodeling_of: @ AND EXTRA a { a @ {1}; transports_or_maintains_localization_of: ( @ OR @ OR @ ) *; + has_primary_input: ( @ OR @ ) *; + has_primary_output: ( @ OR @ ) *; has_target_end_location: @ *; has_target_start_location: @ *; } // rdfs:comment "a transporter activity GO molecular function or child" @@ -423,14 +488,14 @@ PREFIX results_in_remodeling_of: location_of: ( @ OR @ ) {0,1}; } // rdfs:comment "an anatomical entity" - IRI @ AND EXTRA rdfs:subClassOf { - rdfs:subClassOf [ GoNativeCell: ]; + IRI @ AND EXTRA rdfs:subClassOf { + rdfs:subClassOf [ GoCell: ]; } - @ AND EXTRA a { - a @ {1}; + @ AND EXTRA a { + a @ {1}; part_of: @ {0,1}; -} // rdfs:comment "a native cell or child" +} // rdfs:comment "a cell or child" IRI @ AND EXTRA rdfs:subClassOf { rdfs:subClassOf [ GoCellularComponent: ]; @@ -440,18 +505,27 @@ PREFIX results_in_remodeling_of: owl:complementOf @ } + IRI @ AND EXTRA a { + a [ GoCellularComponent: ]; +} + # @ AND EXTRA a { # If we want to intersect with anatomical entity, then GO cellular_component needs to subclass anatomical entity in go-lego @ AND EXTRA a { a ( @ OR @ ) {1}; part_of: @ {0,1}; adjacent_to: @ *; overlaps: @ *; + existence_overlaps: ( @ OR @ OR @ ) *; + existence_starts_and_ends_during: ( @ OR @ OR @ ) *; } // rdfs:comment "a cellular component" @ AND EXTRA a { a @; located_in: @ {0,1}; + is_active_in: @ OR @ {0,1}; has_part: ( @ OR @) *; + existence_overlaps: ( @ OR @ OR @ ) *; + existence_starts_and_ends_during: ( @ OR @ OR @ ) *; } // rdfs:comment "a protein complex" IRI @ AND EXTRA rdfs:subClassOf { @@ -460,6 +534,9 @@ PREFIX results_in_remodeling_of: @ AND EXTRA a { a @ +; + is_small_molecule_regulator_of: @ *; + is_small_molecule_activator_of: @ *; + is_small_molecule_inhibitor_of: @ *; }// rdfs:comment "a molecular entity (a gene product, chemical, or complex typically)" IRI @ AND EXTRA rdfs:subClassOf { @@ -472,7 +549,9 @@ PREFIX results_in_remodeling_of: @ AND EXTRA a { a @ ; located_in: @ {0,1}; + is_active_in: @ OR @ {0,1}; part_of: @ {0,1}; + contributes_to: @ {0,1}; }// rdfs:comment "a protein" @@ -482,7 +561,9 @@ PREFIX results_in_remodeling_of: @ AND EXTRA a { a @ +; located_in: @ {0,1}; + is_active_in: @ OR @ {0,1}; part_of: @ {0,1}; + contributes_to: @ {0,1}; }// rdfs:comment "an information biomacromolecule - e.g. a protein or RNA product" IRI @ AND EXTRA rdfs:subClassOf { diff --git a/minerva-core/src/test/resources/validation/should_pass/Test027-has_input_2_MolecularEntity.ttl b/minerva-core/src/test/resources/validation/should_pass/Test027-has_input_2_MolecularEntity.ttl index e8d77210..589a0419 100644 --- a/minerva-core/src/test/resources/validation/should_pass/Test027-has_input_2_MolecularEntity.ttl +++ b/minerva-core/src/test/resources/validation/should_pass/Test027-has_input_2_MolecularEntity.ttl @@ -323,7 +323,7 @@ ### http://model.geneontology.org/5d27d1cf00000607/5d27d1cf00000626 rdf:type owl:NamedIndividual , - ; + ; "http://orcid.org/0000-0003-1813-6857"^^xsd:string ; "2019-07-12"^^xsd:string ; "http://geneontology.org"^^xsd:string . diff --git a/minerva-server/src/test/resources/models/should_pass/Test027-has_input_2_MolecularEntity.ttl b/minerva-server/src/test/resources/models/should_pass/Test027-has_input_2_MolecularEntity.ttl index 00de798a..171fa5eb 100644 --- a/minerva-server/src/test/resources/models/should_pass/Test027-has_input_2_MolecularEntity.ttl +++ b/minerva-server/src/test/resources/models/should_pass/Test027-has_input_2_MolecularEntity.ttl @@ -157,8 +157,8 @@ owl:versionInfo rdf:type owl:AnnotationProperty . rdf:type owl:Class . -### http://purl.obolibrary.org/obo/CHEBI_60579 - rdf:type owl:Class . +### http://purl.obolibrary.org/obo/CHEBI_30623 + rdf:type owl:Class . ### http://purl.obolibrary.org/obo/ECO_0000314 @@ -467,7 +467,7 @@ owl:versionInfo rdf:type owl:AnnotationProperty . ### http://model.geneontology.org/5d27d1cf00000607/5d27d1cf00000626 rdf:type owl:NamedIndividual , - ; + ; "http://orcid.org/0000-0003-1813-6857"^^xsd:string ; "2019-07-12"^^xsd:string ; "http://geneontology.org"^^xsd:string .