Package com.complexible.stardog.api
Interface Adder
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.
- Since:
- 0.3
- Version:
- 6.0
- Author:
- Michael Grove
-
Method Summary
Modifier and TypeMethodDescriptiongraph(Collection<Statement> theGraph, Resource... theContext) Add the graph to the database.io()Add statements to the database from IO operations.Add a single statement to the database.Add a single statement to the database
-
Method Details
-
statement
Adder statement(Resource theSubj, IRI thePred, Value theObj, Resource... theContext) throws StardogException Add a single statement to the database. If contexts are specified, the statement will be added to each context.- Parameters:
theSubj- the subjectthePred- the predicatetheObj- the objecttheContext- the (optional) named graph to add the data to- Returns:
- this object
- Throws:
StardogException- if there is an error while adding the statement
-
statement
Add a single statement to the database- Parameters:
theStmt- the statement to add- Returns:
- this object
- Throws:
StardogException- if there was an error while adding the statement
-
graph
Add the graph to the database. If any contexts are specified, they will override the context specified on statements within the graph. When multiple contexts are specified, the graph is added to each context.- Parameters:
theGraph- the graph to addtheContext- the named graph to add the information to- Returns:
- this object
- Throws:
StardogException- if there is an error adding the data
-
io
Add statements to the database from IO operations.- Returns:
- an IO instance
- Throws:
StardogException- if there is an error creating an IO adder- See Also:
-