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 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:
assert profileInvoking the assert profile adds two productions to the actionsStr production:
| [3] | actionStr |
+= | assertStr |
| [rule1] | assertStr |
::= | 'assert' dbSpec? '(' decl ('.' decl)* '.'? ')' |
| [rule2] | fwRuleStr |
::= | 'fwrule' askStr assertStr |
assert Descriptionassert takes a set of one or more assertions in notation 3 and adds them to the identified database.
fwrule DescriptionThe 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.
[1] "Algae - RDF Query Language", Eric Prud'hommeaux