@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix reason: <http://ggen.io/ontology/reasoning#> .

# Ontology definition
reason:ReasoningOntology a owl:Ontology ;
    rdfs:label "Reasoning MCP Ontology" ;
    dc:description "RDF ontology for AI agent reasoning and inference" ;
    dc:creator "ggen-team" ;
    owl:versionInfo "1.0.0" .

# Core Classes
reason:ReasoningEngine a owl:Class ; rdfs:label "Reasoning Engine" ; rdfs:comment "AI reasoning engine" .
reason:Reasoning a owl:Class ; rdfs:label "Reasoning" ; rdfs:comment "Reasoning process" .
reason:Inference a owl:Class ; rdfs:label "Inference" ; rdfs:comment "Logical inference" .
reason:Rule a owl:Class ; rdfs:label "Rule" ; rdfs:comment "Inference rule" .
reason:Fact a owl:Class ; rdfs:label "Fact" ; rdfs:comment "Known fact" .
reason:Conclusion a owl:Class ; rdfs:label "Conclusion" ; rdfs:comment "Inferred conclusion" .
reason:Proof a owl:Class ; rdfs:label "Proof" ; rdfs:comment "Reasoning proof" .
reason:Explanation a owl:Class ; rdfs:label "Explanation" ; rdfs:comment "Explanation of reasoning" .

# Reasoning Types
reason:DeductiveReasoning a reason:Reasoning ; rdfs:label "Deductive" ; reason:description "Deductive reasoning" .
reason:InductiveReasoning a reason:Reasoning ; rdfs:label "Inductive" ; reason:description "Inductive reasoning" .
reason:AbductiveReasoning a reason:Reasoning ; rdfs:label "Abductive" ; reason:description "Abductive reasoning" .
reason:AnalogicalReasoning a reason:Reasoning ; rdfs:label "Analogical" ; reason:description "Analogical reasoning" .
reason:CausalReasoning a reason:Reasoning ; rdfs:label "Causal" ; reason:description "Causal reasoning" .
reason:ProbabilisticReasoning a reason:Reasoning ; rdfs:label "Probabilistic" ; reason:description "Probabilistic reasoning" .
reason:TemporalReasoning a reason:Reasoning ; rdfs:label "Temporal" ; reason:description "Temporal reasoning" .
reason:SpatialReasoning a reason:Reasoning ; rdfs:label "Spatial" ; reason:description "Spatial reasoning" .

# Inference Engines
reason:ForwardChaining a owl:Class ; rdfs:label "Forward Chaining" ; reason:description "Forward chaining inference" .
reason:BackwardChaining a owl:Class ; rdfs:label "Backward Chaining" ; reason:description "Backward chaining inference" .
reason:SPARQLInference a owl:Class ; rdfs:label "SPARQL Inference" ; reason:description "SPARQL-based inference" .
reason:RDFEntailment a owl:Class ; rdfs:label "RDF Entailment" ; reason:description "RDF entailment" .
reason:OWLReasoner a owl:Class ; rdfs:label "OWL Reasoner" ; reason:description "OWL ontology reasoning" .

# Planning
reason:Plan a owl:Class ; rdfs:label "Plan" ; rdfs:comment "Execution plan" .
reason:Goal a owl:Class ; rdfs:label "Goal" ; rdfs:comment "Reasoning goal" .
reason:Subgoal a owl:Class ; rdfs:label "Subgoal" ; rdfs:comment "Decomposed subgoal" .
reason:Action a owl:Class ; rdfs:label "Action" ; rdfs:comment "Planned action" .
reason:Precondition a owl:Class ; rdfs:label "Precondition" ; rdfs:comment "Action precondition" .
reason:Postcondition a owl:Class ; rdfs:label "Postcondition" ; rdfs:comment "Action effect" .
reason:Constraint a owl:Class ; rdfs:label "Constraint" ; rdfs:comment "Planning constraint" .

# MCP Integration
reason:MCPTool a owl:Class ; rdfs:label "MCP Tool" ; rdfs:comment "MCP protocol tool" .
reason:MCPAgent a owl:Class ; rdfs:label "MCP Agent" ; rdfs:comment "MCP-enabled agent" .
reason:MCPMessage a owl:Class ; rdfs:label "MCP Message" ; rdfs:comment "MCP protocol message" .
reason:MCPTransport a owl:Class ; rdfs:label "MCP Transport" ; rdfs:comment "MCP transport layer" .

# Properties
reason:hasReasoning a owl:ObjectProperty ; rdfs:domain reason:ReasoningEngine ; rdfs:range reason:Reasoning .
reason:hasInference a owl:ObjectProperty ; rdfs:domain reason:Reasoning ; rdfs:range reason:Inference .
reason:hasRule a owl:ObjectProperty ; rdfs:domain reason:Inference ; rdfs:range reason:Rule .
reason:hasFact a owl:ObjectProperty ; rdfs:domain reason:Reasoning ; rdfs:range reason:Fact .
reason:hasConclusion a owl:ObjectProperty ; rdfs:domain reason:Reasoning ; rdfs:range reason:Conclusion .
reason:hasProof a owl:ObjectProperty ; rdfs:domain reason:Conclusion ; rdfs:range reason:Proof .
reason:hasExplanation a owl:ObjectProperty ; rdfs:domain reason:Reasoning ; rdfs:range reason:Explanation .
reason:hasGoal a owl:ObjectProperty ; rdfs:domain reason:Plan ; rdfs:range reason:Goal .
reason:hasSubgoal a owl:ObjectProperty ; rdfs:domain reason:Goal ; rdfs:range reason:Subgoal .
reason:hasAction a owl:ObjectProperty ; rdfs:domain reason:Plan ; rdfs:range reason:Action .
reason:hasPrecondition a owl:ObjectProperty ; rdfs:domain reason:Action ; rdfs:range reason:Precondition .
reason:hasPostcondition a owl:ObjectProperty ; rdfs:domain reason:Action ; rdfs:range reason:Postcondition .
reason:hasConstraint a owl:ObjectProperty ; rdfs:domain reason:Plan ; rdfs:range reason:Constraint .
reason:usesMCP a owl:ObjectProperty ; rdfs:domain reason:ReasoningEngine ; rdfs:range reason:MCPTool .

# Data Properties
reason:reasoningId a owl:DatatypeProperty ; rdfs:domain reason:Reasoning ; rdfs:range xsd:string .
reason:confidence a owl:DatatypeProperty ; rdfs:domain reason:Conclusion ; rdfs:range xsd:float .
reason:probability a owl:DatatypeProperty ; rdfs:domain reason:Conclusion ; rdfs:range xsd:float .
reason:truthValue a owl:DatatypeProperty ; rdfs:domain reason:Fact ; rdfs:range xsd:boolean .
reason:timestamp a owl:DatatypeProperty ; rdfs:domain reason:Reasoning ; rdfs:range xsd:dateTime .
reason:hops a owl:DatatypeProperty ; rdfs:domain reason:Inference ; rdfs:range xsd:integer ; rdfs:comment "Number of inference hops" .
reason:complexity a owl:DatatypeProperty ; rdfs:domain reason:Reasoning ; rdfs:range xsd:integer .
reason:cost a owl:DatatypeProperty ; rdfs:domain reason:Action ; rdfs:range xsd:float .
reason:priority a owl:DatatypeProperty ; rdfs:domain reason:Goal ; rdfs:range xsd:integer .

# Contradiction Detection
reason:Contradiction a owl:Class ; rdfs:label "Contradiction" ; reason:description "Detected contradiction" .
reason:Resolution a owl:Class ; rdfs:label "Resolution" ; reason:description "Contradiction resolution" .
reason:detectsContradiction a owl:ObjectProperty ; rdfs:domain reason:Reasoning ; rdfs:range reason:Contradiction .
reason:resolvesBy a owl:ObjectProperty ; rdfs:domain reason:Contradiction ; rdfs:range reason:Resolution .

# Explanation Types
reason:ProofTrace a reason:Explanation ; rdfs:label "Proof Trace" ; reason:description "Step-by-step proof" .
reason:NaturalLanguage a reason:Explanation ; rdfs:label "Natural Language" ; reason:description "Human-readable explanation" .
reason:Visualization a reason:Explanation ; rdfs:label "Visualization" ; reason:description "Visual explanation" .
reason:ConfidenceScore a reason:Explanation ; rdfs:label "Confidence Score" ; reason:description "Confidence-based explanation" .
