@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 ed: <http://ggen.io/ontology/editor#> .
@prefix code: <http://ggen.io/ontology/code#> .

# Ontology definition
ed:EditorOntology a owl:Ontology ;
    rdfs:label "Agent Editor Ontology" ;
    dc:description "RDF ontology for AI-powered code editor automation" ;
    dc:creator "ggen-team" ;
    owl:versionInfo "1.0.0" .

# Core Classes

ed:CodeEditor a owl:Class ;
    rdfs:label "Code Editor" ;
    rdfs:comment "Represents an intelligent code editor instance" ;
    rdfs:subClassOf owl:Thing .

ed:EditOperation a owl:Class ;
    rdfs:label "Edit Operation" ;
    rdfs:comment "Represents a code edit operation" ;
    rdfs:subClassOf owl:Thing .

ed:Refactoring a owl:Class ;
    rdfs:label "Refactoring" ;
    rdfs:comment "Code refactoring operation" ;
    rdfs:subClassOf ed:EditOperation .

ed:CodeSmell a owl:Class ;
    rdfs:label "Code Smell" ;
    rdfs:comment "Detected code quality issue" ;
    rdfs:subClassOf owl:Thing .

ed:Language a owl:Class ;
    rdfs:label "Programming Language" ;
    rdfs:comment "Supported programming language" ;
    rdfs:subClassOf owl:Thing .

ed:SemanticEdit a owl:Class ;
    rdfs:label "Semantic Edit" ;
    rdfs:comment "Edit based on semantic understanding" ;
    rdfs:subClassOf ed:EditOperation .

ed:TestGeneration a owl:Class ;
    rdfs:label "Test Generation" ;
    rdfs:comment "Automated test generation operation" ;
    rdfs:subClassOf ed:EditOperation .

ed:Documentation a owl:Class ;
    rdfs:label "Documentation" ;
    rdfs:comment "Code documentation generation" ;
    rdfs:subClassOf ed:EditOperation .

# Language instances

ed:Rust a ed:Language ;
    rdfs:label "Rust" ;
    ed:fileExtension ".rs" ;
    ed:supportsSemanticEditing true .

ed:TypeScript a ed:Language ;
    rdfs:label "TypeScript" ;
    ed:fileExtension ".ts" ;
    ed:supportsSemanticEditing true .

ed:Python a ed:Language ;
    rdfs:label "Python" ;
    ed:fileExtension ".py" ;
    ed:supportsSemanticEditing true .

ed:Go a ed:Language ;
    rdfs:label "Go" ;
    ed:fileExtension ".go" ;
    ed:supportsSemanticEditing true .

ed:Java a ed:Language ;
    rdfs:label "Java" ;
    ed:fileExtension ".java" ;
    ed:supportsSemanticEditing true .

# Properties

ed:hasLanguage a owl:ObjectProperty ;
    rdfs:label "has language" ;
    rdfs:domain ed:CodeEditor ;
    rdfs:range ed:Language .

ed:performsOperation a owl:ObjectProperty ;
    rdfs:label "performs operation" ;
    rdfs:domain ed:CodeEditor ;
    rdfs:range ed:EditOperation .

ed:detectsSmell a owl:ObjectProperty ;
    rdfs:label "detects smell" ;
    rdfs:domain ed:CodeEditor ;
    rdfs:range ed:CodeSmell .

ed:targetFile a owl:DatatypeProperty ;
    rdfs:label "target file" ;
    rdfs:domain ed:EditOperation ;
    rdfs:range xsd:string .

ed:lineNumber a owl:DatatypeProperty ;
    rdfs:label "line number" ;
    rdfs:domain ed:EditOperation ;
    rdfs:range xsd:integer .

ed:severity a owl:DatatypeProperty ;
    rdfs:label "severity" ;
    rdfs:domain ed:CodeSmell ;
    rdfs:range xsd:string ;
    rdfs:comment "Severity: low, medium, high, critical" .

ed:refactoringType a owl:DatatypeProperty ;
    rdfs:label "refactoring type" ;
    rdfs:domain ed:Refactoring ;
    rdfs:range xsd:string ;
    rdfs:comment "Type: extract-method, rename, inline, etc." .

ed:confidence a owl:DatatypeProperty ;
    rdfs:label "confidence" ;
    rdfs:domain ed:EditOperation ;
    rdfs:range xsd:float ;
    rdfs:comment "AI confidence score 0.0-1.0" .

ed:timestamp a owl:DatatypeProperty ;
    rdfs:label "timestamp" ;
    rdfs:domain ed:EditOperation ;
    rdfs:range xsd:dateTime .

# Code Smell Types

ed:LongFunction a ed:CodeSmell ;
    rdfs:label "Long Function" ;
    ed:severity "medium" ;
    ed:description "Function exceeds recommended line count" .

ed:DuplicateCode a ed:CodeSmell ;
    rdfs:label "Duplicate Code" ;
    ed:severity "high" ;
    ed:description "Code duplication detected" .

ed:DeadCode a ed:CodeSmell ;
    rdfs:label "Dead Code" ;
    ed:severity "low" ;
    ed:description "Unreachable or unused code" .

ed:ComplexCondition a ed:CodeSmell ;
    rdfs:label "Complex Condition" ;
    ed:severity "medium" ;
    ed:description "Overly complex conditional logic" .

# Refactoring Types

ed:ExtractMethod a ed:Refactoring ;
    rdfs:label "Extract Method" ;
    ed:refactoringType "extract-method" ;
    ed:description "Extract code into separate method" .

ed:RenameSymbol a ed:Refactoring ;
    rdfs:label "Rename Symbol" ;
    ed:refactoringType "rename" ;
    ed:description "Rename variable, function, or class" .

ed:InlineVariable a ed:Refactoring ;
    rdfs:label "Inline Variable" ;
    ed:refactoringType "inline" ;
    ed:description "Inline temporary variable" .

# Quality Gates

ed:QualityGate a owl:Class ;
    rdfs:label "Quality Gate" ;
    rdfs:comment "Code quality validation gate" .

ed:SyntaxValidation a ed:QualityGate ;
    rdfs:label "Syntax Validation" ;
    ed:description "Validate syntax correctness" .

ed:TypeChecking a ed:QualityGate ;
    rdfs:label "Type Checking" ;
    ed:description "Validate type safety" .

ed:SecurityScan a ed:QualityGate ;
    rdfs:label "Security Scan" ;
    ed:description "Scan for security vulnerabilities" .

ed:TestCoverage a ed:QualityGate ;
    rdfs:label "Test Coverage" ;
    ed:description "Validate test coverage threshold" .
