Skip to content

Do properties use @vocab as base IRI or with with textual concatenation #173

Closed
@lanthaler

Description

@lanthaler

The spec is currently ambigous as to whether @vocab is used as a base IRI or not. The syntax spec for instance states

@vocab: Used to set the base IRI for all property IRIs affected by the active context.

and

IRIs may be represented as an absolute IRI, a relative IRI, a term, a compact IRI, or as a value relative to @vocab.

whereas in API spec says (in IRI expansion)

  1. Otherwise, if the IRI being processed does not contain a colon and is a property, i.e., a key in a JSON object, or the value of @type and the active context has a @vocab mapping, join the mapped value to the suffix using textual concatenation

Expand-0028 illustrates the problem:

{
  "@context": {
    "@vocab": "http://example.org/vocab#",
    "date": { "@type": "dateTime" }
  },
  "@id": "example1",
  "@type": "test",
  "date": "2011-01-25T00:00:00Z",
  "embed": {
    "@id": "example2",
    "expandedDate": { "@value": "2012-08-01T00:00:00Z", "@type": "dateTime" }
  }
}

In this test date gets expanded to http://example.org/vocab#date, i.e., expansion uses textual concatenation. If @vocab would be used as base IRI instead, the result would be http://example.org/date.

PROPOSAL: Do not define @vocab as base IRI but as prefix.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions