Skip to content

Instantly share code, notes, and snippets.

@Robsteranium
Last active October 1, 2021 12:28
Show Gist options
  • Save Robsteranium/42bd8cf10ad6a2623ac0ce878dc34aac to your computer and use it in GitHub Desktop.
Save Robsteranium/42bd8cf10ad6a2623ac0ce878dc34aac to your computer and use it in GitHub Desktop.
CSVW to represent Geography Lookups from https://onsvisual.github.io/geo-draw/
{
"@context": ["http://www.w3.org/ns/csvw", {"@language": "en"}],
"tableSchema": {
"columns": [{
"name": "oa11cd",
"datatype": "string",
"propertyUrl": "skos:notation"
},{
"name": "lat",
"datatype": "decimal",
"propertyUrl": "http://www.w3.org/2003/01/geo/wgs84_pos#lat"
},{
"name": "lon",
"datatype": "decimal",
"propertyUrl": "http://www.w3.org/2003/01/geo/wgs84_pos#lon"
}],
"aboutUrl": "http://statistics.data.gov.uk/def/statistical-geography/{oa11cd}"
}
}
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix statgeo: <http://statistics.data.gov.uk/def/statistical-geography/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
statgeo:E00096185
geo:lat 50.4068 ;
geo:lon -4.6742 ;
skos:notation "E00096185" .
statgeo:E00096186
geo:lat 50.4059 ;
geo:lon -4.6697 ;
skos:notation "E00096186" .
statgeo:E00096187
geo:lat 50.4071 ;
geo:lon -4.6601 ;
skos:notation "E00096187" .
statgeo:E00096188
geo:lat 50.407 ;
geo:lon -4.6634 ;
skos:notation "E00096188" .
statgeo:E00096189
geo:lat 50.4044 ;
geo:lon -4.6689 ;
skos:notation "E00096189" .
statgeo:E00096191
geo:lat 50.4093 ;
geo:lon -4.6736 ;
skos:notation "E00096191" .
statgeo:E00096192
geo:lat 50.4089 ;
geo:lon -4.661 ;
skos:notation "E00096192" .
statgeo:E00096193
geo:lat 50.4079 ;
geo:lon -4.6704 ;
skos:notation "E00096193" .
statgeo:E00096194
geo:lat 50.4091 ;
geo:lon -4.67 ;
skos:notation "E00096194" .
statgeo:E00096195
geo:lat 50.4067 ;
geo:lon -4.6712 ;
skos:notation "E00096195" .
oa11cd lat lng
E00096185 50.4068 -4.6742
E00096186 50.4059 -4.6697
E00096187 50.4071 -4.6601
E00096188 50.407 -4.6634
E00096189 50.4044 -4.6689
E00096191 50.4093 -4.6736
E00096192 50.4089 -4.661
E00096193 50.4079 -4.6704
E00096194 50.4091 -4.67
E00096195 50.4067 -4.6712
@Robsteranium
Copy link
Author

This essentially turns the lookup from https://onsvisual.github.io/geo-draw/ into a collection of Statistical Geographies.

The turtle was created with csv2rdf and rapper (to get the compact URIs) as follows:

csv2rdf -t my-lostwithiel.csv -u geographies.json -m annotated | rapper -i turtle -f 'xmlns:statgeo="http://statistics.data.gov.uk/def/statistical-geography/"' -f 'xmlns:skos="http://www.w3.org/2004/02/skos/core#"' -f 'xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"' -o turtle -I / -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment