Why does a fact hold?
In the SPARQL tab, the result of a query whose WHERE is only triple patterns gets a Why? button on each row. It opens a panel next to the table that shows one proof of each fact of the row: the stored facts and the rules the reasoner used to reach it.
Where the button appears
Every row gets a Why? button when the query’s WHERE is a plain conjunction of triple patterns, whatever the variable names and however many there are, and the selected variables are exactly the variables of the patterns (SELECT * is fine). DISTINCT, ORDER BY, LIMIT and OFFSET are allowed. The simplest case:
SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 100
A query with several patterns works too:
SELECT ?who ?friend ?age WHERE { ?who ex:knows ?friend . ?friend ex:age ?age }
The row’s facts are the query’s patterns with the row’s values put in place of the variables. Here each row has two facts, who ex:knows friend and friend ex:age age. The panel shows one proof per fact, one under the other, each with its own Next proof. A query with one pattern shows one proof, as before.
There is no Why? column for a query with FILTER, OPTIONAL, UNION, MINUS, VALUES, BIND or (… AS ?x), a property path (ex:p/ex:q, ex:p*), a sub-query, GRAPH, SERVICE, FROM, GROUP BY or an aggregate, a blank node ([], _:b) in a pattern, a pattern variable that is not selected, or a selected variable that appears in no pattern (?x in SELECT ?s ?p ?o ?x WHERE { ?s ?p ?o }). The column names do not matter: ?s ?p ?o with a FILTER has no button, and ?Subject is not ?subject. A row with an unbound or blank-node value has no button. The public viewer of a public project has no Why? buttons.
In the Instances tab, click a circle (without dragging it) to pin its card. A pinned card lists the instance’s literal values and its outgoing links (property → target), each with a Why? button. Close it with ✕ or Esc. Long values that the card shortens, values shown with a unit (50 g), blank nodes and links to a blank node have no button. While a card is pinned it covers part of the graph: close it to reach the circles under it. The pin is also dropped when the graph is redrawn (new data, a refresh, a change of focus or of display options). The proof is computed on the live package. The SPARQL tab’s graph view has no pinned card and no Why? buttons: use the result table there.
The proof is computed on the data the result came from: the live package, or the deployment the query ran against. If you switch deployments and run again, the panel closes.
Reading the proof tree
Each line is one fact, with short IRIs. Hover a line to see the full IRIs. The fact you asked about is the top line. Under it are the facts it was proved from, and so on down to stored facts. The first two levels start open. Click a line, or its ▸ / ▾ arrow, to open or close it.
Each line has a chip that says why the fact holds:
| Chip | Meaning |
|---|---|
| file | A hand-written fact. In a deployment it reads “hand-written (snapshot)”. |
| mapping | A row of a mapped data file. Click the chip to open the file. |
| data | Data written at runtime through the data API. |
| source | A stored fact whose origin is not known: the live package, or a graph the deployment does not label. The tooltip names the graph. |
| rule | Derived by a rule. The rule’s name follows the fact. Click it to jump to the rule in the editor. Built-in RDFS and OWL rules (rdfs9, …) have no link. |
| closure | A subClassOf, subPropertyOf, sameAs or inverseOf chain, or a property path. Every step of the chain is its own line. |
| builtin | A built-in check or computation, such as a comparison. Its outcome follows it. |
| not | A negation (none / all) that held. |
| aggregate | A sum, count, min, max or average, with the values it used. |
A rule line also lists the variable bindings the rule used, such as ?x = alice. A rule that reads the current time (now()), directly or through a rule it uses, shows [clock] after its name: its conclusions can change as time passes.
A very deep or very large proof is cut. A cut line ends with ….
Other proofs
A fact can often be proved in more than one way. The panel shows Proof 1 first, which is the shortest one. Next proof shows the next one. When there are no others, the panel says No more proofs and gives how many there were.
When the reasoner finds no proof at all, the panel shows the Why not? tree instead.
Clicking Why? on another row shows that row’s first proofs.
Why not?
The Why not? tree explains a fact that is not derivable from current data and rules: where every way of deriving it stops. It never says the fact is false: only that the current data and rules do not produce it.
Asking
- Why? on a fact with no proof shows its why-not tree.
- Why not…? above the SPARQL results opens a small form. Type the subject, predicate and object (full IRIs, bare or in
<…>, or prefixed names such asex:Thingor:Thingusing the Turtle tab’s prefixes and the well-knownrdf:,rdfs:,owl:,xsd:,skos:;<ex:Thing>stays literal; a literal object in double quotes, matched by its text, never expanded) and press Ask. On a public project page only the well-known prefixes are read. A derivable fact shows its proof; an invalid term shows an error naming its position and quoting the term as typed (for exampleInvalid subject `not an iri`: …).
Reading the tree
Only the top line is open. Each line you open is computed when you open it, so a large or circular tree stays fast; a line shows Loading… meanwhile, and an error with Retry if it fails. Failed lines carry ✗, conditions that held carry ✓ (screen readers read “failed” / “succeeded”).
| Line | Meaning |
|---|---|
| goal | A fact or sub-goal to derive. Under it: the stored facts, then one line per rule that could conclude it. |
| no stored fact | No stored fact matches. Its near misses follow (see below). |
| no rule | No rule concludes this predicate: it only comes from data. |
| rule failed | The rule’s conditions have no solution. Conditions that held show ✓, the one where every attempt stopped shows ✗ and is highlighted. Click the rule name to open it in the editor. |
| group | Attempts that stopped at the same condition, with the values tried. +k more opens the full list (at most 200 lines are shown). |
| N rules not applicable | Rules whose conclusion cannot match this fact (a different constant). Closed by default; open it to list them. |
| builtin false | A check that does not hold, with its values (15 > 18). |
| negation blocked | A none condition failed because the formula has a solution; its proof is shown under it. |
| aggregate | A count, sum… whose value does not meet the requirement, or an empty set. |
| circular | The goal only depends on itself: there is no base case. |
| closure | A subClassOf, subPropertyOf, sameAs or type chain that never reaches the target. |
| untestable | In all-failing mode: a condition that needs values only other conditions bind, so it cannot be tested alone. |
Rules are described in the language docs.
All failing conditions
By default a rule line blames the condition where the reasoner stopped. Show all failing conditions tests each condition alone instead, and marks every one that fails (the button stays pressed). Switching it on or off closes the switches below that rule.
Near misses
Under no stored fact, the near misses are stored facts that share two of the three positions with the one you asked about: they often reveal a typo in an IRI or a value. Each has its origin chip; click the fact to see its own Why? proof. This replaces the whole panel with that one fact, even when it showed several facts of a row.
Errors and staleness
An engine error (such as rules that never reach a fixpoint) shows as an error, not as “not derivable”. The tree is recomputed on every opened line: after editing the project, ask again.
Keyboard
Both trees follow the same keys as the file tree:
| Key | Action |
|---|---|
| ↑ / ↓ | Previous / next line |
| Home / End | First / last line |
| → | Open a closed line, or go to its first child |
| ← | Close an open line, or go to its parent |
| Enter / Space | Open or close the line |
| Esc | Close the panel |
Limits
- Hand-written facts name no file. A deployment stores all hand-written facts together, so a deployment’s file chip cannot tell which
.dlfa fact came from, and it does not open anything. - Live origins are not known. On the live package, every stored fact shows the source chip (“graph default”).
- Rule links follow the current sources. On an older deployment, a rule that has since been renamed or removed cannot be opened. A message says “Rule not found in the current sources”.
- At most 201 proofs of one fact can be listed.