Database Reference
In-Depth Information
CREATE ENTITY #Preference (
#oid int,
...
);
through the PREF_Link attribute.
Querying OntoDB by Integrating
Preferences Facility
We note that the created entity is #Preference ,
prefixed by the (#) symbol to precise that the cre-
ation is at the entity meta-model level. Table 15
presents the creation of 4 entities of the preference
model using the OntoQL language. In the first
column, we give the syntax of the creation of the
root entity of the model, Preference. In the second
column, the creation of the entity Preference_URI,
attached to a preference, is given. Finally, in the
last columns the creation of interval and numeric
preferences is given.
In order to handle the preferences in the OntoQL
queries, a preference interpreter has been devel-
oped on top of the OntoQL engine. This is ma-
terialized by adding a PREFERRING subclause
to OntoQL SELECT clause. An interpretation
function is associated to each type of preference
available in our preference model and is associ-
ated to this subclause. The syntax of the SELECT
clause becomes as follows.
SELECT 'selection'
FROM 'tableReference'
PREFERRING 'preferenceIdentifer'
Associating the Ontology and
the Preferences Model
For example, assuming the tourism domain, the
cheap hotels can be retrieved using the following
SELECT clause.
Once the preferences containers are defined at
the meta-schema level, they need to be linked to
their corresponding ontological entity at the meta-
schema as well. This link has been previously
illustrated in Figure 4 by the Pref_Link class.
Practically, in order to encode composition, the
preference link is absorbed by the entity Prop-
erty_or_Class of the ontology model by becoming
its attribute. The following OntoQL statement is
used to create such a link into OntoDB.
SELECT name
FROM Hotel
PREFERRING ' CHEAP'
The whole model and operational resources
associated to preferences are defined. Now it is
possible to show how our approach works on a
case study. The following section illustrates it with
an example taken from the tourism domain and
specifically an online holiday booking domain.
ALTER ENTITY #Property_Or_Class
ADD ATTRIBUTE #PREF_Link REF
(#Preference) ARRAY
It expresses that an aggregate of preference
elements is associated to a class or a property
Table 15. Creating the main entities of the model and 2 types of preferences (Interval and Numeric) with
the OntoQL Create clause at the meta-schema level
CREATE ENTITY
#Preference(
#oid int,
#uri REF(#Preference_Uri));
CREATE ENTITY
#Preference_URI(
#code int,
#name string,
#classification String);
CREATE ENTITY
#Interval_Preference UN-
DER #Preference (
#min_value int,
#max_value int);
CREATE ENTITY #Numeric_
Preference UNDER #Prefer-
ence (#number_value int
)
 
Search WWH ::




Custom Search