@prefix pm: <https://ggen.ai/ontology/project-management#> .
@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 dcterms: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .

# Ontology Definition
pm: a owl:Ontology ;
    dcterms:title "Project Management Ontology" ;
    dcterms:description "Ontology for project management with Gantt charts, sprints, resources, and budgets" ;
    dcterms:created "2025-01-08"^^xsd:date ;
    owl:versionInfo "1.0.0" .

# ============================================================================
# CORE CLASSES
# ============================================================================

# Project Classes
pm:Project a owl:Class ;
    rdfs:label "Project" ;
    rdfs:comment "A project with tasks, milestones, and resources" .

pm:Program a owl:Class ;
    rdfs:label "Program" ;
    rdfs:comment "Collection of related projects" .

pm:Portfolio a owl:Class ;
    rdfs:label "Portfolio" ;
    rdfs:comment "Collection of programs and projects" .

# Task Management
pm:Task a owl:Class ;
    rdfs:label "Task" ;
    rdfs:comment "Individual work item or activity" .

pm:Subtask a owl:Class ;
    rdfs:subClassOf pm:Task ;
    rdfs:label "Subtask" ;
    rdfs:comment "Task that is part of a parent task" .

pm:Milestone a owl:Class ;
    rdfs:label "Milestone" ;
    rdfs:comment "Key project checkpoint or deliverable" .

pm:Deliverable a owl:Class ;
    rdfs:label "Deliverable" ;
    rdfs:comment "Tangible output or product" .

# Dependencies
pm:TaskDependency a owl:Class ;
    rdfs:label "Task Dependency" ;
    rdfs:comment "Dependency relationship between tasks" .

pm:FinishToStart a owl:Class ;
    rdfs:subClassOf pm:TaskDependency ;
    rdfs:label "Finish-to-Start" ;
    rdfs:comment "Task B starts after Task A finishes" .

pm:StartToStart a owl:Class ;
    rdfs:subClassOf pm:TaskDependency ;
    rdfs:label "Start-to-Start" ;
    rdfs:comment "Task B starts when Task A starts" .

pm:FinishToFinish a owl:Class ;
    rdfs:subClassOf pm:TaskDependency ;
    rdfs:label "Finish-to-Finish" ;
    rdfs:comment "Task B finishes when Task A finishes" .

pm:StartToFinish a owl:Class ;
    rdfs:subClassOf pm:TaskDependency ;
    rdfs:label "Start-to-Finish" ;
    rdfs:comment "Task B finishes when Task A starts" .

# Gantt & Scheduling
pm:GanttChart a owl:Class ;
    rdfs:label "Gantt Chart" ;
    rdfs:comment "Visual project timeline" .

pm:Schedule a owl:Class ;
    rdfs:label "Schedule" ;
    rdfs:comment "Project schedule with dates and durations" .

pm:CriticalPath a owl:Class ;
    rdfs:label "Critical Path" ;
    rdfs:comment "Sequence of critical tasks" .

pm:Baseline a owl:Class ;
    rdfs:label "Baseline" ;
    rdfs:comment "Original project plan for comparison" .

# Agile & Sprints
pm:Sprint a owl:Class ;
    rdfs:label "Sprint" ;
    rdfs:comment "Fixed time-boxed iteration" .

pm:Backlog a owl:Class ;
    rdfs:label "Backlog" ;
    rdfs:comment "Prioritized list of work items" .

pm:ProductBacklog a owl:Class ;
    rdfs:subClassOf pm:Backlog ;
    rdfs:label "Product Backlog" ;
    rdfs:comment "Overall product backlog" .

pm:SprintBacklog a owl:Class ;
    rdfs:subClassOf pm:Backlog ;
    rdfs:label "Sprint Backlog" ;
    rdfs:comment "Work items for a sprint" .

pm:UserStory a owl:Class ;
    rdfs:label "User Story" ;
    rdfs:comment "Feature description from user perspective" .

pm:Epic a owl:Class ;
    rdfs:label "Epic" ;
    rdfs:comment "Large user story or feature" .

# Kanban
pm:KanbanBoard a owl:Class ;
    rdfs:label "Kanban Board" ;
    rdfs:comment "Visual workflow board" .

pm:KanbanColumn a owl:Class ;
    rdfs:label "Kanban Column" ;
    rdfs:comment "Column representing work stage" .

pm:WorkInProgress a owl:Class ;
    rdfs:label "Work In Progress" ;
    rdfs:comment "Tasks currently being worked on" .

# Resources
pm:Resource a owl:Class ;
    rdfs:label "Resource" ;
    rdfs:comment "Project resource (person, equipment, material)" .

pm:HumanResource a owl:Class ;
    rdfs:subClassOf pm:Resource ;
    rdfs:label "Human Resource" ;
    rdfs:comment "Team member or person" .

pm:MaterialResource a owl:Class ;
    rdfs:subClassOf pm:Resource ;
    rdfs:label "Material Resource" ;
    rdfs:comment "Consumable material" .

pm:EquipmentResource a owl:Class ;
    rdfs:subClassOf pm:Resource ;
    rdfs:label "Equipment Resource" ;
    rdfs:comment "Reusable equipment" .

pm:ResourceAllocation a owl:Class ;
    rdfs:label "Resource Allocation" ;
    rdfs:comment "Assignment of resource to task" .

# Time Tracking
pm:TimeEntry a owl:Class ;
    rdfs:label "Time Entry" ;
    rdfs:comment "Time logged on a task" .

pm:Timesheet a owl:Class ;
    rdfs:label "Timesheet" ;
    rdfs:comment "Collection of time entries" .

pm:WorkLog a owl:Class ;
    rdfs:label "Work Log" ;
    rdfs:comment "Log of work performed" .

# Budget & Finance
pm:Budget a owl:Class ;
    rdfs:label "Budget" ;
    rdfs:comment "Project budget and costs" .

pm:Cost a owl:Class ;
    rdfs:label "Cost" ;
    rdfs:comment "Cost item or expense" .

pm:Invoice a owl:Class ;
    rdfs:label "Invoice" ;
    rdfs:comment "Billing invoice" .

pm:Expense a owl:Class ;
    rdfs:label "Expense" ;
    rdfs:comment "Project expense" .

pm:EarnedValue a owl:Class ;
    rdfs:label "Earned Value" ;
    rdfs:comment "Value of completed work" .

# Risks & Issues
pm:Risk a owl:Class ;
    rdfs:label "Risk" ;
    rdfs:comment "Potential project risk" .

pm:Issue a owl:Class ;
    rdfs:label "Issue" ;
    rdfs:comment "Current project problem" .

pm:Mitigation a owl:Class ;
    rdfs:label "Mitigation" ;
    rdfs:comment "Risk mitigation strategy" .

# ============================================================================
# PROPERTIES
# ============================================================================

# Project Properties
pm:projectName a owl:DatatypeProperty ;
    rdfs:domain pm:Project ;
    rdfs:range xsd:string ;
    rdfs:label "project name" .

pm:projectCode a owl:DatatypeProperty ;
    rdfs:domain pm:Project ;
    rdfs:range xsd:string ;
    rdfs:label "project code" .

pm:projectStatus a owl:DatatypeProperty ;
    rdfs:domain pm:Project ;
    rdfs:range xsd:string ;
    rdfs:label "project status" .

pm:startDate a owl:DatatypeProperty ;
    rdfs:domain pm:Project ;
    rdfs:range xsd:date ;
    rdfs:label "start date" .

pm:endDate a owl:DatatypeProperty ;
    rdfs:domain pm:Project ;
    rdfs:range xsd:date ;
    rdfs:label "end date" .

pm:projectManager a owl:ObjectProperty ;
    rdfs:domain pm:Project ;
    rdfs:range foaf:Person ;
    rdfs:label "project manager" .

pm:projectSponsor a owl:ObjectProperty ;
    rdfs:domain pm:Project ;
    rdfs:range foaf:Person ;
    rdfs:label "project sponsor" .

# Task Properties
pm:hasTask a owl:ObjectProperty ;
    rdfs:domain pm:Project ;
    rdfs:range pm:Task ;
    rdfs:label "has task" .

pm:taskName a owl:DatatypeProperty ;
    rdfs:domain pm:Task ;
    rdfs:range xsd:string ;
    rdfs:label "task name" .

pm:taskDescription a owl:DatatypeProperty ;
    rdfs:domain pm:Task ;
    rdfs:range xsd:string ;
    rdfs:label "task description" .

pm:taskStatus a owl:DatatypeProperty ;
    rdfs:domain pm:Task ;
    rdfs:range xsd:string ;
    rdfs:label "task status" .

pm:taskPriority a owl:DatatypeProperty ;
    rdfs:domain pm:Task ;
    rdfs:range xsd:string ;
    rdfs:label "task priority" .

pm:estimatedHours a owl:DatatypeProperty ;
    rdfs:domain pm:Task ;
    rdfs:range xsd:decimal ;
    rdfs:label "estimated hours" .

pm:actualHours a owl:DatatypeProperty ;
    rdfs:domain pm:Task ;
    rdfs:range xsd:decimal ;
    rdfs:label "actual hours" .

pm:percentComplete a owl:DatatypeProperty ;
    rdfs:domain pm:Task ;
    rdfs:range xsd:integer ;
    rdfs:label "percent complete" .

pm:assignedTo a owl:ObjectProperty ;
    rdfs:domain pm:Task ;
    rdfs:range pm:Resource ;
    rdfs:label "assigned to" .

# Dependency Properties
pm:dependsOn a owl:ObjectProperty ;
    rdfs:domain pm:Task ;
    rdfs:range pm:Task ;
    rdfs:label "depends on" .

pm:hasDependency a owl:ObjectProperty ;
    rdfs:domain pm:Task ;
    rdfs:range pm:TaskDependency ;
    rdfs:label "has dependency" .

pm:predecessorTask a owl:ObjectProperty ;
    rdfs:domain pm:TaskDependency ;
    rdfs:range pm:Task ;
    rdfs:label "predecessor task" .

pm:successorTask a owl:ObjectProperty ;
    rdfs:domain pm:TaskDependency ;
    rdfs:range pm:Task ;
    rdfs:label "successor task" .

pm:lagTime a owl:DatatypeProperty ;
    rdfs:domain pm:TaskDependency ;
    rdfs:range xsd:duration ;
    rdfs:label "lag time" .

# Milestone Properties
pm:hasMilestone a owl:ObjectProperty ;
    rdfs:domain pm:Project ;
    rdfs:range pm:Milestone ;
    rdfs:label "has milestone" .

pm:milestoneName a owl:DatatypeProperty ;
    rdfs:domain pm:Milestone ;
    rdfs:range xsd:string ;
    rdfs:label "milestone name" .

pm:milestoneDate a owl:DatatypeProperty ;
    rdfs:domain pm:Milestone ;
    rdfs:range xsd:date ;
    rdfs:label "milestone date" .

pm:isAchieved a owl:DatatypeProperty ;
    rdfs:domain pm:Milestone ;
    rdfs:range xsd:boolean ;
    rdfs:label "is achieved" .

# Sprint Properties
pm:hasSprint a owl:ObjectProperty ;
    rdfs:domain pm:Project ;
    rdfs:range pm:Sprint ;
    rdfs:label "has sprint" .

pm:sprintNumber a owl:DatatypeProperty ;
    rdfs:domain pm:Sprint ;
    rdfs:range xsd:integer ;
    rdfs:label "sprint number" .

pm:sprintGoal a owl:DatatypeProperty ;
    rdfs:domain pm:Sprint ;
    rdfs:range xsd:string ;
    rdfs:label "sprint goal" .

pm:sprintVelocity a owl:DatatypeProperty ;
    rdfs:domain pm:Sprint ;
    rdfs:range xsd:integer ;
    rdfs:label "sprint velocity" .

pm:storyPoints a owl:DatatypeProperty ;
    rdfs:domain pm:UserStory ;
    rdfs:range xsd:integer ;
    rdfs:label "story points" .

# Kanban Properties
pm:hasBoard a owl:ObjectProperty ;
    rdfs:domain pm:Project ;
    rdfs:range pm:KanbanBoard ;
    rdfs:label "has board" .

pm:hasColumn a owl:ObjectProperty ;
    rdfs:domain pm:KanbanBoard ;
    rdfs:range pm:KanbanColumn ;
    rdfs:label "has column" .

pm:wipLimit a owl:DatatypeProperty ;
    rdfs:domain pm:KanbanColumn ;
    rdfs:range xsd:integer ;
    rdfs:label "WIP limit" .

pm:columnOrder a owl:DatatypeProperty ;
    rdfs:domain pm:KanbanColumn ;
    rdfs:range xsd:integer ;
    rdfs:label "column order" .

# Resource Properties
pm:hasResource a owl:ObjectProperty ;
    rdfs:domain pm:Project ;
    rdfs:range pm:Resource ;
    rdfs:label "has resource" .

pm:resourceName a owl:DatatypeProperty ;
    rdfs:domain pm:Resource ;
    rdfs:range xsd:string ;
    rdfs:label "resource name" .

pm:availability a owl:DatatypeProperty ;
    rdfs:domain pm:Resource ;
    rdfs:range xsd:decimal ;
    rdfs:label "availability" .

pm:costPerHour a owl:DatatypeProperty ;
    rdfs:domain pm:Resource ;
    rdfs:range xsd:decimal ;
    rdfs:label "cost per hour" .

pm:allocatedHours a owl:DatatypeProperty ;
    rdfs:domain pm:ResourceAllocation ;
    rdfs:range xsd:decimal ;
    rdfs:label "allocated hours" .

# Time Tracking Properties
pm:hasTimeEntry a owl:ObjectProperty ;
    rdfs:domain pm:Task ;
    rdfs:range pm:TimeEntry ;
    rdfs:label "has time entry" .

pm:hoursLogged a owl:DatatypeProperty ;
    rdfs:domain pm:TimeEntry ;
    rdfs:range xsd:decimal ;
    rdfs:label "hours logged" .

pm:logDate a owl:DatatypeProperty ;
    rdfs:domain pm:TimeEntry ;
    rdfs:range xsd:date ;
    rdfs:label "log date" .

pm:loggedBy a owl:ObjectProperty ;
    rdfs:domain pm:TimeEntry ;
    rdfs:range foaf:Person ;
    rdfs:label "logged by" .

# Budget Properties
pm:hasBudget a owl:ObjectProperty ;
    rdfs:domain pm:Project ;
    rdfs:range pm:Budget ;
    rdfs:label "has budget" .

pm:plannedCost a owl:DatatypeProperty ;
    rdfs:domain pm:Budget ;
    rdfs:range xsd:decimal ;
    rdfs:label "planned cost" .

pm:actualCost a owl:DatatypeProperty ;
    rdfs:domain pm:Budget ;
    rdfs:range xsd:decimal ;
    rdfs:label "actual cost" .

pm:remainingBudget a owl:DatatypeProperty ;
    rdfs:domain pm:Budget ;
    rdfs:range xsd:decimal ;
    rdfs:label "remaining budget" .

pm:costVariance a owl:DatatypeProperty ;
    rdfs:domain pm:Budget ;
    rdfs:range xsd:decimal ;
    rdfs:label "cost variance" .

pm:hasInvoice a owl:ObjectProperty ;
    rdfs:domain pm:Project ;
    rdfs:range pm:Invoice ;
    rdfs:label "has invoice" .

pm:invoiceAmount a owl:DatatypeProperty ;
    rdfs:domain pm:Invoice ;
    rdfs:range xsd:decimal ;
    rdfs:label "invoice amount" .

pm:invoiceDate a owl:DatatypeProperty ;
    rdfs:domain pm:Invoice ;
    rdfs:range xsd:date ;
    rdfs:label "invoice date" .

# Risk Properties
pm:hasRisk a owl:ObjectProperty ;
    rdfs:domain pm:Project ;
    rdfs:range pm:Risk ;
    rdfs:label "has risk" .

pm:riskProbability a owl:DatatypeProperty ;
    rdfs:domain pm:Risk ;
    rdfs:range xsd:decimal ;
    rdfs:label "risk probability" .

pm:riskImpact a owl:DatatypeProperty ;
    rdfs:domain pm:Risk ;
    rdfs:range xsd:string ;
    rdfs:label "risk impact" .

pm:hasMitigation a owl:ObjectProperty ;
    rdfs:domain pm:Risk ;
    rdfs:range pm:Mitigation ;
    rdfs:label "has mitigation" .
