com.clarkparsia.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);
 

Since:
0.3
Version:
0.7
Author:
Michael Grove

Method Summary
 Adder graph(Graph theGraph, Resource... theContext)
          Add the graph to the database.
 IO io()
          Add statements to the database from IO operations.
 Adder statement(Resource theSubj, URI thePred, Value theObj, Resource... theContext)
          Add a single statement to the database.
 Adder statement(Statement theStmt)
          Add a single statement to the database
 

Method Detail

statement

Adder statement(Resource theSubj,
                URI 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 subject
thePred - the predicate
theObj - the object
theContext - the (optional) named graph to add the data to
Returns:
this object
Throws:
StardogException - if there is an error while adding the statement

statement

Adder statement(Statement theStmt)
                throws StardogException
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

Adder graph(Graph theGraph,
            Resource... theContext)
            throws StardogException
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 add
theContext - the named graph to add the information to
Returns:
this object
Throws:
StardogException - if there is an error adding the data

io

IO io()
      throws StardogException
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:
IO


Copyright © 2010-2013 Clark & Parsia. All Rights Reserved.