From 5a79b1580a939016b2d662562b495a6c82ec8b0c Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Tue, 14 Nov 2023 17:06:42 -0600 Subject: [PATCH 01/12] Adde `entities_metadata_statements` to SQLImplementation --- .../sqldb/sql_implementation.py | 24 +++++++++++++++++++ tests/test_implementations/test_sqldb.py | 10 ++++++++ 2 files changed, 34 insertions(+) diff --git a/src/oaklib/implementations/sqldb/sql_implementation.py b/src/oaklib/implementations/sqldb/sql_implementation.py index a3655c972..042979742 100644 --- a/src/oaklib/implementations/sqldb/sql_implementation.py +++ b/src/oaklib/implementations/sqldb/sql_implementation.py @@ -127,6 +127,7 @@ DEFINITION, LANGUAGE_TAG, METADATA_MAP, + METADATA_STATEMENT, PRED_CURIE, PREFIX_MAP, RELATIONSHIP, @@ -671,6 +672,29 @@ def entity_metadata_map(self, curie: CURIE, include_all_triples=False) -> METADA self.add_missing_property_values(curie, m) return dict(m) + def entities_metadata_statements( + self, curies: Iterable[CURIE], predicates: Optional[List[PRED_CURIE]] = None + ) -> Iterator[METADATA_STATEMENT]: + q = self.session.query(Statements) + # if not include_all_triples: + # subquery = self.session.query(RdfTypeStatement.subject).filter( + # RdfTypeStatement.object == "owl:AnnotationProperty" + # ) + # annotation_properties = {row.subject for row in subquery} + # annotation_properties = annotation_properties.union(STANDARD_ANNOTATION_PROPERTIES) + # q = q.filter(Statements.predicate.in_(tuple(annotation_properties))) + q = q.filter(Statements.subject.in_(curies)) + if predicates is not None: + q = q.filter(Statements.predicate.in_(predicates)) + for row in q: + if row.value is not None: + v = _python_value(row.value, row.datatype) + elif row.object is not None: + v = row.object + else: + v = None + yield row.subject, row.predicate, v, row.datatype, {} + def ontologies(self) -> Iterable[CURIE]: for row in self.session.query(OntologyNode): yield row.id diff --git a/tests/test_implementations/test_sqldb.py b/tests/test_implementations/test_sqldb.py index e56116c47..214e78f6c 100644 --- a/tests/test_implementations/test_sqldb.py +++ b/tests/test_implementations/test_sqldb.py @@ -19,6 +19,7 @@ HAS_PART, IS_A, LABEL_PREDICATE, + OIO_CREATION_DATE, PART_OF, RDF_TYPE, ) @@ -39,6 +40,7 @@ HUMAN, IMBO, INPUT_DIR, + MEMBRANE, NUCLEAR_ENVELOPE, NUCLEUS, OUTPUT_DIR, @@ -899,3 +901,11 @@ def test_transitive_object_properties(self): def test_simple_subproperty_of_chains(self): self.compliance_tester.test_simple_subproperty_of_chains(self.oi) + + def test_entities_metadata_statements(self): + curies = [MEMBRANE] + predicates = [OIO_CREATION_DATE] + oi = self.oi + result = list(oi.entities_metadata_statements(curies=curies, predicates=predicates)) + self.assertEqual(len(result), 1) + self.assertEqual(len(result[0]), 5) From 9c6a0cd10cdef2b9fd2b94b4cf7af1180d7eb852 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Wed, 15 Nov 2023 16:29:21 -0600 Subject: [PATCH 02/12] Moved test to core compliance tests --- tests/test_implementations/__init__.py | 9 +++++++++ tests/test_implementations/test_sqldb.py | 9 +-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/test_implementations/__init__.py b/tests/test_implementations/__init__.py index 7362e8e18..912bba71c 100644 --- a/tests/test_implementations/__init__.py +++ b/tests/test_implementations/__init__.py @@ -112,6 +112,7 @@ INTRACELLULAR, INTRACELLULAR_ORGANELLE, MAMMALIA, + MEMBRANE, NUCLEAR_ENVELOPE, NUCLEAR_MEMBRANE, NUCLEUS, @@ -1880,3 +1881,11 @@ def test_annotate_text(self, oi: TextAnnotatorInterface): test.assertEqual(object_label, ann.object_label) test.assertEqual(subject_start, ann.subject_start) test.assertEqual(subject_end, ann.subject_end) + + def test_entities_metadata_statements(self): + curies = [MEMBRANE] + predicates = [OIO_CREATION_DATE] + oi = self.oi + result = list(oi.entities_metadata_statements(curies=curies, predicates=predicates)) + self.assertEqual(len(result), 1) + self.assertEqual(len(result[0]), 5) diff --git a/tests/test_implementations/test_sqldb.py b/tests/test_implementations/test_sqldb.py index 214e78f6c..42feb32a9 100644 --- a/tests/test_implementations/test_sqldb.py +++ b/tests/test_implementations/test_sqldb.py @@ -19,7 +19,6 @@ HAS_PART, IS_A, LABEL_PREDICATE, - OIO_CREATION_DATE, PART_OF, RDF_TYPE, ) @@ -40,7 +39,6 @@ HUMAN, IMBO, INPUT_DIR, - MEMBRANE, NUCLEAR_ENVELOPE, NUCLEUS, OUTPUT_DIR, @@ -903,9 +901,4 @@ def test_simple_subproperty_of_chains(self): self.compliance_tester.test_simple_subproperty_of_chains(self.oi) def test_entities_metadata_statements(self): - curies = [MEMBRANE] - predicates = [OIO_CREATION_DATE] - oi = self.oi - result = list(oi.entities_metadata_statements(curies=curies, predicates=predicates)) - self.assertEqual(len(result), 1) - self.assertEqual(len(result[0]), 5) + self.compliance_tester.test_entities_metadata_statements(self.oi) From dd85d625b5d1b3a4c549754d6b0cf2b06ffc67b3 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Wed, 15 Nov 2023 16:29:45 -0600 Subject: [PATCH 03/12] included axiom annotations (optional) --- .../sqldb/sql_implementation.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/oaklib/implementations/sqldb/sql_implementation.py b/src/oaklib/implementations/sqldb/sql_implementation.py index 042979742..a027b9dfd 100644 --- a/src/oaklib/implementations/sqldb/sql_implementation.py +++ b/src/oaklib/implementations/sqldb/sql_implementation.py @@ -673,16 +673,19 @@ def entity_metadata_map(self, curie: CURIE, include_all_triples=False) -> METADA return dict(m) def entities_metadata_statements( - self, curies: Iterable[CURIE], predicates: Optional[List[PRED_CURIE]] = None + self, + curies: Iterable[CURIE], + predicates: Optional[List[PRED_CURIE]] = None, + include_all_triples=False, ) -> Iterator[METADATA_STATEMENT]: q = self.session.query(Statements) - # if not include_all_triples: - # subquery = self.session.query(RdfTypeStatement.subject).filter( - # RdfTypeStatement.object == "owl:AnnotationProperty" - # ) - # annotation_properties = {row.subject for row in subquery} - # annotation_properties = annotation_properties.union(STANDARD_ANNOTATION_PROPERTIES) - # q = q.filter(Statements.predicate.in_(tuple(annotation_properties))) + if not include_all_triples: + subquery = self.session.query(RdfTypeStatement.subject).filter( + RdfTypeStatement.object == "owl:AnnotationProperty" + ) + annotation_properties = {row.subject for row in subquery} + annotation_properties = annotation_properties.union(STANDARD_ANNOTATION_PROPERTIES) + q = q.filter(Statements.predicate.in_(tuple(annotation_properties))) q = q.filter(Statements.subject.in_(curies)) if predicates is not None: q = q.filter(Statements.predicate.in_(predicates)) From ec352f23ce8ee5382f5a8d93a9bce2b8c9413e27 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Wed, 15 Nov 2023 16:48:09 -0600 Subject: [PATCH 04/12] refactored to follow format --- tests/test_implementations/__init__.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/test_implementations/__init__.py b/tests/test_implementations/__init__.py index 912bba71c..344577018 100644 --- a/tests/test_implementations/__init__.py +++ b/tests/test_implementations/__init__.py @@ -1882,10 +1882,14 @@ def test_annotate_text(self, oi: TextAnnotatorInterface): test.assertEqual(subject_start, ann.subject_start) test.assertEqual(subject_end, ann.subject_end) - def test_entities_metadata_statements(self): - curies = [MEMBRANE] - predicates = [OIO_CREATION_DATE] - oi = self.oi - result = list(oi.entities_metadata_statements(curies=curies, predicates=predicates)) - self.assertEqual(len(result), 1) - self.assertEqual(len(result[0]), 5) + def test_entities_metadata_statements(self, oi:BasicOntologyInterface): + test = self.test + + cases = [ + ([MEMBRANE], [OIO_CREATION_DATE]) + ] + for case in cases: + curies,predicates = case + result = list(oi.entities_metadata_statements(curies=curies, predicates=predicates)) + test.assertEqual(len(result), 1) + test.assertEqual(len(result[0]), 5) From ba367fa34b995390caf14edc720d27e8f6513ff6 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Wed, 15 Nov 2023 16:50:08 -0600 Subject: [PATCH 05/12] formattted --- tests/test_implementations/__init__.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/test_implementations/__init__.py b/tests/test_implementations/__init__.py index 344577018..8b173923a 100644 --- a/tests/test_implementations/__init__.py +++ b/tests/test_implementations/__init__.py @@ -1882,14 +1882,12 @@ def test_annotate_text(self, oi: TextAnnotatorInterface): test.assertEqual(subject_start, ann.subject_start) test.assertEqual(subject_end, ann.subject_end) - def test_entities_metadata_statements(self, oi:BasicOntologyInterface): + def test_entities_metadata_statements(self, oi: BasicOntologyInterface): test = self.test - cases = [ - ([MEMBRANE], [OIO_CREATION_DATE]) - ] + cases = [([MEMBRANE], [OIO_CREATION_DATE])] for case in cases: - curies,predicates = case + curies, predicates = case result = list(oi.entities_metadata_statements(curies=curies, predicates=predicates)) test.assertEqual(len(result), 1) test.assertEqual(len(result[0]), 5) From 41df720e10e468483051db04107a201a62d8ccc4 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Wed, 15 Nov 2023 17:00:50 -0600 Subject: [PATCH 06/12] added expected results --- tests/test_implementations/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_implementations/__init__.py b/tests/test_implementations/__init__.py index 8b173923a..106279fc8 100644 --- a/tests/test_implementations/__init__.py +++ b/tests/test_implementations/__init__.py @@ -1885,9 +1885,11 @@ def test_annotate_text(self, oi: TextAnnotatorInterface): def test_entities_metadata_statements(self, oi: BasicOntologyInterface): test = self.test - cases = [([MEMBRANE], [OIO_CREATION_DATE])] + cases = [([MEMBRANE], [OIO_CREATION_DATE], [('GO:0016020', 'oio:creation_date', '2014-03-06T11:37:54Z', 'xsd:string', {})])] for case in cases: - curies, predicates = case + curies, predicates, expected_result = case result = list(oi.entities_metadata_statements(curies=curies, predicates=predicates)) - test.assertEqual(len(result), 1) - test.assertEqual(len(result[0]), 5) + test.assertEqual(len(result), len(expected_result)) + test.assertEqual(len(result[0]), len(expected_result[0])) + test.assertEqual(result[0], expected_result[0]) + From 777c1e8a354c984c9c694c026fbe03b9728cea86 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Wed, 15 Nov 2023 17:01:08 -0600 Subject: [PATCH 07/12] formatted --- tests/test_implementations/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_implementations/__init__.py b/tests/test_implementations/__init__.py index 106279fc8..d4c8575b3 100644 --- a/tests/test_implementations/__init__.py +++ b/tests/test_implementations/__init__.py @@ -1885,11 +1885,16 @@ def test_annotate_text(self, oi: TextAnnotatorInterface): def test_entities_metadata_statements(self, oi: BasicOntologyInterface): test = self.test - cases = [([MEMBRANE], [OIO_CREATION_DATE], [('GO:0016020', 'oio:creation_date', '2014-03-06T11:37:54Z', 'xsd:string', {})])] + cases = [ + ( + [MEMBRANE], + [OIO_CREATION_DATE], + [("GO:0016020", "oio:creation_date", "2014-03-06T11:37:54Z", "xsd:string", {})], + ) + ] for case in cases: curies, predicates, expected_result = case result = list(oi.entities_metadata_statements(curies=curies, predicates=predicates)) test.assertEqual(len(result), len(expected_result)) test.assertEqual(len(result[0]), len(expected_result[0])) test.assertEqual(result[0], expected_result[0]) - From 07748dacc668af1d7e734d41ce197ef03a53ea5a Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Wed, 15 Nov 2023 17:58:24 -0600 Subject: [PATCH 08/12] added more cases --- tests/test_implementations/__init__.py | 118 +++++++++++++++++++++++-- 1 file changed, 113 insertions(+), 5 deletions(-) diff --git a/tests/test_implementations/__init__.py b/tests/test_implementations/__init__.py index d4c8575b3..236260fcf 100644 --- a/tests/test_implementations/__init__.py +++ b/tests/test_implementations/__init__.py @@ -1890,11 +1890,119 @@ def test_entities_metadata_statements(self, oi: BasicOntologyInterface): [MEMBRANE], [OIO_CREATION_DATE], [("GO:0016020", "oio:creation_date", "2014-03-06T11:37:54Z", "xsd:string", {})], - ) + ), + ( + [MEMBRANE], + None, + [ + ( + "GO:0016020", + "IAO:0000115", + "A lipid bilayer along with all the proteins and protein complexes embedded in it an attached to it.", + "xsd:string", + {}, + ), + ("GO:0016020", "oio:creation_date", "2014-03-06T11:37:54Z", "xsd:string", {}), + ("GO:0016020", "oio:hasAlternativeId", "GO:0098589", "xsd:string", {}), + ("GO:0016020", "oio:hasAlternativeId", "GO:0098805", "xsd:string", {}), + ( + "GO:0016020", + "oio:hasDbXref", + "Wikipedia:Biological_membrane", + "xsd:string", + {}, + ), + ("GO:0016020", "oio:hasNarrowSynonym", "membrane region", "xsd:string", {}), + ("GO:0016020", "oio:hasNarrowSynonym", "region of membrane", "xsd:string", {}), + ("GO:0016020", "oio:hasNarrowSynonym", "whole membrane", "xsd:string", {}), + ("GO:0016020", "oio:hasOBONamespace", "cellular_component", "xsd:string", {}), + ("GO:0016020", "oio:id", "GO:0016020", "xsd:string", {}), + ("GO:0016020", "oio:inSubset", "obo:go#goslim_yeast", None, {}), + ("GO:0016020", "oio:inSubset", "obo:go#goslim_plant", None, {}), + ("GO:0016020", "oio:inSubset", "obo:go#goslim_pir", None, {}), + ("GO:0016020", "oio:inSubset", "obo:go#goslim_metagenomics", None, {}), + ("GO:0016020", "oio:inSubset", "obo:go#goslim_flybase_ribbon", None, {}), + ("GO:0016020", "oio:inSubset", "obo:go#goslim_chembl", None, {}), + ("GO:0016020", "oio:inSubset", "obo:go#goslim_candida", None, {}), + ("GO:0016020", "oio:inSubset", "obo:go#goslim_aspergillus", None, {}), + ("GO:0016020", "rdfs:label", "membrane", "xsd:string", {}), + ], + ), + ( + [MEMBRANE], + ["oio:inSubset"], + [ + ("GO:0016020", "oio:inSubset", "obo:go#goslim_yeast", None, {}), + ("GO:0016020", "oio:inSubset", "obo:go#goslim_plant", None, {}), + ("GO:0016020", "oio:inSubset", "obo:go#goslim_pir", None, {}), + ("GO:0016020", "oio:inSubset", "obo:go#goslim_metagenomics", None, {}), + ("GO:0016020", "oio:inSubset", "obo:go#goslim_flybase_ribbon", None, {}), + ("GO:0016020", "oio:inSubset", "obo:go#goslim_chembl", None, {}), + ("GO:0016020", "oio:inSubset", "obo:go#goslim_candida", None, {}), + ("GO:0016020", "oio:inSubset", "obo:go#goslim_aspergillus", None, {}), + ], + ), + ( + [NUCLEUS], + None, + [ + ( + "GO:0005634", + "IAO:0000115", + "A membrane-bounded organelle of eukaryotic cells in which chromosomes are housed and replicated. In most cells, the nucleus contains all of the cell's chromosomes except the organellar chromosomes, and is the site of RNA synthesis and processing. In some species, or in specialized cell types, RNA metabolism or DNA replication may be absent.", + "xsd:string", + {}, + ), + ( + "GO:0005634", + "oio:hasDbXref", + "NIF_Subcellular:sao1702920020", + "xsd:string", + {}, + ), + ("GO:0005634", "oio:hasDbXref", "Wikipedia:Cell_nucleus", "xsd:string", {}), + ("GO:0005634", "oio:hasExactSynonym", "cell nucleus", "xsd:string", {}), + ("GO:0005634", "oio:hasNarrowSynonym", "horsetail nucleus", "xsd:string", {}), + ("GO:0005634", "oio:hasOBONamespace", "cellular_component", "xsd:string", {}), + ("GO:0005634", "oio:id", "GO:0005634", "xsd:string", {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_yeast", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_plant", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_pir", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_mouse", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_metagenomics", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_generic", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_flybase_ribbon", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_drosophila", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_chembl", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_candida", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_aspergillus", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_agr", None, {}), + ("GO:0005634", "rdfs:label", "nucleus", "xsd:string", {}), + ], + ), + ( + [NUCLEUS], + ["oio:inSubset"], + [ + ("GO:0005634", "oio:inSubset", "obo:go#goslim_yeast", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_plant", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_pir", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_mouse", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_metagenomics", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_generic", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_flybase_ribbon", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_drosophila", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_chembl", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_candida", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_aspergillus", None, {}), + ("GO:0005634", "oio:inSubset", "obo:go#goslim_agr", None, {}), + ], + ), ] for case in cases: curies, predicates, expected_result = case - result = list(oi.entities_metadata_statements(curies=curies, predicates=predicates)) - test.assertEqual(len(result), len(expected_result)) - test.assertEqual(len(result[0]), len(expected_result[0])) - test.assertEqual(result[0], expected_result[0]) + results = list(oi.entities_metadata_statements(curies=curies, predicates=predicates)) + test.assertCountEqual(results, expected_result) + test.assertCountEqual(results[0], expected_result[0]) + for idx, result in enumerate(results): + test.assertEqual(result, expected_result[idx]) From 0df542bb1fa699bbab4f96d98576a25430cb11e6 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Wed, 15 Nov 2023 18:08:03 -0600 Subject: [PATCH 09/12] formatted --- tests/test_implementations/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_implementations/__init__.py b/tests/test_implementations/__init__.py index 236260fcf..269eb093f 100644 --- a/tests/test_implementations/__init__.py +++ b/tests/test_implementations/__init__.py @@ -1898,7 +1898,7 @@ def test_entities_metadata_statements(self, oi: BasicOntologyInterface): ( "GO:0016020", "IAO:0000115", - "A lipid bilayer along with all the proteins and protein complexes embedded in it an attached to it.", + "A lipid bilayer along with all the proteins and protein complexes embedded in it an attached to it.", # noqa:E501 "xsd:string", {}, ), @@ -1949,7 +1949,7 @@ def test_entities_metadata_statements(self, oi: BasicOntologyInterface): ( "GO:0005634", "IAO:0000115", - "A membrane-bounded organelle of eukaryotic cells in which chromosomes are housed and replicated. In most cells, the nucleus contains all of the cell's chromosomes except the organellar chromosomes, and is the site of RNA synthesis and processing. In some species, or in specialized cell types, RNA metabolism or DNA replication may be absent.", + "A membrane-bounded organelle of eukaryotic cells in which chromosomes are housed and replicated. In most cells, the nucleus contains all of the cell's chromosomes except the organellar chromosomes, and is the site of RNA synthesis and processing. In some species, or in specialized cell types, RNA metabolism or DNA replication may be absent.", # noqa:E501 "xsd:string", {}, ), From 2925ddbd5f11259043b7453d4577476595c3f17d Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Wed, 15 Nov 2023 21:19:49 -0600 Subject: [PATCH 10/12] refactor include_all_triples to include_nested_metadata --- src/oaklib/implementations/sqldb/sql_implementation.py | 4 ++-- src/oaklib/interfaces/basic_ontology_interface.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/oaklib/implementations/sqldb/sql_implementation.py b/src/oaklib/implementations/sqldb/sql_implementation.py index a027b9dfd..698e038a9 100644 --- a/src/oaklib/implementations/sqldb/sql_implementation.py +++ b/src/oaklib/implementations/sqldb/sql_implementation.py @@ -676,10 +676,10 @@ def entities_metadata_statements( self, curies: Iterable[CURIE], predicates: Optional[List[PRED_CURIE]] = None, - include_all_triples=False, + include_nested_metadata=False, ) -> Iterator[METADATA_STATEMENT]: q = self.session.query(Statements) - if not include_all_triples: + if not include_nested_metadata: subquery = self.session.query(RdfTypeStatement.subject).filter( RdfTypeStatement.object == "owl:AnnotationProperty" ) diff --git a/src/oaklib/interfaces/basic_ontology_interface.py b/src/oaklib/interfaces/basic_ontology_interface.py index 2a11cfc28..4a2ca46cc 100644 --- a/src/oaklib/interfaces/basic_ontology_interface.py +++ b/src/oaklib/interfaces/basic_ontology_interface.py @@ -1419,7 +1419,10 @@ def entity_metadata_map(self, curie: CURIE) -> METADATA_MAP: raise NotImplementedError def entities_metadata_statements( - self, curies: Iterable[CURIE], predicates: Optional[List[PRED_CURIE]] = None + self, + curies: Iterable[CURIE], + predicates: Optional[List[PRED_CURIE]] = None, + include_nested_metadata=False, ) -> Iterator[METADATA_STATEMENT]: """ Retrieve metadata statements (entity annotations) for a collection of entities. From 7ac4f191a662004212e13119eb71b632d71898db Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Thu, 16 Nov 2023 14:59:38 -0600 Subject: [PATCH 11/12] added kwargs --- src/oaklib/implementations/sqldb/sql_implementation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/oaklib/implementations/sqldb/sql_implementation.py b/src/oaklib/implementations/sqldb/sql_implementation.py index 698e038a9..1838a2aa0 100644 --- a/src/oaklib/implementations/sqldb/sql_implementation.py +++ b/src/oaklib/implementations/sqldb/sql_implementation.py @@ -677,6 +677,7 @@ def entities_metadata_statements( curies: Iterable[CURIE], predicates: Optional[List[PRED_CURIE]] = None, include_nested_metadata=False, + **kwargs, ) -> Iterator[METADATA_STATEMENT]: q = self.session.query(Statements) if not include_nested_metadata: From 076fd41a664dc2b89079acbbfbbfffe8bc469d40 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Thu, 16 Nov 2023 15:16:09 -0600 Subject: [PATCH 12/12] Added **kwargs, --- src/oaklib/interfaces/basic_ontology_interface.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/oaklib/interfaces/basic_ontology_interface.py b/src/oaklib/interfaces/basic_ontology_interface.py index 4a2ca46cc..4e4322a1b 100644 --- a/src/oaklib/interfaces/basic_ontology_interface.py +++ b/src/oaklib/interfaces/basic_ontology_interface.py @@ -1423,6 +1423,7 @@ def entities_metadata_statements( curies: Iterable[CURIE], predicates: Optional[List[PRED_CURIE]] = None, include_nested_metadata=False, + **kwargs, ) -> Iterator[METADATA_STATEMENT]: """ Retrieve metadata statements (entity annotations) for a collection of entities.