Created
March 27, 2020 18:11
-
-
Save rpearl/ad1b9c4274207726e48fea48696925ac to your computer and use it in GitHub Desktop.
list of US shelter-in-place orders for covid-19
This file contains 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
curl --data-urlencode query@query.sparql 'https://query.wikidata.org/sparql?format=json' |
This file contains 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
SELECT ?placeLabel ?fips ?isoStartDate ?startSource | |
WHERE { | |
?order wdt:P31 wd:Q88509703; | |
wdt:P1001 ?id. | |
FILTER(BOUND(?fips)) | |
SERVICE wikibase:label { | |
bd:serviceParam wikibase:language 'en'. | |
?order rdfs:label ?orderLabel. | |
?id rdfs:label ?placeLabel. | |
} | |
OPTIONAL { | |
?id wdt:P882 ?fipsCounty. | |
} | |
OPTIONAL { | |
?id wdt:P5087 ?fipsState. | |
} | |
BIND(IF(BOUND(?fipsCounty),?fipsCounty,?fipsState) AS ?fips) | |
OPTIONAL { | |
?order wdt:P580 ?isoStartDate. | |
?order p:P580 ?startStatement. | |
?startStatement ps:P580 ?startValue. | |
OPTIONAL { | |
?startStatement prov:wasDerivedFrom ?startRefNode. | |
?startRefNode pr:P854 ?startURL. | |
} | |
BIND(str(?startURL) as ?startSource). | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this query is awesome! I'd have to learn it some day!