Class JsonLdProcessorOptions
A collection of options for setting up the JSON-LD processor.
Inheritance
Inherited Members
Namespace: VDS.RDF.JsonLd
Assembly: dotNetRdf.dll
Syntax
public class JsonLdProcessorOptions
Properties
| Improve this Doc View SourceBase
The base IRI to use when expanding or compacting the document.
Declaration
public Uri Base { get; set; }
Property Value
Type | Description |
---|---|
System.Uri |
Remarks
If set, this overrides the input document's IRI.
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 |
---|---|
System.Boolean |
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.
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 |
---|---|
System.Boolean |
Remarks
Defaults to true.
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 |
---|---|
System.Func<T1, T2, TResult><System.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.
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 |
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 |
---|---|
Newtonsoft.Json.Linq.JToken |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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.
FrameDefault
Instead of framing a merged graph, frame only the default graph.
Declaration
public bool FrameDefault { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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.
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 |
---|---|
System.Func<T1, T2, TResult><System.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.
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
Remarks
Defaults to false if ProcessingMode is JsonLd10, true otherwise.
Ordered
Specifies whether the processor should operate on properties in lexicographical order or not.
Declaration
public bool Ordered { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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.
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.
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 |
---|---|
System.Boolean |
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.
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 |
---|---|
System.Boolean |
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? |
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 a value less than 0, there is no limit on the number of remote contexts that can be processed. Defaults to -1 (no limit).
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).
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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.
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 |
---|---|
System.Boolean |
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
| Improve this Doc View SourceClone()
Create a copy of this instance, cloning all of its values.
Declaration
public JsonLdProcessorOptions Clone()
Returns
Type | Description |
---|---|
JsonLdProcessorOptions |