Inferences Panel
The Inferences Panel lets you run SHACL rules (and, for the time being, SPIN rules). It will display all triples generated by the rules using a table with 3 columns: subject, predicate and object, or using Turtle source code.
Note
Rules defined using sh:values and sh:defaultValue are evaluated dynamically and will NOT be shown or executed by the panel.
Toolbar Buttons
Run inference rules: Executes all rules at least once.
In-memory/Persistent: Use this to switch between two modes for how inferred triples are stored. The default in-memory mode displays the inferences only in the table, where you can optionally assert them. In persistent mode, the inferences will be added to a dedicated subgraph that is automatically managed by the system whenever the inferences are run. In this mode, the inferred triples will be directly visible in the user interface and to queries. Also, a button will show up where you can clear all inferred triples from the inferences graph.
Assert all inferred triples: This button is enabled only in in-memory mode, after you execute rules that generate statements to display in the panel. Clicking on this button will write the inferred statements into the asset collection. Until you take this action, generated statements are not stored permanently. You may want to undo this from the Change History Panel before re-running the rules again. While you are experimenting, you could also assert them into a Workflow only.
Show/Select inference rules: This button opens a dialog that displays all available rules and lets you activate and deactivate them individually.
Settings
Execute all rules iteratively will repeatedly execute all rules until no further inferences were made. By default, the rules will only execute once. Active this if you have rules that depend on the output of other rules. Iterating is standard behavior in SHACL 1.2 but the option is off by default for backwards compatibility.
Include OWL RL rules will automatically also include the rules defined in the SHACL-based OWL RL rules library bundled with the product. You can find these rules in the file
/TopBraid/SHACL/showlrl.ttlbut you can add your own locally defined rules. This will execute all rules iteratively until no further inferences have been made. Furthermore, this will execute post-processing rules (from the file/TopBraid/SHACL/inferencepostprocessor.ttl) that will, among others, remove trivial OWL inferences such as?s owl:sameAs ?striples.Infer sh:shape or rdf:type based on sh:targetNode and sh:targetWhere will evaluate complex targets based on shape matching (
sh:targetWhere) or node expressions (sh:targetNode) and infer the resulting nodes to be linked to the shape that has the target. The inference will usesh:shapeby default, but may berdf:typeif the shape is also a class.Also materialize the derived triples based on sh:defaultValue/sh:values will additionally execute and display the triples that would normally be evaluated dynamically and are otherwise excluded from this panel, as noted above.
Record rule execution profiling information will, after the rules have finished executing, open a dialog showing the accumulated execution time, number of calls and number of inferred triples for each rule and shape, to help identify performance bottlenecks.
Record the rule that has inferred each triple will add an extra “source rule” column to the inferences table, showing which SHACL (or OWL RL) rule produced each triple. In this mode the inference engine will produce up to 3 times as many triples and the source code will include RDF 1.2 reifiers with
sh:sourceRuletriples. Note that these are only generated for rules that have a URI.Display inferences in Turtle show the Turtle source code of the inferred triples instead of the table.
Display IDs instead of labels toggles between human-readable labels and qnames.
Further Reading on TQ Data Foundation