User Tools

Site Tools


querying_a_gellish_english_database

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
querying_a_gellish_english_database [2017/11/15 11:15]
127.0.0.1 external edit
querying_a_gellish_english_database [2018/11/17 20:09]
andries Updated
Line 1: Line 1:
-====== Querying ​a Gellish English database ​====== +====== Querying ​databases ​====== 
-====== 1. Queries, questions and dialogues in Gellish ​English ​======+====== 1. Queries, questions and dialogues in Gellish ======
  
 Queries for conventional databases are usually expressed in a special query language, such as SQL. \\ Queries for conventional databases are usually expressed in a special query language, such as SQL. \\
-Gellish does not require a special query language, because Gellish ​Queries are nearly identical ​to ordinary ​propositions. In a natural language there is no big difference between the structure of sentence that expresses a question and a sentence that expresses a proposition. That same principle is applied in Gellish ​English. If you know how to express ​facts in Gellish ​English, then you only need to know the few additional rules that are explained below in order to be able to write queries for a [[:​gellish_databases|Gellish ​Database]]. As the response to a Gellish Query also consists of Gellish expressions, this implifies the creation of Software Agents and Distributed ​Gellish ​databases.+Gellish does not require a special query language, because ​queries can be expressed in Gellish ​in a nearly identical ​way as expressing ​ordinary ​statements. In a natural language there is no big difference between the structure of sentence that expresses a question and a sentence that expresses a statement. That same principle is applied in Gellish. If you know how to express ​ideas in Gellish, then you only need to know the few additional rules that are explained below in order to be able to write queries for a [[:​gellish_databases|Gellish ​enabled database]]. The response to a Gellish Query consists of Gellish expressions. This implies that Software Agents and database systems should have import and export capabilities for Gellish ​expressions.
  
 There are basically two kinds of questions: There are basically two kinds of questions:
Line 15: Line 15:
   * a specification of additional constraints that specify values for characteristics for the object(s) that are the result of the basic question.   * a specification of additional constraints that specify values for characteristics for the object(s) that are the result of the basic question.
 For example, the basic question could be: ‘which objects are classified as a pump?’ \\ For example, the basic question could be: ‘which objects are classified as a pump?’ \\
-In Gellish ​English ​such a question should be expressed as if it was a positive ​proposition ​about an individual object, while replacing the unknown object(s) name by '​what'​. For example, the above query is expressed in Gellish English (ignoring the auxiliary ​facts) as is illustrated in Table 1: \\ +In Gellish such a question should be expressed as if it was a positive ​statement ​about an individual object, while specifying as intention '​query'​ (instead of '​assertion'​) ​unknown object(s) ​an specifying as name of the unknown a term that is unknown in the dictionary. For example, the name '​what'​. The above query is expressed in Gellish English (ignoring the contextual ​facts) as is illustrated in Table 1: \\ 
-^Name of left hand object^Name of relation type^Name of right hand object^ +^Intention^Name of left hand object^Name of relation type^Name of right hand object^ 
-|  what |  is classified as a |  pump|+|query|  what |  is classified as a |  pump|
 //Table 1, A simple Gellish English query// \\ //Table 1, A simple Gellish English query// \\
-The example question asks for the object(s) that have a relation of type “is classified as a” with the concept “pump”. Instead of the term '​what'​ there are several other reserved terms to indicate an unknown object that is wanted to be identified and about which information is provided in one or more expressions. Gellish English has defined the following reserved terms:+The example question asks for the object(s) that have a relation of type “is classified as a” with the concept “pump”. Instead of the term '​what'​ there are several other names of unknowns in ordinary language available, but any unknown name is allowed. Recommended names are: what-1, what-2, etc. to indicate an unknown object that is wanted to be identified and about which information is provided in one or more expressions. Gellish English has defined the following reserved terms:
   * what   * what
   * who   * who
Line 28: Line 28:
   * when   * when
  
-The use of any of these terms means that the expression should be interpreted by a computer as a question, whereas the term '​which ​aspect' means that not just possible name of the aspect should be retrieved, but also it value and if applicable the scale for the value. \\ +The use of the intention '​query'​ or '​question'​ indicates that an expression should be interpreted by a computer as a question, whereas the unknown terms are free text. Note that when an unknown indicates an aspect, then not just the possible name of an aspect should be retrieved, but also its value and if applicable the unit of measure ​for the value. \\ 
-Full Gellish ​English ​expressions use unique identifiers (UID'​s) to identify objects. ​To identify objects (or collections of objects) ​that are unknown ​in full Gellish ​English ​the range of unique identifiers ​1-100 is reserved. Thus, the use of a UID in that range means that the objects are unknown and are requested. The name of the unknown is then free, although the use of one or more of the above reserved terms is still recommended.+Full Gellish expressions use unique identifiers (UID'​s) to identify objects. ​Objects ​that are unknowns are identified ​in Gellish ​by UIDs in the reserved ​range 1-99. Thus, the use of a UID in that range means that the object is unknown and is requested. The name of the unknown is then free, although ​for human readability ​the use of one or more of the above reserved terms is still recommended.
 ==== 2.1 Querying results and inheritance ==== ==== 2.1 Querying results and inheritance ====
-The query is in fact a template for the results. So the search engine should find all the facts that fit in the template. Thus, the result of a query will be a list of facts that satisfy the template. \\ +query expressions are in fact a template for the resulting expressions,​ where knowns are filled-in on places of unknowns. So search engine should find all the expressions ​that fit in the template. Thus, the result of a query will be a list of expressions ​that satisfy the query template. \\ 
-If the query asks for objects that are classified by a concept that is defined in the [[:Gellish English Dictionary]], then the //​inheritance//​ rules for the subtype-supertype hierarchy in the taxonomy imply that not only objects that are directly classified by that concept satisfy the question, but also objects that are classified by one of the subtypes of that concept. ​So, the question: \\+If the query asks for objects that are classified by a concept that is defined in the dictionary, then the //​inheritance//​ rules for the subtype-supertype hierarchy in the taxonomy imply that not only objects that are directly classified by that concept satisfy the question, but also objects that are classified by one of the subtypes of that concept. ​For example, the question: \\
  - what is classified as a pressure gauge? \\  - what is classified as a pressure gauge? \\
 means: \\ means: \\
  - what is classified as a pressure gauge or as one of its subtypes? \\  - what is classified as a pressure gauge or as one of its subtypes? \\
-This means that the result of such a query is a list that includes not only things that are directly classified as pressure gauge, but also for example as a manometer, because according to the Gellish ​English ​Dictionary/​Taxonomy ​a manometer is a subtype o a pressure gauge. So the result of the above query could be for example:+This means that the result of such a query is a list that includes not only things that are directly classified as pressure gauge, but also for example as a manometer, because according to the Gellish ​Taxonomic ​Dictionary a manometer is a kind of a pressure gauge. So the result of the above query could be for example:
   * Pr-101 is classified as a pressure gauge   * Pr-101 is classified as a pressure gauge
   * Pr-102 is classified as a manometer   * Pr-102 is classified as a manometer
   * Pr-103 is classified as a manometer   * Pr-103 is classified as a manometer
  
-Software that enables Gellish ​English ​querying should therefore be able to automatically generate the answer as a list of things that are either classified by a concept or are classified as one of its subtypes ​(where ​the software should indicate when objects are classified more than once).+Software that enables Gellish querying should therefore be able to automatically generate the answer as a list of things that are either classified by a concept or are classified as one of its subtypes. Furthermore, ​the software should indicate when objects are classified more than once.
 ==== 2.2 Specification of additional constraints ==== ==== 2.2 Specification of additional constraints ====
-Additional constraints are expressed in a similar way as if it was an expression of the aspects of an individual object that is called ‘what’. For example: \\ +Additional constraints are expressed in a similar way as expressing ​the aspects of an individual object, whereas the intention has the value 'query specification'​. The names and UIDs of the unknowns should be used again where applicable to indicate ​that it is the same object about which an aspect ​is specified. For example: \\ 
-^Name of left hand object^Name of relation type^Name of right hand object^UoM^ +^^Name of left hand object^Name of relation type^Name of right hand object^UoM^ 
-|  ​what |  is classified as a |  pump |  +| query |  ​What |  is classified as a |  pump |  
-|  ​what |  ​is classified ​as |  ​capacity ​of pump |  +| query specification ​|  ​What |  ​has as aspect ​|  ​Capacity ​of pump |  
-|  ​capacity ​of pump |  is classified as a |  capacity (volume flow rate) |  +| query specification ​|  ​Capacity ​of pump |  is classified as a |  capacity (volume flow rate) |  
-|  ​capacity ​of pump |  has on scale a value grater than |  30 |  dm3/s|+| query specification ​|  ​Capacity ​of pump |  has on scale a value grater than |  30 |  dm3/s|
 //Table 2, Example of a query with constraints//​ //Table 2, Example of a query with constraints//​
  
-This example also illustrates that the query expresses a pattern that should be satisfied by the search engine, because ​if we would replace the term '​what'​ by the name of a pump, such as P-101, ​then the above expressions would have been a specification of information about pump P-101.+In this example the names that start with a capital character are individual unknowns. The name '​Capacity of pump' indicates the capacity of any potentially found pump and that capacity is classified and should have a value greater than 30 dm3/s.  
 +This example also illustrates that the query expresses a pattern that should be satisfied by the search engine, because we can replace the term '​what'​ by the name of a pump, such as P-101, ​and replace its capacity by 'cap of P-101'​. Then the above expressions would have been a specification of information about pump P-101, apart from the statement about the quantification of the capacity.
 === 2.2.1 Denials === === 2.2.1 Denials ===
-A specification may also include a denial. This means that things are search because they have some aspect, but because they do not have such an aspect. Such a denial can be expressed ​as a separate qualifier of the expression, called ​the ‘intention’ of the expression (see the paragraph on ‘Requests and Responses’ below) ​that indicates whether the statement ​is for the found things ​should be the case or not be the case. This is indicated by the intention ‘true’, ‘false’ (or ‘not’) or ‘questionable’ (or ‘maybe’).+A specification may also include a denial. This means that things are search because they have some aspect, but because they do not have such an aspect. Such a denial can be expressed ​in the ‘intention’ of the expression (see the paragraph on ‘Requests and Responses’ below) ​by extending the intention with the term '​denial',​ thus becoming 'query denial'​ and 'query specification denial'​. It indicates whether the statement should be the case or not be the case for the found things.
 === 2.2.2 Multiple unknowns === === 2.2.2 Multiple unknowns ===
-If more than one unknown object is included in a query, then the query should make a distinction between the different unknowns. This can be done by using one of the other reserved terms for unknown objects, but it is essentially done by giving them different unique identifiers (UID’s). ​The range of UID’s 1 – 100 are reserved for free usage for unknown queried objects in Gellish queries.+If more than one unknown object is included in a query, then the query should make a distinction between the different unknowns. This should ​be done by using different ​names and unique identifiers (UID’s).\\
   * Note: Application software may hide the UID’s for users by adopting the convention to allow a dash and a sequence number to distinguish different objects and to translate that to a UID and a standard term.   * Note: Application software may hide the UID’s for users by adopting the convention to allow a dash and a sequence number to distinguish different objects and to translate that to a UID and a standard term.
 For example, a query about the capacities of the found pumps would be identical to the above query, except that the name of the aspect ‘capacity of pump’ should be replaced by the term ‘which aspect’. However, in addition to that the unknown aspect shall also have a UID that differs from the UID of the unknown object. So the query would become: \\ For example, a query about the capacities of the found pumps would be identical to the above query, except that the name of the aspect ‘capacity of pump’ should be replaced by the term ‘which aspect’. However, in addition to that the unknown aspect shall also have a UID that differs from the UID of the unknown object. So the query would become: \\
-^UID of left hand object^Name of left hand object^UID of fact^UID of relation ​type^Name of relation ​type^UID of right hand object^Name of right hand object^ +^Intention^UID of left hand object^Name of left hand object^UID of fact^UID ​of kind of relation^Name ​of kind of relation^UID of right hand object^Name of right hand object^ 
-|  1 |  what |  101 |  1225 |  is classified as a |  130206 |  pump| +|query|  1 |  what |  101 |  1225 |  is classified as a |  130206 |  pump| 
-|  1 |  what |  102 |  1727 |  has aspect |  2 |  which aspect| +|query specification|  1 |  what |  102 |  1727 |  has aspect |  2 |  which aspect| 
-|  2 |  which aspect |  103 |  1225 |  is classified as a |  550318 |  capacity (volume ​fow rate)|+|query specification|  2 |  which aspect |  103 |  1225 |  is classified as a |  550318 |  capacity (volume ​flow rate)|
 //Table 3, Example of a query with multiple unknowns// //Table 3, Example of a query with multiple unknowns//
  
 Such a query could result for example in the following answer: Such a query could result for example in the following answer:
-  * P-1 is classified as a reciprocating pump +^Intention^Name of left hand object^Name of kind of relation^Name of right hand object^Unit of measure^ 
-  ​* ​P-1 has aspect ​cap. of P-1 +|assertion|P-1 |is classified as a |reciprocating pump| | 
-  * cap. of P-1 is classified as a capacity (volume flow rate) +|assertion|P-1 |has aspect ​|capacity ​of P-1| | 
-  * cap. of P-1 has on scale a value equal to 45 dm3/s+|assertion|capacity ​of P-1 |is classified as a |capacity (volume flow rate)| | 
 +|assertion|capacity ​of P-1 |has on scale a value equal to |45 |dm3/s|
  
 === 2.2.3 Constraints about different kinds of objects === === 2.2.3 Constraints about different kinds of objects ===
querying_a_gellish_english_database.txt · Last modified: 2020/03/11 14:06 by andries