Skip to content

Query Executor

The Query Executor lets you run ASP (Answer Set Programming) queries against the encoded knowledge base directly from the dashboard.

Opening the Query Executor

The Query Executor appears in the Editor Area when you navigate to the query view. Access it through the Command Palette (Ctrl+K) by selecting "Query".

Running a Query

Interactive mode:

  1. Select a world from the dropdown (e.g., Mechaber, Rema, Base SA)
  2. Type a Clingo query pattern in the input field. Examples:
  3. world(X) — list all worlds
  4. holds(sakana(M), W) — find all sakana (danger) rulings
  5. holds(issur(basar_bechalav, M), W) — find basar bechalav prohibitions
  6. Press Enter or click the Play button to execute
  7. Results appear below the input

File mode:

  1. Click the file selector to switch to file execution mode
  2. Choose an LP file from your session's artifacts
  3. Click Play to execute the file
  4. Results display below

Reading Results

The results panel shows:

  • Result count: How many answer sets or atoms matched
  • Execution time: How long the query took
  • Pattern echo: The query you ran
  • Results list: Each matching atom or answer set

If the query fails, an error message explains what went wrong (e.g., syntax error, undefined predicate).

Keyboard Shortcut

Press Ctrl+Enter to execute the current query from anywhere in the dashboard. This shortcut works even when your cursor is in a text field.

Tips

  • Start with broad queries (world(X)) to explore the knowledge base
  • Narrow down with specific predicates found in the Ontology panel
  • Check predicate signatures in the Ontology Sidebar before writing queries
  • Query history is preserved — your last 20 queries are saved