Owlready
Search
everywhere
only in this topic
Advanced Search
Getting all SWRL rules of an ontology
Classic
List
Threaded
♦
♦
Locked
5 messages
Stefan
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Getting all SWRL rules of an ontology
Hi,
is there a simple way of retrieving all SWRL rules of an ontology?
Jiba
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: Getting all SWRL rules of an ontology
Administrator
Hi,
You can use ontology.rules(), which returns a generator.
Jiba
Stefan
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: Getting all SWRL rules of an ontology
Thanks. Is there also a way to get label/name/iri of a rule? The usual attributes all seem to hold empty strings, but I can find the rules using these when I use ontology.search().
Jiba
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: Getting all SWRL rules of an ontology
Administrator
Hi,
By default, rules are created as blank nodes, so they have no IRI or name.
If you want to create a named rule, pass its name to the constructor : Imp("rule_name").
Jiba
Stefan
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: Getting all SWRL rules of an ontology
Hi,
turns out the attribute I was looking for was "label", not "name". It works now, but maybe this should be documented somewhere.
Free forum by Nabble
Edit this page