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-discussion] a simple questions about owl programming

tingyu li li.hh190 at gmail.com
Wed Nov 17 07:20:13 PST 2010


hi Thomas, thanks for your response. but I still very confused by these
methods...and I have read all the samples posted on the website, but I don't
find any solutions for my problems, a very similar question is about query
all resources that have a certain property value. the code on website is
like this:

> RDFProperty subClassOfProperty = owlModel.getRDFProperty(RDFSNames.Slot.SUB_CLASS_OF);
> OWLNamedClass owlThingClass = owlModel.getOWLThingClass();
> Collection results = owlModel.getRDFResourcesWithPropertyValue(subClassOfProperty, owlThingClass);
> System.out.println("Subclasses of owl:Thing:");
> for (Iterator it = results.iterator(); it.hasNext();) {
>     RDFResource resource = (RDFResource) it.next();
>     System.out.println(" - " + resource.getBrowserText());
> }
>
> but, actually, there are no slot on the new version owl files. and I think
RDFProperty is not very fit for my file. by the way, I use protege 4.0 to
develop a owl file and save it as format: RDF/XML. the file  is like this:

    <owl:ObjectProperty rdf:about="
http://www.semanticweb.org/ontologies/2010/0/family.owl#isUncleOf">
        <rdfs:range rdf:resource="
http://www.semanticweb.org/ontologies/2010/0/family.owl#family_member"/>
        <rdfs:domain rdf:resource="
http://www.semanticweb.org/ontologies/2010/0/family.owl#male_family_member
"/>
    </owl:ObjectProperty>
I want get the similar result as the probem I described above. in other
words, if I click Jim as the picture, I can get the result as the rigt part
of the picture displayed, Usage and Property assertions:Jim

thanks.

2010/11/17 Thomas Russ <tar at isi.edu>

>
> On Nov 16, 2010, at 7:07 AM, tingyu li wrote:
>
>  Hello everyone,
>>
>> I have a simple question about owl programming, and if a instance was
>> specified in my code, and how I get its data properity assertions? and even
>> I can get its class name and superclass or subclass? I can't find a relevant
>> function to do that.
>> right now, I just can use: owlModel.getOWLNamedClass("class name") to
>> specify a class, and use: getInstances to get class's instance. but I don't
>> know how to do a reverse process.
>>
>> I will very appreciate if everyone can give me any suggestions or samples.
>>
>
> I assume you have looked at
> http://protegewiki.stanford.edu/wiki/ProtegeOWL_API_Programmers_Guide
>
> For your specific question, you need to look at the java docs
>   http://protege.stanford.edu/protege/3.4/docs/api/owl/
> for OWLIndividual and find the appropriate methods like
>   getPropertyValue
>   getPropertyValues
>   getRDFType
>   getRDFTypes
>
>
>
>
>
>
>
>
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
> Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03
>



-- 
Li
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20101117/c4a48d24/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture.JPG
Type: image/jpeg
Size: 54625 bytes
Desc: not available
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20101117/c4a48d24/attachment.JPG>


More information about the protege-discussion mailing list