Show / Hide Table of Contents

Class RdfAParser

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

Inheritance
System.Object
RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.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>.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

| Improve this Doc 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()
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.

| Improve this Doc 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.

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.

Methods

| Improve this Doc 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
HtmlAgilityPack.HtmlNode element
string attributeName

The name of the attribute on the element.

Returns
Type Description
string

The value of the attribute.

Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetAttribute(HtmlAgilityPack.HtmlNode, string)
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.

| Improve this Doc View Source

GetAttributeName(HtmlAttribute)

Get the name of an attribute.

Declaration
protected override string GetAttributeName(HtmlAttribute attribute)
Parameters
Type Name Description
HtmlAgilityPack.HtmlAttribute attribute
Returns
Type Description
string
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetAttributeName(HtmlAgilityPack.HtmlAttribute)
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.

| Improve this Doc View Source

GetAttributes(HtmlNode)

Get all attributes of an element.

Declaration
protected override IEnumerable<HtmlAttribute> GetAttributes(HtmlNode element)
Parameters
Type Name Description
HtmlAgilityPack.HtmlNode element
Returns
Type Description
System.Collections.Generic.IEnumerable<T><HtmlAgilityPack.HtmlAttribute>
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetAttributes(HtmlAgilityPack.HtmlNode)
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.

| Improve this Doc View Source

GetAttributeValue(HtmlAttribute)

Get the value of an attribute.

Declaration
protected override string GetAttributeValue(HtmlAttribute attribute)
Parameters
Type Name Description
HtmlAgilityPack.HtmlAttribute attribute
Returns
Type Description
string
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetAttributeValue(HtmlAgilityPack.HtmlAttribute)
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.

| Improve this Doc View Source

GetBaseElement(HtmlDocument)

Get the base element of the specified document.

Declaration
protected override HtmlNode GetBaseElement(HtmlDocument document)
Parameters
Type Name Description
HtmlAgilityPack.HtmlDocument document
Returns
Type Description
HtmlAgilityPack.HtmlNode
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetBaseElement(HtmlAgilityPack.HtmlDocument)
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.

| Improve this Doc View Source

GetChildren(HtmlNode)

Return the children of an element (in order).

Declaration
protected override IEnumerable<HtmlNode> GetChildren(HtmlNode element)
Parameters
Type Name Description
HtmlAgilityPack.HtmlNode element
Returns
Type Description
System.Collections.Generic.IEnumerable<T><HtmlAgilityPack.HtmlNode>
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetChildren(HtmlAgilityPack.HtmlNode)
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.

| Improve this Doc View Source

GetElementName(HtmlNode)

Get the name of an element.

Declaration
protected override string GetElementName(HtmlNode element)
Parameters
Type Name Description
HtmlAgilityPack.HtmlNode element
Returns
Type Description
string
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetElementName(HtmlAgilityPack.HtmlNode)
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.

| Improve this Doc View Source

GetHtmlElement(HtmlDocument)

Get the html element of the document.

Declaration
protected override HtmlNode GetHtmlElement(HtmlDocument document)
Parameters
Type Name Description
HtmlAgilityPack.HtmlDocument document
Returns
Type Description
HtmlAgilityPack.HtmlNode
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetHtmlElement(HtmlAgilityPack.HtmlDocument)
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.

| Improve this Doc 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
HtmlAgilityPack.HtmlNode element
Returns
Type Description
string
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetInnerHtml(HtmlAgilityPack.HtmlNode)
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.

| Improve this Doc 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
HtmlAgilityPack.HtmlNode node
Returns
Type Description
string
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetInnerText(HtmlAgilityPack.HtmlNode)
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.

| Improve this Doc 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
System.Text.StringBuilder output
HtmlAgilityPack.HtmlNode node
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GrabText(System.Text.StringBuilder, HtmlAgilityPack.HtmlNode)
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.

| Improve this Doc 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
HtmlAgilityPack.HtmlNode element
string attributeName

The name of the attribute to check for.

Returns
Type Description
System.Boolean

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

Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.HasAttribute(HtmlAgilityPack.HtmlNode, string)
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.

| Improve this Doc View Source

HasChildren(HtmlNode)

Determine if an element has children.

Declaration
protected override bool HasChildren(HtmlNode element)
Parameters
Type Name Description
HtmlAgilityPack.HtmlNode element
Returns
Type Description
System.Boolean

True if the element has children, false otherwise.

Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.HasChildren(HtmlAgilityPack.HtmlNode)
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.

| Improve this Doc 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
HtmlAgilityPack.HtmlNode node
Returns
Type Description
System.Boolean

True if node is a text node, false otherwise.

Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.IsTextNode(HtmlAgilityPack.HtmlNode)
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.

| Improve this Doc View Source

IsXmlBaseIsPermissible(HtmlDocument)

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

Declaration
protected override bool IsXmlBaseIsPermissible(HtmlDocument document)
Parameters
Type Name Description
HtmlAgilityPack.HtmlDocument document
Returns
Type Description
System.Boolean
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.IsXmlBaseIsPermissible(HtmlAgilityPack.HtmlDocument)
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.

| Improve this Doc View Source

LoadAndParse(TextReader)

Parse the input stream as an HTML document.

Declaration
protected override HtmlDocument LoadAndParse(TextReader input)
Parameters
Type Name Description
System.IO.TextReader input
Returns
Type Description
HtmlAgilityPack.HtmlDocument
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.LoadAndParse(System.IO.TextReader)
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.

| Improve this Doc 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<HtmlAgilityPack.HtmlDocument> context
RdfAEvaluationContext evalContext
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.ProcessDocument(VDS.RDF.Parsing.Contexts.RdfAParserContext<HtmlAgilityPack.HtmlDocument>, VDS.RDF.Parsing.Contexts.RdfAEvaluationContext)
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.

| Improve this Doc 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
HtmlAgilityPack.HtmlNode element
string attributeName

The name of the attribute to set/update.

string value

The new value for the attribute.

Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.SetAttribute(HtmlAgilityPack.HtmlNode, string, string)
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.

Implements

IRdfReader

Extension Methods

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