Show / Hide Table of Contents

Class JsonLdProcessor

Implements the core JSON-LD processing.

Inheritance
object
JsonLdProcessor
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF.JsonLd
Assembly: dotNetRdf.dll
Syntax
public class JsonLdProcessor

Properties

| Edit this page View Source

BaseIri

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.

| Edit this page View Source

ProcessingMode

Get or set the current processing mode.

Declaration
public JsonLdProcessingMode? ProcessingMode { get; set; }
Property Value
Type Description
JsonLdProcessingMode?
| Edit this page View Source

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 Source

Canonicalize(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.

| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Properties
    • BaseIri
    • ProcessingMode
    • Warnings
  • Methods
    • Canonicalize(JArray)
    • Compact(JToken, JToken)
    • Compact(JToken, JToken, JsonLdProcessorOptions)
    • Expand(JToken, JsonLdProcessorOptions)
    • Expand(Uri, JsonLdProcessorOptions)
    • Flatten(JToken, JToken)
    • Flatten(JToken, JToken, JsonLdProcessorOptions)
    • Frame(JToken, JToken, JsonLdProcessorOptions)
  • Extension Methods
Back to top Generated by DocFX