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 boolean
addTriple(String subjName, String predName, Object objValue)
This method is called to add a triple to the instance data.com.ge.research.sadl.reasoner.ResultSet
ask(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.boolean
clearCache()
Method to clear the cache for the current kbase model.void
collectTimingInformation(boolean bCollect)
Turn on/off collection of timing informationjavax.activation.DataSource
construct(String query)
Executes a construct query, which will return a subgraph of the knowledge base and instance data.String
createInstance(String name, String className)
This method creates a new Individual of the class identified.boolean
deleteTriple(String subjName, String predName, Object objValue)
This method is called to delete a triple from the instance data.String
getClassName()
This method returns the name of the class implementing the ISadlService interface.String
getDefaultModelName()
This method retrieves the instance model associated with the default instance data namespace.javax.activation.DataSource
getDerivations()
Gets derivations of all inferred statements (if the reasoner supports derivations)javax.activation.DataSource
getInferredModel(boolean deductionsOnly, String format)
Gets the inferred model as a DataSourceString
getInstanceDataNamespace()
This method retrieves the default instance data namespace.String
getKBaseIdentifier()
Gets the knowledge base identifier for the current session.String
getKbaseRoot()
Method to get the kbase root folder path.String
getReasonerVersion()
Gets the version of the reasoner.String
getServiceModelName()
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.String
getServiceVersion()
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.boolean
loadCsvData(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 specifiedboolean
loadData(String serverDataLocator)
This method is called to cause abox data to be loaded from the server environment.String
parameterizeQuery(String queryStr, List<Object> values)
Method to substitute parameter values for "?" terms in a query string.String
prepareQuery(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.ResultSet
query(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.boolean
reset()
This method is called to delete all instance data added by calls to addTriple or forms of loadInstanceData.String
selectServiceModel(String serviceName)
This method is called to identify the model (tbox) to use by service name.String
selectServiceModel(String knowledgeBaseIdentifier, String modelName)
This method is called to identify the knowledgeBaseIdentifier and model (tbox) to use in this knowledge service session.String
selectServiceModel(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.String
selectServiceModel(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.boolean
sendCsvData(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.boolean
sendData(javax.activation.DataSource dataSrc)
This method passes input data as a semantic model as a DataSourceboolean
sendData(javax.activation.DataSource dataSrc, String inputFormat)
This method passes input data as a semantic model as a DataSource with a specified formatString
setInstanceDataNamespace(String namespace)
This method sets the default instance data namespace.void
setKbaseRoot(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.void
setOwlFileOutputFormat(String outputFormat)
Sets the Owl file output format to be used for output, e.g., when responding to a SPARQL construct query.void
setQueryTimeout(long timeout)
Method to set the timeout for queries.void
setServiceNameMap(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.QueryCancelledException
com.ge.research.sadl.reasoner.QueryParseException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
SessionNotFoundException
URISyntaxException
com.ge.research.sadl.reasoner.InvalidNameException
com.ge.research.sadl.reasoner.ConfigurationException
IOException
-
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:
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
-
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:
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
-
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.QueryCancelledException
com.ge.research.sadl.reasoner.TripleNotFoundException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
SessionNotFoundException
-
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.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
-
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.ConfigurationException
com.ge.research.sadl.reasoner.InvalidNameException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
SessionNotFoundException
com.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:
IOException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
SessionNotFoundException
com.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.ConfigurationException
IOException
com.ge.research.sadl.reasoner.InvalidNameException
SessionNotFoundException
com.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.ReasonerNotFoundException
com.ge.research.sadl.reasoner.ConfigurationException
NamedServiceNotFoundException
SessionNotFoundException
-
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.ConfigurationException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
NamedServiceNotFoundException
-
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.ReasonerNotFoundException
com.ge.research.sadl.reasoner.ConfigurationException
SessionNotFoundException
-
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.ConfigurationException
com.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.ConfigurationException
This method passes input data as a semantic model as a DataSource- Parameters:
dataSrc
-- Returns:
- true if successful else false
- Throws:
IOException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
SessionNotFoundException
com.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.ConfigurationException
This 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:
IOException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
SessionNotFoundException
com.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, SessionNotFoundException
This 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.ConfigurationException
IOException
com.ge.research.sadl.reasoner.InvalidNameException
SessionNotFoundException
com.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.InvalidNameException
SessionNotFoundException
-
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.ConfigurationException
com.ge.research.sadl.reasoner.TripleNotFoundException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
com.ge.research.sadl.reasoner.InvalidNameException
SessionNotFoundException
-
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.ConfigurationException
com.ge.research.sadl.reasoner.InvalidNameException
IOException
SessionNotFoundException
com.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.ConfigurationException
com.ge.research.sadl.reasoner.TripleNotFoundException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
com.ge.research.sadl.reasoner.InvalidNameException
SessionNotFoundException
-
reset
boolean reset() throws com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException
This 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.ReasonerNotFoundException
SessionNotFoundException
-
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.ConfigurationException
SessionNotFoundException
-
getDerivations
javax.activation.DataSource getDerivations() throws com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.InvalidDerivationException, SessionNotFoundException
Gets derivations of all inferred statements (if the reasoner supports derivations)- Returns:
- Derivations datasource
- Throws:
com.ge.research.sadl.reasoner.ConfigurationException
com.ge.research.sadl.reasoner.InvalidDerivationException
SessionNotFoundException
-
getInferredModel
javax.activation.DataSource getInferredModel(boolean deductionsOnly, String format) throws com.ge.research.sadl.reasoner.ConfigurationException
Gets 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.QueryCancelledException
com.ge.research.sadl.reasoner.QueryParseException
SessionNotFoundException
-
collectTimingInformation
void collectTimingInformation(boolean bCollect) throws SessionNotFoundException
Turn 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 SessionNotFoundException
Gets 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, SessionNotFoundException
Method 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.ReasonerNotFoundException
SessionNotFoundException
-
clearCache
boolean clearCache() throws com.ge.research.sadl.reasoner.InvalidNameException, SessionNotFoundException
Method 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.InvalidNameException
SessionNotFoundException
-
-