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] Sparql: How to query for unionOf members?

Martin O'Connor martin.oconnor at stanford.edu
Thu May 8 15:16:51 PDT 2008


Unfortunately the SWRL TBox built-in library does not have the necessary 
built-ins to perform this query at the moment. I'm working on it though.

The SQWRL query will look something like:

tbox:hasRange(has_location, ?r) ^ tbox:isUnionOf(?r) ^ tbox:onClass(?r, 
?c) -> sqwrl:select(?c)

Martin

 Thomas Russ wrote:

>The fundamental problem is that SPARQL works directly on the RDF  
>serialization of the ontology and doesn't understand the OWL structure  
>at all.  Trying to get OWL-level information out using SPARQL is  
>likely to lead to a lot of frustration, since you would have to  
>manually right extraction forms for everything you could get back as  
>an OWL class.
>
>The programming API provides a more convenient interface, but that  
>doesn't really support querying.  Perhaps looking at SQWRL will make  
>this easier?  I'm not completely sure how well your particular example  
>is handled by SQWRL, though.
>
>On May 8, 2008, at 9:58 AM, Melanie-B. wrote:
>
>  
>
>>Hello,
>>
>>I'm desperately trying to get the range classes of a certain property:
>>
>>SELECT ?range
>>WHERE {
>><mydomain:has_location> <http://www.w3.org/2000/01/rdf- 
>>schema#range> ?range
>>.
>>}
>>
>>
>>This works, if there is only one class specified as a range, but it  
>>doesn't
>>work when there are several possibilities. For instance the property
>>has_location can have a Pub or a club as the domain and an address  
>>or a
>>building as a range.
>>
>><owl:ObjectProperty rdf:ID="has_location">
>>
>> <rdfs:domain>
>>   <owl:Class>
>>     <owl:unionOf rdf:parseType="Collection">
>>       <owl:Class rdf:about="#Pub"/>
>>       <owl:Class rdf:about="#Club"/>
>>     </owl:unionOf>
>>   </owl:Class>
>> </rdfs:domain>
>>
>> <rdfs:range>
>>   <owl:Class>
>>     <owl:unionOf rdf:parseType="Collection">
>>       <owl:Class rdf:about="#Address"/>
>>       <owl:Class rdf:about="#Building"/>
>>     </owl:unionOf>
>>   </owl:Class>
>> </rdfs:range>
>>
>></owl:ObjectProperty>
>>
>>
>>Instead of getting something like this:
>>
>>-----------------------------
>>| range                                                 |
>>================
>>| <mydomain:Address> |
>>| <mydomain:Building> |
>>-----------------------------
>>
>>I get this:
>>
>>---------
>>| range |
>>======
>>| _:b0  |
>>---------
>>
>>
>>Can anyone help with that? I know that this is a set union, but how  
>>do I get
>>the members of that class?
>>-- 
>>View this message in context: http://www.nabble.com/Sparql%3A-How-to-query-for-unionOf-members--tp17129297p17129297.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
>>    
>>
>
>_______________________________________________
>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