public class SadlServerImpl extends java.lang.Object implements ISadlServer
| Constructor and Description |
|---|
SadlServerImpl() |
SadlServerImpl(java.lang.String _kbaseRoot) |
| 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[] sparql)
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[] sparql)
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 sparql)
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 csvTemplate)
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 query,
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 sparql)
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 csvTemplate)
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.
|
public SadlServerImpl()
public SadlServerImpl(java.lang.String _kbaseRoot)
throws com.ge.research.sadl.reasoner.ConfigurationException
com.ge.research.sadl.reasoner.ConfigurationExceptionpublic java.lang.String getClassName()
throws SessionNotFoundException
ISadlServergetClassName in interface ISadlServerSessionNotFoundExceptionpublic java.lang.String getServiceVersion()
throws SessionNotFoundException
ISadlServergetServiceVersion in interface ISadlServerSessionNotFoundExceptionpublic com.ge.research.sadl.reasoner.ResultSet query(java.lang.String sparql)
throws com.ge.research.sadl.reasoner.QueryParseException,
com.ge.research.sadl.reasoner.ReasonerNotFoundException,
com.ge.research.sadl.reasoner.QueryCancelledException
ISadlServerquery in interface ISadlServersparql - a query stringcom.ge.research.sadl.reasoner.QueryParseExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptioncom.ge.research.sadl.reasoner.QueryCancelledExceptionpublic com.ge.research.sadl.reasoner.ReasonerTiming[] getTimingInformation()
ISadlServergetTimingInformation in interface ISadlServerpublic javax.activation.DataSource construct(java.lang.String sparql)
throws com.ge.research.sadl.reasoner.QueryParseException,
com.ge.research.sadl.reasoner.QueryCancelledException
ISadlServerconstruct in interface ISadlServercom.ge.research.sadl.reasoner.QueryParseExceptioncom.ge.research.sadl.reasoner.QueryCancelledExceptionpublic 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
ISadlServerask in interface ISadlServercom.ge.research.sadl.reasoner.TripleNotFoundExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionpublic boolean loadData(java.lang.String serverDataLocator)
throws java.io.IOException,
com.ge.research.sadl.reasoner.ReasonerNotFoundException,
com.ge.research.sadl.reasoner.ConfigurationException
ISadlServerloadData in interface ISadlServerserverDataLocator - -- 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.IOExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptioncom.ge.research.sadl.reasoner.ConfigurationExceptionpublic boolean loadCsvData(java.lang.String serverCsvDataLocator,
boolean includesHeader,
java.lang.String csvTemplate)
throws com.ge.research.sadl.reasoner.ConfigurationException,
java.io.IOException,
com.ge.research.sadl.reasoner.InvalidNameException,
com.ge.research.sadl.importer.TemplateException
ISadlServerloadCsvData in interface ISadlServerserverCsvDataLocator - -- server-side location of CSV dataincludesHeader - -- true if the CSV file contains header information in the first rowcsvTemplate - -- server-side location of template mapping filecom.ge.research.sadl.reasoner.ConfigurationExceptionjava.io.IOExceptioncom.ge.research.sadl.reasoner.InvalidNameExceptioncom.ge.research.sadl.importer.TemplateExceptionpublic java.lang.String selectServiceModel(java.lang.String serviceName)
throws com.ge.research.sadl.reasoner.ConfigurationException,
com.ge.research.sadl.reasoner.ReasonerNotFoundException
ISadlServerselectServiceModel in interface ISadlServerserviceName - -- the name of the service, which is used to lookup the knowledgeBaseIdentifier and modelNamecom.ge.research.sadl.reasoner.ConfigurationExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionpublic 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
ISadlServerselectServiceModel in interface ISadlServerserviceName - -- 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.ConfigurationExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionNamedServiceNotFoundExceptionpublic 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
ISadlServerselectServiceModel in interface ISadlServerknowledgeBaseIdentifier - -- 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.ConfigurationExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionpublic 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
ISadlServerselectServiceModel in interface ISadlServerknowledgeBaseIdentifier - -- 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.ConfigurationExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionpublic boolean sendData(javax.activation.DataSource dataSrc)
throws java.io.IOException,
com.ge.research.sadl.reasoner.ReasonerNotFoundException,
com.ge.research.sadl.reasoner.ConfigurationException
ISadlServersendData in interface ISadlServerjava.io.IOExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptioncom.ge.research.sadl.reasoner.ConfigurationExceptionpublic boolean sendData(javax.activation.DataSource dataSrc,
java.lang.String inputFormat)
throws java.io.IOException,
com.ge.research.sadl.reasoner.ReasonerNotFoundException,
com.ge.research.sadl.reasoner.ConfigurationException
ISadlServersendData in interface ISadlServerinputFormat - -- "N-TRIPLE", "N3", or "RDF/XML"java.io.IOExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptioncom.ge.research.sadl.reasoner.ConfigurationExceptionpublic boolean sendCsvData(javax.activation.DataSource csvDataSrc,
boolean includesHeader,
java.lang.String csvTemplate)
throws com.ge.research.sadl.reasoner.ConfigurationException,
java.io.IOException,
com.ge.research.sadl.reasoner.InvalidNameException,
com.ge.research.sadl.importer.TemplateException
ISadlServersendCsvData in interface ISadlServercsvDataSrc - -- CSV data streamincludesHeader - -- true if the CSV file contains header information in the first rowcsvTemplate - -- template mapping identifiercom.ge.research.sadl.reasoner.ConfigurationExceptionjava.io.IOExceptioncom.ge.research.sadl.reasoner.InvalidNameExceptioncom.ge.research.sadl.importer.TemplateExceptionpublic 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
ISadlServeraddTriple in interface ISadlServersubjName - 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.ConfigurationExceptioncom.ge.research.sadl.reasoner.TripleNotFoundExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionpublic 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
ISadlServerdeleteTriple in interface ISadlServercom.ge.research.sadl.reasoner.ConfigurationExceptioncom.ge.research.sadl.reasoner.TripleNotFoundExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionpublic boolean reset()
throws com.ge.research.sadl.reasoner.ReasonerNotFoundException
ISadlServerreset in interface ISadlServercom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionpublic 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
ISadlServerprepareQuery in interface ISadlServercom.ge.research.sadl.reasoner.InvalidNameExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptioncom.ge.research.sadl.reasoner.ConfigurationExceptionpublic java.lang.String parameterizeQuery(java.lang.String query,
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
ISadlServerparameterizeQuery in interface ISadlServerquery - -- SPARQL query or update stringvalues - -- parameter values to be substitutedcom.ge.research.sadl.reasoner.InvalidNameExceptioncom.ge.research.sadl.reasoner.ConfigurationExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionpublic void setOwlFileOutputFormat(java.lang.String outputFormat)
ISadlServersetOwlFileOutputFormat in interface ISadlServeroutputFormat - -- "N-TRIPLE", "N3", or "RDF/XML"public java.lang.String getKBaseIdentifier()
throws com.ge.research.sadl.reasoner.ConfigurationException
ISadlServergetKBaseIdentifier in interface ISadlServercom.ge.research.sadl.reasoner.ConfigurationExceptionpublic java.lang.String getModelName()
throws java.io.IOException
ISadlServergetModelName in interface ISadlServerjava.io.IOExceptionpublic java.lang.String getReasonerVersion()
throws com.ge.research.sadl.reasoner.ConfigurationException
ISadlServergetReasonerVersion in interface ISadlServercom.ge.research.sadl.reasoner.ConfigurationExceptionpublic javax.activation.DataSource getDerivations()
throws com.ge.research.sadl.reasoner.ConfigurationException,
com.ge.research.sadl.reasoner.InvalidDerivationException
ISadlServergetDerivations in interface ISadlServercom.ge.research.sadl.reasoner.ConfigurationExceptioncom.ge.research.sadl.reasoner.InvalidDerivationExceptionpublic void setServiceNameMap(java.util.Map<java.lang.String,java.lang.String[]> serviceNameMap)
ISadlServersetServiceNameMap in interface ISadlServerserviceNameMap - -- service name mappublic java.util.Map<java.lang.String,java.lang.String[]> getServiceNameMap()
ISadlServergetServiceNameMap in interface ISadlServerpublic void collectTimingInformation(boolean bCollect)
ISadlServercollectTimingInformation in interface ISadlServerbCollect - -- true to collect timing information; false otherwisepublic void setKbaseRoot(java.lang.String _kbaseRoot)
throws com.ge.research.sadl.reasoner.ConfigurationException
ISadlServersetKbaseRoot in interface ISadlServercom.ge.research.sadl.reasoner.ConfigurationExceptionpublic java.lang.String getKbaseRoot()
ISadlServergetKbaseRoot in interface ISadlServerpublic com.ge.research.sadl.reasoner.ResultSet[] atomicQuery(java.lang.String serviceName,
javax.activation.DataSource dataSrc,
java.lang.String inputFormat,
java.lang.String[] sparql)
throws java.io.IOException,
com.ge.research.sadl.reasoner.ConfigurationException,
NamedServiceNotFoundException,
com.ge.research.sadl.reasoner.QueryParseException,
com.ge.research.sadl.reasoner.ReasonerNotFoundException,
SessionNotFoundException,
com.ge.research.sadl.reasoner.InvalidNameException,
com.ge.research.sadl.reasoner.QueryCancelledException
ISadlServeratomicQuery in interface ISadlServerserviceName - -- 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"sparql - -- a array of queries to be executedjava.io.IOExceptioncom.ge.research.sadl.reasoner.ConfigurationExceptionNamedServiceNotFoundExceptioncom.ge.research.sadl.reasoner.QueryParseExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionSessionNotFoundExceptioncom.ge.research.sadl.reasoner.InvalidNameExceptioncom.ge.research.sadl.reasoner.QueryCancelledExceptionpublic com.ge.research.sadl.reasoner.ResultSet[] atomicQueryCsvData(java.lang.String serviceName,
javax.activation.DataSource csvDataSrc,
boolean includesHeader,
java.lang.String csvTemplate,
java.lang.String[] sparql)
throws java.io.IOException,
com.ge.research.sadl.reasoner.ConfigurationException,
NamedServiceNotFoundException,
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.QueryCancelledException
ISadlServeratomicQueryCsvData in interface ISadlServerserviceName - -- 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 streamsparql - -- a array of queries to be executedjava.io.IOExceptioncom.ge.research.sadl.reasoner.ConfigurationExceptionNamedServiceNotFoundExceptioncom.ge.research.sadl.reasoner.QueryParseExceptioncom.ge.research.sadl.reasoner.ReasonerNotFoundExceptionSessionNotFoundExceptioncom.ge.research.sadl.reasoner.InvalidNameExceptioncom.ge.research.sadl.importer.TemplateExceptioncom.ge.research.sadl.reasoner.QueryCancelledExceptionpublic java.lang.String setInstanceDataNamespace(java.lang.String namespace)
throws com.ge.research.sadl.reasoner.InvalidNameException
ISadlServersetInstanceDataNamespace in interface ISadlServernamespace - -- the default instance data namespacecom.ge.research.sadl.reasoner.InvalidNameExceptionpublic java.lang.String getInstanceDataNamespace()
ISadlServergetInstanceDataNamespace in interface ISadlServerpublic java.lang.String getInstanceModelName()
ISadlServergetInstanceModelName in interface ISadlServerpublic 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
ISadlServercreateInstance in interface ISadlServername - -- 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.ConfigurationExceptioncom.ge.research.sadl.reasoner.InvalidNameExceptionjava.io.IOExceptionpublic void setQueryTimeout(long timeout)
throws com.ge.research.sadl.reasoner.ReasonerNotFoundException,
SessionNotFoundException
ISadlServersetQueryTimeout in interface ISadlServertimeout - (in milliseconds)com.ge.research.sadl.reasoner.ReasonerNotFoundExceptionSessionNotFoundExceptionpublic boolean clearCache()
throws com.ge.research.sadl.reasoner.InvalidNameException,
SessionNotFoundException
ISadlServerclearCache in interface ISadlServercom.ge.research.sadl.reasoner.InvalidNameExceptionSessionNotFoundException