LinkedPasts / linked-places-format

Linked Places format is used to describe attestations of places in a standard way, primarily for linking gazetteer datasets.
78 stars 9 forks source link

Use of @type in expanded term definitions in JSON-LD context #11

Open gklyne opened 5 years ago

gklyne commented 5 years ago

I think the use of @type in the JSON-LD context definition is questionable. Unfortunately, I'm finding the JSON-LD spec is not very clear about this: my claim is based mainly on the fact that I can't find any usage in the JSON-LD spec that corresponds with what I'm seeing here.

I'll pick on one example to illustrate. In the context file, we have:

  "timespans": { 
    "@id": "lpo:timespan",
    "@type": "lpo:Timespan", 
    "@container": "@set"
  },

Corresponding example data would be:

        "timespans": [{"start": {"in":"0676"},"end": {"in":"1066"}}],

It seems clear to me that the value of the timespan (object of the lpo:timespan property) here is what JSON-LD calls a node object, rather than a value object. (JSON-LD value objects correspond to RDF literal nodes.)

But, as far as I can tell, when @type is used in a context expanded-term-definition, it indicates that the corresponding value is to be interpreted as a literal of the indicated type.

The usage here appears to be trying to associate a node object with an associated rdf:type value, which is not how I think JSON-LD works.

If I'm interpreting the intent correctly, I think the the context description for timespans should be:

  "timespans": { 
    "@id": "lpo:timespan",
    "@type": "@id", 
    "@container": "@set"
  },

which says the timespans values are node objects, and says nothing about the RDF types of those nodes.

This is all confusing because the @type keyword can be used to indicate the type of a node object in the data (as opposed to the context). e.g. Specifying the Type.

Apart from the examples, the best evidence I can find in the JSON-LD spec supporting my claim is this:

A value with an associated type, also known as a typed value, is indicated by associating a value with an IRI which indicates the value's type. Typed values may be expressed in JSON-LD in three ways:

  • By utilizing the @type keyword when defining a term within an @context section.

See also:

There are several other definitions in the context file that exhibit the same concern.

gklyne commented 5 years ago

Discussions with the JSON-LD team have confirmed by interpretation.

See thread starting at: https://lists.w3.org/Archives/Public/public-json-ld-wg/2019Jun/0006.html

Especially: https://lists.w3.org/Archives/Public/public-json-ld-wg/2019Jun/0010.html

kgeographer commented 5 years ago

thanks for this Graham – on the move and will check it out soon

kg

On 6/14/19, 1:48 PM, "Graham Klyne" notifications@github.com wrote:

Discussions with the JSON-LD team have confirmed by interpretation.

See thread starting at: https://lists.w3.org/Archives/Public/public-json-ld-wg/2019Jun/0006.html

Especially: https://lists.w3.org/Archives/Public/public-json-ld-wg/2019Jun/0010.html

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.