new rule framework for inqle

0 views
Skip to first unread message

David Donohue

unread,
Sep 9, 2009, 10:52:48 PM9/9/09
to inqle...@googlegroups.com
So after much wrangling and attempts to integrate with existing
semantic rules frameworks, we have settled on a new approach to
semantic rules. None of the existing frameworks met all of our
requirements. Our solution is simply to use SPARQL CONSTRUCT
statements to apply rules. The antecedent of the rule is simply the
WHERE clause of the CONSTRUCT statement. The consequent is the
CONSTRUCT clause. The beauty of such a system is we can create an
arbitrarily complex statements, including whatever probabilistic or
other metadata we desire, using the power that is built into SPARQL.
Also, rules can be applied to any SPARQL endpoint. The only
limitation I have foreseen is that CONSTRUCT statements cannot, to my
knowledge, create new, unqiue named URIs. We can solve this by
creating a new user defined function to do so.

I have implemented the new Rule class, which is a rather simple
Jenabean class. This from the Javadoc documentation for class
org.inqle.data.rdf.jena.rules.Rule:

/**
* This class represents a single rule.
* This rule can serialized as a SPARQL CONSTRUCT query,
* and thereby executed against a semantic data store.
* A rule may also be serialized as a SPARQL ASK query, and used to test
* whether it applies.
*
* To construct a rule, you must construct a Rule object, and then do
any of these
* optional steps:<ul>
* <li>add prefix mappings, using the addPrefixMapping() method</li>
* <li>add the antecedent of the rule (the IF portion) as a sparql clause</li>
* <li>add the consequedent of the rule (the THEN portion) as a sparql
clause</li>
* <li>add any SPARQL modifier like ORDER BY, LIMIT, OFFSET. Usually
this is not done.</li>
* </ul>
* @author David Donohue
* September 8, 2009
*/

Note that the act of authoring a rule now becomes one of authoring the
appropriate sections of the SPARQL query (the WHERE, the CONSTRUCT
clauses). However, we have infrastructure already existing to
generate such sections automatically given the products of sampling
(an IDataTable).

Reply all
Reply to author
Forward
0 new messages