Previous topic  Top  Next topic  Print this Topic
 

Retrieval

 

Queries vs. Requests

There are two fundamental ways of retrieving information from OntoBroker. Answering queries involves reasoning, so that, for example, attribute values derived by rules are considered. This kind of information retrieval is identical to answering queries posed in the OntoBroker text query window.

On the other hand, answering requests only involves explicitly stated (or asserted) facts. Answering requests resembles syntactic matching.

Choice of the Retrieval Method

The choice of retrieval method also determines the form results are returned in. When answering a query, OntoBroker looks for variable assignments applicable to the conditions you state in the query; therefore, what is returned are n-tuples of qualifying variable values derived from the known facts. The form of these tuples may or may not directly correspond to that of the facts in the knowledge base.

As an example of the latter, consider querying a department of motor vehicles knowledge base for the average number of speed limit violations depending on the vehicle category. Assuming this information is not stored as a fact, an attempt to modify a tuple from such a result set and submit it back to OntoBroker would not be meaningful as it does not directly correspond to an actual object in the knowledge base. This is how queries are to be seen.

However, answering requests fetches objects from the knowledge base the way they were explicitly entered. This means that a record in the request result set directly corresponds to a record in the knowledge base and as such, can be easily deleted or modified. Hence, this retrieval method is especially of interest when programmatically modifying a knowledge base.

Queries Without Reasoning

When reasoning is not desired but requests are not suitable, there is an additional retrieval method. Using the inferoff option disables reasoning for a query whilst maintaining the greater degree of flexibility of queries.As an example, consider the following query; it will only retrieve direct instances of the concept area, ignoring any instances of its possible subconcepts.

@{options[inferoff]} ?- ?A:Area.