bdi-mental-states skill (Agent-Skills-for-Context-Engineering)

From Public Agent Wiki
Contents
  1. Install
  2. SKILL.md (verbatim)
  3. When to Activate
  4. Core Concepts
  5. Mental Reality Architecture
  6. Cognitive Chain Pattern
  7. World State Grounding
  8. Goal-Directed Planning
  9. T2B2T Paradigm
  10. Notation Selection by Level
  11. Justification and Explainability
  12. Temporal Dimensions
  13. Compositional Mental Entities
  14. Practical Guidance
  15. Build a BDI Model in Six Passes
  16. Keep the Ontology Small
  17. Use BDI Only When Mental-State Semantics Matter
  18. Detailed Topics
  19. Integration Patterns
  20. Logic Augmented Generation (LAG)
  21. SEMAS Rule Translation
  22. Guidelines
  23. Competency Questions
  24. Examples
  25. Gotchas
  26. Integration
  27. References
  28. Skill Metadata
  29. Other files in this skill
  30. references/bdi-ontology-core.md (verbatim)
  31. Class Hierarchy
  32. Mental Entities (Endurants)
  33. Mental Processes (Perdurants)
  34. Supporting Entities
  35. Object Properties
  36. Motivational Relations
  37. Generative Relations
  38. Referential Relations
  39. Structural Relations
  40. Temporal Relations
  41. Justification Relations
  42. Ontological Restrictions
  43. Belief Restrictions
  44. Desire Restrictions
  45. Intention Restrictions
  46. Mental Process Restrictions
  47. DOLCE Alignment
  48. Reused Ontology Design Patterns
  49. EventCore Pattern
  50. Situation Pattern
  51. TimeIndexedSituation Pattern
  52. BasicPlan Pattern
  53. Provenance Pattern
  54. Namespace Declarations
  55. references/rdf-examples.md (verbatim)
  56. Complete Cognitive Workflow
  57. Multi-Agent Coordination Example
  58. Conflict Resolution Example
  59. T2B2T Payment Processing Example
  60. references/sparql-competency.md (verbatim)
  61. Mental Entity Queries
  62. CQ1: What are all mental entities?
  63. CQ2: What beliefs does an agent hold?
  64. CQ3: What desires does an agent have?
  65. CQ4: What intentions has an agent committed to?
  66. Motivational Chain Queries
  67. CQ5: What beliefs motivated formation of a given desire?
  68. CQ6: Which desire does a particular intention fulfill?
  69. CQ7: What beliefs support a given intention?
  70. CQ8: Trace complete cognitive chain for an intention
  71. Mental Process Queries
  72. CQ9: Which mental process generated a belief?
  73. CQ10: What triggered a mental process?
  74. CQ11: What did a mental process reason upon?
  75. Plan and Goal Queries
  76. CQ12: What plan does an intention specify?
  77. CQ13: What is the ordered sequence of tasks in a plan?
  78. CQ14: What is the first and last task of a plan?
  79. CQ15: Which actions executed which tasks?
  80. Temporal Queries
  81. CQ16: What mental states are valid at a specific time?
  82. CQ17: When was a belief formed?
  83. CQ18: What is the temporal validity of an intention?
  84. Justification Queries
  85. CQ19: What justifies a belief?
  86. CQ20: What justifies an intention?
  87. Compositional Queries
  88. CQ21: What parts comprise a complex belief?
  89. CQ22: Find composite mental entities
  90. World State Queries
  91. CQ23: What world state does a belief refer to?
  92. CQ24: What actions brought about a world state?
  93. CQ25: What world states has an agent perceived?
  94. Validation Queries (OWLUnit Style)
  95. V1: Every intention must fulfill exactly one desire
  96. V2: Every belief must reference a world state
  97. V3: Mental processes must reason upon something
  98. V4: BeliefProcess must generate only Beliefs
  99. V5: Plans must have begin and end tasks
  100. Multi-Agent Queries
  101. CQ26: What beliefs are shared across agents?
  102. CQ27: Which agents share the same desire?

What it does. This skill should be used when modeling agent mental states with BDI concepts: beliefs, desires, intentions, RDF-to-belief transformations, rational agency traces, cognitive agents, BDI ontologies, and neuro-symbolic AI integration. Part of muratcankoylan/Agent-Skills-for-Context-Engineering (muratcankoylan/Agent-Skills-for-Context-Engineering).

Upstream muratcankoylan/Agent-Skills-for-Context-Engineering
Skill file skills/bdi-mental-states/SKILL.md
License MIT
Author Muratcan Koylan
Fetched 2026-09-10

Install

  • npx skills add muratcankoylan/Agent-Skills-for-Context-Engineering --skill bdi-mental-states, or copy the skill folder into ~/.claude/skills/bdi-mental-states/.
  • Raw file: curl -sL https://raw.githubusercontent.com/muratcankoylan/Agent-Skills-for-Context-Engineering/HEAD/skills/bdi-mental-states/SKILL.md

SKILL.md (verbatim)

name: bdi-mental-states
description: "This skill should be used when modeling agent mental states with BDI concepts: beliefs, desires, intentions, RDF-to-belief transformations, rational agency traces, cognitive agents, BDI ontologies, and neuro-symbolic AI integration."

BDI Mental State Modeling

Transform external RDF context into agent mental states (beliefs, desires, intentions) using formal BDI ontology patterns. This skill enables agents to reason about context through cognitive architecture, supporting deliberative reasoning, explainability, and semantic interoperability within multi-agent systems.

When to Activate

Activate this skill when:

  • Processing external RDF context into agent beliefs about world states
  • Modeling rational agency with perception, deliberation, and action cycles
  • Enabling explainability through traceable reasoning chains
  • Implementing BDI frameworks (SEMAS, JADE, JADEX)
  • Augmenting LLMs with formal cognitive structures (Logic Augmented Generation)
  • Coordinating mental states across multi-agent platforms
  • Tracking temporal evolution of beliefs, desires, and intentions
  • Linking motivational states to action plans

Do not activate this skill for adjacent work owned by other skills:

  • General context-window explanations or attention mechanics: context-fundamentals.
  • Persistent user, entity, or conversation memory without formal BDI state: memory-systems.
  • Supervisor, swarm, or handoff topology decisions: multi-agent-patterns.
  • General agent evaluation rubrics or quality gates: evaluation.

Core Concepts

Mental Reality Architecture

Separate mental states into two ontological categories because BDI reasoning requires distinguishing what persists from what happens:

Mental States (Endurants) -- model these as persistent cognitive attributes that hold over time intervals:

  • Belief: Represent what the agent holds true about the world. Ground every belief in a world state reference.
  • Desire: Represent what the agent wishes to bring about. Link each desire back to the beliefs that motivate it.
  • Intention: Represent what the agent commits to achieving. An intention must fulfil a desire and specify a plan.

Mental Processes (Perdurants) -- model these as events that create or modify mental states, because tracking causal transitions enables explainability:

  • BeliefProcess: Triggers belief formation/update from perception. Always connect to a generating world state.
  • DesireProcess: Generates desires from existing beliefs. Preserves the motivational chain.
  • IntentionProcess: Commits to selected desires as actionable intentions.

Cognitive Chain Pattern

Wire beliefs, desires, and intentions into directed chains using bidirectional properties (motivates/isMotivatedBy, fulfils/isFulfilledBy) because this enables both forward reasoning (what should the agent do?) and backward tracing (why did the agent act?):

:Belief_store_open a bdi:Belief ;
    rdfs:comment "Store is open" ;
    bdi:motivates :Desire_buy_groceries .

:Desire_buy_groceries a bdi:Desire ;
    rdfs:comment "I desire to buy groceries" ;
    bdi:isMotivatedBy :Belief_store_open .

:Intention_go_shopping a bdi:Intention ;
    rdfs:comment "I will buy groceries" ;
    bdi:fulfils :Desire_buy_groceries ;
    bdi:isSupportedBy :Belief_store_open ;
    bdi:specifies :Plan_shopping .

World State Grounding

Always ground mental states in world state references rather than free-text descriptions, because ungrounded beliefs break semantic querying and cross-agent interoperability:

:Agent_A a bdi:Agent ;
    bdi:perceives :WorldState_WS1 ;
    bdi:hasMentalState :Belief_B1 .

:WorldState_WS1 a bdi:WorldState ;
    rdfs:comment "Meeting scheduled at 10am in Room 5" ;
    bdi:atTime :TimeInstant_10am .

:Belief_B1 a bdi:Belief ;
    bdi:refersTo :WorldState_WS1 .

Goal-Directed Planning

Connect intentions to plans via bdi:specifies, and decompose plans into ordered task sequences using bdi:precedes, because this separation allows plan reuse across different intentions while keeping execution order explicit:

:Intention_I1 bdi:specifies :Plan_P1 .

:Plan_P1 a bdi:Plan ;
    bdi:addresses :Goal_G1 ;
    bdi:beginsWith :Task_T1 ;
    bdi:endsWith :Task_T3 .

:Task_T1 bdi:precedes :Task_T2 .
:Task_T2 bdi:precedes :Task_T3 .

T2B2T Paradigm

Implement Triples-to-Beliefs-to-Triples as a bidirectional pipeline because agents must both consume external RDF context and produce new RDF assertions. Structure every T2B2T implementation in two explicit phases:

Phase 1: Triples-to-Beliefs -- Translate incoming RDF triples into belief instances. Use bdi:triggers to connect the external world state to a BeliefProcess, and bdi:generates to produce the resulting belief. This preserves provenance from source data through to internal cognition:

:WorldState_notification a bdi:WorldState ;
    rdfs:comment "Push notification: Payment request $250" ;
    bdi:triggers :BeliefProcess_BP1 .

:BeliefProcess_BP1 a bdi:BeliefProcess ;
    bdi:generates :Belief_payment_request .

Phase 2: Beliefs-to-Triples -- After BDI deliberation selects an intention and executes a plan, project the results back into RDF using bdi:bringsAbout. This closes the loop so downstream systems can consume agent outputs as standard linked data:

:Intention_pay a bdi:Intention ;
    bdi:specifies :Plan_payment .

:PlanExecution_PE1 a bdi:PlanExecution ;
    bdi:satisfies :Plan_payment ;
    bdi:bringsAbout :WorldState_payment_complete .

Notation Selection by Level

Choose notation based on the C4 abstraction level being modeled, because mixing notations at the wrong level obscures rather than clarifies the cognitive architecture:

C4 Level Notation Mental State Representation
L1 Context ArchiMate Agent boundaries, external perception sources
L2 Container ArchiMate BDI reasoning engine, belief store, plan executor
L3 Component UML Mental state managers, process handlers
L4 Code UML/RDF Belief/Desire/Intention classes, ontology instances

Justification and Explainability

Attach bdi:Justification instances to every mental entity using bdi:isJustifiedBy, because unjustified mental states make agent reasoning opaque and untraceable. Each justification should capture the evidence or rule that produced the mental state:

:Belief_B1 a bdi:Belief ;
    bdi:isJustifiedBy :Justification_J1 .

:Justification_J1 a bdi:Justification ;
    rdfs:comment "Official announcement received via email" .

:Intention_I1 a bdi:Intention ;
    bdi:isJustifiedBy :Justification_J2 .

:Justification_J2 a bdi:Justification ;
    rdfs:comment "Location precondition satisfied" .

Temporal Dimensions

Assign validity intervals to every mental state using bdi:hasValidity with TimeInterval instances, because beliefs without temporal bounds cannot be garbage-collected or conflict-checked during diachronic reasoning:

:Belief_B1 a bdi:Belief ;
    bdi:hasValidity :TimeInterval_TI1 .

:TimeInterval_TI1 a bdi:TimeInterval ;
    bdi:hasStartTime :TimeInstant_9am ;
    bdi:hasEndTime :TimeInstant_11am .

Query mental states active at a specific moment using SPARQL temporal filters. Use this pattern to resolve conflicts when multiple beliefs about the same world state overlap in time:

SELECT ?mentalState WHERE {
    ?mentalState bdi:hasValidity ?interval .
    ?interval bdi:hasStartTime ?start ;
              bdi:hasEndTime ?end .
    FILTER(?start <= "2025-01-04T10:00:00"^^xsd:dateTime &&
           ?end >= "2025-01-04T10:00:00"^^xsd:dateTime)
}

Compositional Mental Entities

Decompose complex beliefs into constituent parts using bdi:hasPart relations, because monolithic beliefs force full replacement on partial updates. Structure composite beliefs so that each sub-belief can be independently updated, queried, or invalidated:

:Belief_meeting a bdi:Belief ;
    rdfs:comment "Meeting at 10am in Room 5" ;
    bdi:hasPart :Belief_meeting_time , :Belief_meeting_location .

# Update only location component without touching time
:BeliefProcess_update a bdi:BeliefProcess ;
    bdi:modifies :Belief_meeting_location .

Practical Guidance

Build a BDI Model in Six Passes

Use this workflow when converting external semantic context into a BDI representation:

  1. Define the world-state substrate: Identify the external facts or events the agent can perceive. Model these as world states before creating beliefs.
  2. Create belief instances: Translate each relevant world state into a belief with provenance, temporal validity, and a justification reference.
  3. Derive desires from beliefs: Add desires only when a belief creates a goal-relevant motivation. Link each desire to the belief that motivates it.
  4. Commit intentions deliberately: Promote a desire to an intention only when the agent commits to a plan. Record the selected plan and preconditions.
  5. Project action results back to triples: After execution, emit resulting world states as RDF so downstream systems can consume the new state.
  6. Validate with competency questions: Query for provenance, motivation, plan sequence, and active validity windows before trusting the model.

Keep the Ontology Small

Start with Agent, WorldState, Belief, Desire, Intention, Plan, Task, Justification, and TimeInterval. Add specialized classes only after competency questions prove the core model cannot answer required queries. A compact ontology is easier to serialize into prompts, easier to validate, and less likely to create brittle reasoning chains.

Use BDI Only When Mental-State Semantics Matter

BDI modeling is justified when the system needs explainable agency: why an agent believed something, what desire that belief created, which intention was selected, and what plan executed. If the system only needs to remember facts across sessions, use memory-systems. If it only needs to split work across agents, use multi-agent-patterns.

Detailed Topics

Integration Patterns

Logic Augmented Generation (LAG)

Use LAG to constrain LLM outputs with ontological structure, because unconstrained generation produces triples that violate BDI class restrictions. Serialize the ontology into the prompt context, then validate generated triples against it before accepting them:

def augment_llm_with_bdi_ontology(prompt, ontology_graph):
    ontology_context = serialize_ontology(ontology_graph, format='turtle')
    augmented_prompt = f"{ontology_context}\n\n{prompt}"

    response = llm.generate(augmented_prompt)
    triples = extract_rdf_triples(response)

    is_consistent = validate_triples(triples, ontology_graph)
    return triples if is_consistent else retry_with_feedback()

SEMAS Rule Translation

Translate BDI ontology patterns into executable production rules when deploying to rule-based agent platforms. Map each cognitive chain link (belief-to-desire, desire-to-intention) to a HEAD/CONDITIONALS/TAIL rule, because this preserves the deliberative semantics while enabling runtime execution:

% Belief triggers desire formation
[HEAD: belief(agent_a, store_open)] /
[CONDITIONALS: time(weekday_afternoon)] »
[TAIL: generate_desire(agent_a, buy_groceries)].

% Desire triggers intention commitment
[HEAD: desire(agent_a, buy_groceries)] /
[CONDITIONALS: belief(agent_a, has_shopping_list)] »
[TAIL: commit_intention(agent_a, buy_groceries)].

Guidelines

  1. Model world states as configurations independent of agent perspectives, providing referential substrate for mental states.

  2. Distinguish endurants (persistent mental states) from perdurants (temporal mental processes), aligning with DOLCE ontology.

  3. Treat goals as descriptions rather than mental states, maintaining separation between cognitive and planning layers.

  4. Use hasPart relations for meronymic structures enabling selective belief updates.

  5. Associate every mental entity with temporal constructs via atTime or hasValidity.

  6. Use bidirectional property pairs (motivates/isMotivatedBy, generates/isGeneratedBy) for flexible querying.

  7. Link mental entities to Justification instances for explainability and trust.

  8. Implement T2B2T through: (1) translate RDF to beliefs, (2) execute BDI reasoning, (3) project mental states back to RDF.

  9. Define existential restrictions on mental processes (e.g., BeliefProcess ⊑ ∃generates.Belief).

  10. Reuse established ODPs (EventCore, Situation, TimeIndexedSituation, BasicPlan, Provenance) for interoperability.

Competency Questions

Validate implementation against these SPARQL queries:

# CQ1: What beliefs motivated formation of a given desire?
SELECT ?belief WHERE {
    :Desire_D1 bdi:isMotivatedBy ?belief .
}

# CQ2: Which desire does a particular intention fulfill?
SELECT ?desire WHERE {
    :Intention_I1 bdi:fulfils ?desire .
}

# CQ3: Which mental process generated a belief?
SELECT ?process WHERE {
    ?process bdi:generates :Belief_B1 .
}

# CQ4: What is the ordered sequence of tasks in a plan?
SELECT ?task ?nextTask WHERE {
    :Plan_P1 bdi:hasComponent ?task .
    OPTIONAL { ?task bdi:precedes ?nextTask }
} ORDER BY ?task

Examples

Example 1: RDF notification to BDI chain

Input world state:

:WorldState_invoice_due a bdi:WorldState ;
    rdfs:comment "Invoice INV-42 is due tomorrow" ;
    bdi:atTime :Time_2026_05_15 .

BDI projection:

:Belief_invoice_due a bdi:Belief ;
    bdi:refersTo :WorldState_invoice_due ;
    bdi:isJustifiedBy :Justification_billing_system ;
    bdi:motivates :Desire_avoid_late_fee .

:Desire_avoid_late_fee a bdi:Desire ;
    bdi:isMotivatedBy :Belief_invoice_due .

:Intention_pay_invoice a bdi:Intention ;
    bdi:fulfils :Desire_avoid_late_fee ;
    bdi:specifies :Plan_pay_invoice .

Example 2: Boundary decision

If the task is "remember that Alice prefers concise summaries," use memory-systems. If the task is "represent why the agent believes Alice needs a summary, what goal that creates, and which plan it commits to," use this skill.

Gotchas

  1. Conflating mental states with world states: Mental states reference world states via bdi:refersTo, they are not world states themselves. Mixing them collapses the perception-cognition boundary and breaks SPARQL queries that filter by type.

  2. Missing temporal bounds: Every mental state needs validity intervals for diachronic reasoning. Without them, stale beliefs persist indefinitely and conflict detection becomes impossible.

  3. Flat belief structures: Use compositional modeling with hasPart for complex beliefs. Monolithic beliefs force full replacement when only one attribute changes.

  4. Implicit justifications: Always link mental entities to explicit Justification instances. Unjustified mental states cannot be audited or traced.

  5. Direct intention-to-action mapping: Intentions specify plans which contain tasks; actions execute tasks. Skipping the plan layer removes the ability to reuse, reorder, or share execution strategies.

  6. Ontology over-complexity: Start with 5-10 core classes and properties (Belief, Desire, Intention, WorldState, Plan, plus key relations). Expanding the ontology prematurely inflates prompt context and slows SPARQL queries without improving reasoning quality.

  7. Reasoning cost explosion: Keep belief chains to 3 levels or fewer (belief -> desire -> intention). Deeper chains become prohibitively expensive for LLM inference and rarely improve decision quality over shallower alternatives.

Integration

This skill owns formal mental-state modeling. Adjacent skills own different layers:

  • memory-systems: persistent facts, entity memory, and temporal knowledge graphs without BDI belief/desire/intention semantics.
  • multi-agent-patterns: agent topology, handoff protocols, and coordination between agents.
  • evaluation: competency questions, regression checks, and quality gates for BDI implementations.
  • context-fundamentals: conceptual context-window and attention mechanics that inform prompt construction.
  • tool-design: schema and tool contracts for BDI query, validation, or projection tools.

References

Internal references:

  • BDI Ontology Core - Read when: implementing BDI class hierarchies or defining ontology properties from scratch
  • RDF Examples - Read when: writing Turtle serializations of mental states or debugging triple structure
  • SPARQL Competency Queries - Read when: validating an implementation against competency questions or building custom queries
  • Framework Integration - Read when: deploying BDI models to SEMAS, JADE, or LAG pipelines

Primary sources:

  • Zuppiroli et al. "The Belief-Desire-Intention Ontology" (2025) — Read when: implementing formal BDI class hierarchies or validating ontology alignment
  • Rao & Georgeff "BDI agents: From theory to practice" (1995) — Read when: understanding the theoretical foundations of practical reasoning agents
  • Bratman "Intention, plans, and practical reason" (1987) — Read when: grounding implementation decisions in the philosophical basis of intentionality

Skill Metadata

Created: 2026-01-07 Last Updated: 2026-05-15 Author: Agent Skills for Context Engineering Contributors Version: 2.1.0

Other files in this skill

references/bdi-ontology-core.md (verbatim)

BDI Ontology Core Patterns

Core ontology design patterns for Belief-Desire-Intention mental state modeling.

Class Hierarchy

Mental Entities (Endurants)

bdi:MentalEntity
├── bdi:Belief          # Informational dimension
├── bdi:Desire          # Motivational dimension  
├── bdi:Intention       # Deliberative dimension
├── bdi:Goal            # Description of desired end state
└── bdi:Plan            # Structured action sequence

Mental Processes (Perdurants)

bdi:MentalProcess
├── bdi:BeliefProcess      # Forms/updates beliefs from perception
├── bdi:DesireProcess      # Generates desires from beliefs
├── bdi:IntentionProcess   # Commits to desires as intentions
├── bdi:Planning           # Transforms intentions into plans
└── bdi:PlanExecution      # Executes plan actions

Supporting Entities

bdi:WorldState        # Configuration of environment
bdi:Justification     # Evidential basis for mental states
bdi:Task              # Atomic unit of planned action
bdi:Action            # Execution of a task
bdi:TimeInterval      # Temporal validity bounds
bdi:TimeInstant       # Point in time reference

Object Properties

Motivational Relations

Property Domain Range Description
motivates Belief Desire Belief provides reason for desire
isMotivatedBy Desire Belief Inverse of motivates
fulfils Intention Desire Intention commits to achieving desire
isFulfilledBy Desire Intention Inverse of fulfils
isSupportedBy Intention Belief Beliefs supporting intention viability

Generative Relations

Property Domain Range Description
generates MentalProcess MentalEntity Process creates mental state
isGeneratedBy MentalEntity MentalProcess Inverse of generates
modifies MentalProcess MentalEntity Process updates existing state
suppresses MentalProcess MentalEntity Process deactivates state
isTriggeredBy MentalProcess MentalEntity State initiates process

Referential Relations

Property Domain Range Description
refersTo MentalEntity WorldState Mental state about world
perceives Agent WorldState Agent observes world
bringsAbout Action WorldState Action causes world change
reasonsUpon MentalProcess MentalEntity Input to reasoning

Structural Relations

Property Domain Range Description
hasPart MentalEntity MentalEntity Meronymic composition
specifies Intention Plan Intention defines plan
addresses Plan Goal Plan achieves goal
hasComponent Plan Task Plan contains tasks
precedes Task Task Task ordering

Temporal Relations

Property Domain Range Description
atTime Entity TimeInstant Point occurrence
hasValidity MentalEntity TimeInterval Persistence bounds
hasStartTime TimeInterval TimeInstant Interval start
hasEndTime TimeInterval TimeInstant Interval end

Justification Relations

Property Domain Range Description
isJustifiedBy MentalEntity Justification Evidential support
justifies Justification MentalEntity Inverse relation

Ontological Restrictions

Belief Restrictions

bdi:Belief rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty bdi:refersTo ;
    owl:someValuesFrom bdi:WorldState
] .

bdi:Belief rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty bdi:hasValidity ;
    owl:maxCardinality 1
] .

Desire Restrictions

bdi:Desire rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty bdi:isMotivatedBy ;
    owl:someValuesFrom bdi:Belief
] .

Intention Restrictions

bdi:Intention rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty bdi:fulfils ;
    owl:cardinality 1
] .

bdi:Intention rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty bdi:isSupportedBy ;
    owl:someValuesFrom bdi:Belief
] .

Mental Process Restrictions

bdi:BeliefProcess rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty bdi:generates ;
    owl:allValuesFrom bdi:Belief
] .

bdi:DesireProcess rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty bdi:generates ;
    owl:allValuesFrom bdi:Desire
] .

bdi:IntentionProcess rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty bdi:generates ;
    owl:allValuesFrom bdi:Intention
] .

DOLCE Alignment

The BDI ontology aligns with DOLCE Ultra Lite (DUL) foundational ontology:

BDI Class DUL Superclass Rationale
Agent dul:Agent Intentional entity capable of action
Belief dul:InformationObject Information-bearing entity
Desire dul:Description Describes desired state
Intention dul:Description Describes committed course
Goal dul:Goal Desired end state description
Plan dul:Plan Organized action sequence
WorldState dul:Situation Configuration of entities
MentalProcess dul:Event Temporally extended occurrence
Task dul:Task Unit of planned work
Action dul:Action Performed task instance

Reused Ontology Design Patterns

EventCore Pattern

Used for mental processes with temporal aspects and participant roles.

Situation Pattern

Used for world state configurations that mental states reference.

TimeIndexedSituation Pattern

Used for associating mental states with validity intervals.

BasicPlan Pattern

Used for goal-plan-task structures linking intentions to actions.

Provenance Pattern

Used for justification tracking and evidential chains.

Namespace Declarations

@prefix bdi: <https://w3id.org/fossr/ontology/bdi/> .
@prefix dul: <http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

references/rdf-examples.md (verbatim)

BDI RDF Examples

Complete RDF/Turtle examples for BDI mental state modeling.

Complete Cognitive Workflow

@prefix bdi: <https://w3id.org/fossr/ontology/bdi/> .
@prefix ex: <http://example.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

# ============================================================
# PHASE 1: World State Perception
# ============================================================

ex:WorldState_traffic a bdi:WorldState ;
    rdfs:comment "Heavy traffic on Route 101" ;
    bdi:atTime "2026-01-04T08:30:00"^^xsd:dateTime ;
    bdi:isPerceivedBy ex:Agent_commuter ;
    bdi:triggers ex:BeliefProcess_assess_traffic .

# ============================================================
# PHASE 2: Belief Formation
# ============================================================

ex:BeliefProcess_assess_traffic a bdi:BeliefProcess ;
    bdi:generates ex:Belief_traffic_delay ;
    bdi:reasonsUpon ex:WorldState_traffic ;
    bdi:isProcessedBy ex:Agent_commuter ;
    bdi:atTime "2026-01-04T08:31:00"^^xsd:dateTime .

ex:Belief_traffic_delay a bdi:Belief ;
    rdfs:label "Traffic will cause 30-minute delay" ;
    bdi:refersTo ex:WorldState_traffic ;
    bdi:hasValidity ex:TimeInterval_morning_commute ;
    bdi:hasPart ex:Belief_route_congested , ex:Belief_delay_duration ;
    bdi:isJustifiedBy ex:Justification_traffic_report ;
    bdi:motivates ex:Desire_arrive_on_time .

ex:Belief_route_congested a bdi:Belief ;
    rdfs:comment "Route 101 is congested" .

ex:Belief_delay_duration a bdi:Belief ;
    rdfs:comment "Delay estimated at 30 minutes" .

ex:Justification_traffic_report a bdi:Justification ;
    rdfs:label "Real-time traffic data from navigation system" ;
    bdi:justifies ex:Belief_traffic_delay .

# ============================================================
# PHASE 3: Desire Formation
# ============================================================

ex:DesireProcess_plan_arrival a bdi:DesireProcess ;
    bdi:generates ex:Desire_arrive_on_time ;
    bdi:reasonsUpon ex:Belief_traffic_delay ;
    bdi:isProcessedBy ex:Agent_commuter .

ex:Desire_arrive_on_time a bdi:Desire ;
    rdfs:label "I desire to arrive at work on time" ;
    bdi:isMotivatedBy ex:Belief_traffic_delay ;
    bdi:refersTo ex:WorldState_on_time_arrival .

# ============================================================
# PHASE 4: Intention Commitment
# ============================================================

ex:IntentionProcess_commit_route a bdi:IntentionProcess ;
    bdi:generates ex:Intention_take_alternate_route ;
    bdi:reasonsUpon ex:Desire_arrive_on_time ;
    bdi:isProcessedBy ex:Agent_commuter .

ex:Intention_take_alternate_route a bdi:Intention ;
    rdfs:label "I will take alternate route via Highway 280" ;
    bdi:fulfils ex:Desire_arrive_on_time ;
    bdi:isSupportedBy ex:Belief_traffic_delay ;
    bdi:specifies ex:Plan_alternate_commute ;
    bdi:isJustifiedBy ex:Justification_time_optimization .

ex:Justification_time_optimization a bdi:Justification ;
    rdfs:label "Alternate route saves 20 minutes based on current conditions" ;
    bdi:justifies ex:Intention_take_alternate_route .

# ============================================================
# PHASE 5: Planning
# ============================================================

ex:Planning_route_selection a bdi:Planning ;
    bdi:reasonsUpon ex:Intention_take_alternate_route ;
    bdi:defines ex:Plan_alternate_commute ;
    bdi:atTime ex:TimeInterval_planning_phase .

ex:Plan_alternate_commute a bdi:Plan ;
    rdfs:label "Alternate commute via Highway 280" ;
    bdi:addresses ex:Goal_arrive_by_9am ;
    bdi:beginsWith ex:Task_exit_Route101 ;
    bdi:endsWith ex:Task_arrive_parking ;
    bdi:hasComponent ex:Task_exit_Route101 , ex:Task_merge_280 , 
                     ex:Task_navigate_280 , ex:Task_arrive_parking .

ex:Task_exit_Route101 a bdi:Task ;
    rdfs:label "Exit Route 101 at Whipple Ave" ;
    bdi:precedes ex:Task_merge_280 .

ex:Task_merge_280 a bdi:Task ;
    rdfs:label "Merge onto Highway 280 North" ;
    bdi:precedes ex:Task_navigate_280 .

ex:Task_navigate_280 a bdi:Task ;
    rdfs:label "Continue on Highway 280 for 8 miles" ;
    bdi:precedes ex:Task_arrive_parking .

ex:Task_arrive_parking a bdi:Task ;
    rdfs:label "Arrive at office parking garage" .

ex:Goal_arrive_by_9am a bdi:Goal ;
    rdfs:label "Arrive at work by 9:00 AM" .

# ============================================================
# PHASE 6: Plan Execution
# ============================================================

ex:PlanExecution_commute a bdi:PlanExecution ;
    bdi:satisfies ex:Plan_alternate_commute ;
    bdi:addresses ex:Goal_arrive_by_9am ;
    bdi:isExecutedBy ex:Agent_commuter ;
    bdi:hasComponent ex:Action_exit , ex:Action_merge , 
                     ex:Action_drive_280 , ex:Action_park ;
    bdi:atTime ex:TimeInterval_execution ;
    bdi:bringsAbout ex:WorldState_arrived_on_time .

ex:Action_exit a bdi:Action ;
    bdi:isExecutionOf ex:Task_exit_Route101 ;
    bdi:isPerformedBy ex:Agent_commuter ;
    bdi:atTime "2026-01-04T08:35:00"^^xsd:dateTime .

ex:Action_merge a bdi:Action ;
    bdi:isExecutionOf ex:Task_merge_280 ;
    bdi:isPerformedBy ex:Agent_commuter ;
    bdi:atTime "2026-01-04T08:37:00"^^xsd:dateTime .

ex:Action_drive_280 a bdi:Action ;
    bdi:isExecutionOf ex:Task_navigate_280 ;
    bdi:isPerformedBy ex:Agent_commuter ;
    bdi:atTime "2026-01-04T08:40:00"^^xsd:dateTime .

ex:Action_park a bdi:Action ;
    bdi:isExecutionOf ex:Task_arrive_parking ;
    bdi:isPerformedBy ex:Agent_commuter ;
    bdi:bringsAbout ex:WorldState_arrived_on_time ;
    bdi:atTime "2026-01-04T08:52:00"^^xsd:dateTime .

# ============================================================
# PHASE 7: Resulting World State
# ============================================================

ex:WorldState_arrived_on_time a bdi:WorldState ;
    rdfs:comment "Agent arrived at work at 8:52 AM" ;
    bdi:atTime "2026-01-04T08:52:00"^^xsd:dateTime .

# ============================================================
# TEMPORAL INTERVALS
# ============================================================

ex:TimeInterval_morning_commute a bdi:TimeInterval ;
    bdi:hasStartTime "2026-01-04T08:30:00"^^xsd:dateTime ;
    bdi:hasEndTime "2026-01-04T09:00:00"^^xsd:dateTime .

ex:TimeInterval_planning_phase a bdi:TimeInterval ;
    bdi:hasStartTime "2026-01-04T08:31:00"^^xsd:dateTime ;
    bdi:hasEndTime "2026-01-04T08:34:00"^^xsd:dateTime .

ex:TimeInterval_execution a bdi:TimeInterval ;
    bdi:hasStartTime "2026-01-04T08:35:00"^^xsd:dateTime ;
    bdi:hasEndTime "2026-01-04T08:52:00"^^xsd:dateTime .

Multi-Agent Coordination Example

@prefix bdi: <https://w3id.org/fossr/ontology/bdi/> .
@prefix ex: <http://example.org/> .
@prefix fipa: <http://www.fipa.org/specs/fipa00061/> .

# Shared belief about project deadline
ex:Agent_developer a bdi:Agent ;
    bdi:hasMentalState ex:Belief_deadline_friday .

ex:Agent_manager a bdi:Agent ;
    bdi:hasMentalState ex:Belief_deadline_friday .

ex:Belief_deadline_friday a bdi:Belief ;
    rdfs:label "Project deadline is Friday 5 PM" ;
    bdi:refersTo ex:WorldState_deadline ;
    bdi:hasValidity ex:TimeInterval_project_week .

ex:WorldState_deadline a bdi:WorldState ;
    rdfs:comment "Project XYZ must be delivered by 2026-01-10T17:00:00" .

# Agent-specific mental states
ex:Agent_developer 
    bdi:hasDesire ex:Desire_complete_coding ;
    bdi:hasIntention ex:Intention_implement_features .

ex:Desire_complete_coding a bdi:Desire ;
    rdfs:label "Complete feature implementation" ;
    bdi:isMotivatedBy ex:Belief_deadline_friday .

ex:Intention_implement_features a bdi:Intention ;
    rdfs:label "Implement features A, B, and C" ;
    bdi:fulfils ex:Desire_complete_coding ;
    bdi:specifies ex:Plan_development .

ex:Agent_manager 
    bdi:hasDesire ex:Desire_ensure_delivery ;
    bdi:hasIntention ex:Intention_coordinate_team .

ex:Desire_ensure_delivery a bdi:Desire ;
    rdfs:label "Ensure on-time project delivery" ;
    bdi:isMotivatedBy ex:Belief_deadline_friday .

ex:Intention_coordinate_team a bdi:Intention ;
    rdfs:label "Coordinate team activities" ;
    bdi:fulfils ex:Desire_ensure_delivery ;
    bdi:specifies ex:Plan_project_management .

# FIPA communication
ex:Message_M1 a fipa:ACLMessage ;
    fipa:sender ex:Agent_manager ;
    fipa:receiver ex:Agent_developer ;
    fipa:content ex:Belief_deadline_friday ;
    fipa:performative fipa:inform .

Conflict Resolution Example

@prefix bdi: <https://w3id.org/fossr/ontology/bdi/> .
@prefix ex: <http://example.org/> .

# Conflicting location beliefs
ex:Belief_at_home a bdi:Belief ;
    bdi:refersTo ex:WorldState_home ;
    rdfs:comment "Agent is currently at home" .

ex:Belief_at_office a bdi:Belief ;
    bdi:refersTo ex:WorldState_office ;
    rdfs:comment "Agent is at office" .

# Conflicting intentions
ex:Intention_work_from_home a bdi:Intention ;
    bdi:isSupportedBy ex:Belief_at_home ;
    rdfs:label "Work from home today" .

ex:Intention_attend_meeting a bdi:Intention ;
    bdi:isSupportedBy ex:Belief_at_office ;
    rdfs:label "Attend in-person meeting" .

# Justification for conflict resolution
ex:Justification_location_conflict a bdi:Justification ;
    rdfs:comment "Cannot simultaneously be at home and office" ;
    bdi:justifies ex:Intention_resolution .

# Resolved intention
ex:Intention_resolution a bdi:Intention ;
    rdfs:label "Attend meeting via video call from home" ;
    bdi:fulfils ex:Desire_meeting_participation ;
    bdi:isSupportedBy ex:Belief_at_home ;
    bdi:isJustifiedBy ex:Justification_location_conflict .

T2B2T Payment Processing Example

@prefix bdi: <https://w3id.org/fossr/ontology/bdi/> .
@prefix ex: <http://example.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# PHASE 1: Triples-to-Beliefs (External RDF → Internal Mental State)

ex:WorldState_notification a bdi:WorldState ;
    rdfs:comment "Push notification: Ghadeh requested $250 via Zelle" ;
    bdi:atTime "2025-10-27T10:15:00"^^xsd:dateTime ;
    bdi:triggers ex:BeliefProcess_BP1 .

ex:BeliefProcess_BP1 a bdi:BeliefProcess ;
    bdi:generates ex:Belief_payment_request ;
    bdi:isProcessedBy ex:Agent_A .

ex:Belief_payment_request a bdi:Belief ;
    rdfs:label "Ghadeh requested $250" ;
    bdi:refersTo ex:WorldState_notification ;
    bdi:motivates ex:Desire_pay_Ghadeh .

ex:Desire_pay_Ghadeh a bdi:Desire ;
    rdfs:label "Pay Ghadeh $250" ;
    bdi:isMotivatedBy ex:Belief_payment_request .

ex:Intention_I1 a bdi:Intention ;
    rdfs:label "Pay Ghadeh $250" ;
    bdi:fulfils ex:Desire_pay_Ghadeh ;
    bdi:specifies ex:Plan_payment .

# PHASE 2: Beliefs-to-Triples (Mental State → External RDF)

ex:PlanExecution_PE1 a bdi:PlanExecution ;
    bdi:satisfies ex:Plan_payment ;
    bdi:bringsAbout ex:WorldState_payment_complete .

ex:WorldState_payment_complete a bdi:WorldState ;
    rdfs:comment "Payment of $250 sent to Ghadeh via Zelle" ;
    bdi:atTime "2025-10-27T10:20:00"^^xsd:dateTime .

references/sparql-competency.md (verbatim)

SPARQL Competency Queries

Validation queries for BDI ontology implementations based on competency questions.

Mental Entity Queries

CQ1: What are all mental entities?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?entity ?type WHERE {
    ?entity rdf:type ?type .
    ?type rdfs:subClassOf* bdi:MentalEntity .
}

CQ2: What beliefs does an agent hold?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?belief ?label WHERE {
    ?agent bdi:hasMentalState ?belief .
    ?belief a bdi:Belief .
    OPTIONAL { ?belief rdfs:label ?label }
}

CQ3: What desires does an agent have?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?desire ?label WHERE {
    ?agent bdi:hasDesire ?desire .
    ?desire a bdi:Desire .
    OPTIONAL { ?desire rdfs:label ?label }
}

CQ4: What intentions has an agent committed to?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?intention ?label WHERE {
    ?agent bdi:hasIntention ?intention .
    ?intention a bdi:Intention .
    OPTIONAL { ?intention rdfs:label ?label }
}

Motivational Chain Queries

CQ5: What beliefs motivated formation of a given desire?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?belief ?beliefLabel WHERE {
    ?desire bdi:isMotivatedBy ?belief .
    ?belief a bdi:Belief .
    OPTIONAL { ?belief rdfs:label ?beliefLabel }
}

CQ6: Which desire does a particular intention fulfill?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?desire ?desireLabel WHERE {
    ?intention bdi:fulfils ?desire .
    ?desire a bdi:Desire .
    OPTIONAL { ?desire rdfs:label ?desireLabel }
}

CQ7: What beliefs support a given intention?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?belief ?label WHERE {
    ?intention bdi:isSupportedBy ?belief .
    ?belief a bdi:Belief .
    OPTIONAL { ?belief rdfs:label ?label }
}

CQ8: Trace complete cognitive chain for an intention

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?intention ?desire ?belief ?worldState WHERE {
    ?intention a bdi:Intention ;
               bdi:fulfils ?desire ;
               bdi:isSupportedBy ?belief .
    ?desire bdi:isMotivatedBy ?belief .
    ?belief bdi:refersTo ?worldState .
}

Mental Process Queries

CQ9: Which mental process generated a belief?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?process ?processType WHERE {
    ?process bdi:generates ?belief .
    ?belief a bdi:Belief .
    ?process a ?processType .
    FILTER(?processType != owl:NamedIndividual)
}

CQ10: What triggered a mental process?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?process ?trigger ?triggerType WHERE {
    ?process a bdi:MentalProcess ;
             bdi:isTriggeredBy ?trigger .
    ?trigger a ?triggerType .
}

CQ11: What did a mental process reason upon?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?process ?input WHERE {
    ?process a bdi:MentalProcess ;
             bdi:reasonsUpon ?input .
}

Plan and Goal Queries

CQ12: What plan does an intention specify?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?intention ?plan ?goal WHERE {
    ?intention bdi:specifies ?plan .
    ?plan a bdi:Plan ;
          bdi:addresses ?goal .
}

CQ13: What is the ordered sequence of tasks in a plan?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?plan ?task ?nextTask WHERE {
    ?plan a bdi:Plan ;
          bdi:hasComponent ?task .
    OPTIONAL { ?task bdi:precedes ?nextTask }
}
ORDER BY ?task

CQ14: What is the first and last task of a plan?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?plan ?firstTask ?lastTask WHERE {
    ?plan a bdi:Plan ;
          bdi:beginsWith ?firstTask ;
          bdi:endsWith ?lastTask .
}

CQ15: Which actions executed which tasks?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?action ?task ?time WHERE {
    ?action bdi:isExecutionOf ?task ;
            bdi:atTime ?time .
}
ORDER BY ?time

Temporal Queries

CQ16: What mental states are valid at a specific time?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT ?mentalState ?type WHERE {
    ?mentalState bdi:hasValidity ?interval .
    ?interval bdi:hasStartTime ?start ;
              bdi:hasEndTime ?end .
    ?mentalState a ?type .
    FILTER(?start <= "2026-01-04T10:00:00"^^xsd:dateTime && 
           ?end >= "2026-01-04T10:00:00"^^xsd:dateTime)
}

CQ17: When was a belief formed?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?belief ?formationTime WHERE {
    ?process bdi:generates ?belief ;
             bdi:atTime ?formationTime .
    ?belief a bdi:Belief .
}

CQ18: What is the temporal validity of an intention?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?intention ?start ?end WHERE {
    ?intention a bdi:Intention ;
               bdi:hasValidity ?interval .
    ?interval bdi:hasStartTime ?start ;
              bdi:hasEndTime ?end .
}

Justification Queries

CQ19: What justifies a belief?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?belief ?justification ?justLabel WHERE {
    ?belief a bdi:Belief ;
            bdi:isJustifiedBy ?justification .
    OPTIONAL { ?justification rdfs:label ?justLabel }
}

CQ20: What justifies an intention?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?intention ?justification ?justLabel WHERE {
    ?intention a bdi:Intention ;
               bdi:isJustifiedBy ?justification .
    OPTIONAL { ?justification rdfs:label ?justLabel }
}

Compositional Queries

CQ21: What parts comprise a complex belief?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?belief ?part ?partLabel WHERE {
    ?belief a bdi:Belief ;
            bdi:hasPart ?part .
    OPTIONAL { ?part rdfs:label ?partLabel }
}

CQ22: Find composite mental entities

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?composite (COUNT(?part) AS ?partCount) WHERE {
    ?composite bdi:hasPart ?part .
}
GROUP BY ?composite
HAVING (COUNT(?part) > 1)

World State Queries

CQ23: What world state does a belief refer to?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?belief ?worldState ?wsComment WHERE {
    ?belief a bdi:Belief ;
            bdi:refersTo ?worldState .
    OPTIONAL { ?worldState rdfs:comment ?wsComment }
}

CQ24: What actions brought about a world state?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?action ?worldState WHERE {
    ?action bdi:bringsAbout ?worldState .
    ?worldState a bdi:WorldState .
}

CQ25: What world states has an agent perceived?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?agent ?worldState ?time WHERE {
    ?agent bdi:perceives ?worldState .
    OPTIONAL { ?worldState bdi:atTime ?time }
}

Validation Queries (OWLUnit Style)

V1: Every intention must fulfill exactly one desire

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?intention WHERE {
    ?intention a bdi:Intention .
    FILTER NOT EXISTS { ?intention bdi:fulfils ?desire }
}
# Expected: Empty result set

V2: Every belief must reference a world state

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?belief WHERE {
    ?belief a bdi:Belief .
    FILTER NOT EXISTS { ?belief bdi:refersTo ?worldState }
}
# Expected: Empty result set (or only abstract beliefs)

V3: Mental processes must reason upon something

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?process WHERE {
    ?process a bdi:MentalProcess .
    FILTER NOT EXISTS { ?process bdi:reasonsUpon ?input }
}
# Expected: Empty result set

V4: BeliefProcess must generate only Beliefs

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?process ?generated WHERE {
    ?process a bdi:BeliefProcess ;
             bdi:generates ?generated .
    FILTER NOT EXISTS { ?generated a bdi:Belief }
}
# Expected: Empty result set

V5: Plans must have begin and end tasks

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?plan WHERE {
    ?plan a bdi:Plan .
    FILTER NOT EXISTS { 
        ?plan bdi:beginsWith ?first ;
              bdi:endsWith ?last 
    }
}
# Expected: Empty result set

Multi-Agent Queries

CQ26: What beliefs are shared across agents?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?belief (COUNT(DISTINCT ?agent) AS ?agentCount) WHERE {
    ?agent bdi:hasMentalState ?belief .
    ?belief a bdi:Belief .
}
GROUP BY ?belief
HAVING (COUNT(DISTINCT ?agent) > 1)

CQ27: Which agents share the same desire?

PREFIX bdi: <https://w3id.org/fossr/ontology/bdi/>

SELECT ?desire ?agent1 ?agent2 WHERE {
    ?agent1 bdi:hasDesire ?desire .
    ?agent2 bdi:hasDesire ?desire .
    FILTER(?agent1 != ?agent2)
}

Back to muratcankoylan/Agent-Skills-for-Context-Engineering or Agent skills.