|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rootdev.javardfa.output.NTripleSink
public class NTripleSink
A pretty ropey NTriple serialiser. Advantages: streams, no dependencies.
Field Summary | |
---|---|
protected String[] |
comments
|
protected PrintWriter |
out
|
Constructor Summary | |
---|---|
NTripleSink(OutputStream os,
String... comments)
|
|
NTripleSink(Writer writer,
String... comments)
|
Method Summary | |
---|---|
void |
addLiteral(String subject,
String predicate,
String lex,
String lang,
String datatype)
Add statement with a literal object. |
void |
addObject(String subject,
String predicate,
String object)
Add statement with non-literal object. |
void |
addPrefix(String prefix,
String uri)
Add a prefix mapping. |
protected String |
enc(int codepoint)
|
protected String |
encode(String s)
|
void |
end()
Complete parsing |
protected String |
longenc(int codepoint)
|
protected String |
quote(String lex)
|
void |
setBase(String base)
|
void |
start()
Begin parsing |
protected String |
toLiteral(String lex,
String lang,
String datatype)
|
protected String |
toNode(String node)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final PrintWriter out
protected final String[] comments
Constructor Detail |
---|
public NTripleSink(OutputStream os, String... comments) throws UnsupportedEncodingException
UnsupportedEncodingException
public NTripleSink(Writer writer, String... comments)
Method Detail |
---|
public void start()
StatementSink
start
in interface StatementSink
public void end()
StatementSink
end
in interface StatementSink
public void addObject(String subject, String predicate, String object)
StatementSink
addObject
in interface StatementSink
subject
- Subject of triplepredicate
- Predicateobject
- Objectpublic void addLiteral(String subject, String predicate, String lex, String lang, String datatype)
StatementSink
addLiteral
in interface StatementSink
subject
- Subject of triplepredicate
- Predicatelex
- Lexical formlang
- Language (may be null)datatype
- Datatype IRI (may be null)public void addPrefix(String prefix, String uri)
StatementSink
addPrefix
in interface StatementSink
protected final String toNode(String node)
protected final String toLiteral(String lex, String lang, String datatype)
protected final String quote(String lex)
protected final String encode(String s)
protected String enc(int codepoint)
protected String longenc(int codepoint)
public void setBase(String base)
setBase
in interface StatementSink
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |