Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://dbpedia.org/snorql/
- //Simple SELECT
- SELECT ?subject
- WHERE {
- ?subject rdf:type <http://dbpedia.org/ontology/City>.
- } LIMIT 20
- //More attributes
- SELECT ?subject ?population
- WHERE {
- ?subject rdf:type <http://dbpedia.org/ontology/City>.
- ?subject <http://dbpedia.org/ontology/populationUrban> ?population.
- } LIMIT 20
- //FILTER
- SELECT ?subject ?population
- WHERE {
- ?subject rdf:type <http://dbpedia.org/ontology/City>.
- ?subject <http://dbpedia.org/ontology/populationUrban> ?population.
- FILTER (xsd:integer(?population) > 2000000)
- } LIMIT 20
- //Another
- SELECT *
- WHERE
- {
- ?e <http://dbpedia.org/ontology/series> <http://dbpedia.org/resource/Game_of_Thrones> .
- ?e <http://dbpedia.org/ontology/releaseDate> ?date .
- ?e <http://dbpedia.org/ontology/episodeNumber> ?number .
- ?e <http://dbpedia.org/ontology/seasonNumber> ?season . }
- ORDER BY DESC(?date)
- //And another
- SELECT *
- WHERE
- {
- ?company a <http://dbpedia.org/ontology/Organisation> .
- ?company <http://dbpedia.org/ontology/foundationPlace> <http://dbpedia.org/resource/California> .
- ?product <http://dbpedia.org/ontology/developer> ?company .
- ?product a <http://dbpedia.org/ontology/Software>
- }
- //More!!
- SELECT ?subject ?label ?released ?abstract WHERE {
- ?subject rdf:type <http://dbpedia.org/ontology/Film>.
- ?subject dbpedia2:starring <http://dbpedia.org/resource/Tom_Cruise>.
- ?subject rdfs:comment ?abstract.
- ?subject rdfs:label ?label.
- FILTER(LANG(?abstract) = "en" && LANG(?label) = "en").
- ?subject <http://dbpedia.org/ontology/releaseDate> ?released.
- FILTER(xsd:date(?released) < "2000-01-01"^^xsd:date).
- } ORDER BY ?released
- //Possible Uses?
- SELECT DISTINCT ?person {
- { ?person a dbpedia-owl:Scientist } UNION
- { ?person a dbpedia-owl:Writer } UNION
- { ?person a dbpedia-owl:Philosopher } UNION
- { ?person a <http://dbpedia.org/class/yago/AmericanAnthropologists> }
- UNION
- { ?person dct:subject <http://dbpedia.org/resource/Category:German_poets> }
- ?person dct:subject <http://dbpedia.org/resource/Category:1943_deaths> .
- }
- //Other fun uses
- PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
- SELECT ?subject ?lat ?long WHERE {
- ?subject <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Category:Football_venues_in_Germany>.
- ?subject geo:lat ?lat.
- ?subject geo:long ?long.
- } LIMIT 20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement