Difference between CONSTRUCT and stardog rules

What is the difference in using CONSTRUCT queries in Stardog and in using IF-THEN rules with reasoning on?

CONSTRUCT queries, as any queries with a WHERE clause, are evaluated over explicitly asserted data, i.e. over triples on the RDF graph. Rules, on the other hand, describe implicit relationships in the data. The head of a rule is true whenever facts in the body are true, whether they’re explicitly asserted in the data or follow from other rules and axioms.

Of course you can evaluate CONSTRUCT queries with reasoning, too, in which case the results will include facts that follow from axioms and rules. But the results won’t become a part of the graph and will not interact with other queries (unless you explicitly add them back to your data).

It’s useful to remember that while the Stardog Rule Syntax looks like SPARQL, it’s merely a convenient syntax for SWRL rules. It does not mean that Stardog evaluates SPARQL queries to “execute” rules.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.