Closed SvenPVoigt closed 2 years ago
The http://schema.org/ context defines contentUrl
using "@type": "@id"
, as you would expect.
Thanks for pointing that out. It is not as I would expect, since URL is a datatype, which is used to type RDF literals not IRIs. For example, the superclass of URL is text, which is obviously a datatype.
I would also expect about
to be @type: @id
since it is supposed to reference Things
, which would have @id
attributes. I guess my confusion is with schema.org's jsonld implementation then.
In JSON-LD, IRIs are identifiers (it's in the name). Literals are not identifiers, but may be values. It's true that there is an xsd:anyUri
datatype, that is appropriate to use for literals that have the form of a URI.
JSON-LD takes the model from RDF, which basically has identifiers and literals, with literals only appearing in the object (value) position. If an identifier is used as the value (such as an IRI or blank node), it refers to another entity, possibly in the same file, which is used by the framing and flattening algorithms.
I would also expect
about
to be@type: @id
since it is supposed to referenceThings
, which would have@id
attributes. I guess my confusion is with schema.org's jsonld implementation then.
Schema.org is conservative in implicitly casting properly values as @id
, and will accept most anything. As you can see with contentUrl
, there are exceptions, but that one is fairly clearly intended to be an identifier (actually, resource locator). You might say {"about": "Bob"}
, and Google may be able to make sense of that, even though "Bob" isn't necessarily an identifier.
These things are probably best discussed on Stack Overflow or Gitter, rather than as issues against the specification. Issues regarding the playground can be made on https://github.com/json-ld/json-ld.org/issues.
Hello all,
In the specification https://www.w3.org/TR/json-ld/#iris there are three rules for what json values can be converted to IRIs:
However, in the playground, when I expand the object:
The expanded form shows:
The use of
@id
indicates that the contentUrl was interpreted as an IRI, even though none of the three conditions were met. contentUrl should have been interpreted as an@value
according to the specification.