Stardog rules and named graphs

In Stardog rules, can you match rules based on and create triples in a specific graph?
The graph can be accessed from SPARQL, but the syntax for doing so from rules (wither SWRL or Stardog rules) is not obvious, if it is possible.

Why? In many cases the graph represents the context of the contained assertions. This context can be important for validating the rules. One application would be processing trust of a particular graph.

If I understand your question correctly there is no way to have have axioms or rules apply to only a specific graph. The question seems to have come up fairly often. Your axioms and rules apply to the entire database. This is the case regardless of any attempt to apply access control even in the case of names graph access control. The only way that I have been able to think of to attempt to do what people have been asking for is to have separate databases with different schemes and to use service queries to query a shared database.

Thanks Zachary,
What I would like to do is reference the quad as part of the match expression, these will represent context and are not appropriate for separate databases. Unfortunate, I will look elsewhere. Thanks for the prompt and succinct reply.

Can you give an example, possibly in some pseudo syntax, to illustrate what you’re trying to do? You cannot write a rule which’d entail triples to a particular named graph, as Zach said. Rules are abstract in the sense that the application defines which dataset they apply to and what to do with the results. Nor can you apply different rules depending on the named graph. But you can write a query s.t. (all) rules will be applied to a particular graph(s) only.

Cheers,
Pavel

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