Some sample SPARQL queries for KB endpoint
Cover art lookup service:
http://coverservice.bibliotheek.nl/cover/image/{isbn}
Examples:
Some sample SPARQL queries for KB endpoint
Cover art lookup service:
http://coverservice.bibliotheek.nl/cover/image/{isbn}
Examples:
# lookup books and labels | |
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
PREFIX dbr: <http://dbpedia.org/resource/> | |
PREFIX schema: <http://schema.org/> | |
SELECT distinct ?s ?label WHERE { | |
{ ?s a schema:Book } | |
union | |
{ ?s a schema:EBook } | |
union | |
{ ?s a schema:CreativeWork } | |
?s rdfs:label ?label . | |
} |
# lookup concepts | |
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
PREFIX dbr: <http://dbpedia.org/resource/> | |
PREFIX schema: <http://schema.org/> | |
PREFIX skos: <http://www.w3.org/2004/02/skos/core#> | |
SELECT distinct ?s ?label WHERE { | |
?s a skos:Concept ; | |
rdfs:label ?label . | |
} |
# find all concepts related to the interests of a person | |
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
PREFIX skos: <http://www.w3.org/2004/02/skos/core#> | |
PREFIX foaf: <http://xmlns.com/foaf/0.1/> | |
PREFIX dct: <http://purl.org/dc/terms/> | |
SELECT ?o2 (count(distinct ?o) as ?c1) WHERE { | |
service <http://dydra.com/eknutov/hackalod/sparql> { | |
?s a foaf:Person ; | |
foaf:interest ?o | |
} | |
?o dct:subject|dct:creator ?z . | |
?z skos:broader* ?o2 . | |
} | |
group by ?o2 |
# lookup libraries and labels | |
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
PREFIX dbr: <http://dbpedia.org/resource/> | |
SELECT distinct ?s ?label WHERE { | |
?s a dbr:Library ; | |
rdfs:label ?label | |
} |