next up previous contents
Next: Features Up: Corese RDF Query and Previous: From CG rules to   Contents

A Rule language based on the query language

The Corese rule language is based on the triple model of RDF. The syntax of a rule is the following:

<cos:rule>
 <cos:if>
    triple pattern
 </cos:if>
 <cos:then>
    triple pattern
 </cos:then>
 </cos:rule>
where cos is the prefix for the Corese namespace and where the triples correspond to RDF statements whose conjunction is translated into a conceptual graph.

In fact the rule language syntax uses the triple query language embedded into an RDF markup, hence its syntax is RDF compliant. However, the corresponding RDF statements are not part of the RDF graph, they are compiled into an internal format.

<rdf:RDF>
 <cos:rule>
  <cos:if>
      RDF Query
  </cos:if>
  <cos:then>
      RDF Pattern
  </cos:then>
 </cos:rule>
</rdf:RDF>

The RDF Query part correspond to the STAT production of the query langage.

The RDF Pattern part correspond to the STAT production of the query langage without the OR, PATH and CONSTRAINT statements.

For instance, the CG rule given as an example in the previous section is the translation of the following Corese rule:

<cos:rule>
 <cos:if>
    ?m rdf:type s:Person
    ?m s:head ?t
    ?t rdf:type s:Team
    ?t s:hasMember ?p
    ?p rdf:type s:Person
 </cos:if>
<cos:then>
    ?m s:manage ?p
</cos:then>
</cos:rule>

Rules are compiled into an internal format as a pair of query graphs. Rules coming from one document are placed into a rule base object. There may be several rule bases. FG: this lsat point is not clear to me


next up previous contents
Next: Features Up: Corese RDF Query and Previous: From CG rules to   Contents
Olivier Corby 2005-07-01