3

I want query through SPARQL for RDF graph (basically turtle format) and resolve the object if it is url and embed the rdf graph of url in current rdf graph for sparql query. I am doing it through apache jena in java. Any suggestion how to do it.

For example : There three webpages webpage1(url1) , webpage2(url2) and webpage3(url3)

Data in Url1(after converting into turtle(rdf graph)):

Id1 person <Url2>.

Data in Url2:

x  firstname “Dhannan”.
x lastname “Chaudhary”.
x Project <Url3>.

Data in Url3:

y P1 “imageProcessing”.
y P2 “WebDevelopment”.

I want a SPARQL query in java using apache-jena to find Person details means firstname lastname and all projects details where the starting point is URL1.

Jeen Broekstra
  • 21,642
  • 4
  • 51
  • 73
Badman
  • 407
  • 5
  • 17
  • You already have the triples in some kind of pseudo syntax, so why not start with a simple SPARQL query? – UninformedUser Aug 04 '16 at 11:09
  • I am assuming that these triple are generating at run time through jena.Actually what I know about jena is that when I give a link or file (rdf form) it creates rdf graph (in trutle format) and run my sparql query but I want to resolve the object value whose value is also a link or url .Generally when I do sparql query it creates the graph for starting url (or file) not resolving the object value which is also a url. – Badman Aug 04 '16 at 11:59
  • So, you are able to load the data into Jena? And what is your current SPARQL query? – UninformedUser Aug 04 '16 at 12:00
  • And no it does not transitively load data for any URI in the graph that you loaded from a file. How should this work? – UninformedUser Aug 04 '16 at 12:01
  • In above example I have sparql query : SELECT * WHERE { ?x Project ?y } assume the starting url is Url2 .I want answer "Webdevelopment" and "ImageProcessing" along with its Project Id – Badman Aug 04 '16 at 12:02
  • Then you have to add another triple pattern: `SELECT * WHERE { ?x Project ?y. ?y ?p ?o }` – UninformedUser Aug 04 '16 at 12:59
  • @AKSW In above comment you wrote a query but in query how ?y variable resolve into triplet while ?y is a url like in above question (x Project .) – Badman Aug 04 '16 at 16:36
  • 1
    You have to load all 3 datasets before. There is no automatic Linked Data resolving mechanism as far as I know. On the other hand, you could write this in Java easily. – UninformedUser Aug 04 '16 at 16:56

0 Answers0