I am new in the ontology field, and I don’t know if my question is easy or not. I am a Ph.D. student in Transportation Planning, using an ontology (HBOnto - https://github.com/dzolzaya/HRBModel/blob/master/HBOnto.owl) to deal with a critical task in my thesis.
I have been studying the book ontologies-with-python-programming-owl-20-ontologies-with-python-and-owlready2 and testing some examples. Unfortunately, I have not been able to perform queries using rdflib.
I did exactly how it is in the book, but can not get the result, I am always receiving a empty list as a result. When i’ve test with the book’s ontology (bacteria) works weel, but with HBOnto doesnt work.
I’ve put below some code parts in pictures.
I do really apreciate some help.
I tested your ontology. First, it appears that http://localhost/HRBModel/HBOnto.owl#time is both declared as a DataProperty and a Class. This is not supported by Owlready, and is not clearly defined in OWL. I removed the DataProperty definition, as it is not used in the ontology.
Then, it appears that there is no instances of the "working" class. This explains why the SPARQL query returns an empty list.
You may want to search for subclasses of "working", as follows: