author | František Kučera <franta-hg@frantovo.cz> |
Mon, 21 Feb 2022 01:21:22 +0100 | |
branch | v_0 |
changeset 330 | 70e7eb578cfa |
parent 310 | aeda3cb4528d |
permissions | -rwxr-xr-x |
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 |