You could use the listReferences method from the OWLModel interface. A
sample code that returns all references to a property is below:
RDFProperty p = owlModel.getRDFProperty("hasTopping");
Iterator it = owlModel.listReferences(p, -1);
while (it.hasNext()) {
Tuple ref = (Tuple) it.next();
System.out.print("The subj and pred of reference: " + ref);
RDFResource subj = ref.getSubject();
if (subj instanceof OWLAnonymousClass) {
System.out.println("\tUsed in: " +
((OWLAnonymousClass)subj).getOwner());
}
}
Hope this helps.
Tania
M. jack wrote:
> Hello,
>
> I'd like to know if Protege gives the opportunity to find and say if a
> property is used or not in the ontology. Because, there are Properties that
> I want to remove, but I don't want consequently to remove restrictions
> applied on classes using the property. I mean that first I have to change
> the property with a more global property in all classes restrictions. And
> then remove the property. But if I have forgotten to change the property
> name in some classes restrictions, I'd like to know it before the
> restriction is removed.
> Thank you.
>
_______________________________________________
protege-owl mailing list
protege-owl@...
https://mailman.stanford.edu/mailman/listinfo/protege-owlInstructions for unsubscribing:
http://protege.stanford.edu/doc/faq.html#01a.03