public abstract class AbstractRDFInserter extends AbstractRDFHandler
| Modifier and Type | Field and Description |
|---|---|
protected Resource[] |
contexts
The contexts to add the statements to.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRDFInserter(ValueFactory vf)
Creates a new RDFInserter object that preserves bnode IDs and that does not enforce any context upon statements
that are reported to it.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addNamespace(String prefix,
String name) |
protected abstract void |
addStatement(Resource subj,
IRI pred,
Value obj,
Resource ctxt) |
void |
endRDF()
Signals the end of the RDF data.
|
void |
enforceContext(Resource... contexts)
Enforces the supplied contexts upon all statements that are reported to this RDFInserter.
|
boolean |
enforcesContext()
Checks whether this RDFInserter enforces its contexts upon all statements that are reported to it.
|
Resource[] |
getContexts()
Gets the contexts that this RDFInserter enforces upon all statements that are reported to it (in case
enforcesContext() returns true).
|
void |
handleNamespace(String prefix,
String name)
Handles a namespace declaration/definition.
|
void |
handleStatement(Statement st)
Handles a statement.
|
boolean |
preservesBNodeIDs()
Checks whether this RDFInserter preserves blank node IDs.
|
void |
setPreserveBNodeIDs(boolean preserveBNodeIDs)
Sets whether this RDFInserter should preserve blank node IDs.
|
handleComment, startRDFprotected Resource[] contexts
protected AbstractRDFInserter(ValueFactory vf)
public void setPreserveBNodeIDs(boolean preserveBNodeIDs)
preserveBNodeIDs - The new value for this flag.public boolean preservesBNodeIDs()
public void enforceContext(Resource... contexts)
contexts - the contexts to use. Use an empty array (not null!) to indicate no context(s) should be enforced.public boolean enforcesContext()
public Resource[] getContexts()
protected abstract void addNamespace(String prefix, String name) throws RDF4JException
RDF4JExceptionprotected abstract void addStatement(Resource subj, IRI pred, Value obj, Resource ctxt) throws RDF4JException
RDF4JExceptionpublic void endRDF()
throws RDFHandlerException
RDFHandlerendRDF in interface RDFHandlerendRDF in class AbstractRDFHandlerRDFHandlerException - If the RDF handler has encountered an unrecoverable error.public void handleNamespace(String prefix, String name)
RDFHandlerhandleNamespace in interface RDFHandlerhandleNamespace in class AbstractRDFHandlerprefix - The prefix for the namespace, or an empty string in case of a default namespace.name - The URI that the prefix maps to.public void handleStatement(Statement st) throws RDFHandlerException
RDFHandlerhandleStatement in interface RDFHandlerhandleStatement in class AbstractRDFHandlerst - The statement.RDFHandlerException - If the RDF handler has encountered an unrecoverable error.Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.