Show / Hide Table of Contents

Class WriterHelper

Helper methods for writers.

Inheritance
object
WriterHelper
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF.Writing
Assembly: dotNetRdf.dll
Syntax
public static class WriterHelper

Methods

| Edit this page View Source

EncodeForXml(string)

Encodes values for use in XML.

Declaration
public static string EncodeForXml(string value)
Parameters
Type Name Description
string value

Value to encode.

Returns
Type Description
string

The value with any ampersands escaped to &.

| Edit this page View Source

FindAnnotations(IAnnotationCompressingWriterContext)

Finds triple annotations (triples whose subject is another triple asserted in the graph) which can be compressed into annotation constructs in some RDF syntaxes.

Declaration
public static void FindAnnotations(IAnnotationCompressingWriterContext context)
Parameters
Type Name Description
IAnnotationCompressingWriterContext context

Writer context.

| Edit this page View Source

FindCollections(ICollectionCompressingWriterContext)

Helper method which finds Collections expressed in the Graph which can be compressed into concise collection syntax constructs in some RDF syntaxes.

Declaration
public static void FindCollections(ICollectionCompressingWriterContext context)
Parameters
Type Name Description
ICollectionCompressingWriterContext context

Writer Context.

| Edit this page View Source

FindCollections(ICollectionCompressingWriterContext, CollectionSearchMode)

Helper method which finds Collections expressed in the Graph which can be compressed into concise collection syntax constructs in some RDF syntaxes.

Declaration
public static void FindCollections(ICollectionCompressingWriterContext context, CollectionSearchMode mode)
Parameters
Type Name Description
ICollectionCompressingWriterContext context

Writer Context.

CollectionSearchMode mode

Collection Search Mode.

| Edit this page View Source

GetTriplesSortedBySubjectPredicate(IGraph)

Get a list of all triples in the specified graph, sorted by subject and then predicate.

Declaration
public static List<Triple> GetTriplesSortedBySubjectPredicate(IGraph graph)
Parameters
Type Name Description
IGraph graph

The graph whose triples are to be returned.

Returns
Type Description
List<Triple>

A list of the triples in graph sorted by their subject and then predicate.

| Edit this page View Source

IsValidBlankNodeID(string)

Determines whether a Blank Node ID is valid as-is when serialised in NTriple like syntaxes (Turtle/N3/SPARQL).

Declaration
public static bool IsValidBlankNodeID(string id)
Parameters
Type Name Description
string id

ID to test.

Returns
Type Description
bool
Remarks

If false is returned then the writer will alter the ID in some way.

| Edit this page View Source

IsValidStrictBlankNodeID(string)

Determines whether a Blank Node ID is valid as-is when serialised as NTriples.

Declaration
public static bool IsValidStrictBlankNodeID(string id)
Parameters
Type Name Description
string id
Returns
Type Description
bool
| Edit this page View Source

RemoveInvalidXmlChars(string)

Removes characters invalid in XML documents.

Declaration
public static string RemoveInvalidXmlChars(string content)
Parameters
Type Name Description
string content

The string to filter.

Returns
Type Description
string

New string that does not contain any invalid characters.

| Edit this page View Source

SortTriplesBySubjectPredicate(List<Triple>)

Sort the provided list of triples by subject and then predicate. The list is modified in-place.

Declaration
public static void SortTriplesBySubjectPredicate(List<Triple> ts)
Parameters
Type Name Description
List<Triple> ts

The list of triples to be sorted.

  • Edit this page
  • View Source
In this article
  • Methods
    • EncodeForXml(string)
    • FindAnnotations(IAnnotationCompressingWriterContext)
    • FindCollections(ICollectionCompressingWriterContext)
    • FindCollections(ICollectionCompressingWriterContext, CollectionSearchMode)
    • GetTriplesSortedBySubjectPredicate(IGraph)
    • IsValidBlankNodeID(string)
    • IsValidStrictBlankNodeID(string)
    • RemoveInvalidXmlChars(string)
    • SortTriplesBySubjectPredicate(List<Triple>)
Back to top Generated by DocFX