Christoph; This is getting into the boundary between application
development and data management.  The if-then structure of your
scenario is particularly telling in this respect.  If you want to do
this directly in an ontology (i.e. in data) you basically end up
tricking the app to do your if-then logic, instead of doing it
directly via a program.

This specific problem could easily be solved with SPARQL CONSTRUCT.
If you put the queried in a SPARQLMotion script, then it can be called
as a Web service and run from an application.

In terms of the SPARQL, the queries would look something like this
(which includes some wild guesses):

CONSTRUCT {?bill :hasLateCharge ?amt} # ?bill is whatever instance
this is applied to
WHERE {
   ?bill :cancelEvent ?cancelDate . # however you store the
cancellation
   ?bill :arrivaEvent ?arriveDate .
   FILTER ((?arriveDate - ?cancelDate) < 1) . # or 24 hours or
whatever
   :LateFee :value ?amt . # hardcoded late fee somewhere in data
}

A similar thing could be done for no-shows.  In terms of "connecting"
this logic to an instance, this is handled by the WHERE clause.  The
above example would find all instances with a late fee and add
the :hasLateCharge to each.

Therefore the query can be stored anywhere.  If you wanted to restrict
the computation to instances of a specific class, then add a "?bill
a :ClassName" clause.  With SPIN, both issues (storing the query and
applying to all instances of a class) can be addressed by adding the
SPARQL queries as Rules for the class and using ?this as the instance
variable.  In this alternative, the rule would be triggered by running
TopSPIN inferences.

-- Scott


On Jan 5, 6:45 am, Christoph <[email protected]> wrote:
> Hello, I have a hotel ontology and would like to define some
> cancellation conditions, such as:
>
> If cancelled up to 1 day before the date of arrival, no fee will be
> charged.
> If cancelled later or in case of no-show, the first night will be
> charged.
>
> I think that DL is not sufficent for this anymore. They are more like
> production rules, which rule language would you use for this kind of
> rules and how would you connect it to the ontology? How can you link
> from the hotel instance to the corresponding rules (maybe stored in a
> rule file or rule repository? Is RuleML a good alternative for doing
> this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TopBraid Composer Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/topbraid-composer-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to