Class WriterHelper
Helper methods for writers.
Inheritance
System.Object
WriterHelper
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()
Namespace: VDS.RDF.Writing
Assembly: dotNetRDF.dll
Syntax
public static class WriterHelper
Methods
| Improve this Doc View SourceEncodeForXml(String)
Encodes values for use in XML.
Declaration
public static string EncodeForXml(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | Value to encode. |
Returns
Type | Description |
---|---|
System.String | The value with any ampersands escaped to &. |
FindCollections(IGraph, BaseTripleCollection)
Helper method which finds Collections expressed in the Graph which can be compressed into concise collection syntax constructs in some RDF syntaxes.
Declaration
[Obsolete("Use the alternative overloads of this method which take an ICollectionCompressingWriterContext instead", true)]
public static Dictionary<INode, OutputRdfCollection> FindCollections(IGraph g, BaseTripleCollection triplesDone)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to find collections in. |
BaseTripleCollection | triplesDone | Triple Collection in which Triples that have been output are to be listed. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<INode, OutputRdfCollection> |
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. |
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. |
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<Triple> | A list of the triples in graph sorted by their subject and then predicate. |
IsDefaultGraph(Uri)
Determines whether a given Uri refers to one of the Default Graph URIs assigned to the default Graph when parsing from some RDF dataset syntax.
Declaration
[Obsolete("No longer required since all code that uses 'magic' URIs to refer to the default graph has been removed from the API", true)]
public static bool IsDefaultGraph(Uri u)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | u | Uri to test. |
Returns
Type | Description |
---|---|
System.Boolean |
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 |
---|---|---|
System.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 |
---|---|---|
System.String | id |
Returns
Type | Description |
---|---|
System.Boolean |
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<Triple> | ts | The list of triples to be sorted. |