geojson / geojson-ld

GeoJSON in JSON-LD contexts
Other
130 stars 13 forks source link

Develop a @ndarray container type #34

Closed sgillies closed 8 years ago

sgillies commented 8 years ago

To complement @set and @list. See the note at the end of http://www.w3.org/TR/json-ld/#sets-and-lists about how lists of lists were left out of JSON-LD.

Our use for @ndarray in GeoJSON is to describe the coordinates member of geometry objects.

akuckartz commented 8 years ago

This is about a proposal for JSON-LD 2.0 ?

akuckartz commented 8 years ago

By convention the "@" indicates that the property belongs to JSON-LD. That was the reason for my last comment.

dinizime commented 8 years ago

And how exactly would be the RDF representation of a @ndarray?

I guess something like this could work for [[1,2],[3,4]]:

_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:b3 .
_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b2 .
_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first>_:b5.
_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
_:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
_:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b4 .
_:b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2"^^<http://www.w3.org/2001/XMLSchema#integer> .
_:b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
_:b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3"^^<http://www.w3.org/2001/XMLSchema#integer> .
_:b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b6 .
_:b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4"^^<http://www.w3.org/2001/XMLSchema#integer> .
_:b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .

But it is not useful at all... What about the idea of jsonld:JsonData?

sgillies commented 8 years ago

@dinizime I agree that RDF isn't useful. jsonld:JsonData (from https://github.com/geojson/geojson-ld/issues/28#issuecomment-64129489) works for me.

dr-shorthair commented 8 years ago

RDF is not designed/optimized for ordered lists/arrays. Not really for 'data' in the tables sense. Good for objects with heterogeneous properties, but not if the values of those properties include arrays.

pietercolpaert commented 8 years ago

I disagree with the comments stating that coordinates in RDF aren't useful. It's become a "holy discussion" within the geo-community whether geometry is 1 triple or multiple. We're not going to solve this today, but I would like to keep the option open for both solutions, as (in the future)[https://xkcd.com/644/], separate triples may find a particular use case.

In https://github.com/json-ld/json-ld.org/issues/397#issuecomment-153425387, we've discussed that it's going to be difficult to find a solution that just works for everything. I suggest we implement a converter, which is able to convert the GeoJSON-LD (a new mime type) proposed in #37, to JSON-LD. Then this issue can be closed.

dinizime commented 8 years ago

@pietercolpaert Well, unfortunately, I need to be very practical. We literally don't have any tool that does spatial analysis in coordinates as a graph available today. On the other hand we have GeoSPARQL and stSPARQL available to deal with WKT. But I agree with you that we must keep the option open...

pietercolpaert commented 8 years ago

An example of people actually converting geo shapes to RDF: http://nuts.geovocab.org/id/BE.html

sgillies commented 8 years ago

Sorry, folks. I don't see the way forward here. Closing.

sgillies commented 5 years ago

Hey, there are developments here: https://github.com/w3c/json-ld-syntax/pull/41. I think all interested persons should review and helpfully comment.