Show / Hide Table of Contents

Class WriterHelper

Helper methods for writers.

Inheritance
System.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

| Improve this Doc 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 &.

| Improve this Doc 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.

| Improve this Doc 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.

| Improve this Doc 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.

| Improve this Doc 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
System.Collections.Generic.List<T><Triple>

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

| Improve this Doc 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
System.Boolean
Remarks

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

| Improve this Doc 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
System.Boolean
| Improve this Doc 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
System.Collections.Generic.List<T><Triple> ts

The list of triples to be sorted.

  • Improve this Doc
  • View Source
In This Article
  • Methods
    • EncodeForXml(string)
    • FindAnnotations(IAnnotationCompressingWriterContext)
    • FindCollections(ICollectionCompressingWriterContext, CollectionSearchMode)
    • FindCollections(ICollectionCompressingWriterContext)
    • GetTriplesSortedBySubjectPredicate(IGraph)
    • IsValidBlankNodeID(string)
    • IsValidStrictBlankNodeID(string)
    • SortTriplesBySubjectPredicate(List<Triple>)
Back to top Generated by DocFX