Package org.apache.any23.writer
Class URIListWriter
- java.lang.Object
-
- org.apache.any23.writer.TripleWriterHandler
-
- org.apache.any23.writer.URIListWriter
-
- All Implemented Interfaces:
AutoCloseable
,FormatWriter
,TripleHandler
,TripleWriter
public class URIListWriter extends TripleWriterHandler implements FormatWriter
This writer simply produces a list of unique IRI present in the subject or in the object of every single extracted RDF Statement.- Author:
- Davide Palmisano (palmisano@fbk.eu), Hans Brende (hansbrende@apache.org)
-
-
Constructor Summary
Constructors Constructor Description URIListWriter(OutputStream outputStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Will be called last and exactly once.void
endDocument(org.eclipse.rdf4j.model.IRI documentIRI)
Writers may override this method to handle an "endDocument" extraction event.boolean
isAnnotated()
Iftrue
then the produced RDF is annotated with the extractors used to generate the specific statements.void
setAnnotated(boolean f)
Sets the annotation flag.void
writeNamespace(String prefix, String uri)
Writes a prefix-namespace mapping.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)
Writes a triple and, optionally, a graph resource name.-
Methods inherited from class org.apache.any23.writer.TripleWriterHandler
closeContext, openContext, receiveNamespace, receiveTriple, setContentLength, startDocument
-
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, startDocument
-
-
-
-
Constructor Detail
-
URIListWriter
public URIListWriter(OutputStream outputStream)
-
-
Method Detail
-
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 TripleHandlerException
Description copied from interface:TripleWriter
Writes a triple and, optionally, a graph resource name.- Specified by:
writeTriple
in 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
Description copied from interface:TripleWriter
Writes 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:
writeNamespace
in 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 TripleHandlerException
Description copied from class:TripleWriterHandler
Writers may override this method to handle an "endDocument" extraction event. The default implementation does nothing.- Specified by:
endDocument
in interfaceTripleHandler
- Overrides:
endDocument
in classTripleWriterHandler
- Parameters:
documentIRI
- the document IRI.- Throws:
TripleHandlerException
- if an error occurred while responding to a "endDocument" extraction event.
-
close
public void close() throws TripleHandlerException
Description copied from interface:TripleHandler
Will be called last and exactly once.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceTripleHandler
- Specified by:
close
in interfaceTripleWriter
- Throws:
TripleHandlerException
- if there is an error closing theTripleHandler
implementation.
-
isAnnotated
public boolean isAnnotated()
Description copied from interface:FormatWriter
Iftrue
then the produced RDF is annotated with the extractors used to generate the specific statements.- Specified by:
isAnnotated
in interfaceFormatWriter
- Returns:
- the annotation flag value.
-
setAnnotated
public void setAnnotated(boolean f)
Description copied from interface:FormatWriter
Sets the annotation flag.- Specified by:
setAnnotated
in interfaceFormatWriter
- Parameters:
f
- Iftrue
then the produced RDF is annotated with the extractors used to generate the specific statements.
-
-