Rulesets have (optional) URIs and labels, (optional) base URI declarations, (optional) prefixes, (optional) inclusions of other rulesets, some set of rules, and (optional) rule-composition instructions: RULESET "to show things off", "voila!"@fr BASE PREFIX spoo: INCLUDE { } RUN , ; , [all URIs here fake] Inside the {} brackets are the rules. A rule has an (optional) URIs and labels, (optional) base URI declarations, (optional) prefixes, and a body. The body can be a SPARQL construct query or similarly a pattern => conclusion which is pretty much the CONSTRUCT query written the other way round. The pattern language is extended from SPARQL in the following ways: (1) The patterns {ALL variable. pattern} and {ALL variable. pattern -> conclusion} do aggregation; the variable name is bound outside the pattern to a bunch [1] of its bindings. (Then you feed the aggregated variable to a function.) (2) The pattern `UNLESS pattern` only matches if `pattern` doesn't match (in some graph to be decided). (3) The pseudopattern `LET variable = expression` binds the variable to the value of the expression, allowing arbitrary expressions to be used. (4) The function in a function-call can have a plain name as well as a IRI-style name. (This is mostly a syntactic trick to subsume all the SPARQL builtins into a single piece of grammar.) (5) The object of a statement can be a function-call. A moderately atrocious rendering of the grammar courtesy of jjdoc can be found at http://cdollin/rules/rules-B.html and a random bunch of examples at http://cdollin/rules/example-inf-a.txt -- I'll try and do something wiht more sense. [1] It's a set or bag or a list or something. Don't know which yet. ////////////////////////////// Also: rulesets can have a dataset description following the rules.