public interface Adder
Interface for adding RDF to a Stardog database via a connection
.
Usage:
// some stuff from a file
c.add().io().format(RDFFormat.TURTLE).file(new File("data.ttl"));
// also add something from some input stream
c.add().io().format(RDFFormat.RDFXML).stream(input);
// or add a specific statement
c.add().statement(s,p,o);
The changes done through this class might not be sent immediately to the server. The client connection may batch the changes locally and delay sending those changes to the server to minimize the number of network calls. This is an implementation detail and will not change the execution order of read and write operations performed within the transaction.
Modifier and Type | Method and Description |
---|---|
Adder |
graph(Collection<Statement> theGraph,
Resource... theContext)
Add the graph to the database.
|
IO |
io()
Add statements to the database from IO operations.
|
Adder |
statement(Resource theSubj,
IRI thePred,
Value theObj,
Resource... theContext)
Add a single statement to the database.
|
Adder |
statement(Statement theStmt)
Add a single statement to the database
|
Adder statement(Resource theSubj, IRI thePred, Value theObj, Resource... theContext) throws StardogException
theSubj
- the subjectthePred
- the predicatetheObj
- the objecttheContext
- the (optional) named graph to add the data toStardogException
- if there is an error while adding the statementAdder statement(Statement theStmt) throws StardogException
theStmt
- the statement to addStardogException
- if there was an error while adding the statementAdder graph(Collection<Statement> theGraph, Resource... theContext) throws StardogException
theGraph
- the graph to addtheContext
- the named graph to add the information toStardogException
- if there is an error adding the dataIO io() throws StardogException
StardogException
- if there is an error creating an IO adderIO
Copyright © 2010-2016 Stardog Union. All Rights Reserved.