Package org.apache.jena.util
Class PrintUtil
java.lang.Object
org.apache.jena.util.PrintUtil
A collection of small utilities for pretty printing nodes, triples
and associated things. The core functionality here is a static
prefix map which is preloaded with known prefixes.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
expandQname
(String uri) Expand qnames to URIs.static void
init()
Load built in prefixes.static String
Default print which just uses tostringstatic String
Return a simplified print string for a Node.static String
Return a simplified print string for a Triplestatic String
Return a simplified print string for an RDFNode.static String
Return a simplified print string for a statementstatic String
print
(TriplePattern triple) Return a simplified print string for a TriplePatternstatic void
printIndent
(PrintWriter out, int indent) Print an n-space indent to the given output streamstatic void
Print all the Triple values from a find iterator.static void
registerPrefix
(String prefix, String namespace) Register a new prefix/namespace mapping which will be used to shorten the print strings for resources in known namespaces.static void
registerPrefixMap
(Map<String, String> map) Register a set of new prefix/namespace mapping which will be used to shorten the print strings for resources in known namespaces.static void
removePrefix
(String prefix) Remove a registered prefix from the table of known short formsstatic void
removePrefixMap
(Map<String, String> map) Remove a set of prefix mappings from the table of known short forms
-
Field Details
-
egNS
Default built in eg namespace used in testing- See Also:
-
-
Constructor Details
-
PrintUtil
public PrintUtil()
-
-
Method Details
-
init
public static void init()Load built in prefixes. -
registerPrefix
Register a new prefix/namespace mapping which will be used to shorten the print strings for resources in known namespaces. -
registerPrefixMap
Register a set of new prefix/namespace mapping which will be used to shorten the print strings for resources in known namespaces. -
removePrefix
Remove a registered prefix from the table of known short forms -
removePrefixMap
Remove a set of prefix mappings from the table of known short forms -
print
Return a simplified print string for a Node. -
print
Return a simplified print string for an RDFNode. -
print
Return a simplified print string for a Triple -
print
Return a simplified print string for a TriplePattern -
print
Return a simplified print string for a statement -
print
Default print which just uses tostring -
expandQname
Expand qnames to URIs. If the given URI appears to start with one of the registered prefixes then expand the prefix, otherwise return the original URI -
printIndent
Print an n-space indent to the given output stream -
printOut
Print all the Triple values from a find iterator.
-