Skip to content

Commit

Permalink
Fix DifferentFrom SWRL builtin
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Baptiste "Jiba" Lamy authored and Jean-Baptiste "Jiba" Lamy committed Sep 12, 2019
1 parent fc4a539 commit 592d650
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ version 2 - 0.21
- Fix data loss in Restriction modification
- Fix 'no query solution' error in search()
- Fix literal support in RDF lists, causing "TypeError: '<' not supported between instances of 'NoneType' and 'int'" when saving ontologies
- Fix DifferentFrom SWRL builtin

Links
-----
Expand Down
2 changes: 1 addition & 1 deletion base.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def set_datatype_iri(datatype, iri):
swrl_argument2 = _universal_abbrev("http://www.w3.org/2003/11/swrl#argument2")
swrl_arguments = _universal_abbrev("http://www.w3.org/2003/11/swrl#arguments")
swrl_equivalentindividual = _universal_abbrev("http://www.w3.org/2003/11/swrl#SameIndividualAtom")
swrl_differentfrom = _universal_abbrev("http://www.w3.org/2003/11/swrl#DifferentIndividualAtom")
swrl_differentfrom = _universal_abbrev("http://www.w3.org/2003/11/swrl#DifferentIndividualsAtom")

owl_bottomobjectproperty = _universal_abbrev("http://www.w3.org/2002/07/owl#bottomObjectProperty")
owl_bottomdataproperty = _universal_abbrev("http://www.w3.org/2002/07/owl#bottomDataProperty")
Expand Down
4 changes: 2 additions & 2 deletions rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def set_as_rule(self, rule, namespaces = None):
atom = atom.value
if atom in _BUILTINS: atom = BuiltinAtom(builtin = atom)
elif atom == "SameAs": atom = SameIndividualAtom()
elif atom == "DifferentFrom": atom = DifferentIndividualAtom()
elif atom == "DifferentFrom": atom = DifferentIndividualsAtom()
elif atom in _NAME_2_DATARANGE: atom = DataRangeAtom(datarange = _NAME_2_DATARANGE[atom])
else:
entity = _find_entity(atom, namespaces)
Expand Down Expand Up @@ -231,7 +231,7 @@ class SameIndividualAtom(_FixedArguments, Thing):
def __str__(self):
return "SameAs(%s)" % (", ".join(str(i) for i in self.arguments))

class DifferentIndividualAtom(_FixedArguments, Thing):
class DifferentIndividualsAtom(_FixedArguments, Thing):
namespace = swrl

def __str__(self):
Expand Down
2 changes: 1 addition & 1 deletion triplelite.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def _base_62_2_int(storid):
(owlready2.base.swrl_argument2, "http://www.w3.org/2003/11/swrl#argument2"),
(owlready2.base.swrl_arguments, "http://www.w3.org/2003/11/swrl#arguments"),
(owlready2.base.swrl_equivalentindividual, "http://www.w3.org/2003/11/swrl#SameIndividualAtom"),
(owlready2.base.swrl_differentfrom, "http://www.w3.org/2003/11/swrl#DifferentIndividualAtom"),
(owlready2.base.swrl_differentfrom, "http://www.w3.org/2003/11/swrl#DifferentIndividualsAtom"),
])
self.execute("""UPDATE store SET version=8""")
self.db.commit()
Expand Down

0 comments on commit 592d650

Please sign in to comment.