Show / Hide Table of Contents

Class NodeFactory

A default implementation of a Node Factory which generates Nodes unrelated to Graphs (wherever possible we suggest using a Graph based implementation instead).

Inheritance
System.Object
NodeFactory
Implements
INodeFactory
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public class NodeFactory : INodeFactory

Constructors

| Improve this Doc View Source

NodeFactory(Uri, INamespaceMapper, bool, IUriFactory)

Creates a new Node Factory.

Declaration
[Obsolete("Replaced by NodeFactory(NodeFactoryOptions, INamespaceMapper, IUriFactory)")]
public NodeFactory(Uri baseUri = null, INamespaceMapper namespaceMap = null, bool normalizeLiteralValues = false, IUriFactory uriFactory = null)
Parameters
Type Name Description
System.Uri baseUri

The initial base URI to use for the resolution of relative URI references. Defaults to null.

INamespaceMapper namespaceMap

The namespace map to use for the resolution of QNames. If not specified, a default NamespaceMapper instance will be created.

System.Boolean normalizeLiteralValues

Whether or not to normalize the value strings of literal nodes.

IUriFactory uriFactory

The factory to use to create URIs. Defaults to the root UriFactory instance.

| Improve this Doc View Source

NodeFactory(NodeFactoryOptions, INamespaceMapper, IUriFactory)

Creates a new Node Factory.

Declaration
public NodeFactory(NodeFactoryOptions options, INamespaceMapper namespaceMap = null, IUriFactory uriFactory = null)
Parameters
Type Name Description
NodeFactoryOptions options

Configuration options for this node factory.

INamespaceMapper namespaceMap

The namespace map to use for the resolution of QNames. If not specified, a default NamespaceMapper instance will be created.

IUriFactory uriFactory

The factory to use to create URIs. Defaults to the root UriFactory instance.

Properties

| Improve this Doc View Source

BaseUri

Get or set the base URI used to resolve relative URI references.

Declaration
public Uri BaseUri { get; set; }
Property Value
Type Description
System.Uri
Remarks

If BaseUri is null, attempting to invoke CreateUriNode(Uri) with a relative URI or CreateUriNode(string) with a QName that resolves to a relative URI will result in a RdfException being raised.

| Improve this Doc View Source

NamespaceMap

Get the namespace map for this node factory.

Declaration
public INamespaceMapper NamespaceMap { get; }
Property Value
Type Description
INamespaceMapper
| Improve this Doc View Source

NormalizeLiteralValues

Get or set the flag that controls whether the value strings of literal nodes should be normalized on creation.

Declaration
public bool NormalizeLiteralValues { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

UriFactory

Get or set the factory to use when creating URIs.

Declaration
public IUriFactory UriFactory { get; set; }
Property Value
Type Description
IUriFactory
| Improve this Doc View Source

ValidateLanguageSpecifiers

Get or set the flag that controls whether or not language tags are validated when creating language-tagged literal nodes.

Declaration
public bool ValidateLanguageSpecifiers { get; set; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

CreateBlankNode()

Creates a Blank Node with a new automatically generated ID.

Declaration
public IBlankNode CreateBlankNode()
Returns
Type Description
IBlankNode
| Improve this Doc View Source

CreateBlankNode(string)

Creates a Blank Node with the given Node ID.

Declaration
public IBlankNode CreateBlankNode(string nodeId)
Parameters
Type Name Description
string nodeId

Node ID.

Returns
Type Description
IBlankNode
| Improve this Doc View Source

CreateGraphLiteralNode()

Creates a Graph Literal Node which represents the empty Sub-graph.

Declaration
public IGraphLiteralNode CreateGraphLiteralNode()
Returns
Type Description
IGraphLiteralNode
| Improve this Doc View Source

CreateGraphLiteralNode(IGraph)

Creates a Graph Literal Node which represents the given Sub-graph.

Declaration
public IGraphLiteralNode CreateGraphLiteralNode(IGraph subgraph)
Parameters
Type Name Description
IGraph subgraph

Subgraph.

Returns
Type Description
IGraphLiteralNode
| Improve this Doc View Source

CreateLiteralNode(string, string)

Creates a Literal Node with the given Value and Language.

Declaration
public ILiteralNode CreateLiteralNode(string literal, string langSpec)
Parameters
Type Name Description
string literal

Value of the Literal.

string langSpec

Language Specifier for the Literal.

Returns
Type Description
ILiteralNode
| Improve this Doc View Source

CreateLiteralNode(string, Uri)

Creates a Literal Node with the given Value and Data Type.

Declaration
public ILiteralNode CreateLiteralNode(string literal, Uri datatype)
Parameters
Type Name Description
string literal

Value of the Literal.

System.Uri datatype

Data Type URI of the Literal.

Returns
Type Description
ILiteralNode
| Improve this Doc View Source

CreateLiteralNode(string)

Creates a Literal Node with the given Value.

Declaration
public ILiteralNode CreateLiteralNode(string literal)
Parameters
Type Name Description
string literal

Value of the Literal.

Returns
Type Description
ILiteralNode
| Improve this Doc View Source

CreateTripleNode(Triple)

Creates a node that quotes the given triple.

Declaration
public ITripleNode CreateTripleNode(Triple triple)
Parameters
Type Name Description
Triple triple

The triple to be the quoted value of the created node.

Returns
Type Description
ITripleNode
| Improve this Doc View Source

CreateUriNode()

Creates a URI Node that corresponds to the current Base URI of the node factory.

Declaration
public IUriNode CreateUriNode()
Returns
Type Description
IUriNode

A new URI Node.

Exceptions
Type Condition
RdfException

Raised if BaseUri is currently null.

| Improve this Doc View Source

CreateUriNode(string)

Creates a URI Node for the given QName using the Graphs NamespaceMap to resolve the QName.

Declaration
public IUriNode CreateUriNode(string qName)
Parameters
Type Name Description
string qName

QName.

Returns
Type Description
IUriNode

A new URI node.

| Improve this Doc View Source

CreateUriNode(Uri)

Creates a URI Node for the given URI.

Declaration
public IUriNode CreateUriNode(Uri uri)
Parameters
Type Name Description
System.Uri uri

URI.

Returns
Type Description
IUriNode
| Improve this Doc View Source

CreateVariableNode(string)

Creates a Variable Node for the given Variable Name.

Declaration
public IVariableNode CreateVariableNode(string varName)
Parameters
Type Name Description
string varName
Returns
Type Description
IVariableNode
| Improve this Doc View Source

GetNextBlankNodeID()

Creates a new unused Blank Node ID and returns it.

Declaration
public string GetNextBlankNodeID()
Returns
Type Description
string
| Improve this Doc View Source

ResolveQName(string)

Resolve a QName to a URI using this factory's NamespaceMap and BaseUri.

Declaration
public Uri ResolveQName(string qName)
Parameters
Type Name Description
string qName
Returns
Type Description
System.Uri

Implements

INodeFactory

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • NodeFactory(Uri, INamespaceMapper, bool, IUriFactory)
    • NodeFactory(NodeFactoryOptions, INamespaceMapper, IUriFactory)
  • Properties
    • BaseUri
    • NamespaceMap
    • NormalizeLiteralValues
    • UriFactory
    • ValidateLanguageSpecifiers
  • Methods
    • CreateBlankNode()
    • CreateBlankNode(string)
    • CreateGraphLiteralNode()
    • CreateGraphLiteralNode(IGraph)
    • CreateLiteralNode(string, string)
    • CreateLiteralNode(string, Uri)
    • CreateLiteralNode(string)
    • CreateTripleNode(Triple)
    • CreateUriNode()
    • CreateUriNode(string)
    • CreateUriNode(Uri)
    • CreateVariableNode(string)
    • GetNextBlankNodeID()
    • ResolveQName(string)
  • Implements
  • Extension Methods
Back to top Generated by DocFX