@prefix : <#> .
@prefix schema: <http://schema.org/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix p-plan: <http://purl.org/net/p-plan#> .

<> a schema:CreativeWork ;
    schema:name "Hospital Operating System Ontology Document"@en ;
    schema:description "Document about TBox for the 'Operating System' box of the IBD (Intelligent By Design) hospital-design framing: how the hospital works, as distinct from the physical Structural Design box (where the hospital works). Mockup derived from agent-rdf-memory/ontology.ttl's authoring conventions, applied to a hospital operating-model domain rather than agent session memory."@en ;
    schema:dateCreated "2026-08-04"^^xsd:date ;
    schema:about :hospitalOS .

:hospitalOS a owl:Ontology ;
    schema:name "Hospital Operating System Ontology"@en ;
    schema:description "Models the ten operating-model concept categories (Clinical Pathways, Terminology & Ontologies, Workflows/Processes, Knowledge Graph, Tasks & Workforce, Master Data, Policies & Governance, Decision Rights, Logistics & Resources, Performance & Quality) and the relations that answer: what is done, by whom, with what, in what sequence, and under what rules. The source framing states this layer spans roughly 30,000-60,000 tasks and thousands of concepts hospital-wide; entities.ttl instantiates one representative pathway at illustrative scale, not the full inventory. Workflow/sequencing terms (ClinicalPathway, WorkflowStep, hasStep, nextStep) are cross-referenced via owl:equivalentClass/owl:inverseOf to the P-Plan ontology (http://purl.org/net/p-plan#) for interoperability with plan/step-modeling tools outside this corpus."@en ;
    rdfs:seeAlso <entities.ttl>, <howto/instantiate-new-pathway.ttl>, <http://purl.org/net/p-plan#> .

# ── Category Classes (the 10 boxes) ─────────────────────────────────────────
# All ten are rdfs:subClassOf :KnowledgeGraphComponent: the "Knowledge Graph"
# box in the source image is not a sibling silo but the connective layer that
# every other category participates in once instantiated and linked.

:KnowledgeGraphComponent a rdfs:Class ;
    rdfs:label "Knowledge Graph Component"@en ;
    rdfs:comment "Marker superclass for any entity that participates as a node in the hospital operating-model knowledge graph. Represents the 'Knowledge Graph' box as the connective semantic layer spanning the other nine categories, rather than as an isolated concept type."@en ;
    rdfs:isDefinedBy :hospitalOS .

:ClinicalPathway a rdfs:Class ;
    rdfs:subClassOf :KnowledgeGraphComponent ;
    rdfs:label "Clinical Pathway"@en ;
    rdfs:comment "An ordered, protocol-driven sequence of care for a clinical condition, composed of WorkflowSteps."@en ;
    owl:equivalentClass p-plan:Plan ;
    rdfs:isDefinedBy :hospitalOS .

:TerminologyConcept a rdfs:Class ;
    rdfs:subClassOf :KnowledgeGraphComponent, skos:Concept ;
    rdfs:label "Terminology Concept"@en ;
    rdfs:comment "A standardized clinical or operational term (e.g. a SNOMED CT / LOINC-style concept) used to bind pathways, tasks, and master data to a controlled vocabulary. Subclasses skos:Concept so terminology can use skos:prefLabel, skos:notation, and skos:broader/narrower directly."@en ;
    rdfs:isDefinedBy :hospitalOS .

:WorkflowStep a rdfs:Class ;
    rdfs:subClassOf :KnowledgeGraphComponent ;
    rdfs:label "Workflow Step"@en ;
    rdfs:comment "One ordered stage of a ClinicalPathway, grouping the Tasks performed at that stage."@en ;
    owl:equivalentClass p-plan:Step ;
    rdfs:isDefinedBy :hospitalOS .

:Task a rdfs:Class ;
    rdfs:subClassOf :KnowledgeGraphComponent ;
    rdfs:label "Task"@en ;
    rdfs:comment "A discrete unit of work within a WorkflowStep. The hospital-wide operating model is described as spanning roughly 30,000-60,000 such tasks."@en ;
    rdfs:isDefinedBy :hospitalOS .

:WorkforceRole a rdfs:Class ;
    rdfs:subClassOf :KnowledgeGraphComponent ;
    rdfs:label "Workforce Role"@en ;
    rdfs:comment "A staff role (by job function, not by named individual) that performs Tasks. Pairs with Task to realize the 'Tasks & Workforce' box."@en ;
    rdfs:isDefinedBy :hospitalOS .

:MasterDataEntity a rdfs:Class ;
    rdfs:subClassOf :KnowledgeGraphComponent ;
    rdfs:label "Master Data Entity"@en ;
    rdfs:comment "A governed reference-data record (patient record, formulary item, order-catalog entry) that a Task reads or writes."@en ;
    rdfs:isDefinedBy :hospitalOS .

:Policy a rdfs:Class ;
    rdfs:subClassOf :KnowledgeGraphComponent ;
    rdfs:label "Policy"@en ;
    rdfs:comment "A governance rule that constrains how a Task, WorkflowStep, or ClinicalPathway may be carried out."@en ;
    rdfs:isDefinedBy :hospitalOS .

:DecisionRight a rdfs:Class ;
    rdfs:subClassOf :KnowledgeGraphComponent ;
    rdfs:label "Decision Right"@en ;
    rdfs:comment "An authority to make a specific class of decision (e.g. initiate a bundle, escalate to ICU), held by a WorkforceRole and scoped to a Task or ClinicalPathway."@en ;
    rdfs:isDefinedBy :hospitalOS .

:LogisticsResource a rdfs:Class ;
    rdfs:subClassOf :KnowledgeGraphComponent ;
    rdfs:label "Logistics Resource"@en ;
    rdfs:comment "A physical or schedulable resource (bed, equipment, stock item) consumed or occupied by a Task."@en ;
    rdfs:isDefinedBy :hospitalOS .

:PerformanceMetric a rdfs:Class ;
    rdfs:subClassOf :KnowledgeGraphComponent ;
    rdfs:label "Performance Metric"@en ;
    rdfs:comment "A quality or performance measure used to evaluate a ClinicalPathway or Task against a target."@en ;
    rdfs:isDefinedBy :hospitalOS .

# ── Relations: what / by whom / with what / in what sequence / under what rules ─

:hasStep a owl:ObjectProperty ;
    rdfs:label "has step"@en ;
    rdfs:comment "Links a ClinicalPathway to one of its ordered WorkflowSteps."@en ;
    rdfs:domain :ClinicalPathway ;
    rdfs:range :WorkflowStep ;
    owl:inverseOf p-plan:isStepOfPlan ;
    rdfs:isDefinedBy :hospitalOS .

:stepOrder a owl:DatatypeProperty, owl:FunctionalProperty ;
    rdfs:label "step order"@en ;
    rdfs:comment "1-based position of a WorkflowStep within its ClinicalPathway. [in what sequence]"@en ;
    rdfs:domain :WorkflowStep ;
    rdfs:range xsd:integer ;
    rdfs:isDefinedBy :hospitalOS .

:nextStep a owl:ObjectProperty, owl:FunctionalProperty, owl:IrreflexiveProperty ;
    rdfs:label "next step"@en ;
    rdfs:comment "Points from one WorkflowStep to the WorkflowStep that follows it. Redundant with stepOrder but makes the sequence directly traversable without sorting. [in what sequence]"@en ;
    rdfs:domain :WorkflowStep ;
    rdfs:range :WorkflowStep ;
    owl:inverseOf p-plan:isPrecededBy ;
    rdfs:isDefinedBy :hospitalOS .

:hasTask a owl:ObjectProperty ;
    rdfs:label "has task"@en ;
    rdfs:comment "Links a WorkflowStep to a Task performed within it. [what is done]"@en ;
    rdfs:domain :WorkflowStep ;
    rdfs:range :Task ;
    rdfs:isDefinedBy :hospitalOS .

:performedBy a owl:ObjectProperty ;
    rdfs:label "performed by"@en ;
    rdfs:comment "Links a Task to the WorkforceRole that carries it out. [by whom]"@en ;
    rdfs:domain :Task ;
    rdfs:range :WorkforceRole ;
    rdfs:isDefinedBy :hospitalOS .

:referencesMasterData a owl:ObjectProperty ;
    rdfs:label "references master data"@en ;
    rdfs:comment "Links a Task to a MasterDataEntity it reads or writes. [with what]"@en ;
    rdfs:domain :Task ;
    rdfs:range :MasterDataEntity ;
    rdfs:isDefinedBy :hospitalOS .

:consumesResource a owl:ObjectProperty ;
    rdfs:label "consumes resource"@en ;
    rdfs:comment "Links a Task to a LogisticsResource it occupies or draws down. [with what]"@en ;
    rdfs:domain :Task ;
    rdfs:range :LogisticsResource ;
    rdfs:isDefinedBy :hospitalOS .

:usesTerminology a owl:ObjectProperty ;
    rdfs:label "uses terminology"@en ;
    rdfs:comment "Binds a Task, MasterDataEntity, or ClinicalPathway to the standardized TerminologyConcept it is expressed in."@en ;
    rdfs:domain :KnowledgeGraphComponent ;
    rdfs:range :TerminologyConcept ;
    rdfs:isDefinedBy :hospitalOS .

:governedByPolicy a owl:ObjectProperty ;
    rdfs:label "governed by policy"@en ;
    rdfs:comment "Links a Task, WorkflowStep, or ClinicalPathway to a Policy that constrains how it may be carried out. [under what rules]"@en ;
    rdfs:domain :KnowledgeGraphComponent ;
    rdfs:range :Policy ;
    rdfs:isDefinedBy :hospitalOS .

:hasDecisionRight a owl:ObjectProperty ;
    rdfs:label "has decision right"@en ;
    rdfs:comment "Links a Task or ClinicalPathway to a DecisionRight that must be exercised at that point. [under what rules]"@en ;
    rdfs:domain :KnowledgeGraphComponent ;
    rdfs:range :DecisionRight ;
    rdfs:isDefinedBy :hospitalOS .

:heldBy a owl:ObjectProperty ;
    rdfs:label "held by"@en ;
    rdfs:comment "Links a DecisionRight to the WorkforceRole authorized to exercise it. [by whom]"@en ;
    rdfs:domain :DecisionRight ;
    rdfs:range :WorkforceRole ;
    rdfs:isDefinedBy :hospitalOS .

:measuredBy a owl:ObjectProperty ;
    rdfs:label "measured by"@en ;
    rdfs:comment "Links a ClinicalPathway or Task to a PerformanceMetric that evaluates it."@en ;
    rdfs:domain :KnowledgeGraphComponent ;
    rdfs:range :PerformanceMetric ;
    rdfs:isDefinedBy :hospitalOS .

:metricTargetValue a owl:DatatypeProperty, owl:FunctionalProperty ;
    rdfs:label "metric target value"@en ;
    rdfs:comment "The numeric target a PerformanceMetric is evaluated against."@en ;
    rdfs:domain :PerformanceMetric ;
    rdfs:range xsd:decimal ;
    rdfs:isDefinedBy :hospitalOS .

:metricUnit a owl:DatatypeProperty, owl:FunctionalProperty ;
    rdfs:label "metric unit"@en ;
    rdfs:comment "The unit of measure for a PerformanceMetric's value and target (e.g. 'minutes', 'percent')."@en ;
    rdfs:domain :PerformanceMetric ;
    rdfs:range xsd:string ;
    rdfs:isDefinedBy :hospitalOS .

:estimatedAnnualTaskVolume a owl:DatatypeProperty, owl:FunctionalProperty ;
    rdfs:label "estimated annual task volume"@en ;
    rdfs:comment "Illustrative estimate of how many times a ClinicalPathway's tasks fire per year, used to connect this worked example back to the source framing's hospital-wide 30,000-60,000 task figure. Not a verified operational statistic."@en ;
    rdfs:domain :ClinicalPathway ;
    rdfs:range xsd:integer ;
    rdfs:isDefinedBy :hospitalOS .
