using HERMIT

classic Classic list List threaded Threaded
3 messages Options
ivo
Reply | Threaded
Open this post in threaded view
|

using HERMIT

ivo
Hi OWLREADY creator,

Thanks for your job.

I am using your test_reasoning.owl from your repository to test HERMiT.
I used it locally with the name testReasoning.owl

You have 2 properties: has_topping and topping_of (inverse of has_topping).

When I used a query with HAS_TOPPING, the results are ok,
but the query with TOPPING_OF, no results.

I am not a good python user and the code is below.
Thanks a lot.

____
from owlready2 import *

Ob3 = World()
onto_path.append("c://TESTE")
Ob3.get_ontology("file://C:/TESTE/testReasoning.owl").load()
sync_reasoner(Ob3)

graph          = Ob3.as_rdflib_graph()

query = "PREFIX owl: <http://www.w3.org/2002/07/owl#> " \
                "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "\
                "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " \
                "PREFIX : <http://www.semanticweb.org/jiba/ontologies/2017/2/test_reasoning.owl#>" \
                "SELECT ?s ?o " \
                "WHERE { " \
                "?s :topping_of ?o  ." \
                "}"

resultsList = graph.query(query)
print("\nResults:\n")

for row in resultsList.bindings:
    for col in row:
        print( "?" + col + ":   ", row[ col ] )
    print( "" )
Reply | Threaded
Open this post in threaded view
|

Re: using HERMIT

Jiba
Administrator
Hi,

I think SPARQL does not perform any inference, including on inverse properties (inverse properties are OWL while SPARQL works at the RDF level).

Best regards,
Jiba
ivo
Reply | Threaded
Open this post in threaded view
|

Re: using HERMIT

ivo
Hi,

Thanks Jiba for your answer.

Hugs,
ivo