public interface Backend
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connection to the store.
|
void |
connect()
Establishes the connection to the store.
|
void |
populate()
Fills the initial store with the OWL data of the ontologies from the OWL
files in the config folder (or registered in the system).
|
void |
populate(String owlFileName)
Fills the store with the OWL data of a certain ontologies from the OWL
file in the config folder (or registered in the system).
|
String |
queryBySPARQL(String input,
String... scopeArray)
Returns the result of a SPARQL query issued to the underlying store.
|
void |
removeOldEvents(long tstamp)
Removes all events from the underlying store that were received until the
specified timestamp.
|
ArrayList |
retrieveEvent(String subject,
String subjecttype,
String predicate,
Object object,
Integer confidence,
Long expiration,
Object provider,
Long tstamp,
String... scopeArray)
Retrieves a list of
ContextEvent from the
underlying store, which members are the context events that match the
parameters passed. |
ArrayList |
retrieveEventsBetweenTstmp(String subject,
String subjecttype,
String predicate,
Object object,
Integer confidence,
Long expiration,
ContextProvider provider,
Long tstamp,
Long tstfrom,
Long tstto,
String... scopeArray)
Retrieves a list of
ContextEvent from the
underlying store, which members are the context events that match the
parameters passed, and were received within the specified time range. |
ArrayList |
retrieveEventsBySPARQL(String input,
String... scopeArray)
Retrieves a list of
ContextEvent from the
underlying store, as a result of a SPARQL query. |
ArrayList |
retrieveEventsFromTstmp(String subject,
String subjecttype,
String predicate,
Object object,
Integer confidence,
Long expiration,
ContextProvider provider,
Long tstamp,
Long tstfrom,
String... scopeArray)
Retrieves a list of
ContextEvent from the
underlying store, which members are the context events that match the
parameters passed, and were received after the specified timestamp. |
ArrayList |
retrieveEventsToTstmp(String subject,
String subjecttype,
String predicate,
Object object,
Integer confidence,
Long expiration,
ContextProvider provider,
Long tstamp,
Long tstto,
String... scopeArray)
Retrieves a list of
ContextEvent from the
underlying store, which members are the context events that match the
parameters passed, and were received before the specified timestamp. |
void |
setSerializer(MessageContentSerializer service)
Set the MessageContentSerializer universAAL Parser that can be used to
serialize and parse RDF data to universAAL data and vice-versa.
|
void |
storeEvent(ContextEvent e)
Stores a
ContextEvent in the
underlying store. |
void connect()
void close()
void storeEvent(ContextEvent e)
ContextEvent
in the
underlying store.e
- The context event to be stored.ArrayList retrieveEvent(String subject, String subjecttype, String predicate, Object object, Integer confidence, Long expiration, Object provider, Long tstamp, String... scopeArray)
ContextEvent
from the
underlying store, which members are the context events that match the
parameters passed. A parameter can be passed a value of null
for wildcarding.
This is not used in the current version. Will probably be deprecated.
subject
- The URI of the subject of the event to be matchedsubjecttype
- The URI of the type of subject of the event to be matchedpredicate
- The URI of the predicate of the event to be matchedobject
- The Object of the event to be matched. It depends on the
implementer of this method how to match the object.confidence
- The confidence of the event to be matchedexpiration
- The expiration time of the event to be matchedprovider
- The context provider of the event to be matchedtstamp
- The timestamp in milliseconds of the event to be matchedscopeArray
- Optional argument: scopes defining the origin tenants of the
requested infoArrayList retrieveEventsFromTstmp(String subject, String subjecttype, String predicate, Object object, Integer confidence, Long expiration, ContextProvider provider, Long tstamp, Long tstfrom, String... scopeArray)
ContextEvent
from the
underlying store, which members are the context events that match the
parameters passed, and were received after the specified timestamp. A
parameter can be passed a value of null
for wildcarding.subject
- The URI of the subject of the event to be matchedsubjecttype
- The URI of the type of subject of the event to be matchedpredicate
- The URI of the predicate of the event to be matchedobject
- The Object of the event to be matched. It depends on the
implementer of this method how to match the object.confidence
- The confidence of the event to be matchedexpiration
- The expiration time of the event to be matchedprovider
- The context provider of the event to be matchedtstamp
- The timestamp in milliseconds of the event to be matched. If
not null
, only events with this specified
timestamp will be returned, as long as it is inside the time
range specified by tstinputfrom
tstfrom
- The timestamp in milliseconds from which events are requested.
Only events stored after this timestamp will be returned.scopeArray
- Optional argument: scopes defining the origin tenants of the
requested infoArrayList retrieveEventsToTstmp(String subject, String subjecttype, String predicate, Object object, Integer confidence, Long expiration, ContextProvider provider, Long tstamp, Long tstto, String... scopeArray)
ContextEvent
from the
underlying store, which members are the context events that match the
parameters passed, and were received before the specified timestamp. A
parameter can be passed a value of null
for wildcarding.subject
- The URI of the subject of the event to be matchedsubjecttype
- The URI of the type of subject of the event to be matchedpredicate
- The URI of the predicate of the event to be matchedobject
- The Object of the event to be matched. It depends on the
implementer of this method how to match the object.confidence
- The confidence of the event to be matchedexpiration
- The expiration time of the event to be matchedprovider
- The context provider of the event to be matchedtstamp
- The timestamp in milliseconds of the event to be matched. If
not null
, only events with this specified
timestamp will be returned, as long as it is inside the time
range specified by tstinputto
tstto
- The timestamp in milliseconds until which events are
requested. Only events stored before this timestamp will be
returned.scopeArray
- Optional argument: scopes defining the origin tenants of the
requested infoArrayList retrieveEventsBetweenTstmp(String subject, String subjecttype, String predicate, Object object, Integer confidence, Long expiration, ContextProvider provider, Long tstamp, Long tstfrom, Long tstto, String... scopeArray)
ContextEvent
from the
underlying store, which members are the context events that match the
parameters passed, and were received within the specified time range. A
parameter can be passed a value of null
for wildcarding.subject
- The URI of the subject of the event to be matchedsubjecttype
- The URI of the type of subject of the event to be matchedpredicate
- The URI of the predicate of the event to be matchedobject
- The Object of the event to be matched. It depends on the
implementer of this method how to match the object.confidence
- The confidence of the event to be matchedexpiration
- The expiration time of the event to be matchedprovider
- The context provider of the event to be matchedtstamp
- The timestamp in milliseconds of the event to be matched. If
not null
, only events with this specified
timestamp will be returned, as long as it is inside the time
rangetstfrom
- The timestamp in milliseconds from which events are requested.
Only events stored after this timestamp will be returned.tstto
- The timestamp in milliseconds until which events are
requested. Only events stored before this timestamp will be
returned.scopeArray
- Optional argument: scopes defining the origin tenants of the
requested infoArrayList retrieveEventsBySPARQL(String input, String... scopeArray)
ContextEvent
from the
underlying store, as a result of a SPARQL query.input
- The SPARQL query that defines the events to be returned. The
variable that represents the event MUST be named
c
. For instance: "SELECT ?c WHERE {...". Only
SELECT queries are allowed.scopeArray
- Optional argument: scopes defining the origin tenants of the
requested infoString queryBySPARQL(String input, String... scopeArray)
input
- The SPARQL query to be executed.scopeArray
- Optional argument: scopes defining the origin tenants of the
requested infovoid removeOldEvents(long tstamp)
tstamp
- The timestamp in milliseconds until which events are removed.
A value of 0 does nothing.void setSerializer(MessageContentSerializer service)
service
- The MessageContentSerializer service implementation found in
OSGivoid populate() throws org.openrdf.repository.RepositoryException, org.openrdf.rio.RDFParseException, IOException
org.openrdf.repository.RepositoryException
org.openrdf.rio.RDFParseException
IOException
void populate(String owlFileName) throws org.openrdf.repository.RepositoryException, org.openrdf.rio.RDFParseException, IOException
owlFileName
- The naem of the OWL file to storeorg.openrdf.repository.RepositoryException
org.openrdf.rio.RDFParseException
IOException
Copyright © 2018 universAAL Consortium. All rights reserved.