Package org.apache.any23.writer
Class JSONWriter
- java.lang.Object
-
- org.apache.any23.writer.TripleWriterHandler
-
- org.apache.any23.writer.JSONWriter
-
- All Implemented Interfaces:
AutoCloseable,FormatWriter,TripleHandler,TripleWriter
@Deprecated public class JSONWriter extends TripleWriterHandler implements FormatWriter
Deprecated.since 2.3. UseJSONLDWriterinstead.Implementation of JSONTripleWriter.- Author:
- Michele Mostarda (mostarda@fbk.eu)
-
-
Constructor Summary
Constructors Constructor Description JSONWriter(OutputStream os)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Deprecated.Will be called last and exactly once.voidendDocument(org.eclipse.rdf4j.model.IRI documentIRI)Deprecated.Writers may override this method to handle an "endDocument" extraction event.booleanisAnnotated()Deprecated.Iftruethen the produced RDF is annotated with the extractors used to generate the specific statements.voidsetAnnotated(boolean f)Deprecated.Sets the annotation flag.voidstartDocument(org.eclipse.rdf4j.model.IRI documentIRI)Deprecated.Writers may override this method to handle a "startDocument" extraction event.voidwriteNamespace(String prefix, String uri)Deprecated.Writes a prefix-namespace mapping.voidwriteTriple(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o, org.eclipse.rdf4j.model.Resource g)Deprecated.Writes a triple and, optionally, a graph resource name.-
Methods inherited from class org.apache.any23.writer.TripleWriterHandler
closeContext, openContext, receiveNamespace, receiveTriple, setContentLength
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.any23.writer.TripleHandler
closeContext, openContext, receiveNamespace, receiveTriple, setContentLength
-
-
-
-
Constructor Detail
-
JSONWriter
public JSONWriter(OutputStream os)
Deprecated.
-
-
Method Detail
-
startDocument
public void startDocument(org.eclipse.rdf4j.model.IRI documentIRI) throws TripleHandlerExceptionDeprecated.Description copied from class:TripleWriterHandlerWriters may override this method to handle a "startDocument" extraction event. The default implementation does nothing.- Specified by:
startDocumentin interfaceTripleHandler- Overrides:
startDocumentin classTripleWriterHandler- Parameters:
documentIRI- the name of the document that was started- Throws:
TripleHandlerException- if an error occurred while responding to a "startDocument" extraction event.
-
writeTriple
public void writeTriple(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o, org.eclipse.rdf4j.model.Resource g) throws TripleHandlerExceptionDeprecated.Description copied from interface:TripleWriterWrites a triple and, optionally, a graph resource name.- Specified by:
writeTriplein interfaceTripleWriter- Parameters:
s- the subject to writep- the predicate to writeo- the object to writeg- the graph name to write, or null- Throws:
TripleHandlerException- if there is an error writing the triple
-
writeNamespace
public void writeNamespace(String prefix, String uri) throws TripleHandlerException
Deprecated.Description copied from interface:TripleWriterWrites a prefix-namespace mapping.
NOTE: this method should be called before writing out any triples. Calling this method after writing out a triple may result in the prefix-namespace mapping being ignored.- Specified by:
writeNamespacein interfaceTripleWriter- Parameters:
prefix- the namespace prefixuri- the namespace uri- Throws:
TripleHandlerException- if there was an error writing out the prefix-namespace mapping
-
endDocument
public void endDocument(org.eclipse.rdf4j.model.IRI documentIRI) throws TripleHandlerExceptionDeprecated.Description copied from class:TripleWriterHandlerWriters may override this method to handle an "endDocument" extraction event. The default implementation does nothing.- Specified by:
endDocumentin interfaceTripleHandler- Overrides:
endDocumentin classTripleWriterHandler- Parameters:
documentIRI- the document IRI.- Throws:
TripleHandlerException- if an error occurred while responding to a "endDocument" extraction event.
-
close
public void close() throws TripleHandlerExceptionDeprecated.Description copied from interface:TripleHandlerWill be called last and exactly once.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceTripleHandler- Specified by:
closein interfaceTripleWriter- Throws:
TripleHandlerException- if there is an error closing theTripleHandlerimplementation.
-
isAnnotated
public boolean isAnnotated()
Deprecated.Description copied from interface:FormatWriterIftruethen the produced RDF is annotated with the extractors used to generate the specific statements.- Specified by:
isAnnotatedin interfaceFormatWriter- Returns:
- the annotation flag value.
-
setAnnotated
public void setAnnotated(boolean f)
Deprecated.Description copied from interface:FormatWriterSets the annotation flag.- Specified by:
setAnnotatedin interfaceFormatWriter- Parameters:
f- Iftruethen the produced RDF is annotated with the extractors used to generate the specific statements.
-
-