From 9ce1d0c63acc69ad0b0e73f9730d1e633d838361 Mon Sep 17 00:00:00 2001 From: "Francesca L. Bleken" <48128015+francescalb@users.noreply.github.com> Date: Thu, 13 Jan 2022 21:31:24 +0100 Subject: [PATCH] Changed arguments in _has_obj_triples_spo (#351) * Changed arguments in _has_obj_triple_spo pylint complains as it checks in the definition defined in owlready2.namespace.Namespace (which takes subject and predicate as arguments). The function that is actually used is defined in owlready2.triplelite. --- ontopy/ontology.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ontopy/ontology.py b/ontopy/ontology.py index 8fc6db5f8..f08a5418d 100644 --- a/ontopy/ontology.py +++ b/ontopy/ontology.py @@ -44,6 +44,7 @@ LabelDefinitionError, ThingClassDefinitionError, ) + from ontopy.ontograph import OntoGraph # FIXME: deprecate... @@ -1135,8 +1136,16 @@ def set_version(self, version=None, version_iri=None): """ _version_iri = "http://www.w3.org/2002/07/owl#versionIRI" version_iri_storid = self.world._abbreviate(_version_iri) - if self._has_obj_triple_spo( - subject=self.storid, predicate=version_iri_storid + if self._has_obj_triple_spo( # pylint: disable=unexpected-keyword-arg + # For some reason _has_obj_triples_spo exists in both + # owlready2.namespace.Namespace (with arguments subject/predicate) + # and in owlready2.triplelite._GraphManager (with arguments s/p) + # owlready2.Ontology inherits from Namespace directly + # and pylint checks that. + # It actually accesses the one in triplelite. + # subject=self.storid, predicate=version_iri_storid + s=self.storid, + p=version_iri_storid, ): self._del_obj_triple_spo(s=self.storid, p=version_iri_storid)