Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] How to get property assertions

Thomas Russ tar at isi.edu
Tue Aug 31 09:11:39 PDT 2010


On Aug 31, 2010, at 3:58 AM, Ishan wrote:

>
> Hi all,
>
> I am using a local copy of unit.owl
> (http://www.qudt.org/qudt/owl/1.0.0/index.html) and I want retrieve  
> the
> symbol of individual "meter" of class "LengthUnit". When I opened  
> the owl
> file through protege I can see it listed down under the data property
> assertions of "meter".
> How can I retrieve this through a java application. I am using  
> protegeAPI.

You're really close.

Use RDFIndividual.getPropertyValue() or  
RDFIndividual.getPropertyValues() depending on whether it is  
functional or not.

>
> This is what I have tried up to now...
>
> RDFSNamedClass cls =
> owlModel.getRDFSNamedClass("http://data.nasa.gov/qudt/owl/qudt#LengthUnit 
> ");
>
>        Collection col3 = cls.getInstances(true);
>        System.out.println("INSTANCE COUNT : " + col3.size());
>        RDFProperty pr = owlModel.getRDFProperty("rdf:symbol");
>
>        for (Iterator it = col3.iterator(); it.hasNext();) {
>            RDFIndividual object = (RDFIndividual) it.next();
>            System.out.println("INS: " + object.getLocalName());
>        }
> -- 
> View this message in context: http://protege-ontology-editor-knowledge-acquisition-system.136.n4.nabble.com/How-to-get-property-assertions-tp2401364p2401364.html
> Sent from the Protege OWL mailing list archive at Nabble.com.
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03




More information about the protege-owl mailing list