relpipe-data/examples/rdf-coreys.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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
310
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
#!/usr/bin/env rdf-sparql-interpreter.sh
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
# endpoint: https://dbpedia.org/sparql
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
# relation: coreys
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
PREFIX foaf:  <http://xmlns.com/foaf/0.1/>
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
PREFIX dbo:   <http://dbpedia.org/ontology/>
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
SELECT
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
	?film_name
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
	(?film AS ?film_uri)
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
WHERE {
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
	?actor1 foaf:name "Corey Haim"@en .
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
	?actor2 foaf:name "Corey Feldman"@en .
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
	?film dbo:starring ?actor1 .
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
	?film dbo:starring ?actor2 .
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
	?film foaf:name ?film_name .
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
}
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
ORDER BY ?film_name