public interface KnowledgeStore extends Closeable
This interface represents the entry point of the KnowledgeStore API. Users have to first obtain
an instance of this interface, in a way that depends on whether the KnowledgeStore is running
locally in embedded mode or is accessed via its CRUD and SPARQL endpoints at some base URL
(reported by method #getURL()
). After an instance is obtained, new user sessions can be
created calling methods newSession()
(for anonymous sessions} or
#newSession(URI, String)
(for authenticated user sessions); the returned
Session
objects allow in turn to issue API calls to the KnowledgeStore. When the
KnowledgeStore instance is no more used, method close()
should be called to release
the KnowledgeStore
instance and any resource possibly allocated to it.
KnowledgeStore
instances are thread safe. Object equality is used for comparing
Store
instances.
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the
KnowledgeStore instance, releasing any resource possibly
allocated. |
boolean |
isClosed()
Tests whether this
KnowledgeStore instance has been closed. |
Session |
newSession()
Creates a new anonymous user session.
|
Session |
newSession(String username,
String password)
Creates a new user session, using the optional username and password specified.
|
Session newSession() throws IllegalStateException
Session
depend on the security settings for anonymous users of the KnowledgeStore
instance.Session
IllegalStateException
- in case the KnowledgeStore
instance has been closedSession newSession(@Nullable String username, @Nullable String password) throws IllegalStateException
Session
depend on the security settings
for the specific authenticated user of the KnowledgeStore instance.username
- the username, possibly nullpassword
- the user password, possibly nullSession
IllegalStateException
- in case the KnowledgeStore
instance has been closedboolean isClosed()
KnowledgeStore
instance has been closed.KnowledgeStore
instance has been closedvoid close()
KnowledgeStore
instance, releasing any resource possibly
allocated. Calling this method additional times has no effect. After this method is called,
calls to other methods of the KnowledgeStore
interface will result in
IllegalStateException
s being thrown.close
in interface AutoCloseable
close
in interface Closeable
Copyright © 2015–2016 FBK-irst. All rights reserved.