Class PrintUtil

java.lang.Object
org.apache.jena.util.PrintUtil

public class PrintUtil extends Object
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 Details

  • Constructor Details

    • PrintUtil

      public PrintUtil()
  • Method Details

    • init

      public static void init()
      Load built in prefixes.
    • registerPrefix

      public 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.
    • registerPrefixMap

      public 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.
    • removePrefix

      public static void removePrefix(String prefix)
      Remove a registered prefix from the table of known short forms
    • removePrefixMap

      public static void removePrefixMap(Map<String,String> map)
      Remove a set of prefix mappings from the table of known short forms
    • print

      public static String print(Node node)
      Return a simplified print string for a Node.
    • print

      public static String print(RDFNode node)
      Return a simplified print string for an RDFNode.
    • print

      public static String print(Triple triple)
      Return a simplified print string for a Triple
    • print

      public static String print(TriplePattern triple)
      Return a simplified print string for a TriplePattern
    • print

      public static String print(Statement stmt)
      Return a simplified print string for a statement
    • print

      public static String print(Object obj)
      Default print which just uses tostring
    • expandQname

      public static String expandQname(String uri)
      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

      public static void printIndent(PrintWriter out, int indent)
      Print an n-space indent to the given output stream
    • printOut

      public static void printOut(Iterator<?> it)
      Print all the Triple values from a find iterator.