Show / Hide Table of Contents

Class JsonLdProcessorOptions

A collection of options for setting up the JSON-LD processor.

Inheritance
object
JsonLdProcessorOptions
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 JsonLdProcessorOptions

Properties

| Edit this page View Source

Base

The base IRI to use when expanding or compacting the document.

Declaration
public Uri Base { get; set; }
Property Value
Type Description
Uri
Remarks

If set, this overrides the input document's IRI.

| Edit this page View Source

CompactArrays

Flag indicating if arrays of one element should be replaced by the single value during compaction.

Declaration
public bool CompactArrays { get; set; }
Property Value
Type Description
bool
Remarks

If set to true, the JSON-LD processor replaces arrays with just one element with that element during compaction. If set to false, all arrays will remain arrays even if they have just one element.

Defaults to true.

| Edit this page View Source

CompactToRelative

Determines if IRIs are compacted relative to the base option or document location when compacting.

Declaration
public bool CompactToRelative { get; set; }
Property Value
Type Description
bool
Remarks

Defaults to true.

| Edit this page View Source

DocumentLoader

The callback of the loader to be used to retrieve remote documents and contexts.

Declaration
public Func<Uri, JsonLdLoaderOptions, RemoteDocument> DocumentLoader { get; set; }
Property Value
Type Description
Func<Uri, JsonLdLoaderOptions, RemoteDocument>
Remarks

If specified, the DocumentLoader is used to retrieve remote documents and contexts; otherwise, if not specified, the processor's built-in loader is used.

If the function returns null or throws an exception, it will be assumed that dereferencing the IRI has failed.

| Edit this page View Source

Embed

Get/set the value of the object embed flag used in the Framing Algorithm.

Declaration
public JsonLdEmbed Embed { get; set; }
Property Value
Type Description
JsonLdEmbed
| Edit this page View Source

ExpandContext

A context that is used to initialize the active context when expanding a document.

Declaration
public JToken ExpandContext { get; set; }
Property Value
Type Description
JToken
| Edit this page View Source

Explicit

Get/Set the value of the explicit inclusion flag used in the Framing Algorithm.

Declaration
public bool Explicit { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

ExtractAllScripts

Specifies whether HTML document processing should target all of the JSON-LD script elements in the document or not.

Declaration
public bool ExtractAllScripts { get; set; }
Property Value
Type Description
bool
Remarks

If set to true, when extracting JSON-LD script elements from HTML, unless a specific fragment identifier is targeted, extracts all encountered JSON-LD script elements using an array form, if necessary. Defaults to false.

| Edit this page View Source

FrameDefault

Instead of framing a merged graph, frame only the default graph.

Declaration
public bool FrameDefault { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

FrameExpansion

Specifies whether special frame expansion rules should be applied during expansion and/or RDF serialization.

Declaration
public bool FrameExpansion { get; set; }
Property Value
Type Description
bool
Remarks

Enables special frame processing rules for the Expansion Algorithm.

Enables special rules for the Serialize RDF as JSON-LD Algorithm to use JSON-LD native types as values, where possible.

Defaults to false.

| Edit this page View Source

Loader

The callback of the loader to be used to retrieve remote documents and contexts.

Declaration
[Obsolete("The Loader property has been deprecated in favor of the DocumentLoader property.", true)]
public Func<Uri, JsonLdLoaderOptions, RemoteDocument> Loader { get; set; }
Property Value
Type Description
Func<Uri, JsonLdLoaderOptions, RemoteDocument>
Remarks

This property has been replaced by the DocumentLoader property whose name matches that defined by the JSON-LD 1.1 API specification.

| Edit this page View Source

OmitDefault

Get/Set the value of the omit default flag used in the Framing Algorithm.

Declaration
public bool OmitDefault { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

OmitGraph

Get or set the value of the omit graph flag used in the Framing Algorithm.

Declaration
public bool OmitGraph { get; set; }
Property Value
Type Description
bool
Remarks

Defaults to false if ProcessingMode is JsonLd10, true otherwise.

| Edit this page View Source

Ordered

Specifies whether the processor should operate on properties in lexicographical order or not.

Declaration
public bool Ordered { get; set; }
Property Value
Type Description
bool
Remarks

If set to true, certain algorithm processing steps where indicated are ordered lexicographically. If false, order is not considered in processing.

Defaults to false.

| Edit this page View Source

ProcessingMode

Get or set the processing model that the processor will use.

Declaration
public JsonLdProcessingMode? ProcessingMode { get; set; }
Property Value
Type Description
JsonLdProcessingMode?
Remarks

This implementation supports only the json-ld-1.0 (using JsonLd10) and json-ld-1.1 (using JsonLd11) processing modes as defined in the JSON-LD 1.1 specification.

Defaults to JsonLd11.

| Edit this page View Source

ProduceGeneralizedRdf

If set to true, the JSON-LD processor may emit blank nodes for triple predicates, otherwise they will be omitted.

Declaration
public bool ProduceGeneralizedRdf { get; set; }
Property Value
Type Description
bool
Remarks

This feature of JSON-LD is deprecated in JSON-LD 1.1 and may be removed in future versions of the specification.

Default to false.

| Edit this page View Source

PruneBlankNodeIdentifiers

Removes @id from node objects where the value is a blank node identifier used only once within the document.

Declaration
public bool PruneBlankNodeIdentifiers { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

RdfDirection

Get or set the method by which literal values containing a base direction are transformed to and from RDF.

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

RemoteContextLimit

The maximum number of remote context references to load during processing.

Declaration
public int RemoteContextLimit { get; set; }
Property Value
Type Description
int
Remarks

If set to 0, remote context processing is disabled. If set to a value less than 0, there is no limit on the number of remote contexts that can be processed. Defaults to 10.

This property is no longer part of the JSON-LD specification but is provided as as convenience for developers to ensure that there is a limit to remote context processing (or that remote context processing is completely disabled by setting this property to 0).

| Edit this page View Source

RequireAll

Get or set the value of the require all flag used in the Framing Algorithm.

Declaration
public bool RequireAll { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

UseNativeTypes

Get or set the flag that determines whether or not JSON native values should be used in literals.

Declaration
public bool UseNativeTypes { get; set; }
Property Value
Type Description
bool
Remarks

If enabled, causes the Serialize RDF as JSON-LD Algorithm to use native JSON values in value objects avoiding the need for an explicitly @type.

Defaults to false.

| Edit this page View Source

UseRdfType

Get or set the flag that controls the serialization of rdf:type properties when serializing RDF as JSON-LD.

Declaration
public bool UseRdfType { get; set; }
Property Value
Type Description
bool
Remarks

Enables special rules for the Serialize RDF as JSON-LD Algorithm causing rdf:type properties to be kept as IRIs in the output, rather than use @type. Defaults to false.

Methods

| Edit this page View Source

Clone()

Create a copy of this instance, cloning all of its values.

Declaration
public JsonLdProcessorOptions Clone()
Returns
Type Description
JsonLdProcessorOptions

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Properties
    • Base
    • CompactArrays
    • CompactToRelative
    • DocumentLoader
    • Embed
    • ExpandContext
    • Explicit
    • ExtractAllScripts
    • FrameDefault
    • FrameExpansion
    • Loader
    • OmitDefault
    • OmitGraph
    • Ordered
    • ProcessingMode
    • ProduceGeneralizedRdf
    • PruneBlankNodeIdentifiers
    • RdfDirection
    • RemoteContextLimit
    • RequireAll
    • UseNativeTypes
    • UseRdfType
  • Methods
    • Clone()
  • Extension Methods
Back to top Generated by DocFX