Class NTriple

  • All Implemented Interfaces:
    ARPErrorNumbers

    public class NTriple
    extends java.lang.Object
    implements ARPErrorNumbers
    A command line interface into ARP. Creates NTriple's or just error messages.
     java <class-path> com.hp.hpl.jena.arp.NTriple ( [ -[xstfurR]][ -b xmlBase -[eiw] NNN[,NNN...] ] [ file ] [ url ] )...
     

    All options, files and URLs can be intemingled in any order. They are processed from left-to-right.

    file
    Converts RDF/XML file into N-triples
    url
    Converts RDF/XML from URL into N-triples
    -b uri
    Sets XML Base to the absolute URI.
    -r
    Content is RDF (default, no embedding, rdf:RDF tag may be omitted).
    -R
    RDF embedded in XML document, search for obligatory rdf:RDF start element.
    -t
    No n-triple output, error checking only.
    -x
    Lax mode - warnings are suppressed.
    -s
    Strict mode - most warnings are errors.
    -u
    Allow unqualified attributes (defaults to warning).
    -f
    All errors are.error - report first one only.
    -n
    Show line numbers of each triple.
    -b url
    Sets XML Base to the absolute url.
    -e NNN[,NNN...]
    Treats numbered warning conditions as errrors.
    -w NNN[,NNN...]
    Treats numbered error conditions as warnings.
    -i NNN[,NNN...]
    Ignores numbered error/warning conditions.
    • Constructor Detail

      • NTriple

        public NTriple()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
        Starts an RDF/XML to NTriple converter.
        Parameters:
        args - The command-line arguments.
      • mainEh

        public static void mainEh​(java.lang.String[] args,
                                  org.xml.sax.ErrorHandler eh,
                                  ARPEventHandler ap)
        Starts an RDF/XML to NTriple converter, using an error handler, and an ARPHandler. Statements get processed both by this class, and by the passed in StatementHandler
        Parameters:
        args - The command-line arguments.
        eh - Can be null.
        ap - Can be null.
      • escapeNTriple

        public static java.lang.String escapeNTriple​(java.lang.String anonymousID)
        Replace any non-legal char (or Z) with ZNN where NN are the hex codes in UTF-8
        Parameters:
        anonymousID - Is something that corresponds to an XMLName
        Returns:
        an ascii string that is legal NTriple