You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# If set to a value that is not `false`, the JSON-LD processor must modify the output of the Compaction Algorithm or the Expansion Algorithm by coalescing all properties associated with each subject via the Flattening Algorithm. The value of `flatten must` be either an _IRI_ value representing the name of the graph to flatten, or `true`. If the value is `true`, then the first graph encountered in the input document is selected and flattened.
# If contex has a @version member, it's value MUST be 1.1, otherwise an "invalid @version value" has been detected, and processing is aborted.
310
+
# If processingMode has been set, and "json-ld-1.1" is not a prefix of processingMode , a "processing mode conflict" has been detecting, and processing is aborted.
raiseJsonLdError::ProcessingModeConflict,"#{value} not compatible with #{processingMode}"
317
+
end
318
+
@processingMode ||= "json-ld-1.1"
319
+
else
320
+
raiseJsonLdError::InvalidVersionValue,value
321
+
end
322
+
end
323
+
324
+
# If context has a @vocab member: if its value is not a valid absolute IRI or null trigger an INVALID_VOCAB_MAPPING error; otherwise set the active context's vocabulary mapping to its value and remove the @vocab member from context.
# If context has a @vocab member: if its value is not a valid absolute IRI or null trigger an INVALID_VOCAB_MAPPING error; otherwise set the active context's vocabulary mapping to its value and remove the @vocab member from context.
425
444
context=context.dup# keep from modifying a hash passed as a param
# If not set explicitly, set processingMode to "json-ld-1.0"
461
+
result.processingMode ||= "json-ld-1.0"
462
+
439
463
defined={}
440
464
# For each key-value pair in context invoke the Create Term Definition subalgorithm, passing result for active context, context for local context, key, and defined
# If value contains an @container member, set the container mapping of definition to its value; if its value is neither @set, @index, @type, @id, an absolute IRI nor null, an invalid reverse property error has been detected (reverse properties only support set- and index-containers) and processing is aborted.
582
606
ifvalue.has_key?('@container')
583
607
container=value['@container']
584
-
# FIXME: Are URIS, @id, and @type reasonable for reverse mappings?
585
608
raiseJsonLdError::InvalidReverseProperty,
586
-
"unknown mapping for '@container' to #{container.inspect} on term #{term.inspect}"if
raiseJsonLdError::InvalidTermDefinition,'@nest not valid in term definition for JSON-LD 1.0'ifprocessingMode < 'json-ld-1.1'
674
+
675
+
# Not supported in JSON-LD 1.0
676
+
raiseJsonLdError::InvalidTermDefinition,'@nest not valid in term definition for JSON-LD 1.0'ifprocessingMode < 'json-ld-1.1'
677
+
650
678
nest=value['@nest']
651
679
raiseJsonLdError::InvalidNestValue,"nest must be a string, was #{nest.inspect}} on term #{term.inspect}"unlessnest.is_a?(String)
652
680
raiseJsonLdError::InvalidNestValue,"nest must not be a keyword other than @nest, was #{nest.inspect}} on term #{term.inspect}"ifnest.start_with?('@') && nest != '@nest'
@@ -1310,6 +1338,7 @@ def inspect
1310
1338
v=%w([Context)
1311
1339
v << "base=#{base}"ifbase
1312
1340
v << "vocab=#{vocab}"ifvocab
1341
+
v << "processingMode=#{processingMode}"ifprocessingMode
1313
1342
v << "default_language=#{default_language}"ifdefault_language
1314
1343
v << "term_definitions[#{term_definitions.length}]=#{term_definitions}"
0 commit comments