W3C

Algae Extension for Rules

An extension to the Algae Query Language to support assertions and rules.


Abstract

While Algae is designed to be a query language, its semantics are well tailored to making assertions and rules. In particular, the database attach mechanism defines what database recieves the assertions, and the result set defines the values for variables appearing in rules.

Algae Profile

Algae defines profile identifiers for adding semantics to the languae. This document defines the assert profile which enables Algae query strings to make assertions into a database.

The assert features does not require an ordered result set. It provides the actions:

Semantics of the assert profile

Invoking the assert profile adds two productions to the actionsStr production:

[3]    actionStr    +=    assertStr
| fwRuleStr
[rule1]    assertStr    ::=    'assert' dbSpec? '(' decl ('.' decl)* '.'? ')'
[rule2]    fwRuleStr    ::=    'fwrule' askStr assertStr
| 'fwrule' assertStr askStr

assert Description

assert takes a set of one or more assertions in notation 3 and adds them to the identified database.

fwrule Description

The rule assertion syntax is a straitforward combination of a query and an assertion.

Example 6: simple rule assertion (extends Example 2: query with multiple terms)

ns vcard=<http://www.w3.org/2001/vcard-rdf/3.0#>
ns foaf=<http://xmlns.com/foaf/0.1/>
require <http://www.w3.org/2004/06/20-rules/#rule>
fwrule ask (?name   vcard:Family  ?family .
            ?name   vcard:Given  ?given)
    assert (?name   foaf:family_name  ?family .
            ?name   foaf:given  ?given)

This rule states that if a given vcard entry has the properties vcard:Family and vcard:Given, it also has the properties foaf:family_name and foaf:given.

References

[1] "Algae - RDF Query Language", Eric Prud'hommeaux

Valid XHTML 1.0! Author: Eric Prud'hommeaux
$Date: 2004/06/20 19:08:36 $