Show / Hide Table of Contents

Class SparqlFormatter

Formatter for formatting Nodes for use in SPARQL and for formatting SPARQL Queries.
Inheritance
System.Object
BaseFormatter
QNameFormatter
TurtleFormatter
SparqlFormatter
Implements
ITripleFormatter
ICharFormatter
INamespaceFormatter
IBaseUriFormatter
IQueryFormatter
INodeFormatter
IUriFormatter
IResultFormatter
Inherited Members
TurtleFormatter._longLitMustEscape
TurtleFormatter._litMustEscape
TurtleFormatter.FormatLiteralNode(ILiteralNode, Nullable<TripleSegment>)
TurtleFormatter.FormatBlankNode(IBlankNode, Nullable<TripleSegment>)
QNameFormatter._qnameMapper
QNameFormatter.FormatUriNode(IUriNode, Nullable<TripleSegment>)
BaseFormatter.FormatName
BaseFormatter.Format(INode, Nullable<TripleSegment>)
BaseFormatter.Format(INode)
BaseFormatter.Format(Triple)
BaseFormatter.FormatUri(String)
BaseFormatter.FormatUri(Uri)
BaseFormatter.FormatGraphLiteralNode(IGraphLiteralNode, Nullable<TripleSegment>)
BaseFormatter.FormatChar(Char)
BaseFormatter.FormatChar(Char[])
BaseFormatter.Escape(String, List<String[]>)
BaseFormatter.ToString()
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)
Namespace: VDS.RDF.Writing.Formatting
Assembly: dotNetRDF.dll
Syntax
public class SparqlFormatter : TurtleFormatter, ITripleFormatter, ICharFormatter, INamespaceFormatter, IBaseUriFormatter, IQueryFormatter, INodeFormatter, IUriFormatter, IResultFormatter

Constructors

| Improve this Doc View Source

SparqlFormatter()

Creates a new SPARQL Formatter.
Declaration
public SparqlFormatter()
| Improve this Doc View Source

SparqlFormatter(IGraph)

Creates a new SPARQL Formatter using the given Graph.
Declaration
public SparqlFormatter(IGraph g)
Parameters
Type Name Description
IGraph g Graph.
| Improve this Doc View Source

SparqlFormatter(INamespaceMapper)

Creates a new SPARQL Formatter using the given Namespace Map.
Declaration
public SparqlFormatter(INamespaceMapper nsmap)
Parameters
Type Name Description
INamespaceMapper nsmap Namespace Map.

Methods

| Improve this Doc View Source

Format(GraphPattern)

Formats a Graph Pattern in nicely formatted SPARQL syntax.
Declaration
public virtual string Format(GraphPattern gp)
Parameters
Type Name Description
GraphPattern gp Graph Pattern.
Returns
Type Description
System.String
| Improve this Doc View Source

Format(ITriplePattern)

Formats a Triple Pattern in nicely formatted SPARQL syntax.
Declaration
public virtual string Format(ITriplePattern tp)
Parameters
Type Name Description
ITriplePattern tp Triple Pattern.
Returns
Type Description
System.String
| Improve this Doc View Source

Format(PatternItem, Nullable<TripleSegment>)

Formats a Pattern Item in nicely formatted SPARQL syntax.
Declaration
public virtual string Format(PatternItem item, TripleSegment? segment)
Parameters
Type Name Description
PatternItem item Pattern Item.
System.Nullable<TripleSegment> segment Triple Pattern Segment.
Returns
Type Description
System.String
| Improve this Doc View Source

Format(SparqlQuery)

Formats a Query in nicely formatted SPARQL syntax.
Declaration
public virtual string Format(SparqlQuery query)
Parameters
Type Name Description
SparqlQuery query SPARQL Query.
Returns
Type Description
System.String
| Improve this Doc View Source

Format(SparqlResult)

Formats a SPARQL Result using this Formatter to format the Node values for each Variable.
Declaration
public override string Format(SparqlResult result)
Parameters
Type Name Description
SparqlResult result SPARQL Result.
Returns
Type Description
System.String
Overrides
BaseFormatter.Format(SparqlResult)
| Improve this Doc View Source

FormatAggregate(ISparqlAggregate)

Formats a SPARQL Aggregate.
Declaration
protected virtual string FormatAggregate(ISparqlAggregate agg)
Parameters
Type Name Description
ISparqlAggregate agg SPARQL Aggregate.
Returns
Type Description
System.String
| Improve this Doc View Source

FormatBaseUri(Uri)

Formats a Base URI Declaration.
Declaration
public override string FormatBaseUri(Uri u)
Parameters
Type Name Description
System.Uri u Base URI.
Returns
Type Description
System.String
Overrides
TurtleFormatter.FormatBaseUri(Uri)
| Improve this Doc View Source

FormatBooleanResult(Boolean)

Formats a Boolean Result.
Declaration
public override string FormatBooleanResult(bool result)
Parameters
Type Name Description
System.Boolean result Boolean Result.
Returns
Type Description
System.String
Overrides
BaseFormatter.FormatBooleanResult(Boolean)
| Improve this Doc View Source

FormatDescribeVariablesList(SparqlQuery)

Formats the Variable/QName/URI for a SPARQL DESCRIBE Query.
Declaration
protected virtual string FormatDescribeVariablesList(SparqlQuery q)
Parameters
Type Name Description
SparqlQuery q SPARQL Query.
Returns
Type Description
System.String
| Improve this Doc View Source

FormatExpression(ISparqlExpression)

Formats a SPARQL Expression.
Declaration
protected virtual string FormatExpression(ISparqlExpression expr)
Parameters
Type Name Description
ISparqlExpression expr SPARQL Expression.
Returns
Type Description
System.String
| Improve this Doc View Source

FormatGroupBy(ISparqlGroupBy)

Formats a SPARQL GROUP BY Clause.
Declaration
protected virtual string FormatGroupBy(ISparqlGroupBy groupBy)
Parameters
Type Name Description
ISparqlGroupBy groupBy GROUP BY Clause.
Returns
Type Description
System.String
| Improve this Doc View Source

FormatInlineData(BindingsPattern)

Formats the Inline Data portion of a Query.
Declaration
protected virtual string FormatInlineData(BindingsPattern data)
Parameters
Type Name Description
BindingsPattern data Inline Data.
Returns
Type Description
System.String
| Improve this Doc View Source

FormatNamespace(String, Uri)

Formats a Namespace Declaration.
Declaration
public override string FormatNamespace(string prefix, Uri namespaceUri)
Parameters
Type Name Description
System.String prefix Namespace Prefix.
System.Uri namespaceUri Namespace URI.
Returns
Type Description
System.String
Overrides
TurtleFormatter.FormatNamespace(String, Uri)
| Improve this Doc View Source

FormatOrderBy(ISparqlOrderBy)

Formats a SPARQL ORDER BY Clause.
Declaration
protected virtual string FormatOrderBy(ISparqlOrderBy orderBy)
Parameters
Type Name Description
ISparqlOrderBy orderBy ORDER BY Clause.
Returns
Type Description
System.String
| Improve this Doc View Source

FormatPath(ISparqlPath)

Formats a SPARQL Property Path.
Declaration
protected virtual string FormatPath(ISparqlPath path)
Parameters
Type Name Description
ISparqlPath path SPARQL Property Path.
Returns
Type Description
System.String
| Improve this Doc View Source

FormatVariableNode(IVariableNode, Nullable<TripleSegment>)

Formats a Variable Node in SPARQL Syntax.
Declaration
protected override string FormatVariableNode(IVariableNode v, TripleSegment? segment)
Parameters
Type Name Description
IVariableNode v Variable Node.
System.Nullable<TripleSegment> segment Triple Segment.
Returns
Type Description
System.String
Overrides
BaseFormatter.FormatVariableNode(IVariableNode, Nullable<TripleSegment>)
| Improve this Doc View Source

FormatVariablesList(IEnumerable<SparqlVariable>)

Formats the Variable List for a SPARQL Query.
Declaration
protected virtual string FormatVariablesList(IEnumerable<SparqlVariable> vars)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<SparqlVariable> vars Variables.
Returns
Type Description
System.String
| Improve this Doc View Source

IsValidQName(String)

Determines whether a QName is valid.
Declaration
protected override bool IsValidQName(string value)
Parameters
Type Name Description
System.String value Value.
Returns
Type Description
System.Boolean
Overrides
QNameFormatter.IsValidQName(String)

Implements

ITripleFormatter
ICharFormatter
INamespaceFormatter
IBaseUriFormatter
IQueryFormatter
INodeFormatter
IUriFormatter
IResultFormatter

Extension Methods

Extensions.AsEnumerable<T>(T)
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • SparqlFormatter()
    • SparqlFormatter(IGraph)
    • SparqlFormatter(INamespaceMapper)
  • Methods
    • Format(GraphPattern)
    • Format(ITriplePattern)
    • Format(PatternItem, Nullable<TripleSegment>)
    • Format(SparqlQuery)
    • Format(SparqlResult)
    • FormatAggregate(ISparqlAggregate)
    • FormatBaseUri(Uri)
    • FormatBooleanResult(Boolean)
    • FormatDescribeVariablesList(SparqlQuery)
    • FormatExpression(ISparqlExpression)
    • FormatGroupBy(ISparqlGroupBy)
    • FormatInlineData(BindingsPattern)
    • FormatNamespace(String, Uri)
    • FormatOrderBy(ISparqlOrderBy)
    • FormatPath(ISparqlPath)
    • FormatVariableNode(IVariableNode, Nullable<TripleSegment>)
    • FormatVariablesList(IEnumerable<SparqlVariable>)
    • IsValidQName(String)
  • Implements
  • Extension Methods
Back to top Generated by DocFX