SPARQL is a query language and protocol for querying the so-called SPARQL endpoints.
A SPARQL query asking DBpedia for a book (or books) that has ISBN 0-553-05250-0, and its (or their) related properties and values ββare as follows:
select distinct ?book ?prop ?obj where { ?book a dbo:Book . ?book ?prop ?obj . ?book dbp:isbn ?isbn . FILTER (regex(?isbn, "0-553-05250-0")) } LIMIT 100
See the result of the request in your browser here .
Remember that regex(?isbn, "0-553-05250-0") takes some time to evaluate. This may not work for all ISBNs because
- Wikipedia can never have a complete ISBN list, so no DBpedia
- the same ISBN without a dash will not match a request with a dash.
In addition, I noticed that some ISBNs are just a string of numbers and dashes; others have an βISBNβ in it or β(paperback)β.
You can send this query to the DBpedia endpoint via a web form (by visiting the endpoint using your browser) using Jena , the well-known Java toolkit for RDF and SPARQL.
Here is a query in some Java code that DBpedia asks for results and prints them on the command line (based on another question
My favorite resource is SPARQL, which is a pretty comprehensive reference. You might want to check out Jena provides documentation.
source share