SPARQL Query Demo

This is a demonstration of the SPARQL Protocol and RDF Query Language running on live data in selected Talis Platform stores. 

Click "Run Query" to run demo. The default query looks for named (foaf:name) people (foaf:Person) in the "danja's miscellany" store, which contains a mix of experimental data. Only the first 10 results will be returned (LIMIT 10).

Please note that open-ended queries may produce an error, there's overload protection on the SPARQL server.

You can of course enter your query in the box - then choose a store to query from the drop-down list, and click the Run Query button. There are some sample queries you can copy & paste below. 

You can find more information about SPARQL and how this demo works on the N2 Wiki. If you wish to experiment further, there's also an alternate query form with helper buttons to make it easier to write queries without looking up vocabulary URIs and referring to the spec. If you would like an account to create your own stores on the Talis Platform to experiment with yourself, please mail me - Danny Ayers

If you get an error message, you can check your syntax on the SPARQLer Validator. If that doesn't help, mail me - thanks

.

Query

RDF Store/SPARQL endpoint to query:

Sample Queries

Info about with people with names beginning with 'da'

This is a similar query as the default but using shorthand syntax, with a regular expression filter on the foaf:name literal ('i' is ignore case). Try it on danja's miscellany.

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

SELECT DISTINCT ?name ?nick ?homepage
WHERE { 
   [
     a :Person;
     :name ?name;
     :nick ?nick;
     :homepage ?homepage
     ]
     
FILTER regex(?name,'^da','i') 
}
LIMIT 10

Homepages of some people Richard Cyganiak knows

(use on danja's miscellany)

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

SELECT DISTINCT ?friendname ?homepage
WHERE { 
   [
     :name "Richard Cyganiak";
     :knows [
         :name ?friendname;
         :homepage ?homepage ]
     ]
     
}
LIMIT 10

Recent posts on the Talisians blog

(use on Talisian store)

PREFIX dc: <http://purl.org/dc/elements/1.1/> 
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX sioc: <http://rdfs.org/sioc/ns#>

SELECT DISTINCT  ?title ?creator ?post ?date

WHERE 
{ 
   ?post a sioc:Post ;
      dc:title ?title ;
      dc:creator ?creator ;
      dct:modified ?date .
}
ORDER BY DESC(?date)
LIMIT 20

The 10 most recent twitcrit reviews

(use on twitcrit store)

#
# select twitcrit store!!
#
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX rss: <http://purl.org/rss/1.0/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/> 
PREFIX rev: <http://www.purl.org/stuff/rev#> 

SELECT DISTINCT ?review_uri ?twitnick ?text ?date 
WHERE {
   ?review_uri a rev:Review ;
   rss:date ?date ;
   rev:text ?text ;
   rev:reviewer 
      [ a foaf:Person ;
        foaf:nick ?twitnick ] .
}
ORDER BY DESC(?date)
LIMIT 10

Recent activities (logged by danja) tagged with "sparql"

(use on danja's miscellany - see also Timegrid view, explanation)

PREFIX prj: <http://purl.org/stuff/project/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX rss: <http://purl.org/rss/1.0/>
PREFIX tag: <http://www.holygoat.co.uk/owl/redwood/0.1/tags/>

SELECT DISTINCT ?title ?date 
WHERE {
   ?item a rss:item ;
   dc:title ?title;
   prj:status "done" ;
   dc:date ?date ;
   tag:taggedWithTag [
      tag:tagName "sparql"
   ]
}
ORDER BY DESC(?date)
LIMIT 10