Last active
May 23, 2021 09:38
-
-
Save cmendesce/131d1a3bb96cb022b9be10ce56583803 to your computer and use it in GitHub Desktop.
Sparql Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #endpoint: http://dbpedia.org/sparql | |
| PREFIX owl: <http://www.w3.org/2002/07/owl#> | |
| PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | |
| PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
| PREFIX foaf: <http://xmlns.com/foaf/0.1/> | |
| PREFIX dc: <http://purl.org/dc/elements/1.1/> | |
| PREFIX : <http://dbpedia.org/resource/> | |
| PREFIX dbpedia2: <http://dbpedia.org/property/> | |
| PREFIX dbpedia: <http://dbpedia.org/> | |
| PREFIX skos: <http://www.w3.org/2004/02/skos/core#> | |
| PREFIX dbo: <http://dbpedia.org/ontology/> | |
| SELECT ?film ?title ?abstract | |
| WHERE { | |
| ?film rdf:type dbo:Film . | |
| ?film rdfs:label ?title . | |
| ?film dbo:abstract ?abstract | |
| FILTER (regex (?title, "Batman", "i") && (lang(?title) = lang(?abstract))) | |
| } | |
| ORDER BY lang(?title) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PREFIX dbo: <http://dbpedia.org/ontology/> | |
| PREFIX res: <http://dbpedia.org/resource/> | |
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
| PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
| SELECT ?actor_name | |
| WHERE { | |
| ?film rdf:type dbo:Film . | |
| ?film rdfs:label ?film_name . | |
| ?film dbo:starring ?actor . | |
| ?actor rdfs:label ?actor_name . | |
| filter( regex(?film_name, "Resident Evil" )) . | |
| filter (lang(?film_name)='en') . | |
| filter (lang(?actor_name)='en') | |
| } LIMIT 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PREFIX dbo: <http://dbpedia.org/ontology/> | |
| PREFIX res: <http://dbpedia.org/resource/> | |
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
| PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
| SELECT DISTINCT ?uri ?string | |
| WHERE { | |
| ?uri rdf:type dbo:Book . | |
| ?uri dct:subject dbc:American_romance_novels . | |
| OPTIONAL { ?uri rdfs:label ?string . FILTER (lang(?string) = 'en') } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #endpoint: http://dbpedia.org/sparql | |
| PREFIX dbo: <http://dbpedia.org/ontology/> | |
| PREFIX res: <http://dbpedia.org/resource/> | |
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
| PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
| SELECT DISTINCT ?uri ?name ?movie ?released ?birthDate | |
| WHERE { | |
| ?uri rdf:type dbo:Film . | |
| ?uri rdfs:label ?movie . | |
| ?uri dbo:starring ?actors . | |
| ?uri dbp:released ?released . | |
| ?actors dbo:birthName ?name . | |
| ?actors dbo:birthDate ?birthDate . | |
| FILTER (?birthDate >= "1960-01-01"^^xsd:dateTime && ?birthDate <= "1969-12-31"^^xsd:dateTime) . | |
| FILTER (?released >= "1990-01-01"^^xsd:date && ?released <= "1999-12-31"^^xsd:date) . | |
| FILTER (LANG(?movie)='en') | |
| } LIMIT 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PREFIX dbp: <http://dbpedia.org/property/> | |
| PREFIX dbo: <http://dbpedia.org/ontology/> | |
| PREFIX res: <http://dbpedia.org/resource/> | |
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
| PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
| SELECT DISTINCT ?companyName ?locationCity ?numEmployees ?fortalAreaTotal ?cityTotalArea | |
| WHERE { | |
| ?company rdf:type dbo:Company . | |
| ?company rdfs:label ?companyName . | |
| ?company dbp:numEmployees ?numEmployees . | |
| ?company dbo:locationCity ?locationCity . | |
| ?locationCity dbo:areaTotal ?cityTotalArea . | |
| <http://dbpedia.org/resource/Fortaleza> dbo:areaTotal ?fortalAreaTotal . | |
| FILTER (?cityTotalArea <= ?fortalAreaTotal) | |
| FILTER (?numEmployees > 10000) . | |
| FILTER (lang(?companyName) = 'en') . | |
| } limit 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PREFIX res: <http://dbpedia.org/resource/> | |
| PREFIX dbp: <http://dbpedia.org/property/> | |
| PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
| SELECT DISTINCT ?uri ?string | |
| WHERE { | |
| res:London_Eye dbp:architect ?uri . | |
| OPTIONAL { ?uri rdfs:label ?string. FILTER (lang(?string) = 'en') } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PREFIX dbo: <http://dbpedia.org/ontology/> | |
| PREFIX res: <http://dbpedia.org/resource/> | |
| PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
| SELECT DISTINCT ?developerName ?games ?string | |
| WHERE { | |
| res:World_of_Warcraft dbo:developer ?uri . | |
| ?uri rdfs:label ?developerName . | |
| ?uri dbo:product ?games . | |
| OPTIONAL { ?games rdfs:label ?string . FILTER (lang(?string) = 'en') } | |
| FILTER (lang(?developerName) = 'en') | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PREFIX dbo: <http://dbpedia.org/ontology/> | |
| PREFIX res: <http://dbpedia.org/resource/> | |
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
| PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
| SELECT DISTINCT ?uri ?string | |
| WHERE { | |
| ?company rdf:type dbo:Organisation . | |
| ?company dbo:foundationPlace res:California . | |
| ?uri rdf:type dbo:Software . | |
| ?uri dbo:operatingSystem ?operatingSystem . | |
| FILTER(?operatingSystem = res:Linux) | |
| OPTIONAL { ?uri rdfs:label ?string . FILTER (lang(?string) = 'en') } | |
| } limit 100 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment