public class TDBSink extends AbstractBufferingSink implements org.dice_research.squirrel.sink.triplebased.AdvancedTripleBasedSink, org.dice_research.squirrel.sink.Sink
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOGGER |
private org.dice_research.squirrel.data.uri.CrawleableUri |
metaDataGraphUri
Uri for the MetaData graph, will be stored in the default graph
|
private String |
queryDatasetURI
The URI of the DB in which querys can be performed.
|
private String |
updateDatasetURI
The URI of the DB in which updates can be performed.
|
private String |
updateMetaDataUri
The URI to the metadata DB in which updates can be performed.
|
bufferSize, DEFAULT_BUFFER_SIZE
Constructor and Description |
---|
TDBSink(String host,
String port,
String updateAppendix,
String queryAppendix,
String updateMetaDataAppendix,
String queryMetaDataAppendix)
Constructor of SparqlBasedSink.
|
Modifier and Type | Method and Description |
---|---|
void |
addData(org.dice_research.squirrel.data.uri.CrawleableUri uri,
InputStream stream) |
void |
addMetaData(org.apache.jena.rdf.model.Model model) |
void |
flushMetadata() |
String |
getGraphId(org.dice_research.squirrel.data.uri.CrawleableUri uri)
Get the id of the graph in which the given uri is stored.
|
List<org.apache.jena.graph.Triple> |
getTriplesForGraph(org.dice_research.squirrel.data.uri.CrawleableUri uri) |
String |
getUpdateDatasetURI() |
protected void |
sendQuads(org.dice_research.squirrel.data.uri.CrawleableUri uri,
Collection<org.apache.jena.sparql.core.Quad> buffer) |
protected void |
sendTriples(org.dice_research.squirrel.data.uri.CrawleableUri uri,
Collection<org.apache.jena.graph.Triple> triples)
Method to send all buffered triples to the database
|
addQuad, addTriple, closeSinkForUri, openSinkForUri
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addTriple
private static final org.slf4j.Logger LOGGER
private final String updateMetaDataUri
private String updateDatasetURI
private String queryDatasetURI
private org.dice_research.squirrel.data.uri.CrawleableUri metaDataGraphUri
public TDBSink(String host, String port, String updateAppendix, String queryAppendix, String updateMetaDataAppendix, String queryMetaDataAppendix)
host
- The host name of the sink.port
- The port of the sink.updateAppendix
- The update appendix for the content dataqueryAppendix
- The query appendix for the content dataupdateMetaDataAppendix
- The update appendix for the meta dataqueryMetaDataAppendix
- The query appendix for the meta datapublic List<org.apache.jena.graph.Triple> getTriplesForGraph(org.dice_research.squirrel.data.uri.CrawleableUri uri)
getTriplesForGraph
in interface org.dice_research.squirrel.sink.triplebased.AdvancedTripleBasedSink
protected void sendTriples(org.dice_research.squirrel.data.uri.CrawleableUri uri, Collection<org.apache.jena.graph.Triple> triples)
sendTriples
in class AbstractBufferingSink
uri
- the crawled CrawleableUri
tripleList
- the list of Triple
s regarding that uripublic void addMetaData(org.apache.jena.rdf.model.Model model)
addMetaData
in interface org.dice_research.squirrel.sink.Sink
public void addData(org.dice_research.squirrel.data.uri.CrawleableUri uri, InputStream stream)
addData
in interface org.dice_research.squirrel.sink.UnstructuredDataSink
public String getGraphId(org.dice_research.squirrel.data.uri.CrawleableUri uri)
uri
- The given uri.public String getUpdateDatasetURI()
protected void sendQuads(org.dice_research.squirrel.data.uri.CrawleableUri uri, Collection<org.apache.jena.sparql.core.Quad> buffer)
sendQuads
in class AbstractBufferingSink
public void flushMetadata()
flushMetadata
in interface org.dice_research.squirrel.sink.Sink
Copyright © 2017–2020. All rights reserved.