Java Doc for rdfcat.java in  » RSS-RDF » Jena-2.5.5 » jena » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » RSS RDF » Jena 2.5.5 » jena 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   jena.rdfcat

rdfcat
public class rdfcat (Code)

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. Note In a change from previous versions, but to ensure compatability with standard argument handling practice, the input language options are no longer sticky. In previous versions, rdfcat -n A B C would ensure that A, B and C were all read as N3. From Jena 2.5.2 onwards, this requires: rdfcat -n A -n B -n C, or the use of the -in option.

Synopsis:

 java jena.rdfcat (options|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)
 -in N3  (aliases n, n3, ttl)
 -in N-TRIPLE  (aliases t, ntriple)
 -in RDF/XML  (aliases x, rdf, xml, rdfxml)
 -include
 -noinclude (default)
 input is one of:
 -n <filename> for n3 input  (aliases -n3, -N3, -ttl)
 -x <filename> for rdf/xml input  (aliases -rdf, -xml, -rdfxml)
 -t <filename> for n-triple input  (aliases -ntriple)
 or just a URL, a filename, or - for the standard input.
 

The default input language is RDF/XML, but the reader will try to guess the input language based on the file extension (e.g. N3 for file with a .n3 file extension.

The input language options set the language for the following file name only. So in the following example, input A is read as N3, inputs B, C and D are read as RDF/XML, while stdin is read as N-TRIPLE:

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

To change the default input language for all files that do not have a specified language encoding, use the -in option.

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. If include is turned on, the normal behaviour is for the including statements (e.g owl:imports to be filtered from the output models. To leave such statements in place, use the --nofilter option.

rdfcat uses the Jena com.hp.hpl.jena.util.FileManager 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
 Concatenate two N3-serving http URL's as N-TRIPLE
 java jena.rdfcat -in N3 -out N-TRIPLE http://example.com/a http://example.com/b
 

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.


author:
   Ian Dickinson, HP Labs (email)
version:
   Release @release@ ($Id: rdfcat.java,v 1.15 2008/01/02 12:08:16 andy_seaborne Exp $)

Inner Class :protected class RCCommandLine extends CommandLine
Inner Class :protected class IncludeQueueEntry
Inner Class :protected interface RCAction
Inner Class :protected class ReadAction implements RCAction

Field Summary
final public  ArgDeclHELP
    
final public  ArgDeclINCLUDE
    
final public  ArgDeclIN_LANG
    
final public  ArgDeclIN_N3
    
final public  ArgDeclIN_NTRIPLE
    
final public  ArgDeclIN_RDF_XML
    
final public  ArgDeclNOFILTER
    
final public  ArgDeclNOINCLUDE
    
final public  ArgDeclOUT_LANG
    
final public  ArgDeclUSAGE
    
protected  Listm_actionQ
    
protected  CommandLinem_cmdLine
    
protected  booleanm_include
    
protected  Stringm_inputFormat
    
protected  Modelm_model
    
protected  Stringm_outputFormat
    
protected  booleanm_removeIncludeStatements
    
protected  Setm_seen
    
public static  Mapunabbreviate
     Map from abbreviated names to full names.


Method Summary
protected  voidaddIncludes(Model inModel, List queue)
    
protected  voidexpectInput(String lang)
    
public static  StringgetCheckedLanguage(String shortLang)
     Answer the full, checked, language name expanded from shortName.
protected  StringgetExpectedInput()
    
protected  OutputStreamgetOutputStream()
    
protected  StringgetURL(RDFNode n)
    
protected  voidgo(String[] args)
    
public static  voidmain(String[] args)
    
protected static  MapmakeUnabbreviateMap()
     Construct the canonical abbreviation map.
protected  voidreadInput(String inputName)
    
protected  voidsetInclude(boolean incl)
    
protected  voidsetOutput(String lang)
    
protected  voidsetRemoveIncludeStatements(boolean f)
    
protected  voidusage()
    

Field Detail
HELP
final public ArgDecl HELP(Code)
Argument to show usage



INCLUDE
final public ArgDecl INCLUDE(Code)
Argument to turn include processing on



IN_LANG
final public ArgDecl IN_LANG(Code)
Argument to set the default input language



IN_N3
final public ArgDecl IN_N3(Code)
Argument setting expected input language to N3



IN_NTRIPLE
final public ArgDecl IN_NTRIPLE(Code)
Argument setting expected input language to NTRIPLE



IN_RDF_XML
final public ArgDecl IN_RDF_XML(Code)
Argument setting expected input language to RDF/XML



NOFILTER
final public ArgDecl NOFILTER(Code)
Argument to leave import/seeAlso statements in place in flattened models



NOINCLUDE
final public ArgDecl NOINCLUDE(Code)
Argument to turn include processing off



OUT_LANG
final public ArgDecl OUT_LANG(Code)
Argument to set the output language



USAGE
final public ArgDecl USAGE(Code)



m_actionQ
protected List m_actionQ(Code)
Action queue



m_cmdLine
protected CommandLine m_cmdLine(Code)
The command line processor that handles the arguments



m_include
protected boolean m_include(Code)
Flag to indicate whether we include owl:imports and rdfs:seeAlso



m_inputFormat
protected String m_inputFormat(Code)
The input format we're expecting for the next URL to be read - defaults to RDF/XML



m_model
protected Model m_model(Code)
The merged model containing all of the inputs



m_outputFormat
protected String m_outputFormat(Code)
The output format to write to, defaults to RDF/XML-ABBREV



m_removeIncludeStatements
protected boolean m_removeIncludeStatements(Code)
Flag to control whether import/include statements are filtered from merged models



m_seen
protected Set m_seen(Code)
List of URL's that have been loaded already, occurs check



unabbreviate
public static Map unabbreviate(Code)
Map from abbreviated names to full names.





Method Detail
addIncludes
protected void addIncludes(Model inModel, List queue)(Code)
Add any additional models to include given the rdfs:seeAlso and owl:imports statements in the given model



expectInput
protected void expectInput(String lang)(Code)
Set the input language of next and subsequent reads



getCheckedLanguage
public static String getCheckedLanguage(String shortLang)(Code)
Answer the full, checked, language name expanded from shortName. The shortName is expanded according to the table of abbreviations [below]. It is then checked against RDFWriterFImpl's writer table [this is hacky but at the moment it's the most available interface] and the NoWriter exception trapped and replaced by the original IllegalArgument exception.



getExpectedInput
protected String getExpectedInput()(Code)
Answer the currently expected input format



getOutputStream
protected OutputStream getOutputStream()(Code)
Return the stream to which the output is written, defaults to stdout



getURL
protected String getURL(RDFNode n)(Code)
Answer a URL string from a resource or literal



go
protected void go(String[] args)(Code)



main
public static void main(String[] args)(Code)



makeUnabbreviateMap
protected static Map makeUnabbreviateMap()(Code)
Construct the canonical abbreviation map.



readInput
protected void readInput(String inputName)(Code)



setInclude
protected void setInclude(boolean incl)(Code)
Set the flag to include owl:imports and rdf:seeAlso files in the output, default off



setOutput
protected void setOutput(String lang)(Code)
Set the language to write the output model in



setRemoveIncludeStatements
protected void setRemoveIncludeStatements(boolean f)(Code)
Set the flag to leave owl:imports and rdfs:seeAlso statements in place, rather than filter them



usage
protected void usage()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.