W3C home > Mailing lists > Public > public-sparql-dev@w3.org > July to September 2009

Enumerate nested statements

From: On Lee <onlee2000@hotmail.com>
Date: Tue, 18 Aug 2009 15:32:23 -0700
Message-ID: <BAY104-DAV62EE3904FA068EDD350EBA0FF0@phx.gbl>
To: <public-sparql-dev@w3.org>
Message-ID: <011801ca2053$c15e5640$441b02c0$@com>
http://danbri.org/foaf.rdf has the following nested info:

  <knows>

      <Person>

        <name>Aaron Swartz</name>

        <made>

          <rss:channel rdf:about="http://www.blogspace.com/rss/rss10">

            <rss:title>RSS Info</rss:title>

            <rdfs:seeAlso
rdf:resource="http://www.blogspace.com/rss/rss10"/>

          </rss:channel>

        </made>

        <rdfs:seeAlso rdf:resource="http://www.aaronsw.com/about.xrdf"/>

      </Person>

    </knows>

 

http://sparql.org/sparql.html  executed the following SPARQL:

REFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 

PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#> 

PREFIX foaf:   <http://xmlns.com/foaf/0.1/>

 

SELECT * 

  WHERE 

  { 

     <http://danbri.org/foaf.rdf#danbri> foaf:knows ?known .  

    ?known ?predicate ?object .

  }

 

It produced the first level info. For example,

               ?known = _:b19

             ?predicate = <http://xmlns.com/foaf/0.1/made>

             ?object = <http://www.blogspace.com/rss/rss10>

 

Based on the above info, I could then get the next level info by the
following SPARQL: "SELECT *  WHERE { <http://www.blogspace.com/rss/rss10>
?predicate ?object .}".

 

How to write a single SPARQL so I could retrieve the nested level info even
it has 10 levels deep?

 

Thanks in advance for your help.

 

Best,

-- On Lee

 
Received on Tuesday, 18 August 2009 22:33:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 18 August 2009 22:33:12 GMT