def test_assertion_model(self): """ Functional test for _add_study_provenance() """ impc = IMPC('rdf_graph', True) impc.graph = RDFGraph(True) self.assertTrue(len(list(impc.graph)) == 0) impc._add_assertion_provenance(self.assoc_curie, self.evidence_curie) triples = """ MONARCH:test_association SEPIO:0000015 <https://monarchinitiative.org/.well-known/genid/bf92df374a884963e805> . <https://monarchinitiative.org/.well-known/genid/bf92df374a884963e805> a SEPIO:0000001 ; SEPIO:0000018 <https://www.mousephenotype.org/> ; SEPIO:0000111 <https://monarchinitiative.org/.well-known/genid/evidence> . <https://www.mousephenotype.org/> a foaf:organization ; rdfs:label "International Mouse Phenotyping Consortium" . """ # dbg LOG.info( "Assertion graph:\n %s\n", impc.graph.serialize( format="turtle").decode("utf-8") ) self.assertTrue(self.test_util.test_graph_equality(triples, impc.graph))
def test_assertion_model(self): """ Functional test for _add_study_provenance() """ impc = IMPC('rdf_graph', True) impc_map = impc.open_and_parse_yaml(impc.map_files['impc_map']) impc._add_assertion_provenance(self.assoc_curie, self.evidence_curie, impc_map) sparql_query = """ SELECT * WHERE { MONARCH:test_association OBO:SEPIO_0000015 ?assertion. ?assertion a OBO:SEPIO_0000001 ; OBO:SEPIO_0000018 <http://www.mousephenotype.org/> ; OBO:SEPIO_0000111 <https://monarchinitiative.org/.well-known/genid/evidence> . <http://www.mousephenotype.org/> a foaf:organization ; rdfs:label "International Mouse Phenotyping Consortium" . } """ sparql_output = impc.graph.query(sparql_query) # Test that query passes and returns one row self.assertEqual(len(list(sparql_output)), 1)
def test_assertion_model(self): """ Functional test for _add_study_provenance() """ impc = IMPC('rdf_graph', True) impc.graph = RDFGraph(True) self.assertTrue(len(list(impc.graph)) == 0) impc_map = impc.open_and_parse_yaml(impc.map_files['impc_map']) impc._add_assertion_provenance( self.assoc_curie, self.evidence_curie, impc_map) triples = """ MONARCH:test_association SEPIO:0000015 <https://monarchinitiative.org/.well-known/genid/bcb2c00a5c2f9c43> . <https://monarchinitiative.org/.well-known/genid/bcb2c00a5c2f9c43> a SEPIO:0000001 ; SEPIO:0000018 <http://www.mousephenotype.org/> ; SEPIO:0000111 <https://monarchinitiative.org/.well-known/genid/evidence> . <http://www.mousephenotype.org/> a foaf:organization ; rdfs:label "International Mouse Phenotyping Consortium" . """ # dbg logger.debug("Reference graph: %s", impc.graph.serialize(format="turtle") .decode("utf-8") ) self.assertTrue(self.test_util.test_graph_equality( triples, impc.graph))
def test_assertion_model(self): """ Functional test for _add_study_provenance() """ impc = IMPC('rdf_graph', True) impc.graph = RDFGraph(True) self.assertTrue(len(list(impc.graph)) == 0) impc._add_assertion_provenance(self.assoc_curie, self.evidence_curie) triples = """ MONARCH:test_association SEPIO:0000015 <https://monarchinitiative.org/.well-known/genid/bf92df374a884963e805> . <https://monarchinitiative.org/.well-known/genid/bf92df374a884963e805> a SEPIO:0000001 ; SEPIO:0000018 <https://www.mousephenotype.org/> ; SEPIO:0000111 <https://monarchinitiative.org/.well-known/genid/evidence> . <https://www.mousephenotype.org/> a foaf:organization ; rdfs:label "International Mouse Phenotyping Consortium" . """ # dbg logger.info( "Assertion graph:\n %s\n", impc.graph.serialize( format="turtle").decode("utf-8") ) self.assertTrue(self.test_util.test_graph_equality(triples, impc.graph))