Skip to content

Instantly share code, notes, and snippets.

@janbenetka
Created November 25, 2021 08:08
Show Gist options
  • Save janbenetka/a2ed5ed62a675674a7358afce7fc32d2 to your computer and use it in GitHub Desktop.
Save janbenetka/a2ed5ed62a675674a7358afce7fc32d2 to your computer and use it in GitHub Desktop.
[DBPedia County Info] #sparql #rdf @dbpedia
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
SELECT *
WHERE {
?county rdf:type yago:County108546183 .
?county dbo:country dbr:United_States.
?county dbo:state ?state.
?county rdfs:label ?county_label.
?state rdfs:label ?state_label.
?county geo:long ?long .
?county geo:lat ?lat .
OPTIONAL {?county foaf:homepage ?homepage. }
OPTIONAL {?county dbo:abstract ?abstract. }
OPTIONAL {?county dbo:largestCity ?largest_city. }
OPTIONAL {?county dbo:thumbnail ?thumbnail. }
OPTIONAL {?county dbp:officialName ?official_name. }
OPTIONAL {?county dbp:timeZone ?time_zone. }
OPTIONAL {?county geo:geometry ?geometry. }
FILTER(lang(?abstract)='en')
FILTER(lang(?county_label)='en')
FILTER(lang(?state_label)='en')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment