# AFMRO — Aircraft Fleet Mission Readiness Ontology (FLAWED demo version)
# Workshop: AI-Assisted Ontology Engineering — KGC 2026
# Author: Dougal Watt, Graph Research Labs
#
# This is the FLAWED version used during the workshop demonstration.
# Aligned to gist 14.1.0.
#
# Anti-patterns baked in:
#   1. Deep hierarchy explosion — aircraft types modelled as subclasses
#      of Aircraft instead of as gist:Category instances, then individual
#      aircraft modelled as subclasses of those subclasses.
#   2. Event vs Task confusion — Mission and MissionPlan collapsed into a
#      single Mission class with both planning-time and occurrence-time
#      properties attached to the same class.
#   3. Parallel property invention — invents :containsComponent instead
#      of using the gist:isDirectPartOf partonomy pattern.
#   4. Orphan domain classes — Base and Crew sit at the root of the
#      asserted hierarchy with no upper-ontology parent. With an upper
#      ontology in scope, every domain class should ultimately subclass
#      something in the upper ontology. New base classes fragment the
#      taxonomy and defeat cross-ontology alignment.
#
# Minor flaws:
#   - ReadinessState lacks any magnitude or category constraint.
#   - Capability is misapplied as a gist:Category subclass rather than
#     a gist:Specification.
#   - rdfs:domain and rdfs:range are used on properties — the LLM
#     defaulted to the global-constraint pattern when team convention is
#     property restrictions on the bearing class.
#   - Required capabilities are stored as raw strings rather than as
#     references to CapabilityCategory instances.
#
# Licence: CC-BY-SA-4.0.

@prefix afmro: <https://example.org/afmro/> .
@prefix gist:  <https://w3id.org/semanticarts/ns/ontology/gist/> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos:  <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix dct:   <http://purl.org/dc/terms/> .

#####################################################################
# Ontology header
#####################################################################

<https://example.org/afmro> a owl:Ontology ;
  owl:versionIRI <https://example.org/afmro/0.2.1-flawed> ;
  dct:title "Aircraft Fleet Mission Readiness Ontology (AFMRO) — flawed demo version" ;
  dct:description "FLAWED. Contains three deliberate gist anti-patterns plus minor flaws including misuse of rdfs:domain/range. Used in the KGC 2026 workshop." ;
  dct:creator "Dougal Watt" ;
  dct:license <https://creativecommons.org/licenses/by-sa/4.0/> ;
  owl:imports <https://w3id.org/semanticarts/ontology/gistCore> .

#####################################################################
# ANTI-PATTERN 1 — Deep hierarchy explosion.
#####################################################################

afmro:Aircraft a owl:Class ;
  rdfs:subClassOf gist:Equipment ;
  rdfs:label "Aircraft" .

afmro:F-35A_Aircraft a owl:Class ;
  rdfs:subClassOf afmro:Aircraft ;
  rdfs:label "F-35A Lightning II Aircraft" .

afmro:F-22_Aircraft a owl:Class ;
  rdfs:subClassOf afmro:Aircraft ;
  rdfs:label "F-22 Raptor Aircraft" .

afmro:C-130J_Aircraft a owl:Class ;
  rdfs:subClassOf afmro:Aircraft ;
  rdfs:label "C-130J Super Hercules Aircraft" .

afmro:F-35A_Tail_AC001 a owl:Class ;
  rdfs:subClassOf afmro:F-35A_Aircraft ;
  rdfs:label "F-35A tail number AC-001" .

afmro:F-35A_Tail_AC002 a owl:Class ;
  rdfs:subClassOf afmro:F-35A_Aircraft ;
  rdfs:label "F-35A tail number AC-002" .

afmro:F-22_Tail_AC003 a owl:Class ;
  rdfs:subClassOf afmro:F-22_Aircraft ;
  rdfs:label "F-22 tail number AC-003" .

afmro:C-130J_Tail_AC004 a owl:Class ;
  rdfs:subClassOf afmro:C-130J_Aircraft ;
  rdfs:label "C-130J tail number AC-004" .

#####################################################################
# ANTI-PATTERN 2 — Event vs Task confusion.
# Mission carries BOTH planning-time AND occurrence-time properties.
#####################################################################

afmro:Mission a owl:Class ;
  rdfs:subClassOf gist:Event ;
  rdfs:subClassOf gist:Task ;
  rdfs:label "Mission (collapsed plan and occurrence)" .

afmro:requiredCapability a owl:DatatypeProperty ;
  rdfs:domain afmro:Mission ;
  rdfs:range xsd:string ;
  rdfs:label "required capability (planning-time, on Mission, as raw string)" .

afmro:plannedStartTime a owl:DatatypeProperty ;
  rdfs:domain afmro:Mission ;
  rdfs:range xsd:dateTime ;
  rdfs:label "planned start time (planning-time, on Mission)" .

afmro:plannedDuration a owl:DatatypeProperty ;
  rdfs:domain afmro:Mission ;
  rdfs:range xsd:duration ;
  rdfs:label "planned duration (planning-time, on Mission)" .

afmro:authoriser a owl:DatatypeProperty ;
  rdfs:domain afmro:Mission ;
  rdfs:range xsd:string ;
  rdfs:label "authoriser (planning-time, on Mission, as string)" .

afmro:planStatusLabel a owl:DatatypeProperty ;
  rdfs:domain afmro:Mission ;
  rdfs:range xsd:string ;
  rdfs:label "plan status label (planning-time, free-text)" .

afmro:actualStartTime a owl:DatatypeProperty ;
  rdfs:domain afmro:Mission ;
  rdfs:range xsd:dateTime ;
  rdfs:label "actual start time (occurrence-time, on Mission)" .

afmro:actualParticipant a owl:ObjectProperty ;
  rdfs:domain afmro:Mission ;
  rdfs:range afmro:Aircraft ;
  rdfs:label "actual participant (occurrence-time, on Mission)" .

afmro:missionCallsign a owl:DatatypeProperty ;
  rdfs:domain afmro:Mission ;
  rdfs:range xsd:string ;
  rdfs:label "mission callsign (occurrence-time, on Mission)" .

afmro:outcomeLabel a owl:DatatypeProperty ;
  rdfs:domain afmro:Mission ;
  rdfs:range xsd:string ;
  rdfs:label "outcome label (free-text, on Mission)" .

afmro:Sortie a owl:Class ;
  rdfs:subClassOf afmro:Mission ;
  rdfs:label "Sortie" .

afmro:TrainingExercise a owl:Class ;
  rdfs:subClassOf afmro:Mission ;
  rdfs:label "Training Exercise" .

#####################################################################
# ANTI-PATTERN 3 — Parallel property invention.
# Invents :containsComponent instead of using the gist:isDirectPartOf
# partonomy pattern (or its conventional inverse hasDirectPart).
#####################################################################

afmro:Component a owl:Class ;
  rdfs:subClassOf gist:Component ;
  rdfs:label "Component" .

afmro:containsComponent a owl:ObjectProperty ;
  rdfs:domain afmro:Aircraft ;
  rdfs:range afmro:Component ;
  rdfs:label "contains component (parallel to gist:isDirectPartOf — anti-pattern)" .

#####################################################################
# Squadron, Base, Crew — Squadron is correctly aligned to
# gist:Organization, but the LLM has left Base and Crew floating at
# the root of the class tree with no upper-ontology alignment at all.
#
# This is one of the most consequential anti-patterns when working
# with an upper ontology: every domain class should ultimately
# subclass something in the upper ontology. Classes that sit at the
# root of the asserted hierarchy without an upper-ontology parent
# create "new base classes" that fragment the taxonomy, defeat
# cross-ontology alignment, and make downstream reasoning incomplete.
# The methodology fix-and-resync demo addresses this in the second
# cycle: Base re-parented to gist:GeoRegion, Crew to gist:Composite.
#####################################################################

afmro:Squadron a owl:Class ;
  rdfs:subClassOf gist:Organization ;
  rdfs:label "Squadron" .

afmro:Base a owl:Class ;                       # WRONG — left at root with no upper-ontology parent.
  rdfs:label "Base (orphan: no upper-ontology alignment)" .

afmro:Crew a owl:Class ;                       # WRONG — left at root with no upper-ontology parent.
  rdfs:label "Crew (orphan: no upper-ontology alignment)" .

afmro:operatedBy a owl:ObjectProperty ;
  rdfs:domain afmro:Aircraft ;
  rdfs:range afmro:Squadron ;
  rdfs:label "operated by" .

afmro:stationedAt a owl:ObjectProperty ;
  rdfs:domain afmro:Aircraft ;
  rdfs:range afmro:Base ;
  rdfs:label "stationed at" .

#####################################################################
# MINOR FLAW — Capability misapplied as a Category subclass.
#####################################################################

afmro:Capability a owl:Class ;
  rdfs:subClassOf gist:Category ;       # WRONG — should be Specification.
  rdfs:label "Capability (mis-typed as Category)" .

afmro:hasCapability a owl:ObjectProperty ;
  rdfs:domain afmro:Aircraft ;
  rdfs:range afmro:Capability ;
  rdfs:label "has capability" .

#####################################################################
# MINOR FLAW — ReadinessState lacks any magnitude or category linkage.
#####################################################################

afmro:ReadinessState a owl:Class ;
  rdfs:subClassOf gist:Specification ;
  rdfs:label "Readiness State" .

afmro:readinessLabel a owl:DatatypeProperty ;
  rdfs:domain afmro:ReadinessState ;
  rdfs:range xsd:string ;
  rdfs:label "readiness label (free text — no Category linkage)" .

afmro:hasReadiness a owl:ObjectProperty ;
  rdfs:domain afmro:Aircraft ;
  rdfs:range afmro:ReadinessState ;
  rdfs:label "has readiness" .

#####################################################################
# Maintenance — not flawed, included for completeness.
#####################################################################

afmro:MaintenanceEvent a owl:Class ;
  rdfs:subClassOf gist:Event ;
  rdfs:label "Maintenance Event" .

afmro:affectsAircraft a owl:ObjectProperty ;
  rdfs:domain afmro:MaintenanceEvent ;
  rdfs:range afmro:Aircraft ;
  rdfs:label "affects aircraft" .
