public interface ISadlServer
Modifier and Type | Method and Description |
---|---|
boolean |
addTriple(java.lang.String subjName,
java.lang.String predName,
java.lang.Object objValue)
This method is called to add a triple to the instance data.
|
com.ge.research.sadl.reasoner.ResultSet |
ask(java.lang.String subjName,
java.lang.String propName,
java.lang.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(java.lang.String serviceName,
javax.activation.DataSource dataSrc,
java.lang.String inputFormat,
java.lang.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(java.lang.String serviceName,
javax.activation.DataSource csvDataSrc,
boolean includesHeader,
java.lang.String csvTemplate,
java.lang.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 information
|
javax.activation.DataSource |
construct(java.lang.String query)
Executes a construct query, which will return a subgraph of the knowledge base and instance data.
|
java.lang.String |
createInstance(java.lang.String name,
java.lang.String className)
This method creates a new Individual of the class identified.
|
boolean |
deleteTriple(java.lang.String subjName,
java.lang.String predName,
java.lang.Object objValue)
This method is called to delete a triple from the instance data.
|
java.lang.String |
getClassName()
This method returns the name of the class implementing the ISadlService interface.
|
javax.activation.DataSource |
getDerivations()
Gets derivations of all inferred statements (if the reasoner supports derivations)
|
java.lang.String |
getInstanceDataNamespace()
This method retrieves the default instance data namespace.
|
java.lang.String |
getInstanceModelName()
This method retrieves the instance model associated with the default instance data namespace.
|
java.lang.String |
getKBaseIdentifier()
Gets the knowledge base identifier for the current session.
|
java.lang.String |
getKbaseRoot()
Method to get the kbase root folder path.
|
java.lang.String |
getModelName()
Gets the model name for the current session.
|
java.lang.String |
getReasonerVersion()
Gets the version of the reasoner.
|
java.util.Map<java.lang.String,java.lang.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.
|
java.lang.String |
getServiceVersion()
This method returns the Source Code Control System (SCC) Version of the class implementing the ISadlService interface
|
com.ge.research.sadl.reasoner.ReasonerTiming[] |
getTimingInformation()
Gets timing information for a given session, if the reasoner supports this capability.
|
boolean |
loadCsvData(java.lang.String serverCsvDataLocator,
boolean includesHeader,
java.lang.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 specified
|
boolean |
loadData(java.lang.String serverDataLocator)
This method is called to cause abox data to be loaded from the server environment.
|
java.lang.String |
parameterizeQuery(java.lang.String queryStr,
java.util.List<java.lang.Object> values)
Method to substitute parameter values for "?" terms in a query string.
|
java.lang.String |
prepareQuery(java.lang.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(java.lang.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.
|
java.lang.String |
selectServiceModel(java.lang.String serviceName)
This method is called to identify the model (tbox) to use by service name.
|
java.lang.String |
selectServiceModel(java.lang.String serviceName,
java.util.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.
|
java.lang.String |
selectServiceModel(java.lang.String knowledgeBaseIdentifier,
java.lang.String modelName)
This method is called to identify the knowledgeBaseIdentifier and model (tbox) to use in this knowledge service session.
|
java.lang.String |
selectServiceModel(java.lang.String knowledgeBaseIdentifier,
java.lang.String modelName,
java.util.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.
|
boolean |
sendCsvData(javax.activation.DataSource csvDataSrc,
boolean includesHeader,
java.lang.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 DataSource
|
boolean |
sendData(javax.activation.DataSource dataSrc,
java.lang.String inputFormat)
This method passes input data as a semantic model as a DataSource with a specified format
|
java.lang.String |
setInstanceDataNamespace(java.lang.String namespace)
This method sets the default instance data namespace.
|
void |
setKbaseRoot(java.lang.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(java.lang.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(java.util.Map<java.lang.String,java.lang.String[]> serviceNameMap)
This method sets the service name map.
|
void setServiceNameMap(java.util.Map<java.lang.String,java.lang.String[]> serviceNameMap)
serviceNameMap
- -- service name mapjava.util.Map<java.lang.String,java.lang.String[]> getServiceNameMap()
java.lang.String getClassName() throws SessionNotFoundException
SessionNotFoundException
com.ge.research.sadl.sadlserver.SessionNotFoundException
java.lang.String getServiceVersion() throws SessionNotFoundException
SessionNotFoundException
com.ge.research.sadl.reasoner.ResultSet query(java.lang.String query) throws com.ge.research.sadl.reasoner.QueryCancelledException, com.ge.research.sadl.reasoner.QueryParseException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException
query
- a query stringcom.ge.research.sadl.reasoner.QueryCancelledException
com.ge.research.sadl.reasoner.QueryParseException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
SessionNotFoundException
com.ge.research.sadl.reasoner.ResultSet[] atomicQuery(java.lang.String serviceName, javax.activation.DataSource dataSrc, java.lang.String inputFormat, java.lang.String[] query) throws java.io.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
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 executedjava.io.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.reasoner.ResultSet[] atomicQueryCsvData(java.lang.String serviceName, javax.activation.DataSource csvDataSrc, boolean includesHeader, java.lang.String csvTemplate, java.lang.String[] query) throws java.io.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
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 executedjava.io.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
com.ge.research.sadl.reasoner.ResultSet ask(java.lang.String subjName, java.lang.String propName, java.lang.Object objValue) throws com.ge.research.sadl.reasoner.TripleNotFoundException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, com.ge.research.sadl.reasoner.QueryCancelledException, SessionNotFoundException
subjName
- propName
- objValue
- com.ge.research.sadl.reasoner.QueryCancelledException
com.ge.research.sadl.reasoner.TripleNotFoundException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
SessionNotFoundException
java.lang.String prepareQuery(java.lang.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
query
- 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
java.lang.String parameterizeQuery(java.lang.String queryStr, java.util.List<java.lang.Object> values) throws com.ge.research.sadl.reasoner.InvalidNameException, com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException
queryStr
- -- SPARQL query or update stringvalues
- -- parameter values to be substitutedcom.ge.research.sadl.reasoner.ConfigurationException
com.ge.research.sadl.reasoner.InvalidNameException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
SessionNotFoundException
boolean loadData(java.lang.String serverDataLocator) throws java.io.IOException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException, com.ge.research.sadl.reasoner.ConfigurationException
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.java.io.IOException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
SessionNotFoundException
com.ge.research.sadl.reasoner.ConfigurationException
boolean loadCsvData(java.lang.String serverCsvDataLocator, boolean includesHeader, java.lang.String serverCsvTemplateLocator) throws com.ge.research.sadl.importer.TemplateException, com.ge.research.sadl.reasoner.ConfigurationException, java.io.IOException, com.ge.research.sadl.reasoner.InvalidNameException, SessionNotFoundException, com.ge.research.sadl.importer.TemplateException
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 filecom.ge.research.sadl.reasoner.ConfigurationException
java.io.IOException
com.ge.research.sadl.reasoner.InvalidNameException
SessionNotFoundException
com.ge.research.sadl.importer.TemplateException
java.lang.String selectServiceModel(java.lang.String serviceName) throws com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, NamedServiceNotFoundException, SessionNotFoundException
serviceName
- -- the name of the service, which is used to lookup the knowledgeBaseIdentifier and modelNamecom.ge.research.sadl.reasoner.ReasonerNotFoundException
com.ge.research.sadl.reasoner.ConfigurationException
NamedServiceNotFoundException
SessionNotFoundException
java.lang.String selectServiceModel(java.lang.String serviceName, java.util.List<com.ge.research.sadl.reasoner.ConfigurationItem> preferences) throws com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, NamedServiceNotFoundException
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)com.ge.research.sadl.reasoner.ConfigurationException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
NamedServiceNotFoundException
SessionNotFoundException
java.lang.String selectServiceModel(java.lang.String knowledgeBaseIdentifier, java.lang.String modelName) throws com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException
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 modelcom.ge.research.sadl.reasoner.ReasonerNotFoundException
com.ge.research.sadl.reasoner.ConfigurationException
SessionNotFoundException
java.lang.String selectServiceModel(java.lang.String knowledgeBaseIdentifier, java.lang.String modelName, java.util.List<com.ge.research.sadl.reasoner.ConfigurationItem> preferences) throws com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.ReasonerNotFoundException
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 modelpreferences
- -- preferences override the configuration from the development environment (configuration.rdf)com.ge.research.sadl.reasoner.ConfigurationException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
boolean sendData(javax.activation.DataSource dataSrc) throws java.io.IOException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException, com.ge.research.sadl.reasoner.ConfigurationException
dataSrc
- java.io.IOException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
SessionNotFoundException
com.ge.research.sadl.reasoner.ConfigurationException
boolean sendData(javax.activation.DataSource dataSrc, java.lang.String inputFormat) throws java.io.IOException, com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException, com.ge.research.sadl.reasoner.ConfigurationException
dataSrc
- inputFormat
- -- "N-TRIPLE", "N3", or "RDF/XML"java.io.IOException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
SessionNotFoundException
com.ge.research.sadl.reasoner.ConfigurationException
boolean sendCsvData(javax.activation.DataSource csvDataSrc, boolean includesHeader, java.lang.String csvTemplateIdentifier) throws com.ge.research.sadl.importer.TemplateException, com.ge.research.sadl.reasoner.ConfigurationException, java.io.IOException, com.ge.research.sadl.reasoner.InvalidNameException, SessionNotFoundException
csvDataSrc
- -- CSV data streamincludesHeader
- -- true if the CSV file contains header information in the first rowcsvTemplateIdentifier
- -- template mapping identifiercom.ge.research.sadl.reasoner.ConfigurationException
java.io.IOException
com.ge.research.sadl.reasoner.InvalidNameException
SessionNotFoundException
com.ge.research.sadl.importer.TemplateException
java.lang.String setInstanceDataNamespace(java.lang.String namespace) throws com.ge.research.sadl.reasoner.InvalidNameException, SessionNotFoundException
namespace
- -- the default instance data namespacecom.ge.research.sadl.reasoner.InvalidNameException
SessionNotFoundException
java.lang.String getInstanceDataNamespace()
java.lang.String getInstanceModelName()
boolean addTriple(java.lang.String subjName, java.lang.String predName, java.lang.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
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 DatatypePropertycom.ge.research.sadl.reasoner.ConfigurationException
com.ge.research.sadl.reasoner.TripleNotFoundException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
com.ge.research.sadl.reasoner.InvalidNameException
SessionNotFoundException
java.lang.String createInstance(java.lang.String name, java.lang.String className) throws com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.InvalidNameException, java.io.IOException, SessionNotFoundException
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 belongcom.ge.research.sadl.reasoner.ConfigurationException
com.ge.research.sadl.reasoner.InvalidNameException
java.io.IOException
SessionNotFoundException
boolean deleteTriple(java.lang.String subjName, java.lang.String predName, java.lang.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
subjName
- predName
- objValue
- 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
boolean reset() throws com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException
com.ge.research.sadl.reasoner.TripleNotFoundException
com.ge.research.sadl.reasoner.ReasonerNotFoundException
SessionNotFoundException
void setOwlFileOutputFormat(java.lang.String outputFormat) throws SessionNotFoundException
outputFormat
- -- "N-TRIPLE", "N3", or "RDF/XML"SessionNotFoundException
java.lang.String getKBaseIdentifier() throws com.ge.research.sadl.reasoner.ConfigurationException
com.ge.research.sadl.reasoner.ConfigurationException
java.lang.String getModelName() throws java.io.IOException
java.io.IOException
java.lang.String getReasonerVersion() throws com.ge.research.sadl.reasoner.ConfigurationException, SessionNotFoundException
com.ge.research.sadl.reasoner.ConfigurationException
SessionNotFoundException
javax.activation.DataSource getDerivations() throws com.ge.research.sadl.reasoner.ConfigurationException, com.ge.research.sadl.reasoner.InvalidDerivationException, SessionNotFoundException
com.ge.research.sadl.reasoner.ConfigurationException
com.ge.research.sadl.reasoner.InvalidDerivationException
SessionNotFoundException
javax.activation.DataSource construct(java.lang.String query) throws com.ge.research.sadl.reasoner.QueryCancelledException, com.ge.research.sadl.reasoner.QueryParseException, SessionNotFoundException
com.ge.research.sadl.reasoner.QueryCancelledException
com.ge.research.sadl.reasoner.QueryParseException
SessionNotFoundException
void collectTimingInformation(boolean bCollect) throws SessionNotFoundException
bCollect
- -- true to collect timing information; false otherwiseSessionNotFoundException
com.ge.research.sadl.reasoner.ReasonerTiming[] getTimingInformation() throws SessionNotFoundException
SessionNotFoundException
void setKbaseRoot(java.lang.String kbaseRoot) throws com.ge.research.sadl.reasoner.ConfigurationException
kbaseRoot
- com.ge.research.sadl.reasoner.ConfigurationException
java.lang.String getKbaseRoot()
void setQueryTimeout(long timeout) throws com.ge.research.sadl.reasoner.ReasonerNotFoundException, SessionNotFoundException
timeout
- (in milliseconds)com.ge.research.sadl.reasoner.ReasonerNotFoundException
SessionNotFoundException
boolean clearCache() throws com.ge.research.sadl.reasoner.InvalidNameException, SessionNotFoundException
com.ge.research.sadl.reasoner.InvalidNameException
SessionNotFoundException