Search properties only

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

Search properties only

Neha
Hello,
I have been trying to use the function onto.search(property="*Topping") but I keep getting an empty list. I would be grateful if someone could point out my mistake. Am i doing something wrong?
Reply | Threaded
Open this post in threaded view
|

Re: Search properties only

Jiba
Administrator
Hi,

"property" is not a valid keyword / attribute for search.
You can search for properties whose name ends with "Topping" as follows:

onto.search(iri="*Topping", type = ObjectProperty)

You can also use DataProperty if needed.

If you want both object and data properties, you can do:
 
onto.search(iri="*topping", type = ObjectProperty) | onto.search(iri="*topping", type = DataProperty)

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Search properties only

Neha
Hello,
Thank you so much, it worked! I am actually very new to owlready2 and ontologies in general. I have to evaluate some ontology pruning methods and I am actually investigating weight-based pruning, that is, adding weights to relationships and prune (the relationship plus the node) according to a threshold. Still trying to implement the algorithm :(