Package com.semedy.reasoner.api.core
Class JavaDeductiveDatabase
java.lang.Object
com.semedy.reasoner.api.core.JavaDeductiveDatabase
High level interface for a whole java deductive database.
Encapsulates symbol handler, extensional database (edb),
intensional database (idb), built-ins, rewriters.
Provides adding/removing facts, adding/removing rules,
querying and transaction handling of fact and rule modifications.
DDB is thread local, so every thread has its own instance of DDB.
Core which is a member of DDB is shared for different DDBs.
Encapsulates symbol handler, extensional database (edb),
intensional database (idb), built-ins, rewriters.
Provides adding/removing facts, adding/removing rules,
querying and transaction handling of fact and rule modifications.
DDB is thread local, so every thread has its own instance of DDB.
Core which is a member of DDB is shared for different DDBs.
- Author:
- angele
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addJavaObjects
(Collection<JavaObject> objects) Add a set of homogenious java objects.boolean
removeJavaObjects
(JavaObject object, Collection<String> objectIds) objects with uids are deleted.retrieveJavaObjects
(JavaObject object, String conditions) Retrieve JavaObjects of class A.retrieveJavaObjects
(JavaObject object, String conditions, Configuration config, Properties builtinConfig) Retrieve JavaObjects of class A.void
void
void
-
Constructor Details
-
JavaDeductiveDatabase
- Throws:
IOException
SemReasonerException
-
-
Method Details
-
addJavaObjects
public boolean addJavaObjects(Collection<JavaObject> objects) throws IllegalArgumentException, IllegalAccessException, SymboltableException, IOException, EDBException, InterruptedException Add a set of homogenious java objects.
Properties must be either simple data types or
references to other JavaObjects (with a unique id) or
sets of references to other JavaObjects.
An example is given in the following: public class Person extends JavaObject { String name; Integer age; Set<Person> friends; }- Parameters:
objects
- , collection of java objects- Returns:
- Throws:
IllegalAccessException
IllegalArgumentException
IOException
SymboltableException
EDBException
InterruptedException
-
removeJavaObjects
objects with uids are deleted.- Parameters:
objectIds
-- Returns:
-
retrieveJavaObjects
public List<JavaObject> retrieveJavaObjects(JavaObject object, String conditions) throws InterruptedException, IOException, SemReasonerException Retrieve JavaObjects of class A.
The conditions must contain
conditions on the properties to select the objects.
As variable for the instances of the class ?X is used.
e.g. ?X[name:?Y,age:?Z], ?Y="Kevin",?Z>20 The conditions are not restricted to class A: e.g. ?X[friends:?Y],?Y[age:?Z],?Z>20- Parameters:
object
- , this object defines the structure of the instancesconditions
- , conditions to filter the objects- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
SimpleParseException
SemReasonerException
-
retrieveJavaObjects
public List<JavaObject> retrieveJavaObjects(JavaObject object, String conditions, Configuration config, Properties builtinConfig) throws SemReasonerException, InterruptedException, IOException Retrieve JavaObjects of class A.
The conditions must contain
conditions on the properties to select the objects.
As variable for the instances of the class ?X is used.
e.g. ?X[name:?Y,age:?Z], ?Y="Kevin",?Z>20 The conditions are not restricted to class A: e.g. ?X[friends:?Y],?Y[age:?Z],?Z>20- Parameters:
object
- , this object defines the structure of the instancesconditions
- , conditions to filter the objectsconfig
- , configurationbuiltinConfig
- , configuration for built-ins like e.g. access token- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
SimpleParseException
SemReasonerException
-
transactionBegin
- Throws:
SemReasonerException
IOException
-
transactionRollback
-
transactionCommit
-