org.openrdf.sesame.admin
Class RdfAdmin

java.lang.Object
  extended byorg.openrdf.sesame.admin.RdfAdmin

public class RdfAdmin
extends Object

The RdfAdmin module that can upload files to an RdfRepository and remove sets of statements from it.


Constructor Summary
RdfAdmin(RdfRepository rdfRepository)
           
RdfAdmin(RdfRepository rdfRepository, LocalService service)
          Creates a new RdfAdmin that will use the supplied RdfRepository for administrating the data.
 
Method Summary
 int addRdfModel(InputStream in, String baseURL, AdminListener listener, boolean verifyData)
          Reads and parses an RDF/XML file from the supplied InputStream and adds the triples to the RdfRepository of this RdfAdmin.
 int addRdfModel(InputStream inputStream, String baseURL, AdminListener listener, RDFFormat dataFormat, boolean verifyData)
          Reads and parses an RDF file from the supplied InputStream and adds the triples to the RdfRepository of this RdfAdmin.
 int addRdfModel(Reader reader, String baseURL, AdminListener listener, RDFFormat dataFormat, boolean verifyData)
          Reads and parses an RDF file from the supplied Reader and adds the triples to the RdfRepository of this RdfAdmin.
 void clearRepository(AdminListener listener)
          Clears the repository of this RdfAdmin.
 void removeStatements(Resource subject, URI predicate, Value object, AdminListener listener)
          Removes statements matching the pattern (subject, predicate, object).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RdfAdmin

public RdfAdmin(RdfRepository rdfRepository,
                LocalService service)
Creates a new RdfAdmin that will use the supplied RdfRepository for administrating the data.

Throws:
IllegalArgumentException - If the supplied rdfRepository is equal to null.

RdfAdmin

public RdfAdmin(RdfRepository rdfRepository)
Method Detail

removeStatements

public void removeStatements(Resource subject,
                             URI predicate,
                             Value object,
                             AdminListener listener)
                      throws UpdateException
Removes statements matching the pattern (subject, predicate, object).

Parameters:
subject - the subject of a statement, or null to indicate a match with any resource.
predicate - the predicate of a statement, or null to indicate a match with any URI.
object - the object of a statement, or null to indicate a match with any value.
Throws:
UpdateException

clearRepository

public void clearRepository(AdminListener listener)
                     throws UpdateException
Clears the repository of this RdfAdmin.

Parameters:
listener - An AdminListener to report administrative message to.
Throws:
UpdateException

addRdfModel

public int addRdfModel(InputStream in,
                       String baseURL,
                       AdminListener listener,
                       boolean verifyData)
                throws UpdateException,
                       IOException
Reads and parses an RDF/XML file from the supplied InputStream and adds the triples to the RdfRepository of this RdfAdmin.

Returns:
the number of processed statements
Throws:
UpdateException
IOException

addRdfModel

public int addRdfModel(InputStream inputStream,
                       String baseURL,
                       AdminListener listener,
                       RDFFormat dataFormat,
                       boolean verifyData)
                throws UpdateException,
                       IOException
Reads and parses an RDF file from the supplied InputStream and adds the triples to the RdfRepository of this RdfAdmin.

Parameters:
inputStream - The InputStream containing the RDF data.
baseURL - The base URL of the data for resolving any relative URIs.
listener - An AdminListener that will receive feedback about the progress and of any errors in the data.
dataFormat - Either RDFFormat.RDFXML if the RDF data is XML-encoded RDF, or RDFFormat.NTRIPLES if the RDF data is in N-Triples format.
verifyData - If set to 'true', the data will first be checked for errors. This flag should only be set to false if the input is known for sure to be correct.
Returns:
The number of processed statements.
Throws:
UpdateException
IOException

addRdfModel

public int addRdfModel(Reader reader,
                       String baseURL,
                       AdminListener listener,
                       RDFFormat dataFormat,
                       boolean verifyData)
                throws UpdateException,
                       IOException
Reads and parses an RDF file from the supplied Reader and adds the triples to the RdfRepository of this RdfAdmin.

Parameters:
reader - The Reader containing the RDF data.
baseURL - The base URL of the data for resolving any relative URIs.
listener - An AdminListener that will receive feedback about the progress and of any errors in the data.
dataFormat - Either RDFFormat.RDFXML if the RDF data is XML-encoded RDF, or RDFFormat.NTRIPLES if the RDF data is in N-Triples format.
verifyData - If set to 'true', the data will first be checked for errors. This flag should only be set to false if the input is known for sure to be correct.
Returns:
The number of processed statements.
Throws:
UpdateException
IOException


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.