Class JsonLdProcessor
Implements the core JSON-LD processing.
Inheritance
System.Object
JsonLdProcessor
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: VDS.RDF.JsonLd
Assembly: dotNetRDF.dll
Syntax
public class JsonLdProcessor
Properties
| Improve this Doc View SourceBaseIri
Get or set the base IRI for processing.
Declaration
public Uri BaseIri { get; set; }
Property Value
Type | Description |
---|---|
System.Uri |
Remarks
This value should be set to the IRI of the document being processed if available.
|
Improve this Doc
View Source
ProcessingMode
Get or set the current processing mode.
Declaration
public JsonLdProcessingMode? ProcessingMode { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<JsonLdProcessingMode> |
Warnings
Get the warnings generated by the processor.
Declaration
public List<JsonLdProcessorWarning> Warnings { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<JsonLdProcessorWarning> |
Remarks
May be an empty list.
Methods
| Improve this Doc View SourceCompact(JToken, JToken)
Run the Compaction algorithm.
Declaration
public JObject Compact(JToken input, JToken context)
Parameters
Type | Name | Description |
---|---|---|
Newtonsoft.Json.Linq.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. |
Newtonsoft.Json.Linq.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 |
---|---|
Newtonsoft.Json.Linq.JObject |
Compact(JToken, JToken, JsonLdProcessorOptions)
Run the Compaction algorithm.
Declaration
public static JObject Compact(JToken input, JToken context, JsonLdProcessorOptions options)
Parameters
Type | Name | Description |
---|---|---|
Newtonsoft.Json.Linq.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. |
Newtonsoft.Json.Linq.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 |
---|---|
Newtonsoft.Json.Linq.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 |
---|---|---|
Newtonsoft.Json.Linq.JToken | input | The context JSON object to be expanded. |
JsonLdProcessorOptions | options | Options to apply during the expansion processing. |
Returns
Type | Description |
---|---|
Newtonsoft.Json.Linq.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 |
---|---|---|
System.Uri | contextUrl | The URL to load the source context from. |
JsonLdProcessorOptions | options | Options to apply during the expansion processing. |
Returns
Type | Description |
---|---|
Newtonsoft.Json.Linq.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 |
---|---|---|
Newtonsoft.Json.Linq.JToken | input | |
Newtonsoft.Json.Linq.JToken | context |
Returns
Type | Description |
---|---|
Newtonsoft.Json.Linq.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 |
---|---|---|
Newtonsoft.Json.Linq.JToken | input | |
Newtonsoft.Json.Linq.JToken | context | |
JsonLdProcessorOptions | options |
Returns
Type | Description |
---|---|
Newtonsoft.Json.Linq.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 |
---|---|---|
Newtonsoft.Json.Linq.JToken | input | The input to be framed. |
Newtonsoft.Json.Linq.JToken | frame | The framing specification document. |
JsonLdProcessorOptions | options | Processor options. |
Returns
Type | Description |
---|---|
Newtonsoft.Json.Linq.JObject |