Skip to content

Commit

Permalink
Changed arguments in _has_obj_triples_spo (#351)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
francescalb committed Jan 13, 2022
1 parent 6f6f0f6 commit 9ce1d0c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ontopy/ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
LabelDefinitionError,
ThingClassDefinitionError,
)

from ontopy.ontograph import OntoGraph # FIXME: deprecate...


Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 9ce1d0c

Please sign in to comment.