From 06586d78c482db8dd969c6cde27464d7d4b1297a Mon Sep 17 00:00:00 2001
From: Gregg Kellogg Syntax Tokens and Keywords
language of a JSON-LD document. This keyword is described in
.
@type
@type
to define a type for both node objects and value objects
+ addresses the basic need to type data,
+ be it a literal value or a more complicated resource.
+ @container
Specifying the Type
.
As a syntax, JSON has only a limited number of syntactic elements:
+true
and false
, which describe literal boolean values,Null
, which describes the absense of a value,The JSON-LD data model allows for a richer set of resources, based on the RDF data mode. + The data model is described more fully in . + JSON-LD uses JSON objects to describe various resources, along with the relationships + between these resources:
+@index
.
+ See for more information,
+ and for the normative definition.
+ @id
.
+ See for more information,
+ and for the normative definition.
+ @type
.
+ See for more information,
+ and for the normative definition.
+ @nest
@none
@prefix
Since keywords cannot be redefined, they can also not be aliased to other keywords.
-Aliased keywords may not be used within a context, itself.
+Aliased keywords MUST NOT be used within a context, itself.
The modified key's value above is automatically type coerced to a +
The modified key's value above is automatically type interpreted as a
dateTime value because of the information specified in the
@context
. The example tabs show how a JSON-LD processor will interpret the data.
The @type
keyword is also used to associate a type
with a node. The concept of a node type and
- a value type are different.
A node type specifies the type of thing that is being described, like a person, place, event, or web page. A @@ -9629,6 +9630,175 @@
JSON-LD keywords are described in , + this section describes where each keyword may appear within different JSON-LD structures.
+ +@base
@base
keyword MUST NOT be aliased, and MAY be used as a key in a context definition.
+ Its value MUST be an absolute IRI, a relative IRI, or null.
+ @container
@container
keyword MUST NOT be aliased, and MAY be used as a key in an expanded term definition.
+ Its value MUST be either
+ @list
,
+ @set
,
+ @language
,
+ @index
,
+ @id
,
+ @graph
,
+ @type
, or be
+ null,
+ or an array containing exactly any one of those keywords, or a
+ combination of @set
and any of @index
,
+ @id
, @graph
, @type
,
+ @language
in any order.
+ The value may also be an array
+ containing @graph
along with either @id
or
+ @index
and also optionally including @set
.
+ @context
@context
keyword MUST NOT be aliased, and MAY be used as a key in the following objects:
+ @context
MUST be
+ null,
+ an absolute IRI,
+ a relative IRI,
+ a context definition, or
+ an array composed of any of these.
+ @id
@id
keyword MAY be aliased and MAY be used as a key in a node object or a graph object.
+ The unaliased @id
MAY be used as a key in an expanded term definition,
+ or as the value of the @container
key within an expanded term definition.
+ The value of the @id
key MUST be an absolute IRI, a relative IRI,
+ or a compact IRI (including blank node identifiers).
+ See ,
+ , and
+ for further discussion on
+ @id
values.
+ @index
@index
keyword MAY be aliased and MAY be used as a key in a
+ node object, value object, graph object, set object, or list object.
+ The unaliased @index
MAY be used as the value of the @container
key within an expanded term definition.
+ Its value MUST be a string.
+ See for a further discussion.
+ @language
@language
keyword MAY be aliased and MAY be used as a key in a value object.
+ The unaliased @language
MAY be used as a key in a context definition,
+ or as the value of the @container
key within an expanded term definition.
+ Its value MUST be a string with the lexical form described in [[BCP47]] or be null..
+ See for a further discussion.
+ @list
@list
keyword MAY be aliased and MUST be used as a key in a list object.
+ The unaliased @list
MAY be used as the value of the @container
key within an expanded term definition.
+ Its value MUST be one of the following:
+ @nest
@nest
keyword MAY be aliased and MAY be used as a key in a node object.
+ The unaliased @nest
MAY be used as the value of a simple term definition,
+ or as a key in an expanded term definition.
+ When used in a node object, its value must be a dictionary.
+ When used in an expanded term definition, its value MUST be a term expanding to @nest
.
+ Its value MUST be a string.
+ See for a further discussion.
+ @none
@none
keyword MAY be aliased and MAY beused as a key in an
+ index map, id map, language map, type map.
+ See ,
+ ,
+ ,
+ ,
+ , or
+
+ for a further discussion.@prefix
@prefix
keyword MUST NOT be aliased, and MAY be used as a key in an expanded term definition.
+ Its value MUST be true
or false
.
+ See
+ and
+ for a further discussion.
+ @reverse
@reverse
keyword MAY be aliased and MAY be used as a key in a node object.
+ The unaliased @reverse
MAY be used as a key in an expanded term definition.
+ The value of the @reverse
key MUST be an absolute IRI, a relative IRI,
+ or a compact IRI (including blank node identifiers).
+ See and
+ for further discussion.
+ @set
@set
keyword MAY be aliased and MUST be used as a key in a set object.
+ The unaliased @set
MAY be used as the value of the @container
key within an expanded term definition.
+ Its value MUST be one of the following:
+ @type
@type
keyword MAY be aliased and MAY be used as a key in a node object or a value object.
+ The unaliased @type
MAY be used as a key in an expanded term definition,
+ or as the value of the @container
key within an expanded term definition.
+ The value of the @type
key MUST be a term, absolute IRI, a relative IRI,
+ or a compact IRI (including blank node identifiers).
+ Within an expanded term definition, its value may also be either @id
or @vocab
.
+ This keyword is described further in
+ and .
+ @value
@value
keyword MAY be aliased and MUST be used as a key in a value object.
+ Its value key MUST be either a string, a number, true, false or null.
+ This keyword is described further in .
+ @version
@version
keyword MUST NOT be aliased and MAY be used as a key in a context definition.
+ Its value MUST be a number with the value 1.1
.
+ This keyword is described further in .
+ @vocab
@vocab
keyword MUST NOT be aliased and MAY be used as a key in a context definition
+ or as the value of @type
in an expanded term definition.
+ Its value MUST be a absolute IRI, a compact IRI, a blank node identifier, an empty string (""), a term, or null.
+ This keyword is described further in ,
+ and .
+ @type
to define a type for both node objects and value objects
- addresses the basic need to type data,
- be it a literal value or a more complicated resource.
+ @type
to define a type for both
+ node objects and value objects addresses the basic need to type data,
+ be it a literal value or a more complicated resource.
+ Experts may find the overloaded use of the @type
keyword for both purposes concerning,
+ but should note that Web developer usage of this feature over multiple years
+ has not resulted in its misuse due to the far less frequent use of @type
+ to express typed literal values.
@container
The JSON-LD data model allows for a richer set of resources, based on the RDF data mode. +
The JSON-LD data model allows for a richer set of resources, based on the RDF data model. The data model is described more fully in . JSON-LD uses JSON objects to describe various resources, along with the relationships between these resources:
@@ -3114,7 +3114,7 @@The modified key's value above is automatically type interpreted as a +
The modified key's value above is automatically interpreted as a
dateTime value because of the information specified in the
@context
. The example tabs show how a JSON-LD processor will interpret the data.
@container
@container
keyword MUST NOT be aliased, and MAY be used as a key in an expanded term definition.
Its value MUST be either
- @list
,
- @set
,
- @language
,
- @index
,
- @id
,
- @graph
,
- @type
, or be
- null,
- or an array containing exactly any one of those keywords, or a
- combination of @set
and any of @index
,
- @id
, @graph
, @type
,
- @language
in any order.
- The value may also be an array
- containing @graph
along with either @id
or
- @index
and also optionally including @set
.
+ @list
,
+ @set
,
+ @language
,
+ @index
,
+ @id
,
+ @graph
,
+ @type
, or be
+ null,
+ or an array containing exactly any one of those keywords, or a
+ combination of @set
and any of @index
,
+ @id
, @graph
, @type
,
+ @language
in any order.
+ The value may also be an array
+ containing @graph
along with either @id
or
+ @index
and also optionally including @set
.
@context
@context
keyword MUST NOT be aliased, and MAY be used as a key in the following objects:
+ The @context
keyword MUST NOT be aliased, and MAY be used as a key in the following objects:
As a syntax, JSON has only a limited number of syntactic elements:
+true
and false
, which describe literal boolean values,Null
, which describes the absense of a value,The JSON-LD data model allows for a richer set of resources, based on the RDF data model. + The data model is described more fully in . + JSON-LD uses JSON objects to describe various resources, along with the relationships + between these resources:
+@index
.
+ See for more information,
+ and for the normative definition.
+ @id
.
+ See for more information,
+ and for the normative definition.
+ @type
.
+ See for more information,
+ and for the normative definition.
+ @type
helps
to clarify the association.
- The type of a particular node can be specified using the @type
+
The type of a particular node can be specified using the @type
keyword. In Linked Data, types are uniquely
identified with an IRI.
The value of an @type
key may also be a term defined in the active context:
The value of a @type
key may also be a term defined in the active context:
In addition to setting the type of nodes,
+ @type
can also be used to set the type of a value
+ to create a typed value.
+ This use of @type
is similar to that used to define the type of a node object,
+ but value objects are restricted to having just a single type.
+ The use of @type to create typed values is discussed more fully in .
Typed values can also be defined implicitly, by specifying + @type in an expanded term definition. + This is covered more fully in .
+ +The ability coerce a value using a term definition is distinct + from setting one or more types on a node object, as the former does not result in + new data being added to the graph, while the later manages node types + through adding additional relationships to the graph.
+This section only covers the most basic features associated with
types in JSON-LD. It is worth noting that the @type
keyword is not only used to specify the type of a
@@ -1440,86 +1536,6 @@
As a syntax, JSON has only a limited number of syntactic elements:
-true
and false
, which describe literal boolean values,Null
, which describes the absense of a value,The JSON-LD data model allows for a richer set of resources, based on the RDF data model. - The data model is described more fully in . - JSON-LD uses JSON objects to describe various resources, along with the relationships - between these resources:
-@index
.
- See for more information,
- and for the normative definition.
- @id
.
- See for more information,
- and for the normative definition.
- @type
.
- See for more information,
- and for the normative definition.
- This section only covers the most basic features of JSON-LD. More advanced features, + including typed values, indexed values, and named graphs, + can be found in .
+ +This section only covers the most basic features associated with
- types in JSON-LD. It is worth noting that the @type
- keyword is not only used to specify the type of a
- node but also to express typed values
- (as described in ) and to
- type coerce values (as described in
- ). Specifically, @type
- cannot be used in a context to define a node's
- type. For a detailed description of the differences, please refer to
- .