Querys

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

Querys

RodrigoB
Hi,

I am just starting to use the library and have some questions that may be simple.

I've been reading the documentation and I couldn't understand how I do a question like that:

Ps: I tested this query on protégé

LocatedAt some Bathroom and LeftOf some Chair

Through the examples I have seen I can extract the information for example of where a Chair_1 is located.

Whit the command:

print(onto.Chair_1.LocatedAt)

For example to get information about the relations of the different classes I don't need to use the command:

sync_reasoner() or sync_reasoner_pellet()

In what circumstances do I have to use it?

Thanks for help
Reply | Threaded
Open this post in threaded view
|

Re: Querys

Jiba
Administrator
Hi,

You need to call the reasoner (with sync_reasoner()) if you want to perform inferences on the ontology. It corresponds to the "Start reasoner" menu in Protégé.

Owlready exposes "some" restriction (such as the one in your example) as class properties, which facilitates their use. You can also access them as superclasses (in onto.Chair_1.is_a), as in Protégé, if needed.

Jiba