These tests implement the requirements for the JSON-LD [Deserialize JSON-LD to RDF Algorithm](https://www.w3.org/TR/json-ld11-api/#deserialize-json-ld-to-rdf-algorithm).
Tests generation of a triple using full URIs and a plain literal.
Plain literal with CURIE from default context
Tests generation of a triple using a CURIE defined in the default context.
Tests that a BNode is created if no explicit subject is set.
Tests that a plain literal is created with a language tag.
Tests that a literal may be created using extended characters.
Tests creation of a literal with a datatype.
Tests 'a' generates rdf:type and object is implicit IRI
Verify that 'a' is an alias for rdf:type, and the object is created as an IRI.
Generate an IRI using a prefix defined within an @context.
A property referencing an associative array gets object from subject of array.
Test object processing defines object with implicit BNode
If no @ is specified, a BNode is created, and will be used as the object of an enclosing property.
Tests that Multiple Objects are for a Single Property using array syntax.
Tests that @list: [] generates an empty list.
Creation of a list with multiple elements
Expanding an empty IRI uses the test file location.
Relative IRI expands relative resource location
Expanding a relative IRI uses the test file location.
Frag ID expands relative resource location
Expanding a fragment uses the test file location.
Tests coercion of object to anyURI when specified.
Tests coercion of object to a typed literal when specified.
Tests that a decimal value generates a xsd:double typed literal;.
Tests that a decimal value generates a xsd:integer typed literal.
Tests that a decimal value generates a xsd:boolean typed literal.
Tests that an array with a single element on a property with @list coercion creates an RDF Collection.
Tests that @type with an array of types creates multiple types.
Using @graph with other keys places triples in a named graph.
Tests that named graphs containing named graphs flatten to single level of graph naming.
top-level graph with string subject reference
Tests graphs containing subject references as strings.
Tests that generated triples do not depend on order of @context.
Tests that generated triples do not depend on order of @id.
Tests that generated triples do not depend on order of properties inside @context.
non-fractional numbers converted to xsd:double
xsd:double's canonical lexical is used when converting numbers without fraction that are coerced to xsd:double
The toRDF algorithm does not relabel blank nodes; it reuses the counter from the nodeMapGeneration to generate new ones
Basic use of creating a named graph using an IRI name
Basic use of creating a named graph using a BNode name
Dataset with a default and two named graphs
Dataset with a default and two named graphs (IRI and BNode)
Dataset from node with embedded named graph
Embedding @graph in a node creates a named graph
Dataset from node with embedded named graph (bnode)
Embedding @graph in a node creates a named graph. Graph name is created if there is no subject
Triples with blank node predicates are not dropped if the produce generalized RDF flag is true.
Proper (re-)labeling of blank nodes if used with reverse properties.
Expansion using a scoped context uses term scope for selecting proper term
property and value with different terms mapping to the same expanded property
scoped context layers on intemediate contexts
deep @type-scoped @context does NOT affect nested nodes
orders @type terms when applying scoped contexts
deep property-term scoped @context in @type-scoped @context affects nested nodes
type maps use scoped context from type index and not scoped context from containing
multiple type-scoped contexts are properly reverted
multiple type-scoped contexts are property reverted
multiple type-scoped types resolved against previous context
type-scoped context with multiple property scoped terms
type-scoped property-scoped contexts including @type:@vocab
composed type-scoped property-scoped contexts including @type:@vocab
type-scoped + property-scoped + values evaluates against previous context
type-scoped context with @propagate: true survive node-objects
@propagate: false on property-scoped context
property-scoped context with @propagate: false do not survive node-objects
embedded context with @propagate: false do not survive node-objects
@context resolutions respects relative URLs.
An embedded context which is never used should still be checked.
Unused context with an embedded context error.
An unused context with an embedded context should still be checked.
Scoped contexts may be externally loaded.
Terms should make use of @vocab relative to the scope in which the term was defined.
Expansion with empty property-scoped context.
Adding a minimal/empty property-scoped context should not affect expansion of terms defined in the outer scope.
property-scoped contexts which are alias of @nest
Nesting terms may have property-scoped contexts defined.
Expand string using default and term directions
Strings are coerced to have @direction based on default and term direction.
Expand string using default and term directions and languages
List values where the term has @direction are used in expansion.
Term selection with language maps and @direction.
simple language mapwith overriding term direction
simple language mapwith overriding null direction
simple language map with mismatching term direction
Generate an error if @direction has illegal value.
rdfDirection: i18n-datatype with direction and no language
Generates i18n datatype from literal with direction with option.
rdfDirection: i18n-datatype with direction and language
rdfDirection: compound-literal with direction and no language
rdfDirection: compound-literal with direction and language
Generates compound literal from literal with direction with option.
Free-floating nodes do not generate RDF triples (from expand-0001)
Properties mapped to null or which are never mapped are dropped (from expand-0003)
Type-coerced dates generate typed literals (from expand-0007)
Native types generate typed literals (from expand-0010)
@set of @value objects with keyword aliases
do not remove @graph if not at top-level
Embedded @graph without @id creates BNode-labeled named graph (from expand-0020)
do not remove @graph at top-level if not only property
Lists and sets of properties with list/set coercion
Expanding term mapping to @type uses @type syntax
Use @vocab in properties and @type but not in @id
Mapping a term to null decouples it from @vocab
Multiple properties expanding to the same IRI
Language maps with @vocab, default language, and colliding property
Triples with blank node predicates are dropped by default (from expand-0038).
language and index expansion on non-objects
Using reverse properties inside a @reverse-container
Remove free-floating set values and lists
Using strings as value of a reverse property
Term definitions with prefix separate from prefix definitions
Expansion of keyword aliases in term definitions
@vocab-relative IRIs in term definitions
Expand @vocab-relative term with @type: @vocab
Use terms with @type: @vocab but not with @type: @id
Overwrite document base with @base and reset it again
Coercing native types to arbitrary datatypes
Expand a reverse property with an index-container
Expand reverse property whose values are unlabeled blank nodes
Keys that are not mapped to an IRI in a reverse-map are dropped
Use @vocab to expand keys in reverse-maps
Redefine terms looking like compact IRIs
Objects are unordered, so serialized node definition containing @context may have @context at the end of the node definition
Objects are unordered, so serialized node definition containing @id may have @id at the end of the node definition
Use @vocab to map all properties to blank node identifiers
Use of the base option overrides the document location
Use of the expandContext option to expand the input document
Creates an @graph container if value is a graph
Don't double-expand an already expanded graph
Use of @graph containers with @index and @set
Do not expand [@graph, @index] container if value is a graph
Does not create a new graph object if indexed value is already a graph object
Use of @graph containers with @id and @set
Do not expand [@graph, @id] container if value is a graph
Value Expansion does not expand native values, such as booleans, to a node object
Use of an empty @base is applied to the base option
relative @base overrides base option and document location
Use of a relative @base overrides base option and document location
relative and absolute @base overrides base option and document location
Use of a relative and absolute @base overrides base option and document location
Various relative IRIs as properties with with @vocab: ''
expand @graph container (multiple objects)
expand [@graph, @set] container (multiple objects)
Creates an @graph container if value is a graph (multiple objects)
expand [@graph, @index] container (multiple indexed objects)
expand [@graph, @index, @set] container (multiple objects)
Do not expand [@graph, @index] container if value is a graph (multiple objects)
expand [@graph, @id] container (multiple objects)
expand [@graph, @id, @set] container (multiple objects)
Do not expand [@graph, @id] container if value is a graph (multiple objects)
Expand @graph container if value is a graph (multiple objects)
Expand @graph container if value is a graph (multiple graphs)
Creates an @graph container if value is a graph (mixed graph and object)
Do not expand [@graph, @index] container if value is a graph (mixed graph and object)
Do not expand [@graph, @id] container if value is a graph (mixed graph and object)
expand [@graph, @index] container (indexes with multiple objects)
expand [@graph, @id] container (multiple ids and objects)
IRI expansion of fragments including ':'
Do not treat as absolute IRIs values that look like compact IRIs if they're not absolute
Various relative IRIs as properties with with relative @vocab
Various relative IRIs as properties with with relative @vocab itself relative to an existing vocabulary base
Various relative IRIs as properties with with relative @vocab relative to another relative vocabulary base
context with JavaScript Object property names
Expand with context including JavaScript Object property names
Expansion allows multiple properties expanding to @type
An exception for the colliding keywords error is made for @type
Verifies that relative IRIs as properties with @vocab: '' in 1.0 generate an error
Pathological relative property IRIs in 1.0
Verifies that relative IRIs as properties with relative @vocab in 1.0 generate an error
A term starting with a colon can expand to a different IRI
Terms may begin with a colon and not be treated as IRIs.
Expanding a value staring with a colon does not treat that value as an IRI
Processors SHOULD generate a warning and MUST ignore terms having the form of a keyword.
Ignore some values of @id with @, allow others.
Processors SHOULD generate a warning and MUST ignore values of @id having the form of a keyword.
Ignore some values of @reverse with @, allow others.
Processors SHOULD generate a warning and MUST ignore values of @reverse having the form of a keyword.
Ignore some IRIs when that start with @ when expanding.
Processors SHOULD generate a warning and MUST ignore IRIs having the form of a keyword.
Value objects including invalid literal datatype IRIs are rejected
Verifies that @vocab defined as a compact IRI expands properly
Verifies that @vocab defined as a term expands properly
A scoped context may include itself recursively (direct)
Verifies that no exception is raised on expansion when processing a scoped context referencing itself directly
A scoped context may include itself recursively (indirect)
Verifies that no exception is raised on expansion when processing a scoped context referencing itself indirectly
Two scoped context may include a shared context
Verifies that no exception is raised on expansion when processing two scoped contexts referencing a shared context
Base without trailing slash, without path
Verify URI resolution relative to base (without trailing slash, without path) according to RFC 3986
Verify URI resolution relative to base (without trailing slash, with path) according to RFC 3986
Verifies that an exception is raised on expansion when a invalid term definition is found
Verifies that an exception is raised if @type is defined as a term with an empty map
Verifies that an exception is raised on expansion when a invalid container mapping is found
@nest MUST NOT have a value object value
does not allow a keyword other than @nest for the value of @nest
processingMode json-ld-1.0 conflicts with @version: 1.1
If processingMode is explicitly json-ld-1.0, it will conflict with 1.1 features.
If @version is specified, it must be 1.1
Keywords cannot be aliased to other keywords
Verifies that an exception is raised on expansion when processing an invalid context aliasing a keyword to another keyword
A context may not include itself recursively (direct)
Verifies that an exception is raised on expansion when processing a context referencing itself
A context may not include itself recursively (indirect)
Verifies that an exception is raised on expansion when processing a context referencing itself indirectly
Verifies that an exception is raised on expansion when a context dereference results in an error
Verifies that an exception is raised on expansion when a remote context is not an object containing @context
Verifies that an exception is raised on expansion when a context is not a string or object
Verifies that an exception is raised on expansion when a context contains an invalid @base
Verifies that an exception is raised on expansion when a context contains an invalid @vocab mapping
Verifies that an exception is raised on expansion when a context contains an invalid @language
Verifies that an exception is raised on expansion when a cyclic IRI mapping is found
Verifies that an exception is raised on expansion when a invalid type mapping is found
Verifies that an exception is raised on expansion when a invalid reverse property is found
Invalid IRI mapping (@reverse not a string)
Verifies that an exception is raised on expansion when a invalid IRI mapping is found
Invalid reverse property (invalid @container)
Verifies that an exception is raised on expansion when a invalid keyword alias is found
Verifies that an exception is raised on expansion when a invalid language mapping is found
Invalid IRI mapping (relative IRI in @type)
Verifies that an exception is raised in Expansion when a list of lists is found
Verifies that an exception is raised in Expansion when a invalid reverse property map is found
Verifies that an exception is raised in Expansion when colliding keywords are found
Verifies that an exception is raised in Expansion when an invalid @id value is found
Verifies that an exception is raised in Expansion when an invalid type value is found
Verifies that an exception is raised in Expansion when an invalid value object value is found
Verifies that an exception is raised in Expansion when an invalid language-tagged string value is found
Verifies that an exception is raised in Expansion when an invalid @index value value is found
Verifies that an exception is raised in Expansion when an invalid @reverse value is found
Invalid reverse property value (in @reverse)
Verifies that an exception is raised in Expansion when an invalid reverse property value is found
Verifies that an exception is raised in Expansion when an invalid language map value is found
Invalid reverse property value (through coercion)
Invalid value object (unexpected keyword)
Verifies that an exception is raised in Expansion when an invalid value object is found
Invalid value object (@type and @language)
Verifies that an exception is raised in Expansion when an invalid language-tagged value is found
Verifies that an exception is raised in Expansion when an invalid typed value is found
Verifies that an exception is raised in Expansion when an invalid set or list object is found
Verifies that an exception is raised on expansion when processing an invalid context attempting to define @container on a keyword
Expanding term mapping to @type uses @type syntax now illegal
Term definitions may look like compact IRIs, but must be consistent.
Verifies that a relative IRI cannot be used as a term.
A relative IRI cannot be used as a prefix
Verifies that an exception is raised in Expansion when an invalid IRI is used for @reverse.
Invalid value object value using a value alias
Verifies that an exception is raised in Expansion when an invalid value object value is found using a value alias
Verifies that an exception is raised on expansion when a context contains a definition for the empty term
Verifies that an exception is raised on expansion when a context contains an invalid @prefix value
Invalid value object, multiple values for @type.
The value of @type in a value object MUST be a string or null.
Invalid term definition, multiple values for @type.
The value of @type in an expanded term definition object MUST be a string or null.
Multiple properties mapping to @included are folded together
Error if @included value is a value object
Error if @included value is a list object
Tests transforming property with @type @json to a JSON literal (boolean true).
Tests transforming property with @type @json to a JSON literal (boolean false).
Tests transforming property with @type @json to a JSON literal (double).
Tests transforming property with @type @json to a JSON literal (double-zero).
Tests transforming property with @type @json to a JSON literal (integer).
Tests transforming property with @type @json to a JSON literal (object).
Tests transforming property with @type @json to a JSON literal (array).
Transform JSON literal with array canonicalization
Tests transforming JSON literal with array canonicalization.
Transform JSON literal with string canonicalization
Tests transforming JSON literal with string canonicalization.
Transform JSON literal with structural canonicalization
Tests transforming JSON literal with structural canonicalization.
Transform JSON literal with unicode canonicalization
Tests transforming JSON literal with unicode canonicalization.
Transform JSON literal with value canonicalization
Tests transforming JSON literal with value canonicalization.
Transform JSON literal with wierd canonicalization
Tests transforming JSON literal with wierd canonicalization.
Transform JSON literal without expanding contents
Tests transforming JSON literal does not expand terms inside json.
Transform JSON literal aleady in expanded form
Tests transforming JSON literal in expanded form.
Transform JSON literal aleady in expanded form with aliased keys
Tests transforming JSON literal in expanded form with aliased keys in value object.
Tests transforming property with @type @json to a JSON literal (string).
Tests transforming property with @type @json to a JSON literal (null).
Transform JSON literal with aliased @type
Tests transforming JSON literal with aliased @type.
Transform JSON literal with aliased @value
Tests transforming JSON literal with aliased @value.
Tests transforming JSON literal with a @context.
Transform JSON literal (null) aleady in expanded form.
Tests transforming property with @type @json to a JSON literal (empty array).
@list containing empty @list (with coercion)
coerced @list containing deep empty arrays
coerced @list containing mixed list values
Tests list elements expanded to IRIs with a good @base.
Tests list elements expanded to IRIs with a bad @base.
Tests list elements expanded to IRIs with an empty @base.
Tests list elements expanded to IRIs with a null @base.
Retains @id in object already having an @id
Adds @type to object not having an @type
Prepends @type in object already having an @type
Adds vocabulary expanded @type to object
string value of type map expands to node reference
string value of type map expands to node reference with @type: @id
string value of type map expands to node reference with @type: @vocab
string value of type map must not be a literal
Appends nested values when property at base and nested
Appends nested values from all @nest aliases in term order
Multiple keys may mapping to @type when nesting
literal_ascii_boundaries '\x00\x26\x28...' from N-Triples
literal_with_UTF8_boundaries '\x80\x7ff\x800\xfff...' from N-Triples
literal_all_controls '\x00\x01\x02\x03\x04...' from N-Triples
literal_all_punctuation '!"#$%&()...' from N-Triples
literal with squote "x'y" from N-Triples
literal with 2 squotes "x''y" from N-Triples
literal with dquote "x"y" from N-Triples
literal with 2 dquotes """a""b""" from N-Triples
REVERSE SOLIDUS at end of literal from N-Triples
literal with CHARACTER TABULATION from N-Triples
literal with CARRIAGE RETURN from N-Triples
literal with REVERSE SOLIDUS from N-Triples
literal with numeric escape4 \u from N-Triples
@version may be specified after first context
If processing mode is not set through API, it is set by the first context containing @version.
error if @version is json-ld-1.0 for property-valued index
Expanding index maps where index is a property.
error if @container does not include @index for property-valued index
error if @index is a keyword for property-valued index
error if @index is not a string for property-valued index
error if attempting to add property to value object for property-valued index
property-valued index expands to property value, instead of @index (value)
property-valued index appends to property value, instead of @index (value)
property-valued index expands to property value, instead of @index (node)
property-valued index appends to property value, instead of @index (node)
property-valued index does not output property for @none
property-valued index adds property to graph object
Check error when overriding a protected term.
A term with @protected: false is not protected.
A protected context protects all term definitions.
Do not protect term with @protected: false
A protected context does not protect terms with @protected: false.
Clear active context with protected terms from an embedded context
The Active context be set to null from an embedded context.
Clear active context of protected terms from a term.
The Active context may be set to null from a scoped context of a term.
Attempt to redefine term in other protected context.
A protected term cannot redefine another protected term.
Scoped context fail to override protected term.
Clear protection with array with null context
Fail to override protected terms with type.
Fail to override protected terms with type+null+ctx.
Fail with mix of protected and unprotected terms with type+null+ctx.
Fail with mix of protected and unprotected terms with type+null.
Check legal overriding of type-scoped protected term from nested node.
Allows redefinition of protected alias term with same definition.
Allows redefinition of protected prefix term with same definition.
Allows redefinition of terms with scoped contexts using same definitions.
Fails on redefinition of terms with scoped contexts using different definitions.
Allows redefinition of protected alias term with same definition modulo protected flag.
Fails if trying to redefine a protected null term.
A protected term with a null IRI mapping cannot be redefined.
Does not expand a Compact IRI using a non-prefix term.
Expansion of Compact IRIs considers if the term can be used as a prefix.
Keywords may not be redefined other than to protect them.
Protected keyword aliases cannot be overridden.
Fails if trying to declare a keyword alias as prefix.
Keyword aliases can not be used as prefixes.
Ignores a non-keyword term starting with '@'
Terms in the form of a keyword, which are not keywords, are ignored.
Ignores a non-keyword term starting with '@' (with @vocab)
Ignores a term mapping to a value in the form of a keyword.
Ignores a term mapping to a value in the form of a keyword (with @vocab).
Ignores a term mapping to a value in the form of a keyword (@reverse).
Ignores a term mapping to a value in the form of a keyword (@reverse with @vocab).
Protected terms and property-scoped contexts
Check overriding of protected term from property-scoped context.
numbers with no fractions but that are >= 1e21 are represented as xsd:double
Processors must detect source contexts that include @import.
@propagate: true on type-scoped context with @import
type-scoped context with @propagate: true survive node-objects (with @import)
@propagate: false on property-scoped context with @import
property-scoped context with @propagate: false do not survive node-objects (with @import)
Override term defined in sourced context
The containing context is merged into the source context.
Override @vocab defined in sourced context
Override protected terms in sourced context
@import may not be used in an imported context.
@import only valid within a term definition.
@import can only reference a single context
@import can only reference a single context.
@type: @none expands strings as value objects
@type: @none leaves inputs other than strings alone
Triples including invalid subject IRIs are rejected
ToRdf emits only well-formed statements.
Triples including invalid predicate IRIs are rejected
Triples including invalid object IRIs are rejected
Triples including invalid type IRIs are rejected
Triples including invalid language tags are rejected
Triples including invalid graph name IRIs are rejected