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] Which methods do I use to retrieve information on class property values?

Timothy Redmond tredmond at stanford.edu
Tue Oct 28 03:46:27 PDT 2008


Thomas's answer is excellent for the Protege 3 owl api.  But I am  
uncertain which owl api you are asking about.  Your previous post was  
on the owl api mailing list.  So I will add some answers for the owl  
api case.

On Oct 28, 2008, at 12:11 AM, Thomas Russ wrote:

> Unfortunately I only have time right now to sketch a solution without
> showing code, but since it's mission critical to you, I hope it is
> enough.
>
> There are two possibilities for what you mean with your description.
>
> 1.  has_Lexicalisation is an AnnotationProperty and associates the
> value directly with the class object.
>
>    In that case, you want to use the standard getPropertyValue on the
> class, and the method that finds matching values, perhaps
> OWLModel.getMatchingResources ?

To get annotation properties you would use

	OWLOntology.getEntityAnnotationAxioms(OWLEntity).


>
>
> 2.  has_Lexicalisation is part of a class definition restriction on
> the class.
>
>     What you need to do is get the appropriate hasValueRestriction
> that is associated with the class object and use getHasValue on it.
> Not quite sure how to get those restrictions.  Maybe
> RDFSClass.getSuperclasses and then filter for type OWLHasValue ?
>
>     For your second question you might find
> OWLModel.getOWLRestrictionsOnProperty useful.


I think that you are going to have to do more work for  this case.  If  
you are looking for matching axioms of the form

	A subclassof p some C

then you could use

	OWLOntology.getSubClassAxiomsForLHS(OWLClass)

and then iterate through the axioms to find the ones of the right  
type.  You may also want to look for axioms of the form

      A = B and p some C

in which case you would use

	OWLOntology.getEquivalentClassesAxioms(OWLClass)

and you would have to do a bit more work.    There may be a shorter  
way but I am not sure that there will be. The point is that these  
types of code represents a form in incomplete, ad-hoc inference.   
Depending on what you are doing you might consider using a reasoner to  
get a semantic answer.  Then, once the reasoner is enabled you could  
make calls of the form

	OWLClassReasoner.getSubClasses(OWLDescription)

where the owl description you would use could be "p some Thing".

-Timothy


>
>
>
> On Oct 27, 2008, at 1:00 PM, Patrick McCrae wrote:
>
>> Hi, List -
>>
>> I have already posted this question on the OWL Developer List but
>> did not receive any replies so I am hoping to be more lucky on this
>> list. Your help with this query would be much appreciated since it
>> relates to a mission critical aspect of my current project.
>>
>> In my ontology I have asserted that some classes have the property
>> 'has_Lexicalisation' whose value is an individual of another class
>> 'Lexicalisation'.
>>
>> Example:    (Class) 'Baker.m'  ---has_Lexicalisation---> (Individual
>> of Class Lexicalisation) 'baker'
>>
>> I am now wondering which methods in the OWL API I need to use to
>> obtain the following information:
>> 	• What value does (Class) 'Baker.m' have for (Property)
>> 'has_Lexicalisation'?
>> Expected answer: (Individual) 'baker'
>>
>> 	• Which class has value (Individual) 'baker' for (Property)
>> 'has_Lexicalisation'?
>> Expected answer: (Class) 'Baker.m'
>> I would have expected to find the desired methods in the OWLReasoner
>> class ... but somehow I seem not to have found the right ones. This
>> may be related to querying for the subject and object of the
>> relation 'has_Lexicalisation' in the RDF-way of looking at things.
>>
>> Could anybody please advise?
>>
>> Thanks in advance and kind regards -
>>
>> Pat
>> _______________________
>>
>> Patrick McCrae
>>
>> CINACS Graduate Research Group
>> Department of Informatics
>> Hamburg University
>> Vogt-Kölln-Straße 30
>> 22527 Hamburg, Germany
>>
>> patrick.mccrae at informatik.uni-hamburg.de
>> fon: +49 . 40 . 428 83 - 23 60
>> fax: +49 . 40 . 42883 - 2515
>>
>> -- 
>> _______________________
>>
>> Patrick McCrae
>>
>> CINACS Graduate Research Group
>> Department of Informatics
>> Hamburg University
>> Vogt-Kölln-Straße 30
>> 22527 Hamburg, Germany
>>
>> patrick.mccrae at informatik.uni-hamburg.de
>> fon: +49 . 40 . 428 83 - 23 60
>> fax: +49 . 40 . 42883 - 2515
>> _______________________________________________
>> 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
>
> _______________________________________________
> 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