Show / Hide Table of Contents

Class SparqlFormatter

Formatter for formatting Nodes for use in SPARQL and for formatting SPARQL Queries.

Inheritance
object
BaseFormatter
QNameFormatter
TurtleFormatter
SparqlFormatter
Implements
ITripleFormatter
ICharFormatter
INamespaceFormatter
IBaseUriFormatter
IQueryFormatter
INodeFormatter
IUriFormatter
IResultFormatter
Inherited Members
TurtleFormatter._longLitMustEscape
TurtleFormatter._litMustEscape
TurtleFormatter.FormatLiteralNode(ILiteralNode, TripleSegment?)
TurtleFormatter.FormatBlankNode(IBlankNode, TripleSegment?)
QNameFormatter._qnameMapper
QNameFormatter.FormatUriNode(IUriNode, TripleSegment?)
BaseFormatter.FormatName
BaseFormatter.Format(INode, TripleSegment?)
BaseFormatter.Format(INode)
BaseFormatter.Format(Triple)
BaseFormatter.Format(Triple, IRefNode)
BaseFormatter.FormatUri(string)
BaseFormatter.FormatUri(Uri)
BaseFormatter.FormatGraphLiteralNode(IGraphLiteralNode, TripleSegment?)
BaseFormatter.FormatChar(char)
BaseFormatter.FormatChar(char[])
BaseFormatter.Escape(string, List<string[]>)
BaseFormatter.ToString()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: VDS.RDF.Writing.Formatting
Assembly: dotNetRdf.dll
Syntax
public class SparqlFormatter : TurtleFormatter, ITripleFormatter, ICharFormatter, INamespaceFormatter, IBaseUriFormatter, IQueryFormatter, INodeFormatter, IUriFormatter, IResultFormatter

Constructors

| Edit this page View Source

SparqlFormatter()

Creates a new SPARQL Formatter.

Declaration
public SparqlFormatter()
| Edit this page 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.

| Edit this page 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.

| Edit this page View Source

SparqlFormatter(INamespaceMapper, IUriFactory)

Creates a new SPARQL Formatter using the given Namespace Map.

Declaration
public SparqlFormatter(INamespaceMapper nsmap, IUriFactory uriFactory)
Parameters
Type Name Description
INamespaceMapper nsmap

Namespace Map.

IUriFactory uriFactory

The factory to use when creating new Uri instances.

| Edit this page View Source

SparqlFormatter(IUriFactory)

Creates a new SPARQL Formatter.

Declaration
public SparqlFormatter(IUriFactory uriFactory)
Parameters
Type Name Description
IUriFactory uriFactory

The factory to use when creating new Uri instances.

Methods

| Edit this page View Source

Format(ISparqlResult)

Formats a SPARQL Result using this Formatter to format the Node values for each Variable.

Declaration
public override string Format(ISparqlResult result)
Parameters
Type Name Description
ISparqlResult result

SPARQL Result.

Returns
Type Description
string
Overrides
BaseFormatter.Format(ISparqlResult)
| Edit this page 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
string
| Edit this page 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
string
| Edit this page View Source

Format(PatternItem, 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.

TripleSegment? segment

Triple Pattern Segment.

Returns
Type Description
string
| Edit this page 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
string
| Edit this page 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
string
| Edit this page View Source

FormatBaseUri(Uri)

Formats a Base URI Declaration.

Declaration
public override string FormatBaseUri(Uri u)
Parameters
Type Name Description
Uri u

Base URI.

Returns
Type Description
string
Overrides
TurtleFormatter.FormatBaseUri(Uri)
| Edit this page View Source

FormatBooleanResult(bool)

Formats a Boolean Result.

Declaration
public override string FormatBooleanResult(bool result)
Parameters
Type Name Description
bool result

Boolean Result.

Returns
Type Description
string
Overrides
BaseFormatter.FormatBooleanResult(bool)
| Edit this page 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
string
| Edit this page 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
string
| Edit this page 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
string
| Edit this page 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
string
| Edit this page View Source

FormatNamespace(string, Uri)

Formats a Namespace Declaration.

Declaration
public override string FormatNamespace(string prefix, Uri namespaceUri)
Parameters
Type Name Description
string prefix

Namespace Prefix.

Uri namespaceUri

Namespace URI.

Returns
Type Description
string
Overrides
TurtleFormatter.FormatNamespace(string, Uri)
| Edit this page 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
string
| Edit this page 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
string
| Edit this page View Source

FormatTripleNode(ITripleNode, TripleSegment?)

Formats a triple node a a string for the given format.

Declaration
protected override string FormatTripleNode(ITripleNode t, TripleSegment? segment)
Parameters
Type Name Description
ITripleNode t

Triple node.

TripleSegment? segment

Triple segment being written.

Returns
Type Description
string
Overrides
BaseFormatter.FormatTripleNode(ITripleNode, TripleSegment?)
Remarks

This method should be overridden in formatters that support serializing ITripleNodes.

| Edit this page View Source

FormatVariableNode(IVariableNode, 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.

TripleSegment? segment

Triple Segment.

Returns
Type Description
string
Overrides
BaseFormatter.FormatVariableNode(IVariableNode, TripleSegment?)
| Edit this page 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
IEnumerable<SparqlVariable> vars

Variables.

Returns
Type Description
string
| Edit this page View Source

IsValidQName(string)

Determines whether a QName is valid.

Declaration
protected override bool IsValidQName(string value)
Parameters
Type Name Description
string value

Value.

Returns
Type Description
bool
Overrides
QNameFormatter.IsValidQName(string)

Implements

ITripleFormatter
ICharFormatter
INamespaceFormatter
IBaseUriFormatter
IQueryFormatter
INodeFormatter
IUriFormatter
IResultFormatter

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • SparqlFormatter()
    • SparqlFormatter(IGraph)
    • SparqlFormatter(INamespaceMapper)
    • SparqlFormatter(INamespaceMapper, IUriFactory)
    • SparqlFormatter(IUriFactory)
  • Methods
    • Format(ISparqlResult)
    • Format(GraphPattern)
    • Format(ITriplePattern)
    • Format(PatternItem, TripleSegment?)
    • Format(SparqlQuery)
    • FormatAggregate(ISparqlAggregate)
    • FormatBaseUri(Uri)
    • FormatBooleanResult(bool)
    • FormatDescribeVariablesList(SparqlQuery)
    • FormatExpression(ISparqlExpression)
    • FormatGroupBy(ISparqlGroupBy)
    • FormatInlineData(BindingsPattern)
    • FormatNamespace(string, Uri)
    • FormatOrderBy(ISparqlOrderBy)
    • FormatPath(ISparqlPath)
    • FormatTripleNode(ITripleNode, TripleSegment?)
    • FormatVariableNode(IVariableNode, TripleSegment?)
    • FormatVariablesList(IEnumerable<SparqlVariable>)
    • IsValidQName(string)
  • Implements
  • Extension Methods
Back to top Generated by DocFX