Class RdfAParserBase<THtmlDocument, TElement, TNode, TAttribute>
Base class for the framework-specific RDFa parser implementations.
Inheritance
System.Object
RdfAParserBase<THtmlDocument, TElement, TNode, TAttribute>
Inherited Members
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()
Assembly: dotNetRDF.dll
Syntax
public abstract class RdfAParserBase<THtmlDocument, TElement, TNode, TAttribute> : IRdfReader where TElement : class, TNode
Type Parameters
Name |
Description |
THtmlDocument |
|
TElement |
|
TNode |
|
TAttribute |
|
Constructors
|
Improve this Doc
View Source
RdfAParserBase()
Creates a new RDFa Parser which will auto-detect which RDFa version to use (assumes 1.1 if none explicitly specified).
Declaration
protected RdfAParserBase()
|
Improve this Doc
View Source
RdfAParserBase(RdfASyntax)
Creates a new RDFa Parser which will use the specified RDFa syntax.
Declaration
protected RdfAParserBase(RdfASyntax syntax)
Parameters
Type |
Name |
Description |
RdfASyntax |
syntax |
RDFa Syntax Version. |
Fields
|
Improve this Doc
View Source
HtmlPlusRdfA10Version
RDFa Version Constants.
Declaration
public const string HtmlPlusRdfA10Version = "HTML+RDFa 1.0"
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
HtmlPlusRdfA11Version
RDFa Version Constants.
Declaration
public const string HtmlPlusRdfA11Version = "HTML+RDFa 1.1"
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
RdfANamespace
Namespace URI for RDFa.
Declaration
public const string RdfANamespace = "http://www.w3.org/ns/rdfa#"
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
XHtmlNamespace
Namespace URI for XHTML.
Declaration
public const string XHtmlNamespace = "http://www.w3.org/1999/xhtml#"
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
XHtmlPlusRdfA10Version
RDFa Version Constants.
Declaration
public const string XHtmlPlusRdfA10Version = "XHTML+RDFa 1.0"
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
XHtmlPlusRdfA11Version
RDFa Version Constants.
Declaration
public const string XHtmlPlusRdfA11Version = "XHTML+RDFa 1.1"
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
XHtmlPlusRdfADoctype
URI for the XHTML+RDFa DTD.
Declaration
public const string XHtmlPlusRdfADoctype = "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
XHtmlVocabNamespace
XHTML Vocab Namespace.
Declaration
public const string XHtmlVocabNamespace = "http://www.w3.org/1999/xhtml/vocab#"
Field Value
Type |
Description |
System.String |
|
Methods
|
Improve this Doc
View Source
GetAttribute(TElement, String)
Get the value of a particular attribute of an element.
Declaration
protected abstract string GetAttribute(TElement element, string attributeName)
Parameters
Type |
Name |
Description |
TElement |
element |
The element. |
System.String |
attributeName |
The name of the attribute on the element. |
Returns
Type |
Description |
System.String |
The value of the attribute. |
|
Improve this Doc
View Source
GetAttributeName(TAttribute)
Get the name of an attribute.
Declaration
protected abstract string GetAttributeName(TAttribute attribute)
Parameters
Type |
Name |
Description |
TAttribute |
attribute |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
GetAttributes(TElement)
Get all attributes of an element.
Declaration
protected abstract IEnumerable<TAttribute> GetAttributes(TElement element)
Parameters
Type |
Name |
Description |
TElement |
element |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TAttribute> |
|
|
Improve this Doc
View Source
GetAttributeValue(TAttribute)
Get the value of an attribute.
Declaration
protected abstract string GetAttributeValue(TAttribute attribute)
Parameters
Type |
Name |
Description |
TAttribute |
attribute |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
GetBaseElement(THtmlDocument)
Get the base element of the specified document.
Declaration
protected abstract TElement GetBaseElement(THtmlDocument document)
Parameters
Type |
Name |
Description |
THtmlDocument |
document |
|
Returns
Type |
Description |
TElement |
|
|
Improve this Doc
View Source
GetChildren(TElement)
Return the children of an element (in order).
Declaration
protected abstract IEnumerable<TNode> GetChildren(TElement element)
Parameters
Type |
Name |
Description |
TElement |
element |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TNode> |
|
|
Improve this Doc
View Source
GetElementName(TElement)
Get the name of an element.
Declaration
protected abstract string GetElementName(TElement element)
Parameters
Type |
Name |
Description |
TElement |
element |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
GetHtmlElement(THtmlDocument)
Get the html element of the document.
Declaration
protected abstract TElement GetHtmlElement(THtmlDocument document)
Parameters
Type |
Name |
Description |
THtmlDocument |
document |
|
Returns
Type |
Description |
TElement |
|
|
Improve this Doc
View Source
GetInnerHtml(TElement)
Get the HTML contained within an element as a string.
Declaration
protected abstract string GetInnerHtml(TElement element)
Parameters
Type |
Name |
Description |
TElement |
element |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
GetInnerText(TNode)
Get the inner text of an element or a text node.
Declaration
protected abstract string GetInnerText(TNode node)
Parameters
Type |
Name |
Description |
TNode |
node |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
GrabText(StringBuilder, TNode)
Get the text content of a node and add it to the provided output buffer.
Declaration
protected abstract void GrabText(StringBuilder output, TNode node)
Parameters
Type |
Name |
Description |
System.Text.StringBuilder |
output |
|
TNode |
node |
|
|
Improve this Doc
View Source
HasAttribute(TElement, String)
Determine if an element has a particular attribute.
Declaration
protected abstract bool HasAttribute(TElement element, string attributeName)
Parameters
Type |
Name |
Description |
TElement |
element |
The element to check. |
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. |
|
Improve this Doc
View Source
HasChildren(TElement)
Determine if an element has children.
Declaration
protected abstract bool HasChildren(TElement element)
Parameters
Type |
Name |
Description |
TElement |
element |
|
Returns
Type |
Description |
System.Boolean |
True if the element has children, false otherwise. |
|
Improve this Doc
View Source
IsTextNode(TNode)
Determine if a node in the parsed Html document tree is a text node.
Declaration
protected abstract bool IsTextNode(TNode node)
Parameters
Type |
Name |
Description |
TNode |
node |
|
Returns
Type |
Description |
System.Boolean |
True if node is a text node, false otherwise. |
|
Improve this Doc
View Source
IsXmlBaseIsPermissible(THtmlDocument)
Deterine if the HTML document can have an xml:base element.
Declaration
protected abstract bool IsXmlBaseIsPermissible(THtmlDocument document)
Parameters
Type |
Name |
Description |
THtmlDocument |
document |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Load(IGraph, StreamReader)
Parses RDFa by extracting it from the HTML from the given input.
Declaration
public void Load(IGraph g, StreamReader input)
Parameters
Type |
Name |
Description |
IGraph |
g |
Graph to load into. |
System.IO.StreamReader |
input |
Stream to read from. |
|
Improve this Doc
View Source
Load(IGraph, TextReader)
Parses RDFa by extracting it from the HTML from the given input.
Declaration
public void Load(IGraph g, TextReader input)
Parameters
Type |
Name |
Description |
IGraph |
g |
Graph to load into. |
System.IO.TextReader |
input |
Input to read from. |
|
Improve this Doc
View Source
Load(IGraph, String)
Parses RDFa by extracting it from the HTML from the given file.
Declaration
public void Load(IGraph g, string filename)
Parameters
Type |
Name |
Description |
IGraph |
g |
Graph to load into. |
System.String |
filename |
File to read from. |
|
Improve this Doc
View Source
Load(IRdfHandler, StreamReader)
Parses RDFa by extracting it from the HTML from the given input.
Declaration
public void Load(IRdfHandler handler, StreamReader input)
Parameters
Type |
Name |
Description |
IRdfHandler |
handler |
RDF Handler to use. |
System.IO.StreamReader |
input |
Stream to read from. |
|
Improve this Doc
View Source
Load(IRdfHandler, TextReader)
Parses RDFa by extracting it from the HTML from the given input.
Declaration
public void Load(IRdfHandler handler, TextReader input)
Parameters
Type |
Name |
Description |
IRdfHandler |
handler |
RDF Handler to use. |
System.IO.TextReader |
input |
Input to read from. |
|
Improve this Doc
View Source
Load(IRdfHandler, String)
Parses RDFa by extracting it from the HTML from the given input.
Declaration
public void Load(IRdfHandler handler, string filename)
Parameters
Type |
Name |
Description |
IRdfHandler |
handler |
RDF Handler to use. |
System.String |
filename |
File to read from. |
|
Improve this Doc
View Source
LoadAndParse(TextReader)
Parse the input stream as an HTML document.
Declaration
protected abstract THtmlDocument LoadAndParse(TextReader input)
Parameters
Type |
Name |
Description |
System.IO.TextReader |
input |
|
Returns
Type |
Description |
THtmlDocument |
|
|
Improve this Doc
View Source
ProcessDocument(RdfAParserContext<THtmlDocument>, RdfAEvaluationContext)
Process the content of an HTML document.
Declaration
protected abstract void ProcessDocument(RdfAParserContext<THtmlDocument> context, RdfAEvaluationContext evalContext)
Parameters
|
Improve this Doc
View Source
ProcessElement(RdfAParserContext<THtmlDocument>, RdfAEvaluationContext, TElement)
Process the content of an element of the document.
Declaration
protected void ProcessElement(RdfAParserContext<THtmlDocument> context, RdfAEvaluationContext evalContext, TElement currElement)
Parameters
|
Improve this Doc
View Source
SetAttribute(TElement, String, String)
Set the value of a particular attribute of an element.
Declaration
protected abstract void SetAttribute(TElement element, string attributeName, string value)
Parameters
Type |
Name |
Description |
TElement |
element |
The element. |
System.String |
attributeName |
The name of the attribute to set/update. |
System.String |
value |
The new value for the attribute. |
Events
|
Improve this Doc
View Source
Warning
Event which is raised when there is a non-fatal error with the input being read
Declaration
public event RdfReaderWarning Warning
Event Type
Implements
Extension Methods