relpipe-data/examples/rdf-blonde-and-brunette.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: blonde_and_brunette

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

SELECT DISTINCT
	?star_name
WHERE {
	{
		?film rdfs:label "Ирония судьбы, или С лёгким паром!"@ru .
		?film dbo:starring ?blonde .
		?blonde dbo:birthYear "1941"^^xsd:gYear .
		?blonde rdfs:label ?star_name .
		FILTER (lang(?star_name) = "pl") .
	}
	UNION
	{
		?brunette ?born "1956-04-27"^^xsd:date .
		?brunette schema:description "czech actress, presenter and singer"@en .
		?brunette rdfs:label ?star_name .
		FILTER (lang(?star_name) = "cs") .
	}
}
ORDER BY ?star_name