@prefix uko: <https://cleveragents.ai/ontology/uko#> .
@prefix uko-code: <https://cleveragents.ai/ontology/uko/code#> .
@prefix uko-oo: <https://cleveragents.ai/ontology/uko/oo#> .
@prefix uko-rs: <https://cleveragents.ai/ontology/uko/rs#> .
@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#> .

<https://cleveragents.ai/ontology/uko/rs#> a owl:Ontology ;
    rdfs:label "UKO Rust Vocabulary" ;
    rdfs:comment "Layer 3 technology vocabulary for Rust." .

# ===========================================================================
# UKO Layer 3: Rust-specific vocabulary (uko-rs:)
#
# Extends uko-oo: and uko-func: (Layer 2 paradigms) with Rust-specific
# classes and properties.  Extends at SIGNATURES level with visibility
# modifiers, lifetime parameters, trait bounds, unsafe markers,
# #[derive] macros, and #[must_use] annotations.
#
# Based on docs/specification.md ~lines 44405-44420.
# ===========================================================================

# NOTE: Properties with multiple rdfs:domain values use OWL intersection
# semantics (AND). This is intentional — the domain tuple serves as an
# informational hint for tooling, not a formal OWL restriction.
# See PR #660 review finding #18.

# -- Classes --

uko-rs:RustStruct a owl:Class ;
    rdfs:subClassOf uko-oo:Class ;
    rdfs:label "RustStruct" ;
    rdfs:comment "A Rust struct definition — extends uko-oo:Class. Includes derive macros, visibility, and lifetime parameters." .

uko-rs:RustTrait a owl:Class ;
    rdfs:subClassOf uko-oo:Interface ;
    rdfs:label "RustTrait" ;
    rdfs:comment "A Rust trait definition — extends uko-oo:Interface. Includes associated types, default implementations, and supertraits." .

uko-rs:RustImpl a owl:Class ;
    rdfs:subClassOf uko-code:TypeDefinition ;
    rdfs:label "RustImpl" ;
    rdfs:comment "A Rust impl block — either inherent or trait implementation. Extends uko-code:TypeDefinition." .

uko-rs:RustFunction a owl:Class ;
    rdfs:subClassOf uko-oo:Method ;
    rdfs:label "RustFunction" ;
    rdfs:comment "A Rust function or method — extends uko-oo:Method. Includes lifetime parameters, trait bounds, and unsafe markers." .

uko-rs:RustDeriveAttribute a owl:Class ;
    rdfs:subClassOf uko-code:TypeDefinition ;
    rdfs:label "RustDeriveAttribute" ;
    rdfs:comment "A #[derive(...)] macro attribute applied to a struct/enum. Records which traits are automatically derived." .

# -- Properties --

uko-rs:visibility a owl:DatatypeProperty ;
    rdfs:domain uko-rs:RustStruct , uko-rs:RustTrait , uko-rs:RustFunction ;
    rdfs:range xsd:string ;
    rdfs:label "visibility" ;
    rdfs:comment "Visibility modifier: 'pub', 'pub(crate)', 'pub(super)', 'private' (default)." .

uko-rs:lifetimeParameters a owl:DatatypeProperty ;
    rdfs:domain uko-rs:RustStruct , uko-rs:RustImpl , uko-rs:RustFunction , uko-rs:RustTrait ;
    rdfs:range xsd:string ;
    rdfs:label "lifetimeParameters" ;
    rdfs:comment "Lifetime parameter string (e.g. \"<'a, 'b>\")." .

uko-rs:traitBounds a owl:DatatypeProperty ;
    rdfs:domain uko-rs:RustStruct , uko-rs:RustFunction , uko-rs:RustImpl ;
    rdfs:range xsd:string ;
    rdfs:label "traitBounds" ;
    rdfs:comment "Trait bound constraints (e.g. 'T: Clone + Send')." .

uko-rs:isUnsafe a owl:DatatypeProperty ;
    rdfs:domain uko-rs:RustFunction , uko-rs:RustImpl , uko-rs:RustTrait ;
    rdfs:range xsd:boolean ;
    rdfs:label "isUnsafe" ;
    rdfs:comment "Whether this item is marked as 'unsafe'." .

uko-rs:deriveTraits a owl:DatatypeProperty ;
    rdfs:domain uko-rs:RustDeriveAttribute ;
    rdfs:range xsd:string ;
    rdfs:label "deriveTraits" ;
    rdfs:comment "Comma-separated list of traits in #[derive(...)]. E.g. 'Clone, Debug, Serialize'." .

uko-rs:mustUse a owl:DatatypeProperty ;
    rdfs:domain uko-rs:RustStruct , uko-rs:RustFunction ;
    rdfs:range xsd:boolean ;
    rdfs:label "mustUse" ;
    rdfs:comment "Whether this item carries a #[must_use] annotation." .

uko-rs:hasDerive a owl:ObjectProperty ;
    rdfs:domain uko-rs:RustStruct ;
    rdfs:range uko-rs:RustDeriveAttribute ;
    rdfs:label "hasDerive" ;
    rdfs:comment "Links a struct to its #[derive] attribute." .

uko-rs:implementsTrait a owl:ObjectProperty ;
    rdfs:domain uko-rs:RustImpl ;
    rdfs:range uko-rs:RustTrait ;
    rdfs:label "implementsTrait" ;
    rdfs:comment "Links an impl block to the trait it implements." .
