geojson / geojson-ld

GeoJSON in JSON-LD contexts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use @list and rdf:value for coordinates

sfsheath opened this issue · comments

The @context I'm using in http://sfsheath.github.io/roman-amphitheaters/roman-amphitheaters.geojson has:

"coordinates":{
"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#value",
"@container":"@list"
}

This means a SPARQL query can pull out the individual components of a geojson coord without concern that the resulting triples are being returned in a different order. A snippet would be:

?x geo:geometry/rdf:value/rdf:first ?longitude .
?x geo:geometry/rdf:value/rdf:rest/rdf:first ?latitude .
?x geo:geometry/rdf:value/rdf:rest/rdf:rest/rdf:first ?elevation .

You can see that in practice here:
http://bl.ocks.org/sfsheath/9745576

This means using the ugly rdf list structure, but JSON-LD has already made that choice.

@sfsheath Keep in mind that a GeoJSON coordinates object could be an ordered list of numbers or it could be an ordered list of such lists, in which case your query will fail.