- From: Sean Gillies <sean.gillies@gmail.com>
- Date: Tue, 3 Jan 2017 08:44:31 +0100
- To: Gregg Kellogg <gregg@greggkellogg.net>
- Cc: public-linked-json@w3.org
- Message-ID: <CAOodmJoWsJnw-yPFT6=OpxMzGwsO9YxieUCjmZoo5YbAd7Anmg@mail.gmail.com>
Thanks, Gregg. I've fixed the syntax and pushed a new tagged revision to http://geojson.org/geojson-ld/. I'll revise again with respect to coordinate arrays after JSON-LD 1.1 is published. Yours, On Mon, Jan 2, 2017 at 8:53 PM, Gregg Kellogg <gregg@greggkellogg.net> wrote: > Hi Sean, some minor points: > > The context is missing a comma at the end of line 18, and has an extra > comma at the end of line 19. It should be the following: > > "coordinates": { > "@container": "@list”, > "@id": "geojson:coordinates" > } > > Otherwise, it looks fine. > > Using that context, instead of the example you show, gives somewhat > different output, as coordinates are in list form, which at least allows > you to preserve the order of the coordinates. > > Note that there is an open feature request specifically designed for > supporting the GeoJSON coordinate system [1]. Basically, this would allow > you to define value mappings for an array within a context definition: > > { > "@context": { > "coordinates": { > "@id": "geojson:coordinates", > "@container" : "@list", > "@values" : { > "@type" : "geojson:Coordinate", > "@container" : "@set", > "@values" : [ > {"@type" : "xsd:double", "@id":"geo:longitude"}, > {"@type" : "xsd:double", "@id":"geo:latitude"} > ] > } > } > }, > "@graph" : [{ > "@id" : "ex:LineString1", > "coordinates" : [ > [ > 3.1057405471801753, > 51.064216229943476 > ], > [ > 3.1056976318359375, > 51.063434090307574 > ] > ] > }] > } > > The idea is that each element of the array would be assigned a particular > @type (datatype, or @id) and @id (property URI). In this case, the rendered > RDF might look something like the following: > > @prefix geojson: <...> . > @prefix ex: <http://example/> . > @prefix xsd: <...> . > ex:LineString1 geojson:coordinates ([ > a geojson:Coordinate ; > geo:longitude “3.1057405471801753”^^xsd:double ; > geo:latitude “51.064216229943476”^^xsd:double ; > ], [ > a geojson:Coordinate ; > geo:longitude “3.1056976318359375”^^xsd:double ; > geo:latitude “51.063434090307574”^^xsd:double ; > ]) . > > Another proposal would introduce a JSON datatype to hold JSON values in an > RDF LItera [2]l: > > This might look something like the following: > > { > "@context": { > "coordinates": { > "@id": "geojson:coordinates", > "@container" : "@list", > "@type": "@json" > } > }, > "@graph" : [{ > "@id" : "ex:LineString1", > "coordinates" : [ > [ > 3.1057405471801753, > 51.064216229943476 > ], > [ > 3.1056976318359375, > 51.063434090307574 > ] > ] > }] > } > > That could render something like the following: > > @prefix geojson: <...> . > @prefix ex: <http://example/> . > @prefix xsd: <...> . > ex:LineString1 geojson:coordinates ( > “[3.1057405471801753,51.064216229943476]”^^jsonld:JSON, > “[3.1056976318359375,51.063434090307574]”^^jsonld:JSON > ) . > > The former gives better RDF results, but the later is probably more > generically useful. > > Feedback from the GeoJSON community would be really useful in helping to > set priorities for JSON-LD 1.1. > > Gregg Kellogg > gregg@greggkellogg.net > > [1] https://github.com/json-ld/json-ld.org/issues/397 > [2] https://github.com/json-ld/json-ld.org/issues/333 > > On Jan 2, 2017, at 4:27 AM, Sean Gillies <sean.gillies@gmail.com> wrote: > > Dear all, > > I've published an RDF vocab, JSON-LD context, HTML documentation, and > PURLs for GeoJSON elements to assist those that want to process GeoJSON > data in a JSON-LD context. I'd be grateful if anyone can point out > unacknowledged gaps or suggest improvements in the RDF, context, or text. > > http://geojson.org/geojson-ld/ > > Thanks in advance, and best wishes for the new year! > > -- > Sean Gillies > > > -- Sean Gillies
Received on Tuesday, 3 January 2017 07:45:04 UTC