Java Doc for RepositoryConnection.java in  » RSS-RDF » sesame » org » openrdf » repository » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » RSS RDF » sesame » org.openrdf.repository 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.openrdf.repository.RepositoryConnection

All known Subclasses:   org.openrdf.repository.base.RepositoryConnectionBase,
RepositoryConnection
public interface RepositoryConnection (Code)
Main interface for updating data in and performing queries on a Sesame repository. By default, a RepositoryConnection is in autoCommit mode, meaning that each operation corresponds to a single transaction on the underlying store. autoCommit can be switched off in which case it is up to the user to handle transaction commit/rollback. Note that care should be taking to always properly close a RepositoryConnection after one is finished with it, to free up resources and avoid unnecessary locks.

Several methods take a vararg argument that optionally specifies a (set of) context(s) on which the method should operate. Note that a vararg parameter is optional, it can be completely left out of the method call, in which case a method either operates on a provided statements context (if one of the method parameters is a statement or collection of statements), or operates on the repository as a whole, completely ignoring context. A vararg argument may also be 'null' (cast to Resource) meaning that the method operates on those statements which have no associated context only.

Examples:

 // Ex 1: this method retrieves all statements that appear in either context1 or context2, or both.
 RepositoryConnection.getStatements(null, null, null, true, context1, context2);
 // Ex 2: this method retrieves all statements that appear in the repository (regardless of context).
 RepositoryConnection.getStatements(null, null, null, true);
 // Ex 3: this method retrieves all statements that have no associated context in the repository.
 // Observe that this is not equivalent to the previous method call.
 RepositoryConnection.getStatements(null, null, null, true, (Resource)null);
 // Ex 4: this method adds a statement to the store. If the statement object itself has 
 // a context (i.e. statement.getContext() != null) the statement is added to that context. Otherwise,
 // it is added without any associated context.
 RepositoryConnection.add(statement);
 // Ex 5: this method adds a statement to context1 in the store. It completely ignores any
 // context the statement itself has.
 RepositoryConnection.add(statement, context1);
 

author:
   Arjohn Kampman
author:
   jeen




Method Summary
public  voidadd(InputStream in, String baseURI, RDFFormat dataFormat, Resource... contexts)
     Adds RDF data from an InputStream to the repository, optionally to one or more named contexts.
Parameters:
  in - An InputStream from which RDF data can be read.
Parameters:
  baseURI - The base URI to resolve any relative URIs that are in the dataagainst.
Parameters:
  dataFormat - The serialization format of the data.
Parameters:
  contexts - The contexts to add the data to.
public  voidadd(Reader reader, String baseURI, RDFFormat dataFormat, Resource... contexts)
     Adds RDF data from a Reader to the repository, optionally to one or more named contexts.
public  voidadd(URL url, String baseURI, RDFFormat dataFormat, Resource... contexts)
     Adds the RDF data that can be found at the specified URL to the repository, optionally to one or more named contexts.
Parameters:
  url - The URL of the RDF data.
Parameters:
  baseURI - The base URI to resolve any relative URIs that are in the dataagainst.
public  voidadd(File file, String baseURI, RDFFormat dataFormat, Resource... contexts)
     Adds RDF data from the specified file to a specific contexts in the repository.
Parameters:
  file - A file containing RDF data.
Parameters:
  baseURI - The base URI to resolve any relative URIs that are in the dataagainst.
public  voidadd(Resource subject, URI predicate, Value object, Resource... contexts)
     Adds a statement with the specified subject, predicate and object to this repository, optionally to one or more named contexts.
Parameters:
  subject - The statement's subject.
Parameters:
  predicate - The statement's predicate.
Parameters:
  object - The statement's object.
Parameters:
  contexts - The contexts to add the data to.
public  voidadd(Statement st, Resource... contexts)
     Adds the supplied statement to this repository, optionally to one or more named contexts.
Parameters:
  st - The statement to add.
Parameters:
  contexts - The contexts to add the statements to.
public  voidadd(Iterable<? extends Statement> statements, Resource... contexts)
     Adds the supplied statements to this repository, optionally to one or more named contexts.
Parameters:
  statements - The statements that should be added.
Parameters:
  contexts - The contexts to add the statements to.
public  voidadd(Iteration<? extends Statement, E> statementIter, Resource... contexts)
     Adds the supplied statements to this repository, optionally to one or more named contexts.
Parameters:
  statementIter - The statements to add.
public  voidclear(Resource... contexts)
     Removes all statements from a specific contexts in the repository.
Parameters:
  contexts - The context(s) to remove the data from.
public  voidclearNamespaces()
     Removes all namespace declarations from the repository.
public  voidclose()
     Closes the connection, freeing resources.
public  voidcommit()
     Commits all updates that have been performed as part of this connection sofar.
public  voidexport(RDFHandler handler, Resource... contexts)
     Exports all explicit statements in the specified contexts to the supplied RDFHandler.
Parameters:
  contexts - The context(s) to get the data from.
public  voidexportStatements(Resource subj, URI pred, Value obj, boolean includeInferred, RDFHandler handler, Resource... contexts)
     Exports all statements with a specific subject, predicate and/or object from the repository, optionally from the specified contexts.
Parameters:
  subj - The subject, or null if the subject doesn't matter.
Parameters:
  pred - The predicate, or null if the predicate doesn't matter.
Parameters:
  obj - The object, or null if the object doesn't matter.
Parameters:
  contexts - The context(s) to get the data from.
public  RepositoryResult<Resource>getContextIDs()
     Gets all resources that are used as content identifiers.
public  StringgetNamespace(String prefix)
     Gets the namespace that is associated with the specified prefix, if any.
Parameters:
  prefix - A namespace prefix.
public  RepositoryResult<Namespace>getNamespaces()
     Gets all declared namespaces as a RepositoryResult of Namespace objects.
public  RepositorygetRepository()
     Returns the Repository object to which this connection belongs.
public  RepositoryResult<Statement>getStatements(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts)
     Gets all statements with a specific subject, predicate and/or object from the repository.
public  booleanhasStatement(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts)
     Checks whether the repository contains statements with a specific subject, predicate and/or object, optionally in the specified contexts.
Parameters:
  subj - A Resource specifying the subject, or null for awildcard.
Parameters:
  pred - A URI specifying the predicate, or null for a wildcard.
Parameters:
  obj - A Value specifying the object, or null for a wildcard.
Parameters:
  contexts - The context(s) the need to be searched.
public  booleanhasStatement(Statement st, boolean includeInferred, Resource... contexts)
     Checks whether the repository contains the specified statement, optionally in the specified contexts.
Parameters:
  st - The statement to look for.
public  booleanisAutoCommit()
     Checks whether the connection is in auto-commit mode.
public  booleanisEmpty()
     Returns true if this repository does not contain any (explicit) statements.
public  booleanisOpen()
     Checks whether this connection is open.
public  BooleanQueryprepareBooleanQuery(QueryLanguage ql, String query)
     Prepares true/false queries.
public  BooleanQueryprepareBooleanQuery(QueryLanguage ql, String query, String baseURI)
     Prepares true/false queries.
public  GraphQueryprepareGraphQuery(QueryLanguage ql, String query)
     Prepares queries that produce RDF graphs.
public  GraphQueryprepareGraphQuery(QueryLanguage ql, String query, String baseURI)
     Prepares queries that produce RDF graphs.
public  QueryprepareQuery(QueryLanguage ql, String query)
     Prepares a query for evaluation on this repository (optional operation). In case the query contains relative URIs that need to be resolved against an external base URI, one should use RepositoryConnection.prepareQuery(QueryLanguage,String,String) instead.
Parameters:
  ql - The query language in which the query is formulated.
Parameters:
  query - The query string.
public  QueryprepareQuery(QueryLanguage ql, String query, String baseURI)
     Prepares a query for evaluation on this repository (optional operation).
Parameters:
  ql - The query language in which the query is formulated.
Parameters:
  query - The query string.
Parameters:
  baseURI - The base URI to resolve any relative URIs that are in the queryagainst, can be null if the query does not contain anyrelative URIs.
public  TupleQueryprepareTupleQuery(QueryLanguage ql, String query)
     Prepares a query that produces sets of value tuples.
public  TupleQueryprepareTupleQuery(QueryLanguage ql, String query, String baseURI)
     Prepares a query that produces sets of value tuples.
public  voidremove(Resource subject, URI predicate, Value object, Resource... contexts)
     Removes the statement(s) with the specified subject, predicate and object from the repository, optionally restricted to the specified contexts.
Parameters:
  subject - The statement's subject, or null for a wildcard.
Parameters:
  predicate - The statement's predicate, or null for a wildcard.
Parameters:
  object - The statement's object, or null for a wildcard.
Parameters:
  contexts - The context(s) to remove the data from.
public  voidremove(Statement st, Resource... contexts)
     Removes the supplied statement from the specified contexts in the repository.
Parameters:
  st - The statement to remove.
Parameters:
  contexts - The context(s) to remove the data from.
public  voidremove(Iterable<? extends Statement> statements, Resource... contexts)
     Removes the supplied statements from the specified contexts in this repository.
Parameters:
  statements - The statements that should be added.
Parameters:
  contexts - The context(s) to remove the data from.
public  voidremove(Iteration<? extends Statement, E> statementIter, Resource... contexts)
     Removes the supplied statements from a specific context in this repository, ignoring any context information carried by the statements themselves.
Parameters:
  statementIter - The statements to remove.
public  voidremoveNamespace(String prefix)
     Removes a namespace declaration by removing the association between a prefix and a namespace name.
public  voidrollback()
     Rolls back all updates that have been performed as part of this connection sofar.
public  voidsetAutoCommit(boolean autoCommit)
     Enables or disables auto-commit mode for the connection.
public  voidsetNamespace(String prefix, String name)
     Sets the prefix for a namespace.
public  longsize(Resource... contexts)
     Returns the number of (explicit) statements that are in the specified contexts in this repository.
Parameters:
  contexts - The context(s) to get the data from.



Method Detail
add
public void add(InputStream in, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException(Code)
Adds RDF data from an InputStream to the repository, optionally to one or more named contexts.
Parameters:
  in - An InputStream from which RDF data can be read.
Parameters:
  baseURI - The base URI to resolve any relative URIs that are in the dataagainst.
Parameters:
  dataFormat - The serialization format of the data.
Parameters:
  contexts - The contexts to add the data to. If one or more contexts aresupplied the method ignores contextual information in the actualdata. If no contexts are supplied the contextual information in theinput stream is used, if no context information is available thedata is added without any context.
throws:
  IOException - If an I/O error occurred while reading from the input stream.
throws:
  UnsupportedRDFormatException - If no parser is available for the specified RDF format.
throws:
  RDFParseException - If an error was found while parsing the RDF data.
throws:
  RepositoryException - If the data could not be added to the repository, for examplebecause the repository is not writable.



add
public void add(Reader reader, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException(Code)
Adds RDF data from a Reader to the repository, optionally to one or more named contexts. Note: using a Reader to upload byte-based data means that you have to be careful not to destroy the data's character encoding by enforcing a default character encoding upon the bytes. If possible, adding such data using an InputStream is to be preferred.
Parameters:
  reader - A Reader from which RDF data can be read.
Parameters:
  baseURI - The base URI to resolve any relative URIs that are in the dataagainst.
Parameters:
  dataFormat - The serialization format of the data.
Parameters:
  contexts - The contexts to add the data to. If one or more contexts arespecified the data is added to these contexts, ignoring any contextinformation in the data itself.
throws:
  IOException - If an I/O error occurred while reading from the reader.
throws:
  UnsupportedRDFormatException - If no parser is available for the specified RDF format.
throws:
  RDFParseException - If an error was found while parsing the RDF data.
throws:
  RepositoryException - If the data could not be added to the repository, for examplebecause the repository is not writable.



add
public void add(URL url, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException(Code)
Adds the RDF data that can be found at the specified URL to the repository, optionally to one or more named contexts.
Parameters:
  url - The URL of the RDF data.
Parameters:
  baseURI - The base URI to resolve any relative URIs that are in the dataagainst. This defaults to the value of java.net.URL.toExternalForm url.toExternalForm() if the value isset to null.
Parameters:
  dataFormat - The serialization format of the data.
Parameters:
  contexts - The contexts to add the data to. If one or more contexts arespecified the data is added to these contexts, ignoring any contextinformation in the data itself.
throws:
  IOException - If an I/O error occurred while reading from the URL.
throws:
  UnsupportedRDFormatException - If no parser is available for the specified RDF format.
throws:
  RDFParseException - If an error was found while parsing the RDF data.
throws:
  RepositoryException - If the data could not be added to the repository, for examplebecause the repository is not writable.



add
public void add(File file, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException(Code)
Adds RDF data from the specified file to a specific contexts in the repository.
Parameters:
  file - A file containing RDF data.
Parameters:
  baseURI - The base URI to resolve any relative URIs that are in the dataagainst. This defaults to the value ofjava.io.File.toURI file.toURI() if the value is set tonull.
Parameters:
  dataFormat - The serialization format of the data.
Parameters:
  contexts - The contexts to add the data to. Note that this parameter is avararg and as such is optional. If no contexts are specified, thedata is added to any context specified in the actual data file, orif the data contains no context, it is added without context. Ifone or more contexts are specified the data is added to thesecontexts, ignoring any context information in the data itself.
throws:
  IOException - If an I/O error occurred while reading from the file.
throws:
  UnsupportedRDFormatException - If no parser is available for the specified RDF format.
throws:
  RDFParseException - If an error was found while parsing the RDF data.
throws:
  RepositoryException - If the data could not be added to the repository, for examplebecause the repository is not writable.



add
public void add(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException(Code)
Adds a statement with the specified subject, predicate and object to this repository, optionally to one or more named contexts.
Parameters:
  subject - The statement's subject.
Parameters:
  predicate - The statement's predicate.
Parameters:
  object - The statement's object.
Parameters:
  contexts - The contexts to add the data to. Note that this parameter is avararg and as such is optional. If no contexts are specified, thedata is added to any context specified in the actual data file, orif the data contains no context, it is added without context. Ifone or more contexts are specified the data is added to thesecontexts, ignoring any context information in the data itself.
throws:
  RepositoryException - If the data could not be added to the repository, for examplebecause the repository is not writable.



add
public void add(Statement st, Resource... contexts) throws RepositoryException(Code)
Adds the supplied statement to this repository, optionally to one or more named contexts.
Parameters:
  st - The statement to add.
Parameters:
  contexts - The contexts to add the statements to. Note that this parameter isa vararg and as such is optional. If no contexts are specified, thestatement is added to any context specified in each statement, orif the statement contains no context, it is added without context.If one or more contexts are specified the statement is added tothese contexts, ignoring any context information in the statementitself.
throws:
  RepositoryException - If the statement could not be added to the repository, for examplebecause the repository is not writable.



add
public void add(Iterable<? extends Statement> statements, Resource... contexts) throws RepositoryException(Code)
Adds the supplied statements to this repository, optionally to one or more named contexts.
Parameters:
  statements - The statements that should be added.
Parameters:
  contexts - The contexts to add the statements to. Note that this parameter isa vararg and as such is optional. If no contexts are specified,each statement is added to any context specified in the statement,or if the statement contains no context, it is added withoutcontext. If one or more contexts are specified each statement isadded to these contexts, ignoring any context information in thestatement itself. ignored.
throws:
  RepositoryException - If the statements could not be added to the repository, forexample because the repository is not writable.



add
public void add(Iteration<? extends Statement, E> statementIter, Resource... contexts) throws RepositoryException, E(Code)
Adds the supplied statements to this repository, optionally to one or more named contexts.
Parameters:
  statementIter - The statements to add. In case the iterator is aCloseableIteration, it will be closed before this methodreturns.
Parameters:
  contexts - The contexts to add the statements to. Note that this parameter isa vararg and as such is optional. If no contexts are specified,each statement is added to any context specified in the statement,or if the statement contains no context, it is added withoutcontext. If one or more contexts are specified each statement isadded to these contexts, ignoring any context information in thestatement itself. ignored.
throws:
  RepositoryException - If the statements could not be added to the repository, forexample because the repository is not writable.



clear
public void clear(Resource... contexts) throws RepositoryException(Code)
Removes all statements from a specific contexts in the repository.
Parameters:
  contexts - The context(s) to remove the data from. Note that this parameter isa vararg and as such is optional. If no contexts are supplied themethod operates on the entire repository.
throws:
  RepositoryException - If the statements could not be removed from the repository, forexample because the repository is not writable.



clearNamespaces
public void clearNamespaces() throws RepositoryException(Code)
Removes all namespace declarations from the repository.
throws:
  RepositoryException - If the namespace declarations could not be removed.



close
public void close() throws RepositoryException(Code)
Closes the connection, freeing resources. If the connection is not in autoCommit mode, all non-committed operations will be lost.
throws:
  RepositoryException - If the connection could not be closed.



commit
public void commit() throws RepositoryException(Code)
Commits all updates that have been performed as part of this connection sofar.
throws:
  RepositoryException - If the connection could not be committed.



export
public void export(RDFHandler handler, Resource... contexts) throws RepositoryException, RDFHandlerException(Code)
Exports all explicit statements in the specified contexts to the supplied RDFHandler.
Parameters:
  contexts - The context(s) to get the data from. Note that this parameter is avararg and as such is optional. If no contexts are supplied themethod operates on the entire repository.
Parameters:
  handler - The handler that will handle the RDF data.
throws:
  RDFHandlerException - If the handler encounters an unrecoverable error.



exportStatements
public void exportStatements(Resource subj, URI pred, Value obj, boolean includeInferred, RDFHandler handler, Resource... contexts) throws RepositoryException, RDFHandlerException(Code)
Exports all statements with a specific subject, predicate and/or object from the repository, optionally from the specified contexts.
Parameters:
  subj - The subject, or null if the subject doesn't matter.
Parameters:
  pred - The predicate, or null if the predicate doesn't matter.
Parameters:
  obj - The object, or null if the object doesn't matter.
Parameters:
  contexts - The context(s) to get the data from. Note that this parameter is avararg and as such is optional. If no contexts are supplied themethod operates on the entire repository.
Parameters:
  handler - The handler that will handle the RDF data.
Parameters:
  includeInferred - if false, no inferred statements are returned; if true, inferredstatements are returned if available
throws:
  RDFHandlerException - If the handler encounters an unrecoverable error.



getContextIDs
public RepositoryResult<Resource> getContextIDs() throws RepositoryException(Code)
Gets all resources that are used as content identifiers. Care should be taken that the returned RepositoryResult is closed to free any resources that it keeps hold of. a RepositoryResult object containing Resources that are used ascontext identifiers.



getNamespace
public String getNamespace(String prefix) throws RepositoryException(Code)
Gets the namespace that is associated with the specified prefix, if any.
Parameters:
  prefix - A namespace prefix. The namespace name that is associated with the specified prefix,or null if there is no such namespace.
throws:
  RepositoryException - If the namespace could not be read from the repository.



getNamespaces
public RepositoryResult<Namespace> getNamespaces() throws RepositoryException(Code)
Gets all declared namespaces as a RepositoryResult of Namespace objects. Each Namespace object consists of a prefix and a namespace name. A RepositoryResult containing Namespace objects. Care should betaken to close the RepositoryResult after use.
throws:
  RepositoryException - If the namespaces could not be read from the repository.



getRepository
public Repository getRepository()(Code)
Returns the Repository object to which this connection belongs.



getStatements
public RepositoryResult<Statement> getStatements(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException(Code)
Gets all statements with a specific subject, predicate and/or object from the repository. The result is optionally restricted to the specified set of named contexts.
Parameters:
  subj - A Resource specifying the subject, or null for awildcard.
Parameters:
  pred - A URI specifying the predicate, or null for a wildcard.
Parameters:
  obj - A Value specifying the object, or null for a wildcard.
Parameters:
  contexts - The context(s) to get the data from. Note that this parameter is avararg and as such is optional. If no contexts are supplied themethod operates on the entire repository.
Parameters:
  includeInferred - if false, no inferred statements are returned; if true, inferredstatements are returned if available. The default is true. The statements matching the specified pattern. The result objectis a RepositoryResult object, a lazy Iterator-like objectcontaining Statements and optionally throwing aRepositoryException when an error when a problem occursduring retrieval.



hasStatement
public boolean hasStatement(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException(Code)
Checks whether the repository contains statements with a specific subject, predicate and/or object, optionally in the specified contexts.
Parameters:
  subj - A Resource specifying the subject, or null for awildcard.
Parameters:
  pred - A URI specifying the predicate, or null for a wildcard.
Parameters:
  obj - A Value specifying the object, or null for a wildcard.
Parameters:
  contexts - The context(s) the need to be searched. Note that this parameter isa vararg and as such is optional. If no contexts are supplied themethod operates on the entire repository.
Parameters:
  includeInferred - if false, no inferred statements are considered; if true, inferredstatements are considered if available true If a matching statement is in the repository in the specifiedcontext, false otherwise.



hasStatement
public boolean hasStatement(Statement st, boolean includeInferred, Resource... contexts) throws RepositoryException(Code)
Checks whether the repository contains the specified statement, optionally in the specified contexts.
Parameters:
  st - The statement to look for. Context information in the statement isignored.
Parameters:
  contexts - The context(s) to get the data from. Note that this parameter is avararg and as such is optional. If no contexts are supplied themethod operates on the entire repository.
Parameters:
  includeInferred - if false, no inferred statements are considered; if true, inferredstatements are considered if available true If the repository contains the specified statement, falseotherwise.



isAutoCommit
public boolean isAutoCommit() throws RepositoryException(Code)
Checks whether the connection is in auto-commit mode.
See Also:   RepositoryConnection.setAutoCommit



isEmpty
public boolean isEmpty() throws RepositoryException(Code)
Returns true if this repository does not contain any (explicit) statements. true if this repository is empty, falseotherwise.
throws:
  RepositoryException - If the repository could not be checked to be empty.



isOpen
public boolean isOpen() throws RepositoryException(Code)
Checks whether this connection is open. A connection is open from the moment it is created until it is closed.
See Also:   RepositoryConnection.close()



prepareBooleanQuery
public BooleanQuery prepareBooleanQuery(QueryLanguage ql, String query) throws RepositoryException, MalformedQueryException(Code)
Prepares true/false queries. In case the query contains relative URIs that need to be resolved against an external base URI, one should use RepositoryConnection.prepareBooleanQuery(QueryLanguage,String,String) instead.
Parameters:
  ql - The query language in which the query is formulated.
Parameters:
  query - The query string.
throws:
  IllegalArgumentException - If the supplied query is not a boolean query.
throws:
  MalformedQueryException - If the supplied query is malformed.
throws:
  UnsupportedQueryLanguageException - If the supplied query language is not supported.



prepareBooleanQuery
public BooleanQuery prepareBooleanQuery(QueryLanguage ql, String query, String baseURI) throws RepositoryException, MalformedQueryException(Code)
Prepares true/false queries.
Parameters:
  ql - The query language in which the query is formulated.
Parameters:
  query - The query string.
Parameters:
  baseURI - The base URI to resolve any relative URIs that are in the queryagainst, can be null if the query does not contain anyrelative URIs.
throws:
  IllegalArgumentException - If the supplied query is not a boolean query.
throws:
  MalformedQueryException - If the supplied query is malformed.
throws:
  UnsupportedQueryLanguageException - If the supplied query language is not supported.



prepareGraphQuery
public GraphQuery prepareGraphQuery(QueryLanguage ql, String query) throws RepositoryException, MalformedQueryException(Code)
Prepares queries that produce RDF graphs. In case the query contains relative URIs that need to be resolved against an external base URI, one should use RepositoryConnection.prepareGraphQuery(QueryLanguage,String,String) instead.
Parameters:
  ql - The query language in which the query is formulated.
Parameters:
  query - The query string.
throws:
  IllegalArgumentException - If the supplied query is not a graph query.
throws:
  MalformedQueryException - If the supplied query is malformed.
throws:
  UnsupportedQueryLanguageException - If the supplied query language is not supported.



prepareGraphQuery
public GraphQuery prepareGraphQuery(QueryLanguage ql, String query, String baseURI) throws RepositoryException, MalformedQueryException(Code)
Prepares queries that produce RDF graphs.
Parameters:
  ql - The query language in which the query is formulated.
Parameters:
  query - The query string.
Parameters:
  baseURI - The base URI to resolve any relative URIs that are in the queryagainst, can be null if the query does not contain anyrelative URIs.
throws:
  IllegalArgumentException - If the supplied query is not a graph query.
throws:
  MalformedQueryException - If the supplied query is malformed.
throws:
  UnsupportedQueryLanguageException - If the supplied query language is not supported.



prepareQuery
public Query prepareQuery(QueryLanguage ql, String query) throws RepositoryException, MalformedQueryException(Code)
Prepares a query for evaluation on this repository (optional operation). In case the query contains relative URIs that need to be resolved against an external base URI, one should use RepositoryConnection.prepareQuery(QueryLanguage,String,String) instead.
Parameters:
  ql - The query language in which the query is formulated.
Parameters:
  query - The query string. A query ready to be evaluated on this repository.
throws:
  MalformedQueryException - If the supplied query is malformed.
throws:
  UnsupportedQueryLanguageException - If the supplied query language is not supported.
throws:
  UnsupportedOperationException - If the prepareQuery method is not supported by thisrepository.



prepareQuery
public Query prepareQuery(QueryLanguage ql, String query, String baseURI) throws RepositoryException, MalformedQueryException(Code)
Prepares a query for evaluation on this repository (optional operation).
Parameters:
  ql - The query language in which the query is formulated.
Parameters:
  query - The query string.
Parameters:
  baseURI - The base URI to resolve any relative URIs that are in the queryagainst, can be null if the query does not contain anyrelative URIs. A query ready to be evaluated on this repository.
throws:
  MalformedQueryException - If the supplied query is malformed.
throws:
  UnsupportedQueryLanguageException - If the supplied query language is not supported.
throws:
  UnsupportedOperationException - If the prepareQuery method is not supported by thisrepository.



prepareTupleQuery
public TupleQuery prepareTupleQuery(QueryLanguage ql, String query) throws RepositoryException, MalformedQueryException(Code)
Prepares a query that produces sets of value tuples. In case the query contains relative URIs that need to be resolved against an external base URI, one should use RepositoryConnection.prepareTupleQuery(QueryLanguage,String,String) instead.
Parameters:
  ql - The query language in which the query is formulated.
Parameters:
  query - The query string.
throws:
  IllegalArgumentException - If the supplied query is not a tuple query.
throws:
  MalformedQueryException - If the supplied query is malformed.
throws:
  UnsupportedQueryLanguageException - If the supplied query language is not supported.



prepareTupleQuery
public TupleQuery prepareTupleQuery(QueryLanguage ql, String query, String baseURI) throws RepositoryException, MalformedQueryException(Code)
Prepares a query that produces sets of value tuples.
Parameters:
  ql - The query language in which the query is formulated.
Parameters:
  query - The query string.
Parameters:
  baseURI - The base URI to resolve any relative URIs that are in the queryagainst, can be null if the query does not contain anyrelative URIs.
throws:
  IllegalArgumentException - If the supplied query is not a tuple query.
throws:
  MalformedQueryException - If the supplied query is malformed.
throws:
  UnsupportedQueryLanguageException - If the supplied query language is not supported.



remove
public void remove(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException(Code)
Removes the statement(s) with the specified subject, predicate and object from the repository, optionally restricted to the specified contexts.
Parameters:
  subject - The statement's subject, or null for a wildcard.
Parameters:
  predicate - The statement's predicate, or null for a wildcard.
Parameters:
  object - The statement's object, or null for a wildcard.
Parameters:
  contexts - The context(s) to remove the data from. Note that this parameter isa vararg and as such is optional. If no contexts are supplied themethod operates on the entire repository.
throws:
  RepositoryException - If the statement(s) could not be removed from the repository, forexample because the repository is not writable.



remove
public void remove(Statement st, Resource... contexts) throws RepositoryException(Code)
Removes the supplied statement from the specified contexts in the repository.
Parameters:
  st - The statement to remove.
Parameters:
  contexts - The context(s) to remove the data from. Note that this parameter isa vararg and as such is optional. If no contexts are supplied themethod operates on the contexts associated with the statementitself, and if no context is associated with the statement, on theentire repository.
throws:
  RepositoryException - If the statement could not be removed from the repository, forexample because the repository is not writable.



remove
public void remove(Iterable<? extends Statement> statements, Resource... contexts) throws RepositoryException(Code)
Removes the supplied statements from the specified contexts in this repository.
Parameters:
  statements - The statements that should be added.
Parameters:
  contexts - The context(s) to remove the data from. Note that this parameter isa vararg and as such is optional. If no contexts are supplied themethod operates on the contexts associated with the statementitself, and if no context is associated with the statement, on theentire repository.
throws:
  RepositoryException - If the statements could not be added to the repository, forexample because the repository is not writable.



remove
public void remove(Iteration<? extends Statement, E> statementIter, Resource... contexts) throws RepositoryException, E(Code)
Removes the supplied statements from a specific context in this repository, ignoring any context information carried by the statements themselves.
Parameters:
  statementIter - The statements to remove. In case the iterator is aCloseableIteration, it will be closed before this methodreturns.
Parameters:
  contexts - The context(s) to remove the data from. Note that this parameter isa vararg and as such is optional. If no contexts are supplied themethod operates on the contexts associated with the statementitself, and if no context is associated with the statement, on theentire repository.
throws:
  RepositoryException - If the statements could not be removed from the repository, forexample because the repository is not writable.



removeNamespace
public void removeNamespace(String prefix) throws RepositoryException(Code)
Removes a namespace declaration by removing the association between a prefix and a namespace name.
Parameters:
  prefix - The namespace prefix of which the assocation with a namespace nameis to be removed.
throws:
  RepositoryException - If the namespace prefix could not be removed.



rollback
public void rollback() throws RepositoryException(Code)
Rolls back all updates that have been performed as part of this connection sofar.
throws:
  RepositoryException - If the connection could not be rolled back.



setAutoCommit
public void setAutoCommit(boolean autoCommit) throws RepositoryException(Code)
Enables or disables auto-commit mode for the connection. If a connection is in auto-commit mode, then all updates will be executed and committed as individual transactions. Otherwise, the updates are grouped into transactions that are terminated by a call to either RepositoryConnection.commit or RepositoryConnection.rollback . By default, new connections are in auto-commit mode.

NOTE: If this connection is switched to auto-commit mode during a transaction, the transaction is committed.
throws:
  RepositoryException - In case the mode switch failed, for example because a currentlyactive transaction failed to commit.
See Also:   RepositoryConnection.commit




setNamespace
public void setNamespace(String prefix, String name) throws RepositoryException(Code)
Sets the prefix for a namespace.
Parameters:
  prefix - The new prefix.
Parameters:
  name - The namespace name that the prefix maps to.
throws:
  RepositoryException - If the namespace could not be set in the repository, for examplebecause the repository is not writable.



size
public long size(Resource... contexts) throws RepositoryException(Code)
Returns the number of (explicit) statements that are in the specified contexts in this repository.
Parameters:
  contexts - The context(s) to get the data from. Note that this parameter is avararg and as such is optional. If no contexts are supplied themethod operates on the entire repository. The number of explicit statements from the specified contexts inthis repository.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.