geojson / geojson-ld

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

Readme example #3

Closed p3dr0 closed 10 years ago

p3dr0 commented 10 years ago

Hi Sean thanks for the initiative checking your example on the READM.md wonder if geojson is not in fact a graph http://www.w3.org/TR/json-ld/#named-graphs So instead of:

    { "@context": {
        "FeatureCollection": "http://example.com/vocab#FeatureCollection",
        "Feature": "http://example.com/vocab#Feature",
        "Thing": "http://schema.org/Thing",
        },
      "type": "FeatureCollection",
      "@id": "http://example.com/collections/1",
      "@type": ["FeatureCollection", "Thing"],
      "features": [ 
        { "type": "Feature",
          "@type": ["Feature", "Thing"],
          "id": 1,
          "@id": "http://example.com/collections/1/features/1",
          ...
          } ]
      }

I would say:

{
    "@context": 
    {
        "@type" : "type"
        "features" : 
        {
            "@container" : "@list" 
        }
    },
    "type": "FeatureCollection",
    "@id": "http://example.com/collections/1",
    "features": [ 
        {
            "@context" : 
            {
                "@type" : "type",
                "@id" : "id"
            }
            "type": "Feature",
            "id" : "1"
           ...
        }
        ...
    ]
}

it seems that if we don't use the keyword @ graph then context needs to be duplicated

what do you think ? cheers and thanks

pedro

sgillies commented 10 years ago

@p3dr0 My understanding is that @graph for JSON-LD serializations of sets of RDF triples. GeoJSON doesn't need it because a FeatureCollection's @context applies to all its features.