Search Mailing List Archives
[protege-discussion] a simple questions about owl programming
Timothy Redmond
tredmond at stanford.edu
Wed Nov 17 10:01:01 PST 2010
> by the way, I use protege 4.0 to develop a owl file
It depends on how much work you have done at this point, but my usual
recommendation with apis is that you only use the Protege 3 owl api if
you plan on using some of the Protege 3 capabilities (e.g. there is some
tab or widget that you want/need). Usually I would recommend the
Manchester owl api (owlapi.sourceforge.net, used by Protege 4) as it has
less warts, handles OWL 2.0 and corresponds very well to the OWL
specifications. If you have more of an RDF orientation rather than an
OWL orientation, there are many other apis that work very well for RDF
and I am not sure which is best.
For the Protege 3 OWL api Thomas's answer is right on but I would also add
getPossibleRDFProperties()
to get a list of all the RDFProperties that could have a value.
> he code on website is like this:
A glance at this code from the web site shows it as a bit brittle. I
think that it will only find classes that are declared to be subclasses
of owl:Thing.
> but I still very confused by these methods...
I started trying to make an example but realized that I am not sure what
the question is. Maybe some more details about what you are trying to
do and what you expect.
> if I click Jim as the picture, I can get the result as the rigt part
> of the picture displayed, Usage
Usage of a resource is one of the things that is particularly difficult
to do in a complete way with the Protege 3 OWL api. It is very easy
with the Manchester OWL api.
-Timothy
On 11/17/2010 07:20 AM, tingyu li wrote:
> 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 <mailto: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
> <mailto: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
>
>
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20101117/1e26b654/attachment.html>
More information about the protege-discussion
mailing list