Triplr: Stuff in, triples out

SPARYQL

SPARQL + YQL = SPARYQL

Try these queries in the YQL Console. These are using the Triplr SPARQL endpoint but you can also try the ARQ / Jena one or any other service with a SPARQL endpoint.

sparyql source on GitHub

  1. Example 1: get all triples from a FOAF file
    YQL Query:
      use "http://triplr.org/sparyql/sparql.xml" as sparql;
      select * from sparql where query="PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT $s $p $o FROM <http://www.dajobe.org/foaf.rdf> WHERE { $s $p $o } LIMIT 10"
        and service="http://triplr.org/query"
    
    Run in YDN console
    REST query results
  2. Example 2: get friend's nick and names from a FOAF file
    YQL Query:
      use "http://triplr.org/sparyql/sparql.xml" as sparql;
      select * from sparql where query="PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT $nick $name FROM <http://www.dajobe.org/foaf.rdf> WHERE { $x a foaf:Person . $x foaf:nick $nick . $x foaf:name $name }"
        and service="http://triplr.org/query"
    
    Run in YDN Console
    REST query results
  3. Example 3 - select just one field: value of object triple
    YQL Query:
      use "http://triplr.org/sparyql/sparql.xml" as sparql;
      select result.o.value from sparql where query="PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT $s $p $o FROM <http://www.dajobe.org/foaf.rdf> WHERE { $s $p $o } LIMIT 10"
        and service="http://triplr.org/query"
    
    Run in YDN Console
    REST query results

what, why, when, how, todo