Class JsonLdProcessor
Implements the core JSON-LD processing.
Inherited Members
Namespace: VDS.RDF.JsonLd
Assembly: dotNetRdf.dll
Syntax
public class JsonLdProcessor
Properties
| Edit this page View SourceBaseIri
Get or set the base IRI for processing.
Declaration
public Uri BaseIri { get; set; }
Property Value
Type | Description |
---|---|
Uri |
Remarks
This value should be set to the IRI of the document being processed if available.
ProcessingMode
Get or set the current processing mode.
Declaration
public JsonLdProcessingMode? ProcessingMode { get; set; }
Property Value
Type | Description |
---|---|
JsonLdProcessingMode? |
Warnings
Get the warnings generated by the processor.
Declaration
public List<JsonLdProcessorWarning> Warnings { get; }
Property Value
Type | Description |
---|---|
List<JsonLdProcessorWarning> |
Remarks
May be an empty list.
Methods
| Edit this page View SourceCanonicalize(JArray)
Returns the canonicalized RDF corresponding to the (already expanded!) JSON-LD input.
Declaration
public static string Canonicalize(JArray input)
Parameters
Type | Name | Description |
---|---|---|
JArray | input |
Returns
Type | Description |
---|---|
string |
Remarks
Caution: Make sure to use DateParseHandling.None when deserializing the JSON document.
Compact(JToken, JToken)
Run the Compaction algorithm.
Declaration
public JObject Compact(JToken input, JToken context)
Parameters
Type | Name | Description |
---|---|---|
JToken | input | The JSON-LD data to be compacted. Expected to be a JObject or JArray of JObject or a JString whose value is the IRI reference to a JSON-LD document to be retrieved. |
JToken | context | The context to use for the compaction process. May be a JObject, JArray of JObject, JString or JArray of JString. String values are treated as IRI references to context documents to be retrieved. |
Returns
Type | Description |
---|---|
JObject |
Compact(JToken, JToken, JsonLdProcessorOptions)
Run the Compaction algorithm.
Declaration
public static JObject Compact(JToken input, JToken context, JsonLdProcessorOptions options)
Parameters
Type | Name | Description |
---|---|---|
JToken | input | The JSON-LD data to be compacted. Expected to be a JObject or JArray of JObject or a JString whose value is the IRI reference to a JSON-LD document to be retrieved. |
JToken | context | The context to use for the compaction process. May be a JObject, JArray of JObject, JString or JArray of JString. String values are treated as IRI references to context documents to be retrieved. |
JsonLdProcessorOptions | options | Additional processor options. |
Returns
Type | Description |
---|---|
JObject |
Expand(JToken, JsonLdProcessorOptions)
Apply the JSON-LD expansion algorithm to a context JSON object.
Declaration
public static JArray Expand(JToken input, JsonLdProcessorOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
JToken | input | The context JSON object to be expanded. |
JsonLdProcessorOptions | options | Options to apply during the expansion processing. |
Returns
Type | Description |
---|---|
JArray | The expanded JSON-LD context. |
Expand(Uri, JsonLdProcessorOptions)
Apply the JSON-LD context expansion algorithm to the context found at the specified URL.
Declaration
public static JArray Expand(Uri contextUrl, JsonLdProcessorOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Uri | contextUrl | The URL to load the source context from. |
JsonLdProcessorOptions | options | Options to apply during the expansion processing. |
Returns
Type | Description |
---|---|
JArray | The expanded JSON-LD context. |
Flatten(JToken, JToken)
Flattens the given input and compacts it using the passed context according to the steps in the JSON-LD Flattening algorithm.
Declaration
public JToken Flatten(JToken input, JToken context)
Parameters
Type | Name | Description |
---|---|---|
JToken | input | |
JToken | context |
Returns
Type | Description |
---|---|
JToken |
Flatten(JToken, JToken, JsonLdProcessorOptions)
Flattens the given input and compacts it using the passed context according to the steps in the JSON-LD Flattening algorithm.
Declaration
public static JToken Flatten(JToken input, JToken context, JsonLdProcessorOptions options)
Parameters
Type | Name | Description |
---|---|---|
JToken | input | |
JToken | context | |
JsonLdProcessorOptions | options |
Returns
Type | Description |
---|---|
JToken |
Frame(JToken, JToken, JsonLdProcessorOptions)
Applies the framing algorithm to the specified input.
Declaration
public static JObject Frame(JToken input, JToken frame, JsonLdProcessorOptions options)
Parameters
Type | Name | Description |
---|---|---|
JToken | input | The input to be framed. |
JToken | frame | The framing specification document. |
JsonLdProcessorOptions | options | Processor options. |
Returns
Type | Description |
---|---|
JObject |