@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-java: <https://cleveragents.ai/ontology/uko/java#> .
@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/java#> a owl:Ontology ;
    rdfs:label "UKO Java Vocabulary" ;
    rdfs:comment "Layer 3 technology vocabulary for Java." .

# ===========================================================================
# UKO Layer 3: Java-specific vocabulary (uko-java:)
#
# Extends uko-oo: (Layer 2 OO paradigm) with Java-specific classes
# and properties.  Extends at SIGNATURES level with package visibility,
# final/abstract/sealed modifiers, annotation lists, and checked
# exceptions.
#
# 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-java:JavaClass a owl:Class ;
    rdfs:subClassOf uko-oo:Class ;
    rdfs:label "JavaClass" ;
    rdfs:comment "A Java class definition — extends uko-oo:Class. Includes final/abstract/sealed modifiers and annotations." .

uko-java:JavaInterface a owl:Class ;
    rdfs:subClassOf uko-oo:Interface ;
    rdfs:label "JavaInterface" ;
    rdfs:comment "A Java interface — extends uko-oo:Interface. Includes sealed permits and default method support." .

uko-java:JavaMethod a owl:Class ;
    rdfs:subClassOf uko-oo:Method ;
    rdfs:label "JavaMethod" ;
    rdfs:comment "A Java method — extends uko-oo:Method. Includes annotations, checked exceptions, and modifiers." .

uko-java:JavaAnnotation a owl:Class ;
    rdfs:subClassOf uko-code:TypeDefinition ;
    rdfs:label "JavaAnnotation" ;
    rdfs:comment "A Java annotation entry (@Override, @Deprecated, custom). Records annotation name and parameters." .

uko-java:JavaCheckedException a owl:Class ;
    rdfs:subClassOf uko-code:TypeDefinition ;
    rdfs:label "JavaCheckedException" ;
    rdfs:comment "A checked exception declaration in a method's throws clause. Records the exception class and any conditions." .

# -- Properties --

uko-java:packageVisibility a owl:DatatypeProperty ;
    rdfs:domain uko-java:JavaClass , uko-java:JavaInterface , uko-java:JavaMethod ;
    rdfs:range xsd:string ;
    rdfs:label "packageVisibility" ;
    rdfs:comment "Package-level visibility modifier: 'public', 'protected', 'package-private' (default), 'private'." .

uko-java:isFinal a owl:DatatypeProperty ;
    rdfs:domain uko-java:JavaClass , uko-java:JavaMethod ;
    rdfs:range xsd:boolean ;
    rdfs:label "isFinal" ;
    rdfs:comment "Whether this class/method is marked 'final'." .

uko-java:isAbstract a owl:DatatypeProperty ;
    rdfs:domain uko-java:JavaClass , uko-java:JavaMethod ;
    rdfs:range xsd:boolean ;
    rdfs:label "isAbstract" ;
    rdfs:comment "Whether this class/method is marked 'abstract'." .

uko-java:isSealed a owl:DatatypeProperty ;
    rdfs:domain uko-java:JavaClass , uko-java:JavaInterface ;
    rdfs:range xsd:boolean ;
    rdfs:label "isSealed" ;
    rdfs:comment "Whether this class/interface is marked 'sealed'." .

uko-java:hasAnnotation a owl:ObjectProperty ;
    rdfs:domain uko-java:JavaClass , uko-java:JavaInterface , uko-java:JavaMethod ;
    rdfs:range uko-java:JavaAnnotation ;
    rdfs:label "hasAnnotation" ;
    rdfs:comment "Links a class/method to its Java annotations." .

uko-java:annotationName a owl:DatatypeProperty ;
    rdfs:domain uko-java:JavaAnnotation ;
    rdfs:range xsd:string ;
    rdfs:label "annotationName" ;
    rdfs:comment "The fully-qualified name of the annotation (e.g. 'java.lang.Override')." .

uko-java:throwsException a owl:ObjectProperty ;
    rdfs:domain uko-java:JavaMethod ;
    rdfs:range uko-java:JavaCheckedException ;
    rdfs:label "throwsException" ;
    rdfs:comment "Links a method to its checked exception declarations." .

uko-java:exceptionClass a owl:DatatypeProperty ;
    rdfs:domain uko-java:JavaCheckedException ;
    rdfs:range xsd:string ;
    rdfs:label "exceptionClass" ;
    rdfs:comment "Fully-qualified class name of the checked exception." .
