Re: Ignore JSON nesting


Thanks for you answer.

I’ve found a solution for my problem, by using an extra predicate (‘geojsonProperties’, which can be ignored), and using the same @id twice. What do you think?

Permalink to JSON-LD playground:

Or only JSON-LD file:

On 11 Mar 2014 at 17:36:15, Gregg Kellogg ( wrote:

On Mar 11, 2014, at 6:15 AM, Bert Spaan <> wrote:

(I’m sorry if this message will appear on the mailing list twice, but it seems my attempt from this morning did not come through…)


I'm working on an open data API which currently can serialize its output to GeoJSON or RDF/Turtle. I'm working on JSON-LD serialization, and ideally I would like to have a @context which I can add to the existing GeoJSON output (together with some @ids and @types), so that both the Turtle output and the JSON-LD output will normalize to the same triples.

Data is organized as follows: each object/feature has an ID and a name, and data on one or more layers. Per layer, there is a data field, which contains a JSON object. Example GeoJSON output:

  "type": "FeatureCollection",   
  "features": [
      "type": "Feature",
      "properties": {
        "id": "",
        "name": "Appingedam",
        "layers": {
          "cbs": {
            "data": {
              "name": "Appingedam",
              "population": 1092
          "admr": {
              "data": {
              "name": "Appingedam",
                "gme_code": 4654,
                "admn_level": 3
      "geometry": {…}

Example Turtle output:

    a :Node ;
    dc:title "Appingedam" ;
    :createdOnLayer <layer/admr> ;
    :layerData <> ;
    :layerData <> .
    a :LayerData ;
    :definedOnLayer <layer/admr> ;
    <layer/admr/name> "Appingedam" ;
    <layer/admr/gme_code> "4654" .
    <layer/admr/admn_level> "3" .
    a :LayerData ;
    :definedOnLayer <layer/cbs> ;
    <layer/cbs/name> "Appingedam" ;
    <layer/cbs/population> "1092" ;

The properties object does not have its own URI. Is there a way to create a JSON-LD context which takes the contents of the properties into account, but further 'ignores' its precence?

This is something that keeps coming up: having a transparent layer, that basically folds properties up a level. This was discussed during the development of JSON-LD, but ultimately it was rejected.

I don't see any prospects for doing something in the short-term, but it could be revisited in a possible future WG chartered with revising the spec. Feedback like this is quite useful.

In the mean time, you can play with different JSON-LD encodings that match your RDF though tools like and my own


Many thanks,

Bert Spaan

Received on Thursday, 13 March 2014 13:51:49 UTC