@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 sf: <http://ggen.io/ontology/schema-forge-cli#> .
@prefix clap: <http://ggen.io/ontology/clap-noun-verb#> .

# Ontology definition
sf:SchemaForgeCLIOntology a owl:Ontology ;
    rdfs:label "Schema Forge CLI Ontology" ;
    dc:description "RDF ontology for schema-forge-cli tool using clap-noun-verb pattern" ;
    dc:creator "ggen-team" ;
    owl:versionInfo "1.0.0" .

# ===== Noun Classes =====

sf:Model a clap:Noun, owl:Class ;
    rdfs:label "Model" ;
    rdfs:comment "Data model operations" ;
    clap:hasVerb sf:create, sf:list, sf:show, sf:addField, sf:removeField .

sf:Validate a clap:Noun, owl:Class ;
    rdfs:label "Validate" ;
    rdfs:comment "Data validation operations" ;
    clap:hasVerb sf:data, sf:consistency, sf:constraints .

sf:Generate a clap:Noun, owl:Class ;
    rdfs:label "Generate" ;
    rdfs:comment "Code generation operations" ;
    clap:hasVerb sf:jsonSchema, sf:sql, sf:graphql, sf:openapi, sf:rust .

# ===== Verb Classes =====

# Model verbs
sf:create a clap:Verb, owl:Class ;
    rdfs:label "create" ;
    rdfs:comment "Create new data model" ;
    clap:belongsToNoun sf:Model ;
    clap:hasArgument sf:nameArg, sf:descriptionArg ;
    clap:returns sf:ModelResult .

sf:list a clap:Verb, owl:Class ;
    rdfs:label "list" ;
    rdfs:comment "List all models" ;
    clap:belongsToNoun sf:Model ;
    clap:returns sf:ModelList .

sf:show a clap:Verb, owl:Class ;
    rdfs:label "show" ;
    rdfs:comment "Show model schema" ;
    clap:belongsToNoun sf:Model ;
    clap:hasArgument sf:nameArg ;
    clap:returns sf:ModelDetails .

sf:addField a clap:Verb, owl:Class ;
    rdfs:label "add-field" ;
    rdfs:comment "Add field to model" ;
    clap:belongsToNoun sf:Model ;
    clap:hasArgument sf:modelArg, sf:fieldNameArg, sf:fieldTypeArg, sf:constraintsArg ;
    clap:returns sf:FieldResult .

sf:removeField a clap:Verb, owl:Class ;
    rdfs:label "remove-field" ;
    rdfs:comment "Remove field from model" ;
    clap:belongsToNoun sf:Model ;
    clap:hasArgument sf:modelArg, sf:fieldNameArg ;
    clap:returns sf:FieldResult .

# Validate verbs
sf:data a clap:Verb, owl:Class ;
    rdfs:label "data" ;
    rdfs:comment "Validate data against model" ;
    clap:belongsToNoun sf:Validate ;
    clap:hasArgument sf:fileArg, sf:modelArg ;
    clap:returns sf:ValidationResult .

sf:consistency a clap:Verb, owl:Class ;
    rdfs:label "consistency" ;
    rdfs:comment "Check model consistency" ;
    clap:belongsToNoun sf:Validate ;
    clap:returns sf:ConsistencyResult .

sf:constraints a clap:Verb, owl:Class ;
    rdfs:label "constraints" ;
    rdfs:comment "Validate constraints" ;
    clap:belongsToNoun sf:Validate ;
    clap:hasArgument sf:modelArg ;
    clap:returns sf:ConstraintResult .

# Generate verbs
sf:jsonSchema a clap:Verb, owl:Class ;
    rdfs:label "json-schema" ;
    rdfs:comment "Generate JSON Schema" ;
    clap:belongsToNoun sf:Generate ;
    clap:hasArgument sf:modelArg, sf:outputArg ;
    clap:returns sf:GenerateResult .

sf:sql a clap:Verb, owl:Class ;
    rdfs:label "sql" ;
    rdfs:comment "Generate SQL DDL" ;
    clap:belongsToNoun sf:Generate ;
    clap:hasArgument sf:modelArg, sf:outputArg, sf:dialectArg ;
    clap:returns sf:GenerateResult .

sf:graphql a clap:Verb, owl:Class ;
    rdfs:label "graphql" ;
    rdfs:comment "Generate GraphQL SDL" ;
    clap:belongsToNoun sf:Generate ;
    clap:hasArgument sf:modelArg, sf:outputArg ;
    clap:returns sf:GenerateResult .

sf:openapi a clap:Verb, owl:Class ;
    rdfs:label "openapi" ;
    rdfs:comment "Generate OpenAPI spec" ;
    clap:belongsToNoun sf:Generate ;
    clap:hasArgument sf:modelArg, sf:outputArg ;
    clap:returns sf:GenerateResult .

sf:rust a clap:Verb, owl:Class ;
    rdfs:label "rust" ;
    rdfs:comment "Generate Rust structs" ;
    clap:belongsToNoun sf:Generate ;
    clap:hasArgument sf:modelArg, sf:outputArg ;
    clap:returns sf:GenerateResult .

# ===== Argument Definitions =====

sf:nameArg a clap:Argument ;
    clap:name "name" ;
    clap:type xsd:string ;
    clap:required true ;
    clap:help "Model name" .

sf:descriptionArg a clap:Argument ;
    clap:name "description" ;
    clap:short "d" ;
    clap:type xsd:string ;
    clap:required false ;
    clap:help "Model description" .

sf:modelArg a clap:Argument ;
    clap:name "model" ;
    clap:short "m" ;
    clap:type xsd:string ;
    clap:required true ;
    clap:help "Model name" .

sf:fieldNameArg a clap:Argument ;
    clap:name "field" ;
    clap:type xsd:string ;
    clap:required true ;
    clap:help "Field name" .

sf:fieldTypeArg a clap:Argument ;
    clap:name "type" ;
    clap:short "t" ;
    clap:type xsd:string ;
    clap:required true ;
    clap:help "Field type (string, integer, boolean, etc.)" .

sf:constraintsArg a clap:Argument ;
    clap:name "constraints" ;
    clap:short "c" ;
    clap:type xsd:string ;
    clap:required false ;
    clap:help "Constraints JSON" .

sf:fileArg a clap:Argument ;
    clap:name "file" ;
    clap:type xsd:string ;
    clap:required true ;
    clap:help "Data file path" .

sf:outputArg a clap:Argument ;
    clap:name "output" ;
    clap:short "o" ;
    clap:type xsd:string ;
    clap:required true ;
    clap:help "Output file path" .

sf:dialectArg a clap:Argument ;
    clap:name "dialect" ;
    clap:short "d" ;
    clap:type xsd:string ;
    clap:default "postgresql" ;
    clap:help "SQL dialect (postgresql, mysql, sqlite)" .

# ===== Return Types =====

sf:ModelResult a owl:Class ;
    clap:hasField sf:nameField, sf:descriptionField, sf:fieldsField .

sf:ModelList a owl:Class ;
    clap:hasField sf:modelsField, sf:countField .

sf:ModelDetails a owl:Class ;
    clap:hasField sf:nameField, sf:descriptionField, sf:fieldsField, sf:constraintsField .

sf:FieldResult a owl:Class ;
    clap:hasField sf:nameField, sf:typeField, sf:constraintsField .

sf:ValidationResult a owl:Class ;
    clap:hasField sf:validField, sf:errorsField .

sf:ConsistencyResult a owl:Class ;
    clap:hasField sf:consistentField, sf:issuesField .

sf:ConstraintResult a owl:Class ;
    clap:hasField sf:validField, sf:violationsField .

sf:GenerateResult a owl:Class ;
    clap:hasField sf:successField, sf:formatField, sf:pathField .

# ===== Field Definitions =====

sf:nameField a clap:Field ; clap:name "name" ; clap:type xsd:string .
sf:descriptionField a clap:Field ; clap:name "description" ; clap:type xsd:string .
sf:fieldsField a clap:Field ; clap:name "fields" ; clap:type "Vec<Field>" .
sf:modelsField a clap:Field ; clap:name "models" ; clap:type "Vec<Model>" .
sf:countField a clap:Field ; clap:name "count" ; clap:type xsd:integer .
sf:constraintsField a clap:Field ; clap:name "constraints" ; clap:type "Vec<Constraint>" .
sf:typeField a clap:Field ; clap:name "type" ; clap:type xsd:string .
sf:validField a clap:Field ; clap:name "valid" ; clap:type xsd:boolean .
sf:errorsField a clap:Field ; clap:name "errors" ; clap:type "Vec<String>" .
sf:consistentField a clap:Field ; clap:name "consistent" ; clap:type xsd:boolean .
sf:issuesField a clap:Field ; clap:name "issues" ; clap:type "Vec<String>" .
sf:violationsField a clap:Field ; clap:name "violations" ; clap:type "Vec<Violation>" .
sf:successField a clap:Field ; clap:name "success" ; clap:type xsd:boolean .
sf:formatField a clap:Field ; clap:name "format" ; clap:type xsd:string .
sf:pathField a clap:Field ; clap:name "path" ; clap:type xsd:string .
