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] Creating a SPARQL query to list all the datatype properties (including the inherited ones)

Gustavo Felhberg gustavo.felhberg at
Tue Aug 14 12:06:27 PDT 2007

Hi Martin, thanks a lot for your answer.

I agree with you that not all the "inherited" properties may apply to a 
specialized class, but for the purpose of my application, I need to get 
all of them. To be more visual, looking at the OWLClasses Tab on 
Protege, on the Asserted Conditions panel, there are the necessary and 
necessary & sufficient conditions and more below the relations referring 
to the superClasses of this class. I need to get all these inherit 
conditions to get the properties these conditions refer.

Maybe SPARQL is not the best way to do it. Is there any other query-like 
way to do it?

Thanks a lot.

Gustavo Felhberg

Martin O'Connor wrote:
> What do you mean by 'all the datatype properties of a class'? All 
> datatype properties for which the class has been specified in their 
> domain? Datatype properties for which a cardinality of greater than zero 
> has been specified for that class? Or classes that have someValue or 
> hasValue restrictions for that property? Also, in OWL any property with 
> a domain of owl:Thing (e.g. all properties) may be a potential 
> candidate. There are other possibilities - and a reasoner would be 
> required to deduce them.
> Properties are not necessarily 'inherited' in the way that you might 
> expect. For example, stating that a property has a domain of a 
> particular class, X, does not imply the property has a domain of any of 
> the subclasses of X (though the Protégé-OWL GUI may give that impression).
> A simple example illustrates this:
> Assume we have a class Person with subclasses Parent and 
> ChildlessPerson, property hasChild with a domain and range of Person. 
> Define Parents as all Persons that have a child and ChildlessPerson as 
> any person that is not a parent. Even though it is true that hasChild 
> has domain Person it is not true that hasChild has domain 
> ChildlessPerson. Intuitively, Person has an associated hasChild property 
> but its subclass ChildlessPerson should not inherit this property 
> because it has a restriction that explicitly states that it is not in 
> its domain.
> SPARQL is an RDF query language and has no understanding of OWL 
> semantics (and one could argue that it has very little understanding of 
> RDF semantics either). Using it to query OWL ontologies is fraught with 
> difficulties. Even if you could try to enumerate the possible ways of 
> defining 'all the datatype properties of a class' the resulting SPARQL 
> query would be absurd.
> Martin, Tim
> Gustavo Felhberg wrote:
>> Hi guys,
>> I need to make a SPARQL query to get all the datatype properties of a 
>> class. Until now I just got the direct datatype properties but I also 
>> need the inherited ones. For example, I have a class Producer with a 
>> datatype property called "name" and a specialized class Team 
>> (specialization of Producer) with a datatype property "numberOfElements".
>> I need to make a query that if I ask the class Team, it shows me the 
>> properties "name" and "numberOfElements".
>> The query I made to get the direct properties are:
>> WHERE {
>>            ?x rdfs:subClassOf ?y.
>>            ?y owl:onProperty ?z.
>>            ?z ?a owl:DatatypeProperty.  # this ?a means nothing
>> } ORDER BY ?x
>> Thanks a lot.
>> Gustavo Felhberg
>> _______________________________________________
>> protege-owl mailing list
>> protege-owl at
>> Instructions for unsubscribing: 
> _______________________________________________
> protege-owl mailing list
> protege-owl at
> Instructions for unsubscribing: 

Gustavo Felhberg
Mestrando em Informática
Universidade Federal do Espírito Santo

More information about the protege-owl mailing list