relpipe-data/examples/rdf-breakfast-club.sparql
author František Kučera <franta-hg@frantovo.cz>
Mon, 27 Jul 2020 17:51:53 +0200
branchv_0
changeset 310 aeda3cb4528d
permissions -rwxr-xr-x
examples: Querying an RDF triplestore using SPARQL

#!/usr/bin/env rdf-sparql-interpreter.sh
# endpoint: https://dbpedia.org/sparql
# relation: breakfast_club

PREFIX foaf:  <http://xmlns.com/foaf/0.1/>
PREFIX dbo:   <http://dbpedia.org/ontology/>
PREFIX rdfs:  <http://www.w3.org/2000/01/rdf-schema#>

SELECT
	?firstname
	?surname
WHERE {
	?film a dbo:Film .
	?film rdfs:label "The Breakfast Club"@en .
	?film dbo:starring ?actor .
	?actor foaf:givenName ?firstname .
	?actor foaf:surname ?surname .
	FILTER (lang(?firstname) = "en" && lang(?surname) = "en")
	?actor dbo:birthYear ?born .
	FILTER(?born > "1950"^^xsd:gYear)
}
ORDER BY ?firstname ?surname