Re: Error in the example 21 of Typed Values

Hi Michael, thanks for your comment. Note that the RDF 1.1 working group was discontinued after the release of the recommendations, including that for JSON-LD that you referenced. However, there is now a JSON-LD 1.1 Working Group [1] for which such issues can be directed.

> On Aug 29, 2018, at 5:13 AM, Michael Steidl (NIT) <mwsteidl@newsit.biz> wrote:
> 
> Hi all,
>  
> I had a look at the examples of Typed Values https://www.w3.org/TR/json-ld/#typed-values
> and got confused by Example 21 vs Example 23
>  
> The narrative below Example 23 explains:
> As a general rule, when @value and @type are used in the same JSON object, the @type keyword is expressing a value type. Otherwise {if @id is present in the object}, the @type keyword is expressing a node type.
>  
> Sections 8.2 and 8.3 of the specification support that view at a formal level.
>  
> The JSON-LD code of example 23 and the comments in grey align to that.
>  
> But Example 21 shows as code
> "modified":
>     {
>       "@id": "http://purl.org/dc/terms/modified",
>       "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
>     }
> and explains by a table below it that a JSON-LD processor will interpret this code as @type defines the type of the value of modified.
> This is a clear contradiction to the explanation below Example 23.
> 
> Please clarify if my view is wrong or if example 21 has an error.

What you’re seeing here for “modified” is it’s term definition within the context, not its use within the body of the document. The full example from the spec follows:

{
  "@context":
  {
    "modified":
    {
      "@id": "http://purl.org/dc/terms/modified",
      "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
    }
  },
...
  "@id": "http://example.com/docs/1",
  "modified": "2010-05-29T14:17:39+02:00",
…
}

Below the ellipsis is the actual JSON-LD document which describes a node having @id and a “modified” value, which is coerced to have the dateTime datatype. Basically, everything referenced by @context is not part of the data itself, but provides “context” for interpreting the data. In this case, the term “modified” is given an IRI (dc:modified) and a default datatype (xsd:dateTime) which is used to interpret values within the data, in this case “modified”: "2010-05-29T14:17:39+02:00”, causing it to be interpreted as a typed literal.

The updated document has the same example, but whitespace is normalized, which may make it read easier:

{
  "@context": {
    "modified": {
      "@id": "http://purl.org/dc/terms/modified",
      "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
    }
  },
...
  "@id": "http://example.com/docs/1",
  "modified": "2010-05-29T14:17:39+02:00",
  ...
}

Note that any issues found with 1.0 versions of the specs will be addressed in the 1.1 work; drafts are referenced from the WG home page [1], as is the updated group mailing list. Each specification draft also has it’s own issues list, and you can feel free to raise issues directly on GitHub or over the mailing list.

Gregg

[1] https://www.w3.org/2018/json-ld-wg/

> Thanks,
> Michael
>  
>  
> Michael Steidl
> Lead of the Photo Metadata and Video Metadata
> Working Groups of IPTC (www.iptc.org) 
> Email: mwsteidl@newsit.biz

Received on Wednesday, 29 August 2018 16:23:17 UTC