Permalink
Browse files

Scratch pad query

  • Loading branch information...
1 parent 11a8b47 commit 7d4fc55a2e430111fa9e0721657144db10acde70 @pkordel pkordel committed May 14, 2012
Showing with 24 additions and 0 deletions.
  1. +24 −0 doc/sparql_queries.txt
View
@@ -213,3 +213,27 @@ Example with HTTParty:
resp = HTTParty.get 'http://data.deichman.no/sparql', query: { query: q, format: 'json' }
j = JSON.parse resp
results = j["results"]["bindings"].first => {"title"=>{"type"=>"literal", "value"=>"Kaldt produkt"}, "name"=>{"type"=>"literal", "value"=>"Matias Faldbakken"}, "text"=>{"type"=>"literal", "xml:lang"=>"nb", "value"=>"Ibsen shaken and stirred. Debatten rundt individets frihet forsvinner nesten i den kjølige likegyldigheten, og det tegnes opp en skremmende visjon. En bok som gjorde meg fysisk uvel, og likevel har brent seg fast. Du vil ikke forbli uberørt av dette skuespillet."}, "img"=>{"type"=>"uri", "value"=>"http://www.bokkilden.no/SamboWeb/servlet/VisBildeServlet?produktId=1641525"}}
+
+
+
+Books with isbn, covers
+=======================
+
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX dc: <http://purl.org/dc/terms/>
+PREFIX bibo: <http://purl.org/ontology/bibo/>
+
+select ?s ?isbn ?title ?author ?cover where {
+graph <http://data.deichman.no/books> {
+ ?s a bibo:Document ;
+ bibo:isbn ?isbn ;
+ dc:title ?title ;
+ dc:creator ?creator ;
+ foaf:depiction ?cover .
+ ?creator foaf:name ?author .
+ FILTER(!regex(?cover, "L.jpg|S.jpg"))
+}
+}
+group by ?isbn
+order by ?isbn
+offset 100 limit 100

0 comments on commit 7d4fc55

Please sign in to comment.