logo       


Toma - A suggestion for TMQL: msg#00001

Subject: Toma - A suggestion for TMQL
Dear all,

Attached a description of the Toma language. Toma is a suggestion for
a topic map query language. It is inspired by Tolog, AsTMa* and SQL,
but uses also some notations that are used in OO languages.

In the past I published in the tmql-wg mailing list an even more
un-ready description of the language. Currently the language is a bit
more mature - and a prototype that partly implement it was
written. 
In fact, all the examples in the attached document are actually run
using that prototype.

As the language is still very young, there are some issues that should
be changes or fixed. I would appreciate any feedback about it.

Thanks 

Rani


-- 
Rani Pinchuk
Software Engineer
Space Applications Services
Leuvensesteenweg, 325
B-1932 Zaventem
Belgium

Tel.: + 32 2 721 54 84
Fax.: + 32 2 721 54 44

http://www.spaceapplications.com 

Attachment: SAS-Computers-TM.xml
Description: Text Data


Toma - Topic Map Query Language

The following is the language description of Toma which is a Topic Map query language.

A prototype that implement most of the features described in this document was written, and the examples below are run using that prototype. Thus it is clear that the language as written in this document is quite easy to implement.


LANGUAGE DESCRIPTION

Whitespaces and Comments

Whitespace characters are used to as token separators, and apart from that, they are ignored by the parser. One exception to that rule are whitespaces within quotes.

Any line starting with hash character '#' is ignoed by the parser and can be used to comment the code.

Quoted Strings

A string of whatever characters that is surrounded by single quotes is a quoted string. If the string supposed to contain a single quote, it is escaped with another single quote. Example:

  'this is a quoted string'
 
  'and that''s also a quoted string'

Labels

Labels are used to indicate topic ids, topic maps ids, association types, roles types and scope topics. They can come in two formats - as an alphanumeric + underscore string, or an alphanumeric + underscore + hyphen string surrounded by square brackets. Examples:

 container
 
 [logical-exchange]

When the label comes with square brackets, only the string within the brackets is taken as the label.

Topic variable

Dollar followed by any alphanumeric character or underscore is a topic variable and it represents a topic.

  $<variable_name>

Examples:

  $a
 
  $person

Through out this document we will refer to topic variable as

  <topic_variable>

However, we will refer to _expression_ that is evaluated to a topic as

  <topic>

Note that the second can be but is not always equivalent to the first - any topic variable is evaluated to a topic but there are other expressions that are not topic variables which are evaluated to topics.

Operators over Topics

Id of a Topic - id

.id gives the topic id as a string:

  <topic>.id

Example:

  $person.id

Base name - bn

.bn gives the topic base name as a string:

  <topic>.bn

Example:

  $person.bn

Subject identity of a Topic - si.tr, si.sir and si.rr

.si.tr, .si.sir and .si.rr give the topic subjectIdentity as a string (xlink:href), and refer respectively to topicRef, subjectIndicatorRef or resourceRef:

  <topic>.si.tr
  <topic>.si.sir
  <topic>.si.rr

Example:

  $person.si.tr
  $person.si.sir
  $person.si.rr

Occurrences with the type of the occurrence - oc().rd, oc().rr

.oc().rd and .oc().rr give the occurrences of the topic as a string. The occurrences are respectively resourceData or resourceRef. However, it also take into account the type (instanceOf) of the occurrence - if within the brackets there is a label, it is taken as the topic id of the type of the occurrence. If within the brackets there is a topic variable, it will be set to the type of the occurrence. The occurrences are respectively resourceData or resourceRef.

   <topic>.oc(<topic_varibale>).rd
   <topic>.oc(<topic_varibale>).rr
   <topic>.oc(<topic_id>).rd
   <topic>.oc(<topic_id>).rr

Example:


   $person.oc('cv').rd
   $person.oc('cv').rr
   $person.oc($type).rd
   $person.oc($type).rr

$type will hold the type of the occurrence.

instanceOf relationship - type()

.type(<level_ref)> gives a type (instanceOf relationship) of the topic as a topic:

  <topic>.type(<level_ref>)

The type of a topic is a topic by itself.

The level_ref inside the brackets can be a number which gives the superclass of that level.

For example, the type of $person topic:

  $person.type(0)

The type of the occurrence of the $person:

  $person.oc.type(0)

The type of the type of $person topic (the type of the superclass of $person topic):

  $person.type(1)

which is equivalent to:


  $person.type(0).type(0)

Associations

Association - ->

-> is the association operator. It provides the ability to refer to a certain role of certain association:


  <topic_variable_or_topic_id>-><topic_variable_or_topic_id>

Where topic_variable_or_topic_id can be a topic variable or a label which is a topic id. The topic_variable_or_topic_id in the left represents the type of the association, while the right topic_variable_or_topic_id represents the roleSpec.

The whole argument gives a topic which is the topic that plays the role in that association.

For example,

The location role of the association 'city':

  city->location

The location role of certain association:

  $association->location

A certain role of certain association:


  $association->$role

The base name of the topic which plays the certain role of the certain association is:

  $association->$role.bn

Chaining Associations

Usually when quering about association, the aim is to find a connection between topics. For example -

                [logical-exchange]->sender.id = 'motherboard'
            and [logical-exchange]->receiver = $receiver;

The target of the above query is to get all the topics that receive something from the 'motherboard'. However, it is not clear how the first condition above is linked to the second: The first condition states that 'motherboard' is the topic id of the topic that plays the role 'sender' in the association of type 'logical-exchange'. The second condition states that the topic $receiver suppose to play the 'receiver' role in the association of type 'logical-exchange'. But in no place it is stated that it is the very same association - only the type of the association is the same. So, $receiver might be 'video-card' which really receives something directly from the 'motherboard', but it can be also 'screen' that is a topic that plays the 'receiver' role in other association of type 'logical-exchange'.

This confustion is solved by the chainging rule: Any association _expression_ in a statement that has the same topic id or topic variable as the association type share the same association object. So in the above example 'screen' will not play the 'receiver' role in the association, because it must be the same association in both lines.

If it is not desirable to force that two association expressions will share the same association object, we should re-write the above as:

                $le->sender.id = 'motherboard'
            and [logical-exchange]->receiver = $receiver;
            and $le.id = 'logical-exchange';

This looks equivalent to the former example, however, here the two association expressions do not have the same topic id or topic variable, and therefore they do not have to share the same association object and therefore 'screen' can play the 'receiver' role in the association.

This rule is an obvious flaw in the language syntax. However the author could not find a more elegant way to symbolize the association objects and their interactions - any other way seem to be very unreadable. However, if the reader has a suggestion for a more elegant solution, any feedback is welcomed.

Scopes

Scope - @

@ is the scope operator, and it defines the scope of the object to its left, by a topic id or topic variable on its right:

  <scoped_object>@<topic_id>
  <scoped_object>@<topic_variable>

The possible scoped_objects are base names, occurrences and associations. The scope comes immedaitly after bn and oc(). In association, the scope will come just after the topic that represents the type of the association and before the -> operator.

topic_id is a string defines the topic id of the topic that represents the scope. topic_variable is a topic variable which represents the scope.

Examples:

The base name of a topic in English

  $city.bn@en

The base name of a topic in a variable scope

  $city.bn@$scope

The resourceData of an English occurrence of a topic

  $person.oc($oc)@en.rd

The type of the occurrence of a topic in certain scope $scope

  $person.oc@$scope.type(0)

The 'whole' role of the association 'part-of' in the scope 'detailed'

  part-of@detailed->whole

A certain role $role1 of a certain association $association in a certain scope $scope

  $association@$scope->$role1

General Statements Syntax

All statements are terminated with the semicolon ';'.

USE statement

The USE statement is used in order to define which Topic Maps are queried when no specific Topic Map is defined within the query (using the FROM clause).

   use <tm_id_list>;

where tm_id_list is a comma separated list labels which are Topic Map IDs.

Example:

   use computers;

or

   use topicmap1, topicmap2;

The definition that is done by the USE statement is in scope till other definition is done by an other USE statement.

SELECT statement

The SELECT statement is used in order to presents queries over Topic Maps.

The syntax of the SELECT statement is as follows:

   SELECT <selection> WHERE <search_condition>;

or

   SELECT <selection> FROM <tm_id_list> WHERE <search_condition>;

The SELECT clause of the SELECT statement

The SELECT clause of the SELECT statement is used to define which topics are expected to be retreived. It contains comma separated list of topic variables that are present in the search condition clause.

The FROM clause of the SELECT statement

The FROM clause of the SELECT statement is used to define which Topic Maps are queried for that specific query.

   FROM <tm_id_list>

where tm_id_list is a comma separated list labels which are Topic Map IDs.

Example:

   from topicmap1, topicmap2

When the FROM clause is present, the definition made by a preceding USE statement is ignored. When the FROM clause is not present, the query will be made over the topic maps that were defined in the last USE statement.

The WHERE clause

The WHERE clause may contain one of the following clauses:

Comparison clause

Comparison clause consists of two expressions and a comparison sign between them:

   <expression1> <comparison_sign> <expression2>

An _expression_ might be a an _expression_ that is evaluated to a topic (like topic variable, type, association etc), or _expression_ that is evaluated to a string (like a quoted string, topic id, a base name, occurence resourceData or resourceRef, etc).

It is crucial that the two expressions are both evaluated to a topic or are both evaluated to a string. When using the regular expressions comparison signs, the two expressions must be evaluated to a string.

A comparison sign can be one of the following:

  • = Equal sign
  • If the two expressions around the equal sign are equal to each other, the clause is evaluated to be true.

    Examples:

     # the id of the topic type is 'motherboard'
     $topic.type(0).id = 'motherboard'
      
     # $topic2 is the type of $topic1
     $topic1.type(0) = $topic2

  • != Non-equal sign
  • If the two expressions around the non-equal sign are different from each other, the clause is evaluated to be true.

    Examples:

     # the id of the topic that plays the 'container' role  
     # in the association of type 'in-location' is not 'case'
     [in-location]->container.id != 'case'
      
     # the topic that plays the 'sender' role in the 
     # association of type 'logical-exchange' is not $sender.
     [logical-exchange]->sender != $sender

  • ~ Matches regular _expression_, case sensitive
  • A regular _expression_ match operator. Its behaviour is identical to the behaviour of the same operator in Postgres SQL.

    Example:

     # the id of $topic starts with the letter c 
     $topic.id ~ '^c';

  • ~* Matches regular _expression_, case insensitive
  • A regular _expression_ match operator. Its behaviour is identical to the behaviour of the same operator in Postgres SQL.

    Example:

     # the id of $topic starts with the letter c or C
     $topic.id ~* '^c';

  • !~ Does not match regular _expression_, case sensitive
  • A regular _expression_ match operator. Its behaviour is identical to the behaviour of the same operator in Postgres SQL.

    Example:

     # the id of $topic does not start with the letter c 
     $topic.id !~ '^c';

  • !~* Does not match regular _expression_, case insensitive
  • A regular _expression_ match operator. Its behaviour is identical to the behaviour of the same operator in Postgres SQL.

    Example:

     # the id of $topic does not start with the letter c or C
     $topic.id !~* '^c';

EXISTS clause

EXISTS clause consists of an exression (as the _expression_ in the comparison clause).

   exists <_expression_>

If the _expression_ exists, the clause is evaluated to be true.

Examples:

 # $topic exists
 exists $topic;
 
 # $topic has a basename in scope 'location'
 exists $topic.bn@location;

NOT clause

NOT clause consists one search condition.

   not <search_condition>

If the search_condition is evaluated to be false, the Not clause is evaluated to be true.

Example:

 # $topic does not have a basename in scope 'location'
 not (exists $topic.bn@location);

AND clause

AND clause consists of two search conditions.

   <search_condition> and <search_condition>

If both search_conditions are evaluated to be true, the AND clause is evaluated to be true.

Example:

 # $topic has a basename is scope 'location' and is of type 'io-part'
 exists $topic.bn@location and $topic.type(0).id = 'io-part';

OR clause

OR clause consists of two search conditions.

   <search_condition> or <search_condition>

If one of the search_conditions is evaluated to be true, the OR clause is evaluated to be true.

Example:

 # $topic has a basename is scope 'location' or is of type 'io-part'
 exists $topic.bn@location or $topic.type(0).id = 'io-part';

EXAMPLES

The Prototype Implementation

The following examples are all run on the prototype implementation of the language. The XTM source is parsed using XML::Parser Perl module and populate a rational database (Postgres). The Toma queries are parsed by Lex & Yacc (Flex & Bison), and the syntax tree that is created is then converted to Perl data structure. A Perl module is implemented to walk that syntax tree, to generate SQL code, to run that SQL code and to generate the Postgres-like resuslt tables.

As a prototype, many features are not yet implemented. Among them, the choice between Topic Maps (so the USE statement). That means that the database holds only one Topic Map.

However, the prototype helped to understand better the language that is needed, and contributed in some features of the language. Apart from that the prototype demonstrates that the language might be useful (hopefully, it becomes clear from the examples below), and that it is quite easy to implement such a language.

In order to make the example clear, a very simple, and very far from being complete, topic map about computers was created. The XTM of this topic map can be found in SAS-Computers-TM.xml.

Topics, Base Names and Scopes

  • All the existing topics:
  •  select $topic where exists $topic;
     
          topic       
     -----------------
      case            
      close-location  
      contained       
      container       
      device          
      external        
      graphic         
      in-location     
      internal        
      io-part         
      keyboard        
      location        
      logical         
      logical-exchange
      motherboard     
      mouse           
      network-card    
      pc              
      pc-part         
      processing-part 
      processor       
      receiver        
      screen          
      sender          
      sink            
      source          
      structural-part 
      text            
      thermal         
      thermal-exchange
      ventilator1     
      ventilator2     
      video-card      
     (33 rows)
  • All the topics that their base name contains the letter 'p'
  •  select $topic where $topic.bn ~ 'p';
     
        topic    
     ------------
      graphic    
      pc         
      processor  
      ventilator1
     (4 rows)
  • All the topics that their base name has scope 'location'
  •  select $topic where exists $topic.bn@location;
     
        topic     
     -------------
      case        
      keyboard    
      motherboard 
      mouse       
      network-card
      pc          
      processor   
      screen      
      ventilator1 
      ventilator2 
      video-card  
     (11 rows)
  • All the topics that their base name has certain scope
  •  select $topic, $scope where exists $topic.bn@$scope;
     
          topic        |  scope   
     ------------------+----------
      case             | location 
      in-location      | contained
      in-location      | container
      keyboard         | location 
      keyboard         | logical  
      logical-exchange | receiver 
      logical-exchange | sender   
      motherboard      | location 
      motherboard      | logical  
      mouse            | location 
      mouse            | logical  
      network-card     | location 
      network-card     | logical  
      pc               | location 
      pc               | logical  
      pc               | thermal  
      processor        | location 
      processor        | logical  
      processor        | thermal  
      screen           | location 
      screen           | logical  
      thermal-exchange | sink     
      thermal-exchange | source   
      ventilator1      | location 
      ventilator1      | thermal  
      ventilator2      | location 
      ventilator2      | thermal  
      video-card       | location 
      video-card       | logical  
      video-card       | thermal  
     (30 rows)

Types (instanceOf relationship)

Occurences

  • All the topics that have resourceData occurences, with the occurence type.
  •  select $topic, $oc_type where exists $topic.oc($oc_type).rd;
     
        topic      | oc_type
     --------------+--------
      case         | graphic
      case         | text   
      external     | text   
      graphic      | text   
      internal     | text   
      keyboard     | graphic
      keyboard     | text   
      location     | text   
      logical      | text   
      motherboard  | graphic
      motherboard  | text   
      mouse        | graphic
      mouse        | text   
      network-card | graphic
      network-card | text   
      pc           | graphic
      pc           | text   
      processor    | graphic
      processor    | text   
      screen       | graphic
      screen       | text   
      thermal      | text   
      ventilator1  | graphic
      ventilator1  | text   
      ventilator2  | graphic
      ventilator2  | text   
      video-card   | graphic
      video-card   | text   
     (28 rows)
  • All the topics that have resourceRef occurences, with the occurence type.
  •  select $topic, $oc_type where exists $topic.oc($oc_type).rr;
     
        topic      | oc_type
     --------------+--------
      case         | graphic
      keyboard     | graphic
      motherboard  | graphic
      mouse        | graphic
      network-card | graphic
      pc           | graphic
      processor    | graphic
      screen       | graphic
      ventilator1  | graphic
      ventilator2  | graphic
      video-card   | graphic
     (11 rows)
  • All the topics that have resourceRef occurences, and that those occurences have also a scope
  •  select $topic, $oc_type, $scope where exists $topic.oc($oc_type)@$scope.rr;
     
        topic      | oc_type | scope   
     --------------+---------+---------
      case         | graphic | location
      keyboard     | graphic | location
      keyboard     | graphic | logical 
      motherboard  | graphic | location
      motherboard  | graphic | logical 
      mouse        | graphic | location
      mouse        | graphic | logical 
      network-card | graphic | location
      network-card | graphic | logical 
      pc           | graphic | location
      pc           | graphic | logical 
      pc           | graphic | thermal 
      processor    | graphic | location
      processor    | graphic | logical 
      processor    | graphic | thermal 
      screen       | graphic | location
      screen       | graphic | logical 
      ventilator1  | graphic | location
      ventilator1  | graphic | thermal 
      ventilator2  | graphic | location
      ventilator2  | graphic | thermal 
      video-card   | graphic | location
      video-card   | graphic | logical 
      video-card   | graphic | thermal 
     (24 rows)
  • All the topics that have resourceRef occurences, but only of the logical scope.
  •  select $topic, $oc_type where exists $topic.oc($oc_type)@logical.rr;
     
        topic      | oc_type
     --------------+--------
      keyboard     | graphic
      motherboard  | graphic
      mouse        | graphic
      network-card | graphic
      pc           | graphic
      processor    | graphic
      screen       | graphic
      video-card   | graphic
     (8 rows)

Associations

  • Which associations there are and which roles do they have
  •  select $association, $role where exists $association->$role;
     
       association     |  role    
     ------------------+----------
      close-location   | device   
      in-location      | contained
      in-location      | container
      logical-exchange | receiver 
      logical-exchange | sender   
      thermal-exchange | sink     
      thermal-exchange | source   
     (7 rows)
  • Which associations there are, which roles do they have, and in which scopes they come (will show only associations that have scope, in our case, all of them).
  •  select $association, $role, $scope where exists $association@$scope->$role;
     
       association     |  role     | scope   
     ------------------+-----------+---------
      close-location   | device    | location
      in-location      | contained | location
      in-location      | container | location
      logical-exchange | receiver  | logical 
      logical-exchange | sender    | logical 
      thermal-exchange | sink      | thermal 
      thermal-exchange | source    | thermal 
     (7 rows)
  • All the topics that play certain role in certain association in certain scope, and show them all.
  •  select $topic, $role, $association, $scope
          where $association@$scope->$role = $topic;
     
        topic      |  role     |  association     | scope   
     --------------+-----------+------------------+---------
      case         | container | in-location      | location
      keyboard     | device    | close-location   | location
      keyboard     | sender    | logical-exchange | logical 
      motherboard  | contained | in-location      | location
      motherboard  | device    | close-location   | location
      motherboard  | receiver  | logical-exchange | logical 
      motherboard  | sender    | logical-exchange | logical 
      mouse        | device    | close-location   | location
      mouse        | sender    | logical-exchange | logical 
      network-card | contained | in-location      | location
      network-card | device    | close-location   | location
      network-card | receiver  | logical-exchange | logical 
      network-card | sender    | logical-exchange | logical 
      processor    | contained | in-location      | location
      processor    | device    | close-location   | location
      processor    | receiver  | logical-exchange | logical 
      processor    | sender    | logical-exchange | logical 
      processor    | source    | thermal-exchange | thermal 
      screen       | device    | close-location   | location
      screen       | receiver  | logical-exchange | logical 
      ventilator1  | contained | in-location      | location
      ventilator1  | device    | close-location   | location
      ventilator1  | sink      | thermal-exchange | thermal 
      ventilator2  | contained | in-location      | location
      ventilator2  | device    | close-location   | location
      ventilator2  | sink      | thermal-exchange | thermal 
      video-card   | contained | in-location      | location
      video-card   | device    | close-location   | location
      video-card   | receiver  | logical-exchange | logical 
      video-card   | sender    | logical-exchange | logical 
      video-card   | source    | thermal-exchange | thermal 
     (31 rows)
  • Which scopes we have over associations
  •  select $scope where exists $association@$scope->$role;
     
      scope   
     ---------
      location
      logical 
      thermal 
     (3 rows)
  • Show the associations in scope 'location'
  •  select $topic1, $role1, $association, $topic2, $role2
                     where $association@location->$role1 = $topic1
                       and $association@location->$role2 = $topic2
                       and $topic1 != $topic2;
     
        topic1     |  role1    | association    |   topic2     |  role2   
     --------------+-----------+----------------+--------------+----------
      case         | container | in-location    | motherboard  | contained
      case         | container | in-location    | network-card | contained
      case         | container | in-location    | processor    | contained
      case         | container | in-location    | ventilator1  | contained
      case         | container | in-location    | ventilator2  | contained
      case         | container | in-location    | video-card   | contained
      keyboard     | device    | close-location | mouse        | device   
      keyboard     | device    | close-location | screen       | device   
      motherboard  | contained | in-location    | case         | container
      motherboard  | device    | close-location | network-card | device   
      motherboard  | device    | close-location | processor    | device   
      motherboard  | device    | close-location | video-card   | device   
      mouse        | device    | close-location | keyboard     | device   
      mouse        | device    | close-location | screen       | device   
      network-card | contained | in-location    | case         | container
      network-card | device    | close-location | motherboard  | device   
      network-card | device    | close-location | video-card   | device   
      processor    | contained | in-location    | case         | container
      processor    | device    | close-location | motherboard  | device   
      processor    | device    | close-location | ventilator1  | device   
      screen       | device    | close-location | keyboard     | device   
      screen       | device    | close-location | mouse        | device   
      ventilator1  | contained | in-location    | case         | container
      ventilator1  | device    | close-location | processor    | device   
      ventilator2  | contained | in-location    | case         | container
      ventilator2  | device    | close-location | video-card   | device   
      video-card   | contained | in-location    | case         | container
      video-card   | device    | close-location | motherboard  | device   
      video-card   | device    | close-location | network-card | device   
      video-card   | device    | close-location | ventilator2  | device   
     (30 rows)
  • Show the associations in scope 'logical'
  •  select $topic1, $role1, $association, $topic2, $role2
                     where $association@logical->$role1 = $topic1
                       and $association@logical->$role2 = $topic2
                       and $topic1 != $topic2;
     
        topic1     | role1    |  association     |   topic2     | role2   
     --------------+----------+------------------+--------------+---------
      keyboard     | sender   | logical-exchange | motherboard  | receiver
      motherboard  | receiver | logical-exchange | keyboard     | sender  
      motherboard  | receiver | logical-exchange | mouse        | sender  
      motherboard  | receiver | logical-exchange | network-card | sender  
      motherboard  | receiver | logical-exchange | processor    | sender  
      motherboard  | sender   | logical-exchange | network-card | receiver
      motherboard  | sender   | logical-exchange | processor    | receiver
      motherboard  | sender   | logical-exchange | video-card   | receiver
      mouse        | sender   | logical-exchange | motherboard  | receiver
      network-card | receiver | logical-exchange | motherboard  | sender  
      network-card | sender   | logical-exchange | motherboard  | receiver
      processor    | receiver | logical-exchange | motherboard  | sender  
      processor    | sender   | logical-exchange | motherboard  | receiver
      screen       | receiver | logical-exchange | video-card   | sender  
      video-card   | receiver | logical-exchange | motherboard  | sender  
      video-card   | sender   | logical-exchange | screen       | receiver
     (16 rows)
  • Show the associations in scope 'thermal'
  •  select $topic1, $role1, $association, $topic2, $role2
                     where $association@thermal->$role1 = $topic1
                       and $association@thermal->$role2 = $topic2
                       and $topic1 != $topic2;
     
       topic1     | role1  |  association     |  topic2     | role2 
     -------------+--------+------------------+-------------+-------
      processor   | source | thermal-exchange | ventilator1 | sink  
      ventilator1 | sink   | thermal-exchange | processor   | source
      ventilator2 | sink   | thermal-exchange | video-card  | source
      video-card  | source | thermal-exchange | ventilator2 | sink  
     (4 rows)
  • All the devices that sends data to the motherboard
  •  select $topic where [logical-exchange]->sender = $topic
                     and [logical-exchange]->receiver.id = 'motherboard';
     
        topic     
     -------------
      keyboard    
      mouse       
      network-card
      processor   
     (4 rows)
  • All the devices that sends data to the motherboard that are I/O parts
  •  select $topic where [logical-exchange]->sender = $topic
                     and [logical-exchange]->receiver.id = 'motherboard'
                     and $topic.type(0) = 'io-part';
     
      topic   
     ---------
      keyboard
      mouse   
     (2 rows)
  • All the devices that sends data to other device that sends data to the processor.
  •  select $topic where [logical-exchange]->sender = $topic
                     and [logical-exchange]->receiver = $middle
                     and $association->sender = $middle
                     and $association->receiver.id = 'processor'
                     and $association.id = 'logical-exchange';
     
        topic     
     -------------
      keyboard    
      mouse       
      network-card
      processor   
     (4 rows)
     
    Note that in this example we use the L<chaining rule|/"Chaining
    Associations">, which is the reason for using the topic variable
    I<$association>.
  • All the devices that send data to the motherboard and are contained within the case.
  •  select $topic where [logical-exchange]->sender = $topic
                     and [logical-exchange]->receiver.id = 'motherboard'
                     and [in-location]->contained = $topic
                     and [in-location]->container.id = 'case';
     
        topic     
     -------------
      network-card
      processor   
     (2 rows)
  • How are the video card and the motherboard associated?
  •  select $association, $motherboard_role, $video_card_role
                   where $association->$motherboard_role.id = 'motherboard'
                     and $association->$video_card_role.id = 'video-card';
     
       association     | motherboard_role | video_card_role
     ------------------+------------------+----------------
      close-location   | device           | device         
      logical-exchange | sender           | receiver       
     (2 rows)
  • How are the video card and the motherboard associated in the logical scope only?
  •  select $association, $motherboard_role, $video_card_role 
                where $association@logical->$motherboard_role.id = 'motherboard'
                  and $association@logical->$video_card_role.id = 'video-card';
     
       association     | motherboard_role | video_card_role
     ------------------+------------------+----------------
      logical-exchange | sender           | receiver       
     (1 rows)
  • What is inside the case
  •  select $topic where [in-location]->contained = $topic 
                     and [in-location]->container.id = 'case';
     
        topic     
     -------------
      motherboard 
      network-card
      processor   
      ventilator1 
      ventilator2 
      video-card  
     (6 rows)
  • To what the motherboard is associated in the different scopes
  •  select $topic, $role2, $association, $scope 
                    where $association@$scope->$role1 = 'motherboard'
                      and $association@$scope->$role2 = $topic
                      and $role1 != $role2;
     
        topic      |  role2    |  association     | scope   
     --------------+-----------+------------------+---------
      case         | container | in-location      | location
      keyboard     | sender    | logical-exchange | logical 
      mouse        | sender    | logical-exchange | logical 
      network-card | receiver  | logical-exchange | logical 
      network-card | sender    | logical-exchange | logical 
      processor    | receiver  | logical-exchange | logical 
      processor    | sender    | logical-exchange | logical 
      video-card   | receiver  | logical-exchange | logical 
     (8 rows)

Missing Features

Although the language might be already useful in many cases, there are many missing features that should be added to it in the future. Among those features are:


AUTHOR

Rani Pinchuk, <rani.pinchuk@xxxxxxxxxxxxxxxxxxxxx>


COPYRIGHT

Copyright (C) 2004 by Space Applications Services

Attachment: style.css
Description: Text Data

Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe