org.d2rq.pp
Class PrettyPrinter

java.lang.Object
  extended by org.d2rq.pp.PrettyPrinter

public class PrettyPrinter
extends Object

Pretty printer for various kinds of objects.

Author:
Richard Cyganiak (richard@cyganiak.de)

Constructor Summary
PrettyPrinter()
           
 
Method Summary
static String qNameOrURI(String uri, PrefixMapping prefixes)
           
static String toString(Model m, PrefixMapping prefixes)
           
static String toString(Node n)
          Pretty-prints an RDF node.
static String toString(Node n, PrefixMapping prefixes)
          Pretty-prints an RDF node and shortens URIs into QNames according to a PrefixMapping.
static String toString(RDFDatatype datatype)
           
static String toString(RDFNode n)
           
static String toString(Triple t)
           
static String toString(Triple t, PrefixMapping prefixes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrettyPrinter

public PrettyPrinter()
Method Detail

toString

public static String toString(Node n)
Pretty-prints an RDF node.

Parameters:
n - An RDF node
Returns:
An N-Triples style textual representation

toString

public static String toString(Node n,
                              PrefixMapping prefixes)
Pretty-prints an RDF node and shortens URIs into QNames according to a PrefixMapping.

Parameters:
n - An RDF node
Returns:
An N-Triples style textual representation with URIs shortened to QNames

qNameOrURI

public static String qNameOrURI(String uri,
                                PrefixMapping prefixes)

toString

public static String toString(Triple t)

toString

public static String toString(Triple t,
                              PrefixMapping prefixes)

toString

public static String toString(RDFDatatype datatype)

toString

public static String toString(RDFNode n)

toString

public static String toString(Model m,
                              PrefixMapping prefixes)