net.rootdev.javardfa.output
Class TurtleSink
java.lang.Object
net.rootdev.javardfa.output.NTripleSink
net.rootdev.javardfa.output.TurtleSink
- All Implemented Interfaces:
- StatementSink
public class TurtleSink
- extends NTripleSink
A pretty ropey turtle serialiser.
Advantages: streams, no dependencies.
- Author:
- pldms
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TurtleSink
public TurtleSink(OutputStream os,
String... comments)
throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
TurtleSink
public TurtleSink(Writer writer,
String... comments)
end
public void end()
- Description copied from interface:
StatementSink
- Complete parsing
- Specified by:
end
in interface StatementSink
- Overrides:
end
in class NTripleSink
addObject
public void addObject(String subject,
String predicate,
String object)
- Description copied from interface:
StatementSink
- Add statement with non-literal object.
Blank nodes begin with _:, variables with ?, otherwise IRI
- Specified by:
addObject
in interface StatementSink
- Overrides:
addObject
in class NTripleSink
- Parameters:
subject
- Subject of triplepredicate
- Predicateobject
- Object
addLiteral
public void addLiteral(String subject,
String predicate,
String lex,
String lang,
String datatype)
- Description copied from interface:
StatementSink
- Add statement with a literal object.
As above, blank nodes begin with _:, variables with ?, otherwise IRI
- Specified by:
addLiteral
in interface StatementSink
- Overrides:
addLiteral
in class NTripleSink
- Parameters:
subject
- Subject of triplepredicate
- Predicatelex
- Lexical formlang
- Language (may be null)datatype
- Datatype IRI (may be null)
enc
protected final String enc(int codepoint)
- Overrides:
enc
in class NTripleSink
longenc
protected final String longenc(int codepoint)
- Overrides:
longenc
in class NTripleSink
Copyright © 2009-2012. All Rights Reserved.