1

I was looking for a SPARQL tutorial, but all I found was just queries and results - no descriptions. For example:

• Data:

<http://example.org/book/book1>
<http://purl.org/dc/elements/1.1/title>
"SPARQL Tutorial" .

• Query:

SELECT ?title
WHERE { <http://example.org/book/book1>
<http://purl.org/dc/elements/1.1/title>
?title . }

• Result:

title
"SPARQL Tutorial"

Can someone explain this example? Because in the data, I just see 2 URLs and some value. And in the query I just see select ?title, but I don't see any title in the data and so on...

Also, in this example there is just "data", but I thought that SPARQL works with RDF files. So can someone show me an RDF file to this example?

Rubens
  • 14,478
  • 11
  • 63
  • 92
hudi
  • 15,555
  • 47
  • 142
  • 246

3 Answers3

4

You have to look at the data from a different perspective. Your data is just one triple of the form (subject, predicate, object). If you look at it in just one line it might be easier to understand:

<http://example.org/book/book1> <http://purl.org/dc/elements/1.1/title> "SPARQL Tutorial" .

../book1 is the subject, ../title is the predicate and "SPARQL Tutorial" is the object.

Manuel Salvadores
  • 16,287
  • 5
  • 37
  • 56
0

Your data is a (single) statement, saying "the title of book1 is 'SPARQL Tutorial'"; your query is a question "what is the title of book1?". So the result is the answer to your question: "SPARQL Tutorial".

If you save your data to a file, you have your RDF file, which conforms to the Notation3, Turtle and N-Triples specifications.

Ben Companjen
  • 1,417
  • 10
  • 24
0

I really would like to recommend you reading Bob DuCharme's "Learning SPARQL", since it doesn't only show you data, queries and result - it also explains everything in an easy understandable way ;)

zazi
  • 686
  • 1
  • 7
  • 19