W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > May 2005

Re: SPARQL: extracting a subgraph is practically non-trivial, perhaps too hard

From: Dan Connolly <connolly@w3.org>
Date: Thu, 12 May 2005 10:01:08 -0500
To: Nicolas F Rouquette <nicolas.rouquette@jpl.nasa.gov>, public-rdf-dawg-comments@w3.org
Message-Id: <1115910069.13402.416.camel@localhost>

> 1) Extracting the list of the ontologies defined in DOLCE.

Hmm... I would expect to do that ala...

 SELECT ?ont WHERE { ?ONT rdf:type owl:Ontology }.

Does DOLCE not declare its ontologies using rdf:type owl:Ontology?


> I understand that SPARQL was specifically designed for context-free
queries
> that could be executed very efficiently and that extracting _:x in this example
> requires tracking _:x and all of his "descendent" triples.
> Be as it may,
> it does not change the fact that this type of "projection" or "extraction"
> from an OWL ontology is  a reasonable thing to ask for.

Hmm... yes, in fact, we have adopted a closely related use case...

 2.17 Building Ontology Tools (Semantic Web)
 http://www.w3.org/TR/rdf-dawg-uc/#u2.17

note the "Motivates: Extensibility Mechanism" link below; i.e. we think
this sort of query might involve things beyond SPARQL 1.0.

Meanwhile, I think your query might be doable, if somewhat awkward,
using OPTIONAL...
http://www.w3.org/TR/2005/WD-rdf-sparql-query-20050419/#optionals

> The problem boils down to a context-sensitive graph query
> to retrieve things like:
> 
> ns1:requisite
>       rdf:type      owl:ObjectProperty ;
>       rdfs:domain   [ rdf:type      owl:Class ;
>                       owl:unionOf   (ns1:information-object ns1:course 
> ns1:role ns1:figure)
>                     ] ;
>       rdfs:range    ns1:parameter ;
>       rdfs:subPropertyOf  :immediate-relation-i ;
>       owl:inverseOf  ns1:requisite-for .
>
> In this case, there's a triple:
>
> ns1:requisite rdfs:domain _:x
>
> where _:x corresponds to this:
>
> [ rdf:type      owl:Class ;
>   owl:unionOf   (ns1:information-object ns1:course ns1:role ns1:figure)
> ]

You might try:

CONSTRUCT
 { ?C rdfs:domain ?D.
   ?D rdf:type ?DT.
   ?D owl:unionOf ?DU }
WHERE { ?C rdfs:domain ?D.
        OPTIONAL { ?D rdf:type ?DT }
        OPTIONAL { ?D olw:unionOf ?DU }
      }.

and so on.

The lists are particularly problematic. We don't have a good design
for that, and we don't plan to in this version. See issue accessingCollections.
http://www.w3.org/2001/sw/DataAccess/issues#accessingCollections


-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/
D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E
see you at XTech in Amsterdam 24-27 May?
Received on Thursday, 12 May 2005 15:01:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:48 GMT