===Task===
{% if language == "zh" %}
从给定的场景描述中提取本体类，遵循本体工程标准。
{% else %}
Extract ontology classes from the given scenario description following ontology engineering standards.
{% endif %}

===Role===
{% if language == "zh" %}
你是一位专业的本体工程师，精通知识表示和OWL（Web本体语言）标准。你的任务是从场景描述中识别抽象类和概念，而不是具体实例。
{% else %}
You are a professional ontology engineer with expertise in knowledge representation and OWL (Web Ontology Language) standards. Your task is to identify abstract classes and concepts from scenario descriptions, not concrete instances.
{% endif %}

===Scenario Description===
{{ scenario }}

{% if domain -%}
===Domain Hint===
{% if language == "zh" %}
此场景属于 **{{ domain }}** 领域。提取类时请考虑领域特定的概念和术语。
{% else %}
This scenario belongs to the **{{ domain }}** domain. Consider domain-specific concepts and terminology when extracting classes.
{% endif %}
{%- endif %}

===Output Language===
{% if language == "en" -%}
**IMPORTANT: All output content MUST be in English.**
- Class names (name field): English in PascalCase format
- Chinese name (name_chinese field): Provide Chinese translation
- Descriptions: MUST be in English
- Examples: MUST be in English
- Domain: MUST be in English
{%- else -%}
**IMPORTANT: Output content language requirements:**
- Class names (name field): English in PascalCase format
- Chinese name (name_chinese field): Chinese translation
- Descriptions: MUST be in Chinese (中文)
- Examples: MUST be in Chinese (中文)
- Domain: Can be in Chinese or English
{%- endif %}

===Extraction Rules===

{% if language == "zh" %}
**1. 抽象类，而非实例：**
- 提取抽象类别和概念（如"医疗程序"、"患者"、"诊断"）
- 不要提取具体实例（如"张三"、"301房间"、"2024-01-15"）
- 以"事物的类型"而非"具体事物"的角度思考

**2. 命名规范：**
- "name"字段使用中文名称
- 使用清晰、描述性的中文名称
- 示例："医疗程序"、"医疗服务提供者"、"诊断测试"

**3. 领域相关性：**
- 专注于场景领域的核心类
- 优先提取代表关键概念、实体或关系的类
- 避免过于通用的类（如"事物"、"对象"），除非它们在领域中有特定含义

**4. 类数量：**
- 提取5到{{ max_classes }}个类
- 目标是覆盖场景主要概念的平衡集合
- 质量优于数量：优先选择定义明确的类

**5. 清晰的描述：**
- 用中文提供简洁、信息丰富的描述（最多500字）
- 描述类代表什么，而不是具体实例
- 使用清晰、自然的中文解释类在领域中的作用

**6. 具体示例：**
- 为每个类提供2-5个中文具体实例示例
- 示例应该是该类的具体、现实的实例
- 示例有助于阐明类的范围和含义
- 示例格式：["示例1", "示例2", "示例3"]

**7. 类层次结构：**
- 在适用的情况下识别父子关系
- 使用parent_class字段指定继承关系
- 父类必须是提取的类之一或标准OWL类
- 顶级类的parent_class设为null

**8. 实体类型：**
- 为每个类分配适当的entity_type
- 常见类型："人物"、"组织"、"地点"、"事件"、"概念"、"过程"、"对象"、"角色"
- 选择最具体的适用类型

**9. 语言一致性：**
- 所有字段内容必须使用中文
- "name"字段使用中文名称
- "description"字段使用中文描述
- "examples"字段使用中文示例
- "entity_type"字段使用中文类型名称
- "domain"字段使用中文领域名称

{% else %}
**1. Abstract Classes, Not Instances:**
- Extract abstract categories and concepts (e.g., "MedicalProcedure", "Patient", "Diagnosis")
- Do NOT extract concrete instances (e.g., "John Smith", "Room 301", "2024-01-15")
- Think in terms of "types of things" rather than "specific things"

**2. Naming Convention (PascalCase):**
- Use PascalCase format for the "name" field: start with uppercase letter, capitalize each word, no spaces
- Examples: "MedicalProcedure", "HealthcareProvider", "DiagnosticTest"
- Avoid: "medical procedure", "healthcare_provider", "diagnostic-test"
- Use clear, descriptive names in English

**3. Domain Relevance:**
- Focus on classes that are central to the scenario's domain
- Prioritize classes that represent key concepts, entities, or relationships
- Avoid overly generic classes (e.g., "Thing", "Object") unless they have specific domain meaning

**4. Class Quantity:**
- Extract between 5 and {{ max_classes }} classes
- Aim for a balanced set covering the main concepts in the scenario
- Quality over quantity: prefer well-defined classes over exhaustive lists


**5. Clear Descriptions:**
{% if language == "en" -%}
- Provide concise, informative descriptions in English (max 500 characters)
- Describe what the class represents, not specific instances
- Use clear, natural English language that explains the class's role in the domain
{%- else -%}
- Provide concise, informative descriptions in English (max 500 characters)
- Describe what the class represents, not specific instances
- Use clear, natural English language
{%- endif %}

**6. Concrete Examples:**
{% if language == "en" -%}
- Provide 2-5 concrete instance examples in English for each class
- Examples should be specific, realistic instances of the class
- Examples help clarify the class's scope and meaning
- Use natural English language for examples
- Example format: ["Example1", "Example2", "Example3"]
{%- else -%}
- Provide 2-5 concrete instance examples in English for each class
- Examples should be specific, realistic instances of the class
- Examples help clarify the class's scope and meaning
- Example format: ["Example1", "Example2", "Example3"]
{%- endif %}

**7. Class Hierarchy:**
- Identify parent-child relationships where applicable
- Use the parent_class field to specify inheritance
- Parent class must be one of the extracted classes or a standard OWL class
- Leave parent_class as null for top-level classes

**8. Entity Types:**
- Classify each class with an appropriate entity_type
- Common types: "Person", "Organization", "Location", "Event", "Concept", "Process", "Object", "Role"
- Choose the most specific type that applies

**9. Language Consistency:**
- All field content must be in English
- "name" field uses English PascalCase names
- "description" field uses English descriptions
- "examples" field uses English examples
- "entity_type" field uses English type names
- "domain" field uses English domain names
{% endif %}

===Examples===

{% if language == "zh" %}
**示例1（医疗领域）：**
场景："一家医院管理患者记录，安排预约，并协调医疗程序。医生诊断病情并开具治疗方案。"

输出：
{
  "classes": [
    {
      "name": "患者",
      "description": "在医疗机构接受医疗护理或治疗的人",
      "examples": ["张三", "李四", "患有糖尿病的老年患者"],
      "parent_class": null,
      "entity_type": "人物",
      "domain": "医疗"
    },
    {
      "name": "医疗程序",
      "description": "为医疗诊断或治疗而执行的系统性操作流程",
      "examples": ["手术", "血液检查", "X光检查", "疫苗接种"],
      "parent_class": null,
      "entity_type": "过程",
      "domain": "医疗"
    },
    {
      "name": "诊断",
      "description": "基于症状和检查结果对疾病或状况的识别",
      "examples": ["糖尿病诊断", "癌症诊断", "流感诊断"],
      "parent_class": null,
      "entity_type": "概念",
      "domain": "医疗"
    },
    {
      "name": "医生",
      "description": "诊断和治疗患者的持证医疗专业人员",
      "examples": ["全科医生", "外科医生", "心脏病专家"],
      "parent_class": null,
      "entity_type": "角色",
      "domain": "医疗"
    },
    {
      "name": "治疗",
      "description": "为治愈或管理疾病状况而提供的医疗护理或疗法",
      "examples": ["药物治疗", "物理治疗", "化疗", "手术治疗"],
      "parent_class": null,
      "entity_type": "过程",
      "domain": "医疗"
    }
  ],
  "domain": "医疗"
}

**示例2（教育领域）：**
场景："一所大学提供由教授教授的课程。学生注册项目，参加讲座，并完成作业以获得学位。"

输出：
{
  "classes": [
    {
      "name": "学生",
      "description": "在教育机构注册学习的人",
      "examples": ["本科生", "研究生", "在职学生"],
      "parent_class": null,
      "entity_type": "角色",
      "domain": "教育"
    },
    {
      "name": "课程",
      "description": "涵盖特定学科或主题的结构化教育课程",
      "examples": ["计算机科学导论", "微积分I", "世界历史"],
      "parent_class": null,
      "entity_type": "概念",
      "domain": "教育"
    },
    {
      "name": "教授",
      "description": "教授课程并进行研究的学术教师",
      "examples": ["助理教授", "副教授", "正教授"],
      "parent_class": null,
      "entity_type": "角色",
      "domain": "教育"
    },
    {
      "name": "学术项目",
      "description": "通向学位或证书的结构化课程体系",
      "examples": ["理学学士", "文学硕士", "博士项目"],
      "parent_class": null,
      "entity_type": "概念",
      "domain": "教育"
    },
    {
      "name": "作业",
      "description": "分配给学生以评估学习成果的任务或项目",
      "examples": ["论文", "习题集", "研究报告", "实验报告"],
      "parent_class": null,
      "entity_type": "对象",
      "domain": "教育"
    }
  ],
  "domain": "教育"
}

{% else %}

{% if language == "en" -%}
**Example 1 (Healthcare Domain):**
Scenario: "A hospital manages patient records, schedules appointments, and coordinates medical procedures. Doctors diagnose conditions and prescribe treatments."

Output:
{
  "classes": [
    {
      "name": "Patient",
      "name_chinese": "患者",
      "description": "A person who receives medical care or treatment at a healthcare facility",
      "examples": ["Outpatient", "Inpatient", "Emergency patient", "Chronic disease patient"],
      "parent_class": null,
      "entity_type": "Person",
      "domain": "Healthcare"
    },
    {
      "name": "MedicalProcedure",
      "name_chinese": "医疗程序",
      "description": "A systematic operation or process performed for medical diagnosis or treatment",
      "examples": ["Surgery", "Blood test", "X-ray examination", "Vaccination"],
      "parent_class": null,
      "entity_type": "Process",
      "domain": "Healthcare"
    },
    {
      "name": "Diagnosis",
      "name_chinese": "诊断",
      "description": "The identification of a disease or condition based on symptoms and examination results",
      "examples": ["Diabetes diagnosis", "Cancer diagnosis", "Flu diagnosis"],
      "parent_class": null,
      "entity_type": "Concept",
      "domain": "Healthcare"
    },
    {
      "name": "Doctor",
      "name_chinese": "医生",
      "description": "A licensed medical professional who diagnoses and treats patients",
      "examples": ["General practitioner", "Surgeon", "Cardiologist"],
      "parent_class": null,
      "entity_type": "Role",
      "domain": "Healthcare"
    },
    {
      "name": "Treatment",
      "name_chinese": "治疗",
      "description": "Medical care or therapy provided to cure or manage a disease condition",
      "examples": ["Medication therapy", "Physical therapy", "Chemotherapy", "Surgical treatment"],
      "parent_class": null,
      "entity_type": "Process",
      "domain": "Healthcare"
    }
  ],
  "domain": "Healthcare",
  "namespace": "http://example.org/healthcare#"
}
{%- else -%}
**Example 1 (Healthcare Domain):**
Scenario: "A hospital manages patient records, schedules appointments, and coordinates medical procedures. Doctors diagnose conditions and prescribe treatments."

Output:
{
  "classes": [
    {
      "name": "Patient",
      "description": "A person receiving medical care or treatment at a healthcare facility",
      "examples": ["John Smith", "Jane Doe", "Elderly patient with diabetes"],
      "parent_class": null,
      "entity_type": "Person",
      "domain": "Healthcare"
    },
    {
      "name": "MedicalProcedure",
      "description": "A systematic operation performed for medical diagnosis or treatment",
      "examples": ["Surgery", "Blood test", "X-ray examination", "Vaccination"],
      "parent_class": null,
      "entity_type": "Process",
      "domain": "Healthcare"
    },
    {
      "name": "Diagnosis",
      "description": "Identification of a disease or condition based on symptoms and examination results",
      "examples": ["Diabetes diagnosis", "Cancer diagnosis", "Flu diagnosis"],
      "parent_class": null,
      "entity_type": "Concept",
      "domain": "Healthcare"
    },
    {
      "name": "Doctor",
      "description": "A licensed medical professional who diagnoses and treats patients",
      "examples": ["General practitioner", "Surgeon", "Cardiologist"],
      "parent_class": null,
      "entity_type": "Role",
      "domain": "Healthcare"
    },
    {
      "name": "Treatment",
      "description": "Medical care or therapy provided to cure or manage a disease condition",
      "examples": ["Medication therapy", "Physical therapy", "Chemotherapy", "Surgical treatment"],
      "parent_class": null,
      "entity_type": "Process",
      "domain": "Healthcare"
    }
  ],
  "domain": "Healthcare"
}

**Example 2 (Education Domain):**
Scenario: "A university offers courses taught by professors. Students enroll in programs, attend lectures, and complete assignments to earn degrees."

Output:
{
  "classes": [
    {
      "name": "Student",
      "description": "A person enrolled in an educational institution for learning",
      "examples": ["Undergraduate student", "Graduate student", "Part-time student"],
      "parent_class": null,
      "entity_type": "Role",
      "domain": "Education"
    },
    {
      "name": "Course",
      "description": "A structured educational program covering a specific subject or topic",
      "examples": ["Introduction to Computer Science", "Calculus I", "World History"],
      "parent_class": null,
      "entity_type": "Concept",
      "domain": "Education"
    },
    {
      "name": "Professor",
      "description": "An academic teacher who teaches courses and conducts research",
      "examples": ["Assistant professor", "Associate professor", "Full professor"],
      "parent_class": null,
      "entity_type": "Role",
      "domain": "Education"
    },
    {
      "name": "AcademicProgram",
      "description": "A structured curriculum leading to a degree or certificate",
      "examples": ["Bachelor of Science", "Master of Arts", "PhD program"],
      "parent_class": null,
      "entity_type": "Concept",
      "domain": "Education"
    },
    {
      "name": "Assignment",
      "description": "A task or project assigned to students to assess learning outcomes",
      "examples": ["Essay", "Problem set", "Research paper", "Lab report"],
      "parent_class": null,
      "entity_type": "Object",
      "domain": "Education"
    }
  ],
  "domain": "Education"
}
{% endif %}
{% endif %}

===Output Format===

**JSON Requirements:**
- Use only ASCII double quotes (") for JSON structure
- Never use Chinese quotation marks ("") or Unicode quotes
- Escape quotation marks in text with backslashes (\")
- Ensure proper string closure and comma separation
- No line breaks within JSON string values
- All class names must be unique (case-insensitive)
- Extract between 5 and {{ max_classes }} classes
{% if language == "zh" %}
- 所有字段内容必须使用中文
{% else %}
- All field content must be in English
{% endif %}

{{ json_schema }}
