Show / Hide Table of Contents

Class RdfAContext

Base implementation of the IRdfAContext interface.

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

Constructors

| Edit this page View Source

RdfAContext()

Create a new empty vocabulary.

Declaration
public RdfAContext()
| Edit this page View Source

RdfAContext(string, IEnumerable<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>)

Create a new RDFa context with the specified default vocabulary URI, term and prefix mappings.

Declaration
public RdfAContext(string vocabularyUri, IEnumerable<KeyValuePair<string, string>> terms, IEnumerable<KeyValuePair<string, string>> prefixes)
Parameters
Type Name Description
string vocabularyUri

The default vocabulary URI. If null, the context will be defined with no default vocabulary URI.

IEnumerable<KeyValuePair<string, string>> terms

An enumeration of key value pairs mapping each term to the URI that the term maps to. May be null.

IEnumerable<KeyValuePair<string, string>> prefixes

An enumeration of key value pairs mapping each prefix to the URI that the prefix maps to. May be null.

| Edit this page View Source

RdfAContext(IRdfAContext)

Create a new vocabulary from an existing vocabulary.

Declaration
public RdfAContext(IRdfAContext context)
Parameters
Type Name Description
IRdfAContext context

The base vocabulary to copy.

| Edit this page View Source

RdfAContext(IRdfAContext, string, IEnumerable<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, Uri>>)

Create a new vocabulary that extends an existing vocabulary and add terms and prefix mappings to it.

Declaration
public RdfAContext(IRdfAContext baseContext, string vocabularyUri, IEnumerable<KeyValuePair<string, string>> terms = null, IEnumerable<KeyValuePair<string, Uri>> prefixMappings = null)
Parameters
Type Name Description
IRdfAContext baseContext
string vocabularyUri
IEnumerable<KeyValuePair<string, string>> terms
IEnumerable<KeyValuePair<string, Uri>> prefixMappings

Properties

| Edit this page View Source

Mappings

Gets the Term Mappings.

Declaration
public IEnumerable<KeyValuePair<string, string>> Mappings { get; }
Property Value
Type Description
IEnumerable<KeyValuePair<string, string>>
| Edit this page View Source

NamespaceMap

Gets the namespace mappings.

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

Namespaces

Gets the Namespace Mappings.

Declaration
public IEnumerable<KeyValuePair<string, string>> Namespaces { get; }
Property Value
Type Description
IEnumerable<KeyValuePair<string, string>>
| Edit this page View Source

VocabularyUri

Gets/Sets the Default Vocabulary URI.

Declaration
public string VocabularyUri { get; set; }
Property Value
Type Description
string
Remarks

May be NULL if the context does not define a default vocabulary URI.

Methods

| Edit this page View Source

AddNamespace(string, string)

Adds a Namespace to the Vocabulary.

Declaration
public void AddNamespace(string prefix, string nsUri)
Parameters
Type Name Description
string prefix

Prefix.

string nsUri

Namespace URI.

| Edit this page View Source

AddTerm(string, string)

Adds a Term to the Vocabulary.

Declaration
public void AddTerm(string term, string uri)
Parameters
Type Name Description
string term

Term.

string uri

URI.

| Edit this page View Source

HasTerm(string)

Gets whether a Vocabulary contains a Term.

Declaration
public bool HasTerm(string term)
Parameters
Type Name Description
string term

Term.

Returns
Type Description
bool
| Edit this page View Source

Load(IGraph)

Create a new RDFa context by processing the triples in the specified graph.

Declaration
public static IRdfAContext Load(IGraph g)
Parameters
Type Name Description
IGraph g

The graph to process.

Returns
Type Description
IRdfAContext

A new IRdfAContext instance containing the vocabulary declaration, term and prefix mappings defined in the graph.

| Edit this page View Source

Merge(IRdfAContext)

Merges another Vocabulary into this one.

Declaration
public void Merge(IRdfAContext vocab)
Parameters
Type Name Description
IRdfAContext vocab

Vocabulary.

| Edit this page View Source

ResolveCurie(string, Uri)

Resolve a CURIE using the namespaces defined in this vocabulary.

Declaration
public string ResolveCurie(string curie, Uri baseUri)
Parameters
Type Name Description
string curie

The CURIE string to resolve.

Uri baseUri
Returns
Type Description
string
| Edit this page View Source

ResolveTerm(string)

Resolves a Term in the Vocabulary.

Declaration
public string ResolveTerm(string term)
Parameters
Type Name Description
string term

Term.

Returns
Type Description
string

Implements

IRdfAContext

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • RdfAContext()
    • RdfAContext(string, IEnumerable<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>)
    • RdfAContext(IRdfAContext)
    • RdfAContext(IRdfAContext, string, IEnumerable<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, Uri>>)
  • Properties
    • Mappings
    • NamespaceMap
    • Namespaces
    • VocabularyUri
  • Methods
    • AddNamespace(string, string)
    • AddTerm(string, string)
    • HasTerm(string)
    • Load(IGraph)
    • Merge(IRdfAContext)
    • ResolveCurie(string, Uri)
    • ResolveTerm(string)
  • Implements
  • Extension Methods
Back to top Generated by DocFX