SPARQL examples

There is a public SPARQL endpoint over the CervantesVirtual digital library data set at http://data.cervantesvirtual.com/openrdf-sesame/repositories/data.

The endpoint is provided using Sesame as both the back-end database engine and the HTTP/SPARQL server.

Languages

This query lists the most relevant languages available at the BVMC data repository.

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX madsrdf: <http://www.loc.gov/mads/rdf/v1#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT ?language (COUNT(?manifestation) AS ?no_manifestations) ?code 
WHERE { 
	?language rdf:type madsrdf:Language .
	?language madsrdf:code ?code .
	?manifestation dc:language ?language }
GROUP BY ?language ?code

Publication dates

This query lists the publication dates available at the BVMC data repository.

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX time: <http://www.w3.org/2006/time#>
PREFIX rdam: <http://rdaregistry.info/Elements/m/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?lbl (COUNT(?manifestation) AS ?no_manifestations)
WHERE {
	?date rdf:type time:Instant .
	?manifestation rdam:dateOfPublication ?date . 
	?date time:inDateTime ?description .
	?description time:year ?lbl . }
GROUP BY ?lbl

Media type

This query lists the media types available at the BVMC data repository.

PREFIX rdam: <http://rdaregistry.info/Elements/m/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT DISTINCT ?prefLabel (COUNT(?manifestation) AS ?no_manifestations)
WHERE {
	?manifestation rdam:mediaType ?mediaType .
	?mediaType skos:prefLabel ?prefLabel .
	FILTER ( lang(?prefLabel) = "en" ) }
GROUP BY ?prefLabel

Editions and translations

This query lists the editions and translations of the work El retablo de las maravillas available at the BVMC data repository.

PREFIX rdam: <http://rdaregistry.info/Elements/m/>
SELECT ?m ?title
WHERE {
	?m rdam:workManifested <http://data.cervantesvirtual.com/work/18605> .
	?m rdam:title ?title .
}

Publications continued by others

This query lists the publications that are continuation of other works available at the BVMC data repository.

PREFIX rdau: <http://rdaregistry.info/Elements/u/>
SELECT ?m 
WHERE {
	?m rdau:continuedBy ?m2 
}

Publications supplement to others

This query lists the publications that are supplement to other works available at the BVMC data repository.

PREFIX rdau: <http://rdaregistry.info/Elements/u/>
SELECT ?m 
WHERE {
	?m rdau:supplementTo ?m2 
}

Publications adaptation of others

This query lists the publications that are adaptation of other works available at the BVMC data repository.

PREFIX rdau: <http://rdaregistry.info/Elements/u/>
SELECT ?m 
WHERE {
	?m rdau:adaptationOf ?m2 
}