org.mulgara.mrg.writer
Interface GraphWriter

All Known Implementing Classes:
N3Writer, XMLWriter

public interface GraphWriter


Method Summary
 Map<String,URI> getNamespaces()
          Gets a mapping of prefixes to their namespaces.
 void resetNamespaces()
          Clears out the prefix/namespace set.
 void scanNamespaces()
          Scans the URIs in the graph to find all the namespaces.
 void setNamespaces(Map<String,URI> ns)
          Registers a set of prefix/namespace pairs to use when writing the graph.
 void setNamespacesByString(Map<String,String> ns)
          Registers a set of prefix/namespace pairs to use when writing the graph.
 void writeTo(OutputStream out)
          Writes the graph to a stream.
 

Method Detail

setNamespaces

void setNamespaces(Map<String,URI> ns)
Registers a set of prefix/namespace pairs to use when writing the graph.

Parameters:
ns - A map of prefix strings to namespace URIs.

setNamespacesByString

void setNamespacesByString(Map<String,String> ns)
                           throws URISyntaxException
Registers a set of prefix/namespace pairs to use when writing the graph.

Parameters:
ns - A map of prefix strings to namespace strings.
Throws:
URISyntaxException - If one or more of the namespaces is not a valid URI.

resetNamespaces

void resetNamespaces()
Clears out the prefix/namespace set.


scanNamespaces

void scanNamespaces()
Scans the URIs in the graph to find all the namespaces. Namespace prefixes will be automatically generated, except where namespaces are recognized.


getNamespaces

Map<String,URI> getNamespaces()
Gets a mapping of prefixes to their namespaces.

Returns:
a map with prefixes as keys and namespace URIs as values.

writeTo

void writeTo(OutputStream out)
             throws IOException
Writes the graph to a stream.

Parameters:
out - The stream to write the graph to.
Throws:
IOException


Copyright © 2011. All Rights Reserved.