Package com.semedy.reasoner.api.core
Class JSONDeductiveDatabase
java.lang.Object
com.semedy.reasoner.api.core.JSONDeductiveDatabase
Interface for Json objects.
Json objects can be added, removed, and queried for.
A json must have the properties @id, @type
Jsons schemas can also be stored. If a schema
with id = C is there an instance with type = C
is validated against this schema.
Json objects can be added, removed, and queried for.
A json must have the properties @id, @type
Jsons schemas can also be stored. If a schema
with id = C is there an instance with type = C
is validated against this schema.
- Author:
- angele
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
addJsonObject
(org.json.JSONObject json) add a JSON objectboolean
addJsonObject
(org.json.JSONObject json, Object module) add a JSON objectboolean
addJsonObjects
(String objects) add a set of JSON objects, given as a Json array in a string.boolean
addJsonObjects
(String objects, Object module) add a set of JSON objects, given as a Json array in a string.boolean
addJsonObjects
(Collection<org.json.JSONObject> objects) add a set of JSON objects.boolean
addJsonObjects
(Collection<org.json.JSONObject> objects, Object module) add a set of JSON objects.boolean
addJsonObjects
(org.json.JSONArray objects) add a set of JSON objects given in a Json arrayboolean
addJsonObjects
(org.json.JSONArray objects, String module) add a set of JSON objects given in a Json arraystatic void
clear()
clear allvoid
exportJson
(String path, Set<String> excludedProperties) Export jsons into filevoid
exportJSONSchemas
(Writer writer, boolean inherit) export OO-Logic classes as Json Schemas.void
exportJSONSchemas
(String path, boolean inherit) export OO-Logic classes as Json Schemas.getAvailableIdentifiers
(List<String> identifiers) Which of the given json identifiers are there?getAvailableIdentifiers
(List<String> identifiers, Configuration config, Properties builtinConfig) Which of the given json identifiers are there?getAvailableIdentifiers
(List<String> identifiers, String module, Configuration config, Properties builtinConfig) Which of the given json identifiers are there?Returns the deductive database which is used inside the JSONDeductiveDatabase.getJSONSchemas
(boolean inherit) get OO-Logic classes as Json Schemas.org.json.JSONObject
getSchema
(String schemaid, Configuration config, Properties builtinConfig) get schema with id schemaidintrospectionQueryGraphQL
(String graphQLQuery, String module, String variables, Configuration config, Properties builtinConfig) boolean
isIdentifierAvailable
(String identifier) Is this identifier for a json object there?boolean
isIdentifierAvailable
(String identifier, Configuration config, Properties builtinConfig) Is this identifier for a json object there?boolean
isIdentifierAvailable
(String identifier, String module, Configuration config, Properties builtinConfig) Is this identifier for a json object there?void
Import from a json filesvoid
Import from a list of json filesvoid
loadByStream
(InputStream in, InputStream companionstream, String format) load facts by stream.List<org.json.JSONObject>
queryJsonObjects
(String ooquery) Query JSON Objects using an OO-logic query.List<org.json.JSONObject>
queryJsonObjects
(String ooquery, String module) Query JSON Objects using an OO-logic query.List<org.json.JSONObject>
queryJsonObjects
(String ooquery, String module, Configuration config, Properties builtinConfig) Query JSON Objects using an OO-logic query.List<org.json.JSONObject>
queryJsonObjects
(String ooquery, Properties builtinProperties) Query JSON Objects using an OO-logic query.List<org.json.JSONObject>
queryJsonObjects
(Collection<String> identifiers) query JSON objects using the json identifiers (@id) in module
Json objects can be derivedList<org.json.JSONObject>
queryJsonObjects
(Collection<String> identifiers, Configuration config, Properties builtinConfig) query JSON objects using the json identifiers (@id) in module
Json objects can be derivedList<org.json.JSONObject>
queryJsonObjects
(Collection<String> identifiers, Object module, Configuration config, Properties builtinConfig) query JSON objects using the json identifiers (@id) in module
Json objects can be derivedorg.json.JSONObject
queryJsonObjectsByGraphQL
(String graphQLQuery, String module, String variables, Configuration config, Properties builtinConfig) Query JSON Objects using a GraphQL query.boolean
removeJsonObject
(String identifier) Json object with given id (@id) is deletedboolean
removeJsonObject
(String identifier, Configuration config, Properties builtinConfig) Json object with given id (@id) is deletedboolean
removeJsonObjects
(Collection<String> identifiers) Json objects with given ids (@id) are deletedboolean
removeJsonObjects
(Collection<String> identifiers, Configuration config, Properties builtinConfig) Json objects with given ids (@id) are deletedboolean
removeJsonObjects
(Collection<String> identifiers, String module, Configuration config, Properties builtinConfig) Json objects with given ids (@id) are deletedorg.json.JSONObject
retrieveJsonObject
(String identifier, Configuration config, Properties builtinConfig) retrieve JSON object using the json identifier (@id)List<org.json.JSONObject>
retrieveJsonObjects
(String ooquery) Retrieve JSON Objects using an OO-logic query and a module.List<org.json.JSONObject>
retrieveJsonObjects
(String ooquery, Configuration config, Properties builtinConfig) Retrieve JSON Objects using an OO-logic query.List<org.json.JSONObject>
retrieveJsonObjects
(String ooquery, Properties builtinProperties) Retrieve JSON Objects using an OO-logic query and a module.List<org.json.JSONObject>
retrieveJsonObjects
(Collection<String> identifiers) retrieve JSON objects using the json identifiers (@id)List<org.json.JSONObject>
retrieveJsonObjects
(Collection<String> identifiers, boolean initializeTransaction) retrieve JSON objects using the json identifiers (@id)List<org.json.JSONObject>
retrieveJsonObjects
(Collection<String> identifiers, boolean initializeTransaction, Properties builtinConfig) retrieve JSON objects using the json identifiers (@id)List<org.json.JSONObject>
retrieveJsonObjects
(Collection<String> identifiers, Configuration config, Properties builtinConfig) retrieve JSON objects using the json identifiers (@id)List<org.json.JSONObject>
retrieveJsonObjects
(Collection<String> identifiers, Configuration config, Properties builtinConfig, boolean initializeTransaction) retrieve JSON objects using the json identifiers (@id)retrieveJsons
(String ooquery, int maxNumberOfResults, Configuration config, Properties builtinConfig) Retrieve JSON Objects using an OO-logic query.retrieveJsons
(String ooquery, Configuration config, Properties builtinConfig) Retrieve JSON Objects using an OO-logic query.List<org.json.JSONObject>
retrieveTuples
(String query, Configuration config, Properties builtinConfig) Retrieve tuples (variable substitutions) for a given query
E.g. query ?void
setReasoningMonitor
(ReasoningMonitor monitor) set a reasoning monitorvoid
start a transactionvoid
commit transactionvoid
rollback transactionboolean
validateJsonObjects
(List<org.json.JSONObject> jsons, String schemaid) Validate json objects against a stored schema with @id "schema".
Returns true if the schema was available and it has been successfully validated.boolean
validateJsonObjects
(List<org.json.JSONObject> jsons, String schemaid, Configuration config, Properties builtinConfig) Validate json objects against a stored schema with @id "schema".
Returns true if the schema was available and it has been successfully validated.void
validateJsonObjects
(List<org.json.JSONObject> jsons, org.json.JSONObject schema, Properties builtinConfig) Validate json objects against a schema.
-
Constructor Details
-
JSONDeductiveDatabase
- Throws:
IOException
SemReasonerException
-
-
Method Details
-
clear
public static void clear()clear all -
setReasoningMonitor
set a reasoning monitor- Parameters:
monitor
-
-
exportJSONSchemas
public void exportJSONSchemas(String path, boolean inherit) throws IOException, SemReasonerException, InterruptedException export OO-Logic classes as Json Schemas.
For properties ranges are exported only (no comment, no minCardinality) maxCardinality is used for creating array types- Parameters:
path
- , the path for the export fileinherit
- , integrate inherited properties into schema- Throws:
IOException
SemReasonerException
InterruptedException
-
exportJSONSchemas
public void exportJSONSchemas(Writer writer, boolean inherit) throws IOException, SemReasonerException, InterruptedException export OO-Logic classes as Json Schemas.
For properties ranges are exported only (no comment, no minCardinality) maxCardinality is used for creating array types- Parameters:
writer
-inherit
- , integrate inherited properties into schema- Throws:
IOException
SemReasonerException
InterruptedException
-
getJSONSchemas
public Map<String,org.json.JSONObject> getJSONSchemas(boolean inherit) throws IOException, SemReasonerException, InterruptedException get OO-Logic classes as Json Schemas.
For properties ranges are exported only.
maxCardinality is used for creating array types- Parameters:
inherit
- , inherit means that properties are inherited top-down- Returns:
- Throws:
IOException
SemReasonerException
InterruptedException
-
getSchema
public org.json.JSONObject getSchema(String schemaid, Configuration config, Properties builtinConfig) throws InterruptedException, IOException, SemReasonerException get schema with id schemaid- Parameters:
schemaid
- , id of schema, i.e. Personconfig
- , configurationbuiltinConfig
- , builtin configuration- Returns:
- Throws:
InterruptedException
IOException
SemReasonerException
-
addJsonObjects
public boolean addJsonObjects(org.json.JSONArray objects, String module) throws IOException, SemReasonerException, InterruptedException add a set of JSON objects given in a Json array- Parameters:
objects
- , JSON objectsmodule
- , module to add json object to- Returns:
- Throws:
IOException
SemReasonerException
InterruptedException
ReasoningException
-
addJsonObjects
public boolean addJsonObjects(org.json.JSONArray objects) throws IOException, SemReasonerException, ReasoningException, InterruptedException add a set of JSON objects given in a Json array- Parameters:
objects
- , JSON objects- Returns:
- Throws:
IOException
SemReasonerException
InterruptedException
ReasoningException
-
addJsonObject
public boolean addJsonObject(org.json.JSONObject json) throws IOException, SemReasonerException, ReasoningException, InterruptedException add a JSON object- Parameters:
json
- , a JSON object- Returns:
- Throws:
IOException
SemReasonerException
InterruptedException
ReasoningException
-
addJsonObjects
public boolean addJsonObjects(Collection<org.json.JSONObject> objects, Object module) throws IOException, SemReasonerException, ReasoningException, InterruptedException add a set of JSON objects.- Parameters:
objects
- , JSON objectsmodule
- , module to add json object to- Returns:
- Throws:
IOException
SemReasonerException
InterruptedException
ReasoningException
-
addJsonObject
public boolean addJsonObject(org.json.JSONObject json, Object module) throws IOException, SemReasonerException, ReasoningException, InterruptedException add a JSON object- Parameters:
json
- , a JSON objectmodule
- , module to add json object to- Returns:
- Throws:
IOException
SemReasonerException
ReasoningException
InterruptedException
-
addJsonObjects
public boolean addJsonObjects(Collection<org.json.JSONObject> objects) throws IOException, SemReasonerException, ReasoningException, InterruptedException add a set of JSON objects.- Parameters:
objects
- , JSON objects- Returns:
- Throws:
IOException
SemReasonerException
InterruptedException
ReasoningException
-
addJsonObjects
public boolean addJsonObjects(String objects) throws IOException, SemReasonerException, ReasoningException, InterruptedException add a set of JSON objects, given as a Json array in a string.- Parameters:
objects
- , JSON objects- Returns:
- Throws:
IOException
SemReasonerException
InterruptedException
ReasoningException
-
addJsonObjects
public boolean addJsonObjects(String objects, Object module) throws IllegalArgumentException, IllegalAccessException, IOException, SemReasonerException, ReasoningException, InterruptedException add a set of JSON objects, given as a Json array in a string.- Parameters:
objects
- , JSON objectsmodule
- , module to add json object to- Returns:
- Throws:
IllegalAccessException
IllegalArgumentException
IOException
SemReasonerException
InterruptedException
ReasoningException
-
queryJsonObjects
public List<org.json.JSONObject> queryJsonObjects(String ooquery) throws InterruptedException, IOException, SemReasonerException Query JSON Objects using an OO-logic query.
The conditions must contain
conditions on the properties to select the objects.
Json objects can be derived objects As variable for the instances of the class ?Id is used.
e.g. ?- ?Id:Person, ?Id[name:?Y,age:?Z], ?Y="Kevin",?Z>20.- Parameters:
ooquery
- , OO-logic query to filter the objects- Returns:
- Throws:
IOException
InterruptedException
SemReasonerException
-
queryJsonObjects
public List<org.json.JSONObject> queryJsonObjects(String ooquery, Properties builtinProperties) throws InterruptedException, IOException, SemReasonerException Query JSON Objects using an OO-logic query.
The conditions must contain
conditions on the properties to select the objects.
Json objects can be derived objects As variable for the instances of the class ?Id is used.
e.g. ?- ?Id:Person, ?Id[name:?Y,age:?Z], ?Y="Kevin",?Z>20.- Parameters:
ooquery
- , OO-logic query to filter the objectsbuiltinProperties
- , properties to control built-ins and rewriters- Returns:
- Throws:
IOException
InterruptedException
SemReasonerException
-
queryJsonObjects
public List<org.json.JSONObject> queryJsonObjects(String ooquery, String module) throws InterruptedException, IOException, SemReasonerException Query JSON Objects using an OO-logic query.
The conditions must contain
conditions on the properties to select the objects.
Json objects can be derived objects As variable for the instances of the class ?Id is used.
e.g. ?- ?Id:Person, ?Id[name:?Y,age:?Z], ?Y="Kevin",?Z>20.- Parameters:
ooquery
- , OO-logic query to filter the objectsmodule
- , the module to be searched in- Returns:
- Throws:
IOException
InterruptedException
SemReasonerException
-
queryJsonObjects
public List<org.json.JSONObject> queryJsonObjects(String ooquery, String module, Configuration config, Properties builtinConfig) throws InterruptedException, IOException, SemReasonerException Query JSON Objects using an OO-logic query.
The conditions must contain
conditions on the properties to select the objects.
Json objects can be derived objects. As variable for the instances of the class ?Id is used.
e.g. ?- ?Id:Person, ?Id[name:?Y,age:?Z], ?Y="Kevin",?Z>20.- Parameters:
ooquery
- , OO-logic query to filter the objectsmodule
- , the module to be searched in, null for all modulesconfig
- , configurationbuiltinConfig
- , built-in configuration like access token- Returns:
- Throws:
IOException
SemReasonerException
InterruptedException
-
introspectionQueryGraphQL
public String introspectionQueryGraphQL(String graphQLQuery, String module, String variables, Configuration config, Properties builtinConfig) throws SemReasonerException, IOException, InterruptedException -
queryJsonObjectsByGraphQL
public org.json.JSONObject queryJsonObjectsByGraphQL(String graphQLQuery, String module, String variables, Configuration config, Properties builtinConfig) throws SemReasonerException, IOException, InterruptedException Query JSON Objects using a GraphQL query.- Parameters:
graphQLQuery
-module
- , different modules may be distinguishedvariables
- , variables to be substituted in the queryconfig
-builtinConfig
-- Returns:
- Throws:
SemReasonerException
IOException
InterruptedException
-
retrieveJsonObjects
public List<org.json.JSONObject> retrieveJsonObjects(String ooquery) throws ReasoningException, InterruptedException, IOException, SemReasonerException Retrieve JSON Objects using an OO-logic query and a module.
The conditions must contain
conditions on the properties to select the objects.
Json objects are retrieved only; no derived Json objects are returned
As variable for the instances of the class ?Id is used.
e.g. ?- ?Id:Person, ?Id[name:?Y,age:?Z], ?Y="Kevin",?Z>20.- Parameters:
ooquery
- , OO-logic query to filter the objects- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
SemReasonerException
-
retrieveJsonObjects
public List<org.json.JSONObject> retrieveJsonObjects(String ooquery, Properties builtinProperties) throws ReasoningException, InterruptedException, IOException, SemReasonerException Retrieve JSON Objects using an OO-logic query and a module.
The conditions must contain
conditions on the properties to select the objects.
Json objects are retrieved only; no derived Json objects are returned
As variable for the instances of the class ?Id is used.
e.g. ?- ?Id:Person, ?Id[name:?Y,age:?Z], ?Y="Kevin",?Z>20.- Parameters:
ooquery
- , OO-logic query to filter the objectsbuiltinProperties
- , properties to control built-ins and rewriters- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
SemReasonerException
-
retrieveJsonObjects
public List<org.json.JSONObject> retrieveJsonObjects(String ooquery, Configuration config, Properties builtinConfig) throws ReasoningException, InterruptedException, IOException, SemReasonerException Retrieve JSON Objects using an OO-logic query.
The conditions must contain
conditions on the properties to select the objects.
Json objects are retrieved only; no derived Json objects are returned
As variable for the instances of the class ?Id is used.
e.g. ?- ?Id:Person, ?Id[name:?Y,age:?Z], ?Y="Kevin",?Z>20.- Parameters:
ooquery
- , OO-logic query to filter the objectsconfig
- , configurationbuiltinConfig
- , built-in configuration like access token- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
SemReasonerException
-
retrieveJsons
public ResultEnumerator retrieveJsons(String ooquery, Configuration config, Properties builtinConfig) throws ReasoningException, InterruptedException, IOException, SemReasonerException Retrieve JSON Objects using an OO-logic query.
The conditions must contain
conditions on the properties to select the objects.
Json objects are retrieved only; no derived Json objects are returned
As variable for the instances of the class ?Id is used.
e.g. ?- ?Id:Person, ?Id[name:?Y,age:?Z], ?Y="Kevin",?Z>20. The Json Objects may be found in variable ?JsonText- Parameters:
ooquery
- , OO-logic query to filter the objectsconfig
- , configurationbuiltinConfig
- , built-in configuration like access token- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
SemReasonerException
-
retrieveJsons
public ResultEnumerator retrieveJsons(String ooquery, int maxNumberOfResults, Configuration config, Properties builtinConfig) throws ReasoningException, InterruptedException, IOException, SemReasonerException Retrieve JSON Objects using an OO-logic query.
The conditions must contain
conditions on the properties to select the objects.
Json objects are retrieved only; no derived Json objects are returned
As variable for the instances of the class ?Id is used.
e.g. ?- ?Id:Person, ?Id[name:?Y,age:?Z], ?Y="Kevin",?Z>20. The Json Objects may be found in variable ?JsonText- Parameters:
ooquery
- , OO-logic query to filter the objectsconfig
- , configurationbuiltinConfig
- , built-in configuration like access tokenmaxNumberOfResults
- , restrict number of results to that number- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
SemReasonerException
-
retrieveTuples
public List<org.json.JSONObject> retrieveTuples(String query, Configuration config, Properties builtinConfig) throws IOException, SemReasonerException, InterruptedException Retrieve tuples (variable substitutions) for a given query
E.g. query ?- ?Id:Person, ?Id[name:?Y,age:?Z], ?Y="Kevin",?Z>20
A result tuple then looks like:
{"Id": "person1", "Y":"Kevin", "Z":23}- Parameters:
query
-config
- , configurationbuiltinConfig
- , built-in configuration like access token- Returns:
- Throws:
SimpleParseException
IOException
ReasoningException
InterruptedException
SemReasonerException
-
queryJsonObjects
public List<org.json.JSONObject> queryJsonObjects(Collection<String> identifiers, Object module, Configuration config, Properties builtinConfig) throws ReasoningException, InterruptedException, IOException, InstantiationException, IllegalAccessException, SemReasonerException query JSON objects using the json identifiers (@id) in module
Json objects can be derived- Parameters:
identifiers
- , identifiers of the json objectsmodule
- , the modulebuiltinConfig
- , built-in configuration like access token- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
IllegalAccessException
InstantiationException
SemReasonerException
-
queryJsonObjects
public List<org.json.JSONObject> queryJsonObjects(Collection<String> identifiers) throws ReasoningException, InterruptedException, IOException, InstantiationException, IllegalAccessException, SemReasonerException query JSON objects using the json identifiers (@id) in module
Json objects can be derived- Parameters:
identifiers
- , identifiers of the json objects- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
IllegalAccessException
InstantiationException
SemReasonerException
-
queryJsonObjects
public List<org.json.JSONObject> queryJsonObjects(Collection<String> identifiers, Configuration config, Properties builtinConfig) throws ReasoningException, InterruptedException, IOException, InstantiationException, IllegalAccessException, SemReasonerException query JSON objects using the json identifiers (@id) in module
Json objects can be derived- Parameters:
identifiers
- , identifiers of the json objectsconfig
- , configurationbuiltinConfig
- , configuration for built-ins like access tokens- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
IllegalAccessException
InstantiationException
SemReasonerException
-
retrieveJsonObjects
public List<org.json.JSONObject> retrieveJsonObjects(Collection<String> identifiers) throws ReasoningException, InterruptedException, IOException, SemReasonerException retrieve JSON objects using the json identifiers (@id)- Parameters:
identifiers
- , identifiers of the json objects- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
SemReasonerException
-
retrieveJsonObjects
public List<org.json.JSONObject> retrieveJsonObjects(Collection<String> identifiers, boolean initializeTransaction, Properties builtinConfig) throws ReasoningException, InterruptedException, IOException, SemReasonerException retrieve JSON objects using the json identifiers (@id)- Parameters:
identifiers
- , identifiers of the json objectsinitializeTransaction
- used to mark whether a new transaction should be started and rolled back afterwards- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
SemReasonerException
-
retrieveJsonObjects
public List<org.json.JSONObject> retrieveJsonObjects(Collection<String> identifiers, boolean initializeTransaction) throws ReasoningException, InterruptedException, IOException, SemReasonerException retrieve JSON objects using the json identifiers (@id)- Parameters:
identifiers
- , identifiers of the json objectsinitializeTransaction
- used to mark whether a new transaction should be started and rolled back afterwards- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
SemReasonerException
-
retrieveJsonObjects
public List<org.json.JSONObject> retrieveJsonObjects(Collection<String> identifiers, Configuration config, Properties builtinConfig) throws ReasoningException, InterruptedException, IOException, SemReasonerException retrieve JSON objects using the json identifiers (@id)- Parameters:
identifiers
- , identifiers of the json objectsbuiltinConfig
- , configuration for built-in like access token- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
SemReasonerException
-
retrieveJsonObjects
public List<org.json.JSONObject> retrieveJsonObjects(Collection<String> identifiers, Configuration config, Properties builtinConfig, boolean initializeTransaction) throws ReasoningException, InterruptedException, IOException, SemReasonerException retrieve JSON objects using the json identifiers (@id)- Parameters:
identifiers
- , identifiers of the json objectsbuiltinConfig
- , configuration for built-in like access tokeninitializeTransaction
- used to mark whether a new transaction should be started and rolled back afterwards- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
SemReasonerException
-
retrieveJsonObject
public org.json.JSONObject retrieveJsonObject(String identifier, Configuration config, Properties builtinConfig) throws ReasoningException, InterruptedException, IOException, SemReasonerException retrieve JSON object using the json identifier (@id)- Parameters:
identifier
- , identifier of the json objectbuiltinConfig
- , configuration for built-in like access token- Returns:
- Throws:
IOException
InterruptedException
ReasoningException
SemReasonerException
-
removeJsonObjects
public boolean removeJsonObjects(Collection<String> identifiers, String module, Configuration config, Properties builtinConfig) throws ReasoningException, InterruptedException, IOException, SemReasonerException Json objects with given ids (@id) are deleted- Parameters:
identifiers
-module
- , the moduleconfig
- , configurationbuiltinConfig
- , configuration for built-ins like access tokens- Returns:
- Throws:
ReasoningException
InterruptedException
IOException
SemReasonerException
-
removeJsonObjects
public boolean removeJsonObjects(Collection<String> identifiers, Configuration config, Properties builtinConfig) throws ReasoningException, InterruptedException, IOException, SemReasonerException Json objects with given ids (@id) are deleted- Parameters:
identifiers
-config
- , configurationbuiltinConfig
- , configuration for built-ins like access tokens- Returns:
- Throws:
ReasoningException
InterruptedException
IOException
SemReasonerException
-
removeJsonObjects
public boolean removeJsonObjects(Collection<String> identifiers) throws ReasoningException, InterruptedException, IOException, SemReasonerException Json objects with given ids (@id) are deleted- Parameters:
identifiers
-- Returns:
- Throws:
ReasoningException
InterruptedException
IOException
SemReasonerException
-
removeJsonObject
public boolean removeJsonObject(String identifier) throws ReasoningException, InterruptedException, IOException, SemReasonerException Json object with given id (@id) is deleted- Parameters:
identifier
-- Returns:
- Throws:
ReasoningException
InterruptedException
IOException
SemReasonerException
-
removeJsonObject
public boolean removeJsonObject(String identifier, Configuration config, Properties builtinConfig) throws ReasoningException, InterruptedException, IOException, SemReasonerException Json object with given id (@id) is deleted- Parameters:
identifier
-config
- , configurationbuiltinConfig
- , configuration for built-ins like access tokens- Returns:
- Throws:
ReasoningException
InterruptedException
IOException
SemReasonerException
-
validateJsonObjects
public boolean validateJsonObjects(List<org.json.JSONObject> jsons, String schemaid) throws InstantiationException, IllegalAccessException, ReasoningException, InterruptedException, IOException, SemReasonerException Validate json objects against a stored schema with @id "schema".
Returns true if the schema was available and it has been successfully validated.
Returns false if there was no schema throws a SemReasonerException if validation failed- Parameters:
jsons
- , list of jsons to be validatedschemaid
- , id of a stored json schema- Returns:
- has schema been there
- Throws:
InstantiationException
IllegalAccessException
ReasoningException
InterruptedException
IOException
SemReasonerException
-
validateJsonObjects
public boolean validateJsonObjects(List<org.json.JSONObject> jsons, String schemaid, Configuration config, Properties builtinConfig) throws InstantiationException, IllegalAccessException, ReasoningException, InterruptedException, IOException, SemReasonerException Validate json objects against a stored schema with @id "schema".
Returns true if the schema was available and it has been successfully validated.
Returns false if there was no schema throws a SemReasonerException if validation failed- Parameters:
jsons
- , list of jsons to be validatedschemaid
- , id of a stored json schemaconfig
- , configurationconfig
- , configurationbuiltinConfig
- , built-in configuration like access token- Returns:
- has schema been there
- Throws:
InstantiationException
IllegalAccessException
ReasoningException
InterruptedException
IOException
SemReasonerException
-
validateJsonObjects
public void validateJsonObjects(List<org.json.JSONObject> jsons, org.json.JSONObject schema, Properties builtinConfig) throws InstantiationException, IllegalAccessException, ReasoningException, InterruptedException, IOException, SemReasonerException Validate json objects against a schema.
Throws a SemReasonerException if validation failed- Parameters:
jsons
- , list of jsons to be validatedschema
- , json object containing the schemabuiltinConfig
- , built-in configuration like access token- Throws:
InstantiationException
IllegalAccessException
ReasoningException
InterruptedException
IOException
SemReasonerException
-
transactionBegin
start a transaction- Throws:
SemReasonerException
IOException
-
transactionRollback
rollback transaction -
transactionCommit
commit transaction -
getAvailableIdentifiers
public List<String> getAvailableIdentifiers(List<String> identifiers, Configuration config, Properties builtinConfig) throws SemReasonerException, IOException, ReasoningException, InterruptedException Which of the given json identifiers are there?- Parameters:
identifiers
- to be checkedconfig
- , configurationbuiltinConfig
- , configuration for built-ins like access tokens- Returns:
- Throws:
SemReasonerException
IOException
ReasoningException
InterruptedException
-
getAvailableIdentifiers
public List<String> getAvailableIdentifiers(List<String> identifiers) throws SemReasonerException, IOException, ReasoningException, InterruptedException Which of the given json identifiers are there?- Parameters:
identifiers
- to be checked- Returns:
- Throws:
SemReasonerException
IOException
ReasoningException
InterruptedException
-
getAvailableIdentifiers
public List<String> getAvailableIdentifiers(List<String> identifiers, String module, Configuration config, Properties builtinConfig) throws SemReasonerException, IOException, ReasoningException, InterruptedException Which of the given json identifiers are there?- Parameters:
identifiers
- to be checkedmodule
- , the moduleconfig
- , configurationbuiltinConfig
- , built-in configuration like access token- Returns:
- Throws:
SemReasonerException
IOException
ReasoningException
InterruptedException
-
isIdentifierAvailable
public boolean isIdentifierAvailable(String identifier, String module, Configuration config, Properties builtinConfig) throws SemReasonerException, IOException, ReasoningException, InterruptedException Is this identifier for a json object there?- Parameters:
identifier
- to be checkedmodule
-config
- , configurationbuiltinConfig
- , built-in configuration like access token- Returns:
- Throws:
SemReasonerException
IOException
ReasoningException
InterruptedException
-
isIdentifierAvailable
public boolean isIdentifierAvailable(String identifier) throws SemReasonerException, IOException, ReasoningException, InterruptedException Is this identifier for a json object there?- Parameters:
identifier
- to be checked- Returns:
- Throws:
SemReasonerException
IOException
ReasoningException
InterruptedException
-
isIdentifierAvailable
public boolean isIdentifierAvailable(String identifier, Configuration config, Properties builtinConfig) throws SemReasonerException, IOException, ReasoningException, InterruptedException Is this identifier for a json object there?- Parameters:
identifier
- to be checkedconfig
- , configurationbuiltinConfig
- , built-in configuration like access token- Returns:
- Throws:
SemReasonerException
IOException
ReasoningException
InterruptedException
-
exportJson
public void exportJson(String path, Set<String> excludedProperties) throws IOException, SemReasonerException, InterruptedException, ReasoningException Export jsons into file- Parameters:
path
- , path of fileexcludedProperties
- , properties excluded from export, null if not needed- Throws:
IOException
SemReasonerException
InterruptedException
ReasoningException
-
loadByStream
public void loadByStream(InputStream in, InputStream companionstream, String format) throws FileNotFoundException, IOException, EDBException, SemReasonerException, SymboltableException, InterruptedException load facts by stream.
format is either the file format like json,nq etc.
In case of raw it is the predicate like value|3
companion stream contains additional information, e.g. schema information in case of csv- Parameters:
in
- , input stream for datacompanionstream
- , input stream for companion data, e.g. header info and data formats for csv filesformat
-- Throws:
UnsupportedEncodingException
IOException
SemReasonerException
InterruptedException
FileNotFoundException
EDBException
SymboltableException
-
load
public void load(String path) throws FileNotFoundException, IOException, EDBException, SemReasonerException, InterruptedException, SymboltableException Import from a json files- Parameters:
path
- , the file path- Throws:
FileNotFoundException
IOException
EDBException
SemReasonerException
InterruptedException
SymboltableException
-
load
public void load(List<String> paths) throws FileNotFoundException, IOException, EDBException, SemReasonerException, InterruptedException, SymboltableException Import from a list of json files- Parameters:
paths
- , the file paths- Throws:
FileNotFoundException
IOException
EDBException
SemReasonerException
InterruptedException
SymboltableException
-
getDeductiveDatabase
Returns the deductive database which is used inside the JSONDeductiveDatabase.- Returns:
- deductive database
-