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
Inherited Members
RdfAParserBase<HtmlDocument, HtmlNode, HtmlNode, HtmlAttribute>.IsXmlBaseIsPermissible(HtmlDocument)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.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 SourceRdfAParser()
Creates a new RDFa Parser which will auto-detect which RDFa version to use (assumes 1.1 if none explicitly specified).
Declaration
public RdfAParser()
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
| Improve this Doc View SourceGetAttribute(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 | |
System.String | attributeName | The name of the attribute on the element. |
Returns
Type | Description |
---|---|
System.String | The value of the attribute. |
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetAttribute(HtmlAgilityPack.HtmlNode, System.String)
|
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 |
---|---|
System.String |
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetAttributeName(HtmlAgilityPack.HtmlAttribute)
|
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<HtmlAgilityPack.HtmlAttribute> |
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetAttributes(HtmlAgilityPack.HtmlNode)
|
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 |
---|---|
System.String |
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetAttributeValue(HtmlAgilityPack.HtmlAttribute)
|
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)
|
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<HtmlAgilityPack.HtmlNode> |
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetChildren(HtmlAgilityPack.HtmlNode)
|
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 |
---|---|
System.String |
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetElementName(HtmlAgilityPack.HtmlNode)
|
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)
|
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 |
---|---|
System.String |
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetInnerHtml(HtmlAgilityPack.HtmlNode)
|
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 |
---|---|
System.String |
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.GetInnerText(HtmlAgilityPack.HtmlNode)
|
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)
|
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 | |
System.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, System.String)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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 | |
System.String | attributeName | The name of the attribute to set/update. |
System.String | value | The new value for the attribute. |
Overrides
VDS.RDF.Parsing.RdfAParserBase<HtmlAgilityPack.HtmlDocument, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlNode, HtmlAgilityPack.HtmlAttribute>.SetAttribute(HtmlAgilityPack.HtmlNode, System.String, System.String)