I'm using SPARQL in Owlready2 and I've got unexpected results. The result I've got from my query is different from the built-in function in Owlready2. Below is my code in Google Colab:
- - - - - - - - - - - - - - -
!git clone https://bitbucket.org/jibalamy/owlready2/src/master/ owlready2
from owlready2 import *
onto = get_ontology("id.rdf")
domain = [Individuals]
range = [Individuals]
- Results from the query above: [['Individual 3']]
- Expected results: [['Individual 1'], ['Individual 3']]
- Comment 1: I have tried list(indi2.relationship2) and also list(onto.Individual2.relationship2). They gave me exactly what I expected: [id.Individual1, id.Individual3].
- Comment 2: I have tried my query in Protege and got my expected results too.
- Comment 3: Additionally, I used sync_reasoner(infer_property_values = True) but it seems useless.
So I don't really know why my query didn't work in Colab. Any comments are welcome.