activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z3197...@student.unsw.edu.au
Subject Graph traversal using SPARQL
Date Tue, 22 May 2007 05:13:02 GMT

Hi,

  I need to query all the tuples and sub-tuples who's subject 
is "<http://somewhere/Plants>" that essentially means fetching sub-graph 
behind a mentioned node in RDF. I have the following RDF Graph


<?xml version='1.0' encoding='UTF-8'?>

<rdf:RDF
  xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
  xmlns:vCard='http://www.w3.org/2001/vcard-rdf/3.0#'
  xmlns:myLib='http://www.myown.org/rdf-lib#'
   >

  <rdf:Description rdf:about="http://somewhere/Fruit/">
    <vCard:Type>http://somewhere/Banana/</vCard:Type>
    <vCard:Type>http://somewhere/Grapes/</vCard:Type>
    <vCard:Type>http://somewhere/Apple/</vCard:Type>
  </rdf:Description>

  <rdf:Description rdf:about="http://somewhere/Vegetable/">
    <vCard:Type>http://somewhere/Potato/</vCard:Type>
  </rdf:Description>

  <rdf:Description rdf:about="http://somewhere/Plants/">
    <myLib:GrowsOn>http://somewhere/Banana/</myLib:GrowsOn>
    <myLib:GrowsOn>http://somewhere/Grapes/</myLib:GrowsOn>
    <myLib:GrowsOn>http://somewhere/Apple/</myLib:GrowsOn>
    <myLib:SoilIn>http://somewhere/Potato/</myLib:SoilIn>
  </rdf:Description>

  <rdf:Description rdf:about="http://somewhere/Potato/">
    <myLib:AvailableIn>http://somewhere/Market/</myLib:AvailableIn>
  </rdf:Description>

  <rdf:Description rdf:about="http://somewhere/Potato/">
    <myLib:IsIn>http://somewhere/ShoppingCenter/</myLib:IsIn>
  </rdf:Description>

</rdf:RDF>


Apologize, if there is any error in this rdf. So, I am expecting the following 
tuples while ommiting the rest,
 <http://somewhere/Plants/>    | <http://www.myown.org/rdf-lib#SoilIn>       
| "http://somewhere/Potato/"
 <http://somewhere/Plants/>    | <http://www.myown.org/rdf-lib#GrowsOn>      
| "http://somewhere/Apple/"
 <http://somewhere/Plants/>    | <http://www.myown.org/rdf-lib#GrowsOn>      
| "http://somewhere/Grapes/"
 <http://somewhere/Plants/>    | <http://www.myown.org/rdf-lib#GrowsOn>      
| "http://somewhere/Banana/"
 <http://somewhere/Potato/>    | <http://www.myown.org/rdf-lib#AvailableIn>  
| "http://somewhere/Market/"
 <http://somewhere/Market/>    | <http://www.myown.org/rdf-lib#IsIn>         
| "http://somewhere/ShoppingCenter/"

Can anybody plz write a SPARQL query? Thanks with appriciations.


Regards,
Ahmad Ali Iqbal

Mime
View raw message