Show / Hide Table of Contents

Class RdfAParser

Class for reading RDF embedded as RDFa from within HTML web pages.

Inheritance
object
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>
RdfAParser
Implements
IRdfReader
Inherited Members
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.XHtmlVocabNamespace
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.XHtmlPlusRdfADoctype
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.XHtmlNamespace
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.RdfANamespace
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.XHtmlPlusRdfA11Version
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.HtmlPlusRdfA11Version
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.XHtmlPlusRdfA10Version
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.HtmlPlusRdfA10Version
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.Load(IGraph, StreamReader)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.Load(IGraph, TextReader)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.Load(IGraph, string)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.Load(IRdfHandler, StreamReader)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.Load(IRdfHandler, StreamReader, IUriFactory)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.Load(IRdfHandler, TextReader)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.Load(IRdfHandler, TextReader, IUriFactory)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.Load(IRdfHandler, string)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.Load(IRdfHandler, string, IUriFactory)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.LoadAndParse(TextReader)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.HasAttribute(HtmlNode, string)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetAttribute(HtmlNode, string)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.SetAttribute(HtmlNode, string, string)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetBaseElement(HtmlDocument)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.IsXmlBaseIsPermissible(HtmlDocument)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetHtmlElement(HtmlDocument)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.ProcessDocument(RdfAParserContext<HtmlDocument>, RdfAEvaluationContext)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetAttributes(HtmlNode)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetAttributeName(HtmlAttribute)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetAttributeValue(HtmlAttribute)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetElementName(HtmlNode)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetChildren(HtmlNode)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetInnerText(HtmlNode)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetInnerHtml(HtmlNode)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.HasChildren(HtmlNode)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.IsTextNode(HtmlNode)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.IsRoot(HtmlNode)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.IsElement(HtmlNode)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.ProcessElement(RdfAParserContext<HtmlDocument>, RdfAEvaluationContext, HtmlNode)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GrabText(StringBuilder, HtmlNode)
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.Warning
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 RdfAParser : RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>, IRdfReader
Remarks

The RDFa parser uses a HTML parser (Html Agility Pack) that is highly tolerant of real-world HTML and so is able to extract RDFa from pages that are not strictly valid HTML/XHTML.

Constructors

| Edit this page View Source

RdfAParser()

Creates a new RDFa Parser which will auto-detect which RDFa version to use (assumes 1.1 if none explicitly specified).

Declaration
public RdfAParser()
| Edit this page View Source

RdfAParser(RdfAParserOptions)

Creates a new RDFa parser with the provided configuration options.

Declaration
public RdfAParser(RdfAParserOptions parserOptions)
Parameters
Type Name Description
RdfAParserOptions parserOptions

The options to use to configure the parser.

| Edit this page View Source

RdfAParser(RdfASyntax)

Creates a new RDFa Parser which will use the specified RDFa syntax.

Declaration
public RdfAParser(RdfASyntax syntax)
Parameters
Type Name Description
RdfASyntax syntax

RDFa Syntax Version.

Methods

| Edit this page View Source

GetAttribute(HtmlNode, string)

Get the value of a particular attribute of an element.

Declaration
protected override string GetAttribute(HtmlNode element, string attributeName)
Parameters
Type Name Description
HtmlNode element

The element.

string attributeName

The name of the attribute on the element.

Returns
Type Description
string

The value of the attribute.

Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetAttribute(HtmlNode, string)
| Edit this page View Source

GetAttributeName(HtmlAttribute)

Get the name of an attribute.

Declaration
protected override string GetAttributeName(HtmlAttribute attribute)
Parameters
Type Name Description
HtmlAttribute attribute
Returns
Type Description
string
Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetAttributeName(HtmlAttribute)
| Edit this page View Source

GetAttributeValue(HtmlAttribute)

Get the value of an attribute.

Declaration
protected override string GetAttributeValue(HtmlAttribute attribute)
Parameters
Type Name Description
HtmlAttribute attribute
Returns
Type Description
string
Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetAttributeValue(HtmlAttribute)
| Edit this page View Source

GetAttributes(HtmlNode)

Get all attributes of an element.

Declaration
protected override IEnumerable<HtmlAttribute> GetAttributes(HtmlNode element)
Parameters
Type Name Description
HtmlNode element
Returns
Type Description
IEnumerable<HtmlAttribute>
Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetAttributes(HtmlNode)
| Edit this page View Source

GetBaseElement(HtmlDocument)

Get the base element of the specified document.

Declaration
protected override HtmlNode GetBaseElement(HtmlDocument document)
Parameters
Type Name Description
HtmlDocument document
Returns
Type Description
HtmlNode
Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetBaseElement(HtmlDocument)
| Edit this page View Source

GetChildren(HtmlNode)

Return the children of an element (in order).

Declaration
protected override IEnumerable<HtmlNode> GetChildren(HtmlNode element)
Parameters
Type Name Description
HtmlNode element
Returns
Type Description
IEnumerable<HtmlNode>
Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetChildren(HtmlNode)
| Edit this page View Source

GetElementName(HtmlNode)

Get the name of an element.

Declaration
protected override string GetElementName(HtmlNode element)
Parameters
Type Name Description
HtmlNode element
Returns
Type Description
string
Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetElementName(HtmlNode)
| Edit this page View Source

GetHtmlElement(HtmlDocument)

Get the html element of the document.

Declaration
protected override HtmlNode GetHtmlElement(HtmlDocument document)
Parameters
Type Name Description
HtmlDocument document
Returns
Type Description
HtmlNode
Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetHtmlElement(HtmlDocument)
| Edit this page View Source

GetInnerHtml(HtmlNode)

Get the HTML contained within an element as a string.

Declaration
protected override string GetInnerHtml(HtmlNode element)
Parameters
Type Name Description
HtmlNode element
Returns
Type Description
string
Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetInnerHtml(HtmlNode)
| Edit this page View Source

GetInnerText(HtmlNode)

Get the inner text of an element or a text node.

Declaration
protected override string GetInnerText(HtmlNode node)
Parameters
Type Name Description
HtmlNode node
Returns
Type Description
string
Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GetInnerText(HtmlNode)
| Edit this page View Source

GrabText(StringBuilder, HtmlNode)

Get the text content of a node and add it to the provided output buffer.

Declaration
protected override void GrabText(StringBuilder output, HtmlNode node)
Parameters
Type Name Description
StringBuilder output
HtmlNode node
Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.GrabText(StringBuilder, HtmlNode)
| Edit this page View Source

HasAttribute(HtmlNode, string)

Determine if an element has a particular attribute.

Declaration
protected override bool HasAttribute(HtmlNode element, string attributeName)
Parameters
Type Name Description
HtmlNode element

The element to check.

string attributeName

The name of the attribute to check for.

Returns
Type Description
bool

True if the element has an attribute named attributeName, false otherwise.

Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.HasAttribute(HtmlNode, string)
| Edit this page View Source

HasChildren(HtmlNode)

Determine if an element has children.

Declaration
protected override bool HasChildren(HtmlNode element)
Parameters
Type Name Description
HtmlNode element
Returns
Type Description
bool

True if the element has children, false otherwise.

Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.HasChildren(HtmlNode)
| Edit this page View Source

IsElement(HtmlNode)

Determine if a node in the parsed HTML document tree is an element node.

Declaration
protected override bool IsElement(HtmlNode node)
Parameters
Type Name Description
HtmlNode node

The node to evaluate.

Returns
Type Description
bool

True if node is an element node, false otherwise.

Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.IsElement(HtmlNode)
| Edit this page View Source

IsRoot(HtmlNode)

Determine if a node in the parsed HTML document tree is the root document node.

Declaration
protected override bool IsRoot(HtmlNode node)
Parameters
Type Name Description
HtmlNode node

The node to evaluate.

Returns
Type Description
bool

True if node is a root node, false otherwise.

Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.IsRoot(HtmlNode)
| Edit this page View Source

IsTextNode(HtmlNode)

Determine if a node in the parsed Html document tree is a text node.

Declaration
protected override bool IsTextNode(HtmlNode node)
Parameters
Type Name Description
HtmlNode node
Returns
Type Description
bool

True if node is a text node, false otherwise.

Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.IsTextNode(HtmlNode)
| Edit this page View Source

IsXmlBaseIsPermissible(HtmlDocument)

Determine if the HTML document can have an xml:base element.

Declaration
protected override bool IsXmlBaseIsPermissible(HtmlDocument document)
Parameters
Type Name Description
HtmlDocument document
Returns
Type Description
bool
Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.IsXmlBaseIsPermissible(HtmlDocument)
| Edit this page View Source

LoadAndParse(TextReader)

Parse the input stream as an HTML document.

Declaration
protected override HtmlDocument LoadAndParse(TextReader input)
Parameters
Type Name Description
TextReader input
Returns
Type Description
HtmlDocument
Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.LoadAndParse(TextReader)
| Edit this page View Source

ProcessDocument(RdfAParserContext<HtmlDocument>, RdfAEvaluationContext)

Process the content of an HTML document.

Declaration
protected override void ProcessDocument(RdfAParserContext<HtmlDocument> context, RdfAEvaluationContext evalContext)
Parameters
Type Name Description
RdfAParserContext<HtmlDocument> context
RdfAEvaluationContext evalContext
Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.ProcessDocument(RdfAParserContext<HtmlDocument>, RdfAEvaluationContext)
| Edit this page View Source

SetAttribute(HtmlNode, string, string)

Set the value of a particular attribute of an element.

Declaration
protected override void SetAttribute(HtmlNode element, string attributeName, string value)
Parameters
Type Name Description
HtmlNode element

The element.

string attributeName

The name of the attribute to set/update.

string value

The new value for the attribute.

Overrides
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.SetAttribute(HtmlNode, string, string)

Implements

IRdfReader

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • RdfAParser()
    • RdfAParser(RdfAParserOptions)
    • RdfAParser(RdfASyntax)
  • Methods
    • GetAttribute(HtmlNode, string)
    • GetAttributeName(HtmlAttribute)
    • GetAttributeValue(HtmlAttribute)
    • GetAttributes(HtmlNode)
    • GetBaseElement(HtmlDocument)
    • GetChildren(HtmlNode)
    • GetElementName(HtmlNode)
    • GetHtmlElement(HtmlDocument)
    • GetInnerHtml(HtmlNode)
    • GetInnerText(HtmlNode)
    • GrabText(StringBuilder, HtmlNode)
    • HasAttribute(HtmlNode, string)
    • HasChildren(HtmlNode)
    • IsElement(HtmlNode)
    • IsRoot(HtmlNode)
    • IsTextNode(HtmlNode)
    • IsXmlBaseIsPermissible(HtmlDocument)
    • LoadAndParse(TextReader)
    • ProcessDocument(RdfAParserContext<HtmlDocument>, RdfAEvaluationContext)
    • SetAttribute(HtmlNode, string, string)
  • Implements
  • Extension Methods
Back to top Generated by DocFX