My final goal is to get the least common ancestor of a class from an owl file ( for example if i choose AP and TP the result should be base ) base-----=AP |----TP
Iam trying to subclass of a class but no result !
for information i tried this and it doent work for me : How to get Least common subsumer in ontology using SPARQL Query?
I need help please
python file :
from owlready2 import *
onto = get_ontology("file://ess.owl").load()
owlready2.JAVA_EXE = "C:\\Program Files (x86)\\Java\jre1.8.0_311\\bin"
print(list(default_world.sparql("""
SELECT (?x AS ?nb)
{ ?x a owl:Class . }
""")))
print(list(default_world.sparql("""
SELECT ?y
{ "Star" rdfs:subClassOf ?y }
"""))) ```