jena
Class rdfcat

java.lang.Object
  extended by jena.rdfcat

public class rdfcat
extends java.lang.Object

An RDF utility that takes its name from the Unix utility cat, and is used to generate serialisations of the contents of zero or more input model serialisations.

Synopsis:

 java jena.rdfcat (options|lang|input)*
 where options are:
   -out N3  (aliases n, n3, ttl)
   -out N-TRIPLE  (aliases t, ntriple)
   -out RDF/XML  (aliases x, rdf, xml, rdfxml)
   -out RDF/XML-ABBREV (default)
   -include
   -noinclude (default)

 lang is one of:
   -n for n3 input  (aliases -n3, -N3, -ttl)
   -x for rdf/xml input  (aliases -rdf, -xml, -rdfxml)
   -t for n-triple input  (aliases -ntriple)

 input is a URL, a filename, or - for the standard input
 

The input language options set the default language for all subsequent arguments, up to the next lang option. So in the following example, inputs A, B and C are read as N3, while D and stdin are read as RDF/XML:

 java jena.rdfcat -n A B C -x - D
 

If the include option is set, the input files are scanned for rdfs:seeAlso and owl:imports statements, and the objects of these statements are read as well. By default, include is off.

rdfcat uses the Jena FileManager to resolve input URI's to locations. This allows, for example, http: URI's to be re-directed to local file: locations, to avoid a network transaction.

Examples:

 Join two RDF/XML files together into a single model in RDF/XML-ABBREV:
 java jena.rdfcat in1 in2 > out.rdf

 Convert a single RDF/XML file to N3:
 java jena.rdfcat in1 -out N3 > out.n3

 Join two owl files one N3, one XML, and their imports, into a single NTRIPLE file:
 java jena.rdfcat -out NTRIPLE -include in1.owl -n in2.owl > out.ntriple
 

Note that, in a difference from the Unix utility cat, the order of input statements is not preserved. The output document is a merge of the input documents, and does not preserve any statement ordering from the input serialisations. Also, duplicate triples will be suppressed.

Version:
Release @release@ ($Id: rdfcat.java,v 1.5 2005/10/12 09:02:23 ian_dickinson Exp $)
Author:
Ian Dickinson, HP Labs (email)

Field Summary
 jena.cmdline.ArgDecl HELP
          Argument to show usage
 jena.cmdline.ArgDecl IN_N3
          Argument setting expected input language to N3
 jena.cmdline.ArgDecl IN_NTRIPLE
          Argument setting expected input language to NTRIPLE
 jena.cmdline.ArgDecl IN_RDF_XML
          Argument setting expected input language to RDF/XML
 jena.cmdline.ArgDecl INCLUDE
          Argument to turn include processing on
 jena.cmdline.ArgDecl NOINCLUDE
          Argument to turn include processing off
 jena.cmdline.ArgDecl OUT_LANG
          Argument to set the output language
 jena.cmdline.ArgDecl USAGE
           
 
Constructor Summary
rdfcat()
           
 
Method Summary
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IN_N3

public final jena.cmdline.ArgDecl IN_N3
Argument setting expected input language to N3


IN_RDF_XML

public final jena.cmdline.ArgDecl IN_RDF_XML
Argument setting expected input language to RDF/XML


IN_NTRIPLE

public final jena.cmdline.ArgDecl IN_NTRIPLE
Argument setting expected input language to NTRIPLE


OUT_LANG

public final jena.cmdline.ArgDecl OUT_LANG
Argument to set the output language


INCLUDE

public final jena.cmdline.ArgDecl INCLUDE
Argument to turn include processing on


NOINCLUDE

public final jena.cmdline.ArgDecl NOINCLUDE
Argument to turn include processing off


HELP

public final jena.cmdline.ArgDecl HELP
Argument to show usage


USAGE

public final jena.cmdline.ArgDecl USAGE
Constructor Detail

rdfcat

public rdfcat()
Method Detail

main

public static void main(java.lang.String[] args)


Copyright © 2000, 2001, 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP