Package com.ge.research.sadl.server
Interface ISadlServer
-
- All Known Subinterfaces:
ISadlServerMD,ISadlServerPE
- All Known Implementing Classes:
SadlServerImpl,SadlServerMDImpl,SadlServerPEImpl
public interface ISadlServer- Author:
- 200005201
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaddTriple(String subjName, String predName, Object objValue)This method is called to add a triple to the instance data.com.ge.research.sadl.reasoner.ResultSetask(String subjName, String propName, Object objValue)This method retrieves the results of an RDF triple matching request as a list of matching statements.com.ge.research.sadl.reasoner.ResultSet[]atomicQuery(String serviceName, javax.activation.DataSource dataSrc, String inputFormat, String[] query)Method to provide instance data and then execute a set of queries in an atomic (stateless) manner, returning a ResultSet for each query.com.ge.research.sadl.reasoner.ResultSet[]atomicQueryCsvData(String serviceName, javax.activation.DataSource csvDataSrc, boolean includesHeader, String csvTemplate, String[] query)Method to provide CSV instance data and then execute a set of queries in an atomic (stateless) manner, returning a ResultSet for each query.booleanclearCache()Method to clear the cache for the current kbase model.voidcollectTimingInformation(boolean bCollect)Turn on/off collection of timing informationjavax.activation.DataSourceconstruct(String query)Executes a construct query, which will return a subgraph of the knowledge base and instance data.StringcreateInstance(String name, String className)This method creates a new Individual of the class identified.booleandeleteTriple(String subjName, String predName, Object objValue)This method is called to delete a triple from the instance data.StringgetClassName()This method returns the name of the class implementing the ISadlService interface.StringgetDefaultModelName()This method retrieves the instance model associated with the default instance data namespace.javax.activation.DataSourcegetDerivations()Gets derivations of all inferred statements (if the reasoner supports derivations)javax.activation.DataSourcegetInferredModel(boolean deductionsOnly, String format)Gets the inferred model as a DataSourceStringgetInstanceDataNamespace()This method retrieves the default instance data namespace.StringgetKBaseIdentifier()Gets the knowledge base identifier for the current session.StringgetKbaseRoot()Method to get the kbase root folder path.StringgetReasonerVersion()Gets the version of the reasoner.StringgetServiceModelName()Gets the model name for the current session.Map<String,String[]>getServiceNameMap()This method returns the service name map whose keys are the names of the services and whose values are String arrays of size 2 with the 1st element being the actual URL of the knowledge base folder (the folder containing the OWL models, rule files, etc.; the knowledgeBaseIdentifier) and the 2nd element being the public URI of the model which is the entry point into the kbase for the named service.StringgetServiceVersion()This method returns the Source Code Control System (SCC) Version of the class implementing the ISadlService interfacecom.ge.research.sadl.reasoner.ReasonerTiming[]getTimingInformation()Gets timing information for a given session, if the reasoner supports this capability.booleanloadCsvData(String serverCsvDataLocator, boolean includesHeader, String serverCsvTemplateLocator)This method is called to cause abox data to be loaded by mapping from a CSV data file to semantic data using the mapping template specifiedbooleanloadData(String serverDataLocator)This method is called to cause abox data to be loaded from the server environment.StringparameterizeQuery(String queryStr, List<Object> values)Method to substitute parameter values for "?" terms in a query string.StringprepareQuery(String query)Method to expand prefixes, find namespaces, and do whatever other processing may be necessary to prepare a query string for execution by the target query engine.com.ge.research.sadl.reasoner.ResultSetquery(String query)This method retrieves the results of a kbase query as a List array, 1st element being a List of the column headings and second being a List of rows, each of which is a List of values.booleanreset()This method is called to delete all instance data added by calls to addTriple or forms of loadInstanceData.StringselectServiceModel(String serviceName)This method is called to identify the model (tbox) to use by service name.StringselectServiceModel(String knowledgeBaseIdentifier, String modelName)This method is called to identify the knowledgeBaseIdentifier and model (tbox) to use in this knowledge service session.StringselectServiceModel(String knowledgeBaseIdentifier, String modelName, List<com.ge.research.sadl.reasoner.ConfigurationItem> preferences)This method is called to identify the knowledgeBaseIdentifier and model (tbox) to use in this knowledge service session.StringselectServiceModel(String serviceName, List<com.ge.research.sadl.reasoner.ConfigurationItem> preferences)This method is called to identify the model (tbox) to use in this knowledge service session and to simultaneously override certain default configuration settings.booleansendCsvData(javax.activation.DataSource csvDataSrc, boolean includesHeader, String csvTemplateIdentifier)This method is called to send abox data in CSV format to be converted to semantic data using the identified mapping template.booleansendData(javax.activation.DataSource dataSrc)This method passes input data as a semantic model as a DataSourcebooleansendData(javax.activation.DataSource dataSrc, String inputFormat)This method passes input data as a semantic model as a DataSource with a specified formatStringsetInstanceDataNamespace(String namespace)This method sets the default instance data namespace.voidsetKbaseRoot(String kbaseRoot)Method to set the kbase root folder--a folder on the server file system in which and under which server configuration files and folders of model files will be found.voidsetOwlFileOutputFormat(String outputFormat)Sets the Owl file output format to be used for output, e.g., when responding to a SPARQL construct query.voidsetQueryTimeout(long timeout)Method to set the timeout for queries.voidsetServiceNameMap(Map<String,String[]> serviceNameMap)This method sets the service name map.
-
-
-
Method Detail
-
setServiceNameMap
void setServiceNameMap(Map<String,String[]> serviceNameMap)
This method sets the service name map. It is not normally necessary to call this from the client as the service name map is normally set by scanning the kbaseroot and its subfolders when the call is made to setKbaseRoot. However, in theory this could be set from the client without setting a kbaseroot.- Parameters:
serviceNameMap- -- service name map
-
getServiceNameMap
Map<String,String[]> getServiceNameMap()
This method returns the service name map whose keys are the names of the services and whose values are String arrays of size 2 with the 1st element being the actual URL of the knowledge base folder (the folder containing the OWL models, rule files, etc.; the knowledgeBaseIdentifier) and the 2nd element being the public URI of the model which is the entry point into the kbase for the named service.- Returns:
- -- service name map
-
getClassName
String getClassName() throws SessionNotFoundException
This method returns the name of the class implementing the ISadlService interface.- Returns:
- -- class name
- Throws:
SessionNotFoundException
-
getServiceVersion
String getServiceVersion() throws SessionNotFoundException
This method returns the Source Code Control System (SCC) Version of the class implementing the ISadlService interface- Returns:
- the CVS version number of the ISadlServer implementation
- Throws:
SessionNotFoundException
-
query
com.ge.research.sadl.reasoner.ResultSet query(String query) throws com.ge.research.sadl.reasoner.QueryCancelledException, com.ge.research.sadl.reasoner.QueryParseException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException, IOException, com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.InvalidNameException, URISyntaxException
This method retrieves the results of a kbase query as a List array, 1st element being a List of the column headings and second being a List of rows, each of which is a List of values. The query string will depend upon the knowledge representation and reasoner; it might be SPARQL, Prolog, etc.- Parameters:
query- a query string- Returns:
- List[] with first element being the column titles (names of query variables) and second element a list of lists of values
- Throws:
com.ge.research.sadl.reasoner.QueryCancelledExceptioncom.ge.research.sadl.reasoner.QueryParseExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionSessionNotFoundExceptionURISyntaxExceptioncom.ge.research.sadl.reasoner.InvalidNameExceptioncom.ge.research.sadl.reasoner.ConfigurationExceptionIOException
-
atomicQuery
com.ge.research.sadl.reasoner.ResultSet[] atomicQuery(String serviceName, javax.activation.DataSource dataSrc, String inputFormat, String[] query) throws IOException, com.ge.research.sadl.reasoner.ConfigurationException, NamedServiceNotFoundException, com.ge.research.sadl.reasoner.QueryCancelledException, com.ge.research.sadl.reasoner.QueryParseException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException, com.ge.research.sadl.reasoner.InvalidNameException, URISyntaxException, com.ge.research.sadl.reasoner.AmbiguousNameException
Method to provide instance data and then execute a set of queries in an atomic (stateless) manner, returning a ResultSet for each query. The query strings will depend upon the knowledge representation and reasoner; it might be SPARQL, Prolog, etc.- Parameters:
serviceName- -- the name of the service, which is used to lookup the knowledgeBaseIdentifier and modelNamedataSrc- -- the DataSource to supply instance data to the modelinputFormat- -- "N-TRIPLE", "N3", or "RDF/XML"query- -- a array of queries to be executed- Returns:
- -- an array of ResultSet instances containing the results of each query
- Throws:
IOExceptioncom.ge.research.sadl.reasoner.ConfigurationExceptionNamedServiceNotFoundExceptioncom.ge.research.sadl.reasoner.QueryCancelledExceptioncom.ge.research.sadl.reasoner.QueryParseExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionSessionNotFoundExceptioncom.ge.research.sadl.reasoner.InvalidNameExceptionURISyntaxExceptioncom.ge.research.sadl.reasoner.AmbiguousNameException
-
atomicQueryCsvData
com.ge.research.sadl.reasoner.ResultSet[] atomicQueryCsvData(String serviceName, javax.activation.DataSource csvDataSrc, boolean includesHeader, String csvTemplate, String[] query) throws IOException, com.ge.research.sadl.reasoner.ConfigurationException, NamedServiceNotFoundException, com.ge.research.sadl.reasoner.QueryCancelledException, com.ge.research.sadl.reasoner.QueryParseException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException, com.ge.research.sadl.reasoner.InvalidNameException, com.ge.research.sadl.importer.TemplateException, URISyntaxException, com.ge.research.sadl.reasoner.AmbiguousNameException
Method to provide CSV instance data and then execute a set of queries in an atomic (stateless) manner, returning a ResultSet for each query. The query strings will depend upon the knowledge representation and reasoner; it might be SPARQL, Prolog, etc.- Parameters:
serviceName- -- the name of the service, which is used to lookup the knowledgeBaseIdentifier and modelNamecsvDataSrc- -- the CSV DataSource to supply instance data to the modelincludesHeader- -- true if the CSV file contains header information in the first rowcsvTemplate- -- template mapping data streamquery- -- a array of queries to be executed- Returns:
- -- an array of ResultSet instances containing the results of each query
- Throws:
IOExceptioncom.ge.research.sadl.reasoner.ConfigurationExceptionNamedServiceNotFoundExceptioncom.ge.research.sadl.reasoner.QueryCancelledExceptioncom.ge.research.sadl.reasoner.QueryParseExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionSessionNotFoundExceptioncom.ge.research.sadl.reasoner.InvalidNameExceptioncom.ge.research.sadl.importer.TemplateExceptionURISyntaxExceptioncom.ge.research.sadl.reasoner.AmbiguousNameException
-
ask
com.ge.research.sadl.reasoner.ResultSet ask(String subjName, String propName, Object objValue) throws com.ge.research.sadl.reasoner.TripleNotFoundException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, com.ge.research.sadl.reasoner.QueryCancelledException, SessionNotFoundException
This method retrieves the results of an RDF triple matching request as a list of matching statements. Zero or more of the subjName, propName, and objValue may be null.- Parameters:
subjName-propName-objValue-- Returns:
- List of matching statements, each element is Object[3]: subject, predicate, object
- Throws:
com.ge.research.sadl.reasoner.QueryCancelledExceptioncom.ge.research.sadl.reasoner.TripleNotFoundExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionSessionNotFoundException
-
prepareQuery
String prepareQuery(String query) throws com.ge.research.sadl.reasoner.InvalidNameException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.InvalidNameException, SessionNotFoundException, com.ge.research.sadl.reasoner.AmbiguousNameException
Method to expand prefixes, find namespaces, and do whatever other processing may be necessary to prepare a query string for execution by the target query engine. Note: this is provided as a callable functionality so that queries which are known to be completely expanded need not have the overhead of checking.- Parameters:
query-- Returns:
- the expanded query prepared for execution
- Throws:
com.ge.research.sadl.reasoner.InvalidNameExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptioncom.ge.research.sadl.reasoner.ConfigurationExceptioncom.ge.research.sadl.reasoner.InvalidNameExceptionSessionNotFoundExceptioncom.ge.research.sadl.reasoner.AmbiguousNameException
-
parameterizeQuery
String parameterizeQuery(String queryStr, List<Object> values) throws com.ge.research.sadl.reasoner.InvalidNameException, com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException, com.ge.research.sadl.reasoner.AmbiguousNameException
Method to substitute parameter values for "?" terms in a query string.- Parameters:
queryStr- -- SPARQL query or update stringvalues- -- parameter values to be substituted- Returns:
- parameterized query
- Throws:
com.ge.research.sadl.reasoner.ConfigurationExceptioncom.ge.research.sadl.reasoner.InvalidNameExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionSessionNotFoundExceptioncom.ge.research.sadl.reasoner.AmbiguousNameException
-
loadData
boolean loadData(String serverDataLocator) throws IOException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException, com.ge.research.sadl.reasoner.ConfigurationException
This method is called to cause abox data to be loaded from the server environment.- Parameters:
serverDataLocator- -- the location of the data to be loaded in the server environment. This will be reasoner-specifc. For some reasoners it may be a relative file path.- Returns:
- true if successful else false
- Throws:
IOExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionSessionNotFoundExceptioncom.ge.research.sadl.reasoner.ConfigurationException
-
loadCsvData
boolean loadCsvData(String serverCsvDataLocator, boolean includesHeader, String serverCsvTemplateLocator) throws com.ge.research.sadl.importer.TemplateException, com.ge.research.sadl.reasoner.ConfigurationException, IOException, com.ge.research.sadl.reasoner.InvalidNameException, SessionNotFoundException, com.ge.research.sadl.importer.TemplateException
This method is called to cause abox data to be loaded by mapping from a CSV data file to semantic data using the mapping template specified- Parameters:
serverCsvDataLocator- -- server-side location of CSV dataincludesHeader- -- true if the CSV file contains header information in the first rowserverCsvTemplateLocator- -- server-side location of template mapping file- Returns:
- -- true if successful else false
- Throws:
com.ge.research.sadl.reasoner.ConfigurationExceptionIOExceptioncom.ge.research.sadl.reasoner.InvalidNameExceptionSessionNotFoundExceptioncom.ge.research.sadl.importer.TemplateException
-
selectServiceModel
String selectServiceModel(String serviceName) throws com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, NamedServiceNotFoundException, SessionNotFoundException
This method is called to identify the model (tbox) to use by service name.- Parameters:
serviceName- -- the name of the service, which is used to lookup the knowledgeBaseIdentifier and modelName- Returns:
- -- the unique session key for this knowledge service session
- Throws:
com.ge.research.sadl.reasoner.ReasonerNotFoundExceptioncom.ge.research.sadl.reasoner.ConfigurationExceptionNamedServiceNotFoundExceptionSessionNotFoundException
-
selectServiceModel
String selectServiceModel(String serviceName, List<com.ge.research.sadl.reasoner.ConfigurationItem> preferences) throws com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, NamedServiceNotFoundException
This method is called to identify the model (tbox) to use in this knowledge service session and to simultaneously override certain default configuration settings.- Parameters:
serviceName- -- the name of the service, which is used to lookup the knowledgeBaseIdentifier and modelNamepreferences- -- preferences override the configuration from the development environment (configuration.rdf)- Returns:
- -- the unique session key for this knowledge service session
- Throws:
com.ge.research.sadl.reasoner.ConfigurationExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionNamedServiceNotFoundException
-
selectServiceModel
String selectServiceModel(String knowledgeBaseIdentifier, String modelName) throws com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException
This method is called to identify the knowledgeBaseIdentifier and model (tbox) to use in this knowledge service session.- Parameters:
knowledgeBaseIdentifier- -- the identity of the knowledge base, e.g., the folder containing the OWL/Rule files OR the name of the service of a service that does not have a model name specified, in which case the model name is specified by the next parametermodelName- -- the entry point (specific model) within the knowledge base, e.g., the URI corresponding with the base namespace of the OWL model identified as the default model- Returns:
- -- the unique session key for this knowledge service session
- Throws:
com.ge.research.sadl.reasoner.ReasonerNotFoundExceptioncom.ge.research.sadl.reasoner.ConfigurationExceptionSessionNotFoundException
-
selectServiceModel
String selectServiceModel(String knowledgeBaseIdentifier, String modelName, List<com.ge.research.sadl.reasoner.ConfigurationItem> preferences) throws com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.ReasonerNotFoundException
This method is called to identify the knowledgeBaseIdentifier and model (tbox) to use in this knowledge service session.- Parameters:
knowledgeBaseIdentifier- -- the identity of the knowledge base, e.g., the folder containing the OWL/Rule files OR the name of the service of a service that does not have a model name specified, in which case the model name is specified by the next parametermodelName- -- the entry point (specific model) within the knowledge base, e.g., the URI corresponding with the base namespace of the OWL model identified as the default modelpreferences- -- preferences override the configuration from the development environment (configuration.rdf)- Returns:
- -- the unique session key for this knowledge service session
- Throws:
com.ge.research.sadl.reasoner.ConfigurationExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundException
-
sendData
boolean sendData(javax.activation.DataSource dataSrc) throws IOException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException, com.ge.research.sadl.reasoner.ConfigurationExceptionThis method passes input data as a semantic model as a DataSource- Parameters:
dataSrc-- Returns:
- true if successful else false
- Throws:
IOExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionSessionNotFoundExceptioncom.ge.research.sadl.reasoner.ConfigurationException
-
sendData
boolean sendData(javax.activation.DataSource dataSrc, String inputFormat) throws IOException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException, com.ge.research.sadl.reasoner.ConfigurationExceptionThis method passes input data as a semantic model as a DataSource with a specified format- Parameters:
dataSrc-inputFormat- -- "N-TRIPLE", "N3", or "RDF/XML"- Returns:
- true if successful else false
- Throws:
IOExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionSessionNotFoundExceptioncom.ge.research.sadl.reasoner.ConfigurationException
-
sendCsvData
boolean sendCsvData(javax.activation.DataSource csvDataSrc, boolean includesHeader, String csvTemplateIdentifier) throws com.ge.research.sadl.importer.TemplateException, com.ge.research.sadl.reasoner.ConfigurationException, IOException, com.ge.research.sadl.reasoner.InvalidNameException, SessionNotFoundExceptionThis method is called to send abox data in CSV format to be converted to semantic data using the identified mapping template. The template identifier can be a serialized string or it can be a URL to a template.- Parameters:
csvDataSrc- -- CSV data streamincludesHeader- -- true if the CSV file contains header information in the first rowcsvTemplateIdentifier- -- template mapping identifier- Returns:
- -- true if successful else false
- Throws:
com.ge.research.sadl.reasoner.ConfigurationExceptionIOExceptioncom.ge.research.sadl.reasoner.InvalidNameExceptionSessionNotFoundExceptioncom.ge.research.sadl.importer.TemplateException
-
setInstanceDataNamespace
String setInstanceDataNamespace(String namespace) throws com.ge.research.sadl.reasoner.InvalidNameException, SessionNotFoundException
This method sets the default instance data namespace. Instance data nodes without a specified namespace will use this namespace.- Parameters:
namespace- -- the default instance data namespace- Returns:
- -- the old instance data namespace or null if there was none
- Throws:
com.ge.research.sadl.reasoner.InvalidNameExceptionSessionNotFoundException
-
getInstanceDataNamespace
String getInstanceDataNamespace()
This method retrieves the default instance data namespace.- Returns:
-
getDefaultModelName
String getDefaultModelName()
This method retrieves the instance model associated with the default instance data namespace. (The model namespace is the model name with a "#" added at the end.)- Returns:
-
addTriple
boolean addTriple(String subjName, String predName, Object objValue) throws com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.TripleNotFoundException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, com.ge.research.sadl.reasoner.InvalidNameException, SessionNotFoundException, com.ge.research.sadl.reasoner.ConfigurationException
This method is called to add a triple to the instance data. The object value will be interpreted based on type of the Object and on the range of the property if it is an OntProperty.- Parameters:
subjName- the URI of the subjectpredName- the URI of the propertyobjValue- the URI of the object value for an ObjectProperty or a value that will be interpreted for a DatatypeProperty- Returns:
- true if successful
- Throws:
com.ge.research.sadl.reasoner.ConfigurationExceptioncom.ge.research.sadl.reasoner.TripleNotFoundExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptioncom.ge.research.sadl.reasoner.InvalidNameExceptionSessionNotFoundException
-
createInstance
String createInstance(String name, String className) throws com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.InvalidNameException, IOException, SessionNotFoundException, com.ge.research.sadl.reasoner.AmbiguousNameException
This method creates a new Individual of the class identified.- Parameters:
name- -- the name of the new instance to be created. If only a local fragment is given (no namespace), the instance will be created in the default namespace.className- -- the name of the OntClass to which the new Individual will belong- Returns:
- -- the identity of the new Individual; the fully qualified name (URI) for a named resource
- Throws:
com.ge.research.sadl.reasoner.ConfigurationExceptioncom.ge.research.sadl.reasoner.InvalidNameExceptionIOExceptionSessionNotFoundExceptioncom.ge.research.sadl.reasoner.AmbiguousNameException
-
deleteTriple
boolean deleteTriple(String subjName, String predName, Object objValue) throws com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.TripleNotFoundException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, com.ge.research.sadl.reasoner.InvalidNameException, SessionNotFoundException, com.ge.research.sadl.reasoner.ConfigurationException
This method is called to delete a triple from the instance data. The subject, predicate, and/or object can be null to delete everything matching the pattern.- Parameters:
subjName-predName-objValue-- Returns:
- true if successful else false
- Throws:
com.ge.research.sadl.reasoner.ConfigurationExceptioncom.ge.research.sadl.reasoner.TripleNotFoundExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptioncom.ge.research.sadl.reasoner.InvalidNameExceptionSessionNotFoundException
-
reset
boolean reset() throws com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundExceptionThis method is called to delete all instance data added by calls to addTriple or forms of loadInstanceData. The infModel is reset to reflect those removals.- Returns:
- true if successful else false
- Throws:
com.ge.research.sadl.reasoner.ReasonerNotFoundExceptionSessionNotFoundException
-
setOwlFileOutputFormat
void setOwlFileOutputFormat(String outputFormat) throws SessionNotFoundException
Sets the Owl file output format to be used for output, e.g., when responding to a SPARQL construct query.- Parameters:
outputFormat- -- "N-TRIPLE", "N3", or "RDF/XML"- Throws:
SessionNotFoundException
-
getKBaseIdentifier
String getKBaseIdentifier() throws com.ge.research.sadl.reasoner.ConfigurationException
Gets the knowledge base identifier for the current session.- Returns:
- knowledge base identifier
- Throws:
com.ge.research.sadl.reasoner.ConfigurationException
-
getServiceModelName
String getServiceModelName()
Gets the model name for the current session.- Returns:
- model name
-
getReasonerVersion
String getReasonerVersion() throws com.ge.research.sadl.reasoner.ConfigurationException, SessionNotFoundException
Gets the version of the reasoner.- Returns:
- reasoner version
- Throws:
com.ge.research.sadl.reasoner.ConfigurationExceptionSessionNotFoundException
-
getDerivations
javax.activation.DataSource getDerivations() throws com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.InvalidDerivationException, SessionNotFoundExceptionGets derivations of all inferred statements (if the reasoner supports derivations)- Returns:
- Derivations datasource
- Throws:
com.ge.research.sadl.reasoner.ConfigurationExceptioncom.ge.research.sadl.reasoner.InvalidDerivationExceptionSessionNotFoundException
-
getInferredModel
javax.activation.DataSource getInferredModel(boolean deductionsOnly, String format) throws com.ge.research.sadl.reasoner.ConfigurationExceptionGets the inferred model as a DataSource- Parameters:
deductionsOnly- -- if true return only the deductions else return the entire inferred modelformat- -- format for serialization (RDF/XML, RDF/XML-ABBREV, N3, N-TRIPLES, TURTLE)- Returns:
- inferred model DataSource
- Throws:
com.ge.research.sadl.reasoner.ConfigurationException
-
construct
javax.activation.DataSource construct(String query) throws com.ge.research.sadl.reasoner.QueryCancelledException, com.ge.research.sadl.reasoner.QueryParseException, SessionNotFoundException
Executes a construct query, which will return a subgraph of the knowledge base and instance data.- Returns:
- Construct datasource
- Throws:
com.ge.research.sadl.reasoner.QueryCancelledExceptioncom.ge.research.sadl.reasoner.QueryParseExceptionSessionNotFoundException
-
collectTimingInformation
void collectTimingInformation(boolean bCollect) throws SessionNotFoundExceptionTurn on/off collection of timing information- Parameters:
bCollect- -- true to collect timing information; false otherwise- Throws:
SessionNotFoundException
-
getTimingInformation
com.ge.research.sadl.reasoner.ReasonerTiming[] getTimingInformation() throws SessionNotFoundExceptionGets timing information for a given session, if the reasoner supports this capability. Normally a call to collectTimingInformation(true) must be made before the inference session begins for timing to be collected.- Returns:
- timing information
- Throws:
SessionNotFoundException
-
setKbaseRoot
void setKbaseRoot(String kbaseRoot) throws com.ge.research.sadl.reasoner.ConfigurationException
Method to set the kbase root folder--a folder on the server file system in which and under which server configuration files and folders of model files will be found.- Parameters:
kbaseRoot-- Throws:
com.ge.research.sadl.reasoner.ConfigurationException
-
getKbaseRoot
String getKbaseRoot()
Method to get the kbase root folder path.- Returns:
- -- the kbase root else null if not set or request not supported (Web service)
-
setQueryTimeout
void setQueryTimeout(long timeout) throws com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundExceptionMethod to set the timeout for queries. Default is no timeout, which is equivalent to calling this method with a value of -1.- Parameters:
timeout- (in milliseconds)- Throws:
com.ge.research.sadl.reasoner.ReasonerNotFoundExceptionSessionNotFoundException
-
clearCache
boolean clearCache() throws com.ge.research.sadl.reasoner.InvalidNameException, SessionNotFoundExceptionMethod to clear the cache for the current kbase model. Inferred models can be cached, depending on the configuration settings, to provide faster performance when the inputs have not changed.- Returns:
- true if successful else false
- Throws:
com.ge.research.sadl.reasoner.InvalidNameExceptionSessionNotFoundException
-
-