From b0c7e3284b8b539427fb4ca06c919bbcbd42a919 Mon Sep 17 00:00:00 2001 From: Dave Beckett Date: Thu, 4 Mar 2010 10:22:59 -0800 Subject: [PATCH] Import from http://triplr.org/sparyql/ and http://github.com/dajobe/sparyql --- sparql/README.md | 31 ++++++++++++++++++++ sparql/sparql.search.xml | 61 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 sparql/README.md create mode 100644 sparql/sparql.search.xml diff --git a/sparql/README.md b/sparql/README.md new file mode 100644 index 00000000..5c1b2855 --- /dev/null +++ b/sparql/README.md @@ -0,0 +1,31 @@ +SPARYQL +------- + +SPARQL + YQL = SPARYQL + +Try these queries in the [YQL Console][1] + +1. Example 1: get all triples from a FOAF file +

+   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://sparql.org/sparql"
+   
+ +2. Example 2: get friend's nick and names from a FOAF file +

+   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://sparql.org/sparql"
+   
+ +3. Example 3 - select just one field: value of object triple +

+   use "http://triplr.org/sparyql/sparql.xml" as sparql;
+   select result.o.value from sparql where query="PREFIX foaf:  SELECT $s $p $o FROM  WHERE { $s $p $o } LIMIT 10"
+     and service="http://sparql.org/sparql"
+   
+ +*** + + [1]: http://developer.yahoo.com/yql/console/ diff --git a/sparql/sparql.search.xml b/sparql/sparql.search.xml new file mode 100644 index 00000000..4bee65b5 --- /dev/null +++ b/sparql/sparql.search.xml @@ -0,0 +1,61 @@ + + + + + Dave Beckett + http://triplr.org/sparyql/ + select * from {table} where query="SPARQL QUERY" and service="SPARQL ENDPOINT URL" e.g. +select * from {table} 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://sparql.org/sparql" + + + + + + +