{
  "schemaVersion": "1.0",
  "item": {
    "slug": "ontology",
    "name": "Ontology",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/oswalpalash/ontology",
    "canonicalUrl": "https://clawhub.ai/oswalpalash/ontology",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/ontology",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=ontology",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "references/queries.md",
      "references/schema.md",
      "scripts/ontology.py",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/ontology"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/ontology",
    "agentPageUrl": "https://openagent3.xyz/skills/ontology/agent",
    "manifestUrl": "https://openagent3.xyz/skills/ontology/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/ontology/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Ontology",
        "body": "A typed vocabulary + constraint system for representing knowledge as a verifiable graph."
      },
      {
        "title": "Core Concept",
        "body": "Everything is an entity with a type, properties, and relations to other entities. Every mutation is validated against type constraints before committing.\n\nEntity: { id, type, properties, relations, created, updated }\nRelation: { from_id, relation_type, to_id, properties }"
      },
      {
        "title": "When to Use",
        "body": "TriggerAction\"Remember that...\"Create/update entity\"What do I know about X?\"Query graph\"Link X to Y\"Create relation\"Show all tasks for project Z\"Graph traversal\"What depends on X?\"Dependency queryPlanning multi-step workModel as graph transformationsSkill needs shared stateRead/write ontology objects"
      },
      {
        "title": "Core Types",
        "body": "# Agents & People\nPerson: { name, email?, phone?, notes? }\nOrganization: { name, type?, members[] }\n\n# Work\nProject: { name, status, goals[], owner? }\nTask: { title, status, due?, priority?, assignee?, blockers[] }\nGoal: { description, target_date?, metrics[] }\n\n# Time & Place\nEvent: { title, start, end?, location?, attendees[], recurrence? }\nLocation: { name, address?, coordinates? }\n\n# Information\nDocument: { title, path?, url?, summary? }\nMessage: { content, sender, recipients[], thread? }\nThread: { subject, participants[], messages[] }\nNote: { content, tags[], refs[] }\n\n# Resources\nAccount: { service, username, credential_ref? }\nDevice: { name, type, identifiers[] }\nCredential: { service, secret_ref }  # Never store secrets directly\n\n# Meta\nAction: { type, target, timestamp, outcome? }\nPolicy: { scope, rule, enforcement }"
      },
      {
        "title": "Storage",
        "body": "Default: memory/ontology/graph.jsonl\n\n{\"op\":\"create\",\"entity\":{\"id\":\"p_001\",\"type\":\"Person\",\"properties\":{\"name\":\"Alice\"}}}\n{\"op\":\"create\",\"entity\":{\"id\":\"proj_001\",\"type\":\"Project\",\"properties\":{\"name\":\"Website Redesign\",\"status\":\"active\"}}}\n{\"op\":\"relate\",\"from\":\"proj_001\",\"rel\":\"has_owner\",\"to\":\"p_001\"}\n\nQuery via scripts or direct file ops. For complex graphs, migrate to SQLite."
      },
      {
        "title": "Append-Only Rule",
        "body": "When working with existing ontology data or schema, append/merge changes instead of overwriting files. This preserves history and avoids clobbering prior definitions."
      },
      {
        "title": "Create Entity",
        "body": "python3 scripts/ontology.py create --type Person --props '{\"name\":\"Alice\",\"email\":\"alice@example.com\"}'"
      },
      {
        "title": "Query",
        "body": "python3 scripts/ontology.py query --type Task --where '{\"status\":\"open\"}'\npython3 scripts/ontology.py get --id task_001\npython3 scripts/ontology.py related --id proj_001 --rel has_task"
      },
      {
        "title": "Link Entities",
        "body": "python3 scripts/ontology.py relate --from proj_001 --rel has_task --to task_001"
      },
      {
        "title": "Validate",
        "body": "python3 scripts/ontology.py validate  # Check all constraints"
      },
      {
        "title": "Constraints",
        "body": "Define in memory/ontology/schema.yaml:\n\ntypes:\n  Task:\n    required: [title, status]\n    status_enum: [open, in_progress, blocked, done]\n  \n  Event:\n    required: [title, start]\n    validate: \"end >= start if end exists\"\n\n  Credential:\n    required: [service, secret_ref]\n    forbidden_properties: [password, secret, token]  # Force indirection\n\nrelations:\n  has_owner:\n    from_types: [Project, Task]\n    to_types: [Person]\n    cardinality: many_to_one\n  \n  blocks:\n    from_types: [Task]\n    to_types: [Task]\n    acyclic: true  # No circular dependencies"
      },
      {
        "title": "Skill Contract",
        "body": "Skills that use ontology should declare:\n\n# In SKILL.md frontmatter or header\nontology:\n  reads: [Task, Project, Person]\n  writes: [Task, Action]\n  preconditions:\n    - \"Task.assignee must exist\"\n  postconditions:\n    - \"Created Task has status=open\""
      },
      {
        "title": "Planning as Graph Transformation",
        "body": "Model multi-step plans as a sequence of graph operations:\n\nPlan: \"Schedule team meeting and create follow-up tasks\"\n\n1. CREATE Event { title: \"Team Sync\", attendees: [p_001, p_002] }\n2. RELATE Event -> has_project -> proj_001\n3. CREATE Task { title: \"Prepare agenda\", assignee: p_001 }\n4. RELATE Task -> for_event -> event_001\n5. CREATE Task { title: \"Send summary\", assignee: p_001, blockers: [task_001] }\n\nEach step is validated before execution. Rollback on constraint violation."
      },
      {
        "title": "With Causal Inference",
        "body": "Log ontology mutations as causal actions:\n\n# When creating/updating entities, also log to causal action log\naction = {\n    \"action\": \"create_entity\",\n    \"domain\": \"ontology\", \n    \"context\": {\"type\": \"Task\", \"project\": \"proj_001\"},\n    \"outcome\": \"created\"\n}"
      },
      {
        "title": "Cross-Skill Communication",
        "body": "# Email skill creates commitment\ncommitment = ontology.create(\"Commitment\", {\n    \"source_message\": msg_id,\n    \"description\": \"Send report by Friday\",\n    \"due\": \"2026-01-31\"\n})\n\n# Task skill picks it up\ntasks = ontology.query(\"Commitment\", {\"status\": \"pending\"})\nfor c in tasks:\n    ontology.create(\"Task\", {\n        \"title\": c.description,\n        \"due\": c.due,\n        \"source\": c.id\n    })"
      },
      {
        "title": "Quick Start",
        "body": "# Initialize ontology storage\nmkdir -p memory/ontology\ntouch memory/ontology/graph.jsonl\n\n# Create schema (optional but recommended)\npython3 scripts/ontology.py schema-append --data '{\n  \"types\": {\n    \"Task\": { \"required\": [\"title\", \"status\"] },\n    \"Project\": { \"required\": [\"name\"] },\n    \"Person\": { \"required\": [\"name\"] }\n  }\n}'\n\n# Start using\npython3 scripts/ontology.py create --type Person --props '{\"name\":\"Alice\"}'\npython3 scripts/ontology.py list --type Person"
      },
      {
        "title": "References",
        "body": "references/schema.md — Full type definitions and constraint patterns\nreferences/queries.md — Query language and traversal examples"
      },
      {
        "title": "Instruction Scope",
        "body": "Runtime instructions operate on local files (memory/ontology/graph.jsonl and memory/ontology/schema.yaml) and provide CLI usage for create/query/relate/validate; this is within scope. The skill reads/writes workspace files and will create the memory/ontology directory when used. Validation includes property/enum/forbidden checks, relation type/cardinality validation, acyclicity for relations marked acyclic: true, and Event end >= start checks; other higher-level constraints may still be documentation-only unless implemented in code."
      }
    ],
    "body": "Ontology\n\nA typed vocabulary + constraint system for representing knowledge as a verifiable graph.\n\nCore Concept\n\nEverything is an entity with a type, properties, and relations to other entities. Every mutation is validated against type constraints before committing.\n\nEntity: { id, type, properties, relations, created, updated }\nRelation: { from_id, relation_type, to_id, properties }\n\nWhen to Use\nTrigger\tAction\n\"Remember that...\"\tCreate/update entity\n\"What do I know about X?\"\tQuery graph\n\"Link X to Y\"\tCreate relation\n\"Show all tasks for project Z\"\tGraph traversal\n\"What depends on X?\"\tDependency query\nPlanning multi-step work\tModel as graph transformations\nSkill needs shared state\tRead/write ontology objects\nCore Types\n# Agents & People\nPerson: { name, email?, phone?, notes? }\nOrganization: { name, type?, members[] }\n\n# Work\nProject: { name, status, goals[], owner? }\nTask: { title, status, due?, priority?, assignee?, blockers[] }\nGoal: { description, target_date?, metrics[] }\n\n# Time & Place\nEvent: { title, start, end?, location?, attendees[], recurrence? }\nLocation: { name, address?, coordinates? }\n\n# Information\nDocument: { title, path?, url?, summary? }\nMessage: { content, sender, recipients[], thread? }\nThread: { subject, participants[], messages[] }\nNote: { content, tags[], refs[] }\n\n# Resources\nAccount: { service, username, credential_ref? }\nDevice: { name, type, identifiers[] }\nCredential: { service, secret_ref }  # Never store secrets directly\n\n# Meta\nAction: { type, target, timestamp, outcome? }\nPolicy: { scope, rule, enforcement }\n\nStorage\n\nDefault: memory/ontology/graph.jsonl\n\n{\"op\":\"create\",\"entity\":{\"id\":\"p_001\",\"type\":\"Person\",\"properties\":{\"name\":\"Alice\"}}}\n{\"op\":\"create\",\"entity\":{\"id\":\"proj_001\",\"type\":\"Project\",\"properties\":{\"name\":\"Website Redesign\",\"status\":\"active\"}}}\n{\"op\":\"relate\",\"from\":\"proj_001\",\"rel\":\"has_owner\",\"to\":\"p_001\"}\n\n\nQuery via scripts or direct file ops. For complex graphs, migrate to SQLite.\n\nAppend-Only Rule\n\nWhen working with existing ontology data or schema, append/merge changes instead of overwriting files. This preserves history and avoids clobbering prior definitions.\n\nWorkflows\nCreate Entity\npython3 scripts/ontology.py create --type Person --props '{\"name\":\"Alice\",\"email\":\"alice@example.com\"}'\n\nQuery\npython3 scripts/ontology.py query --type Task --where '{\"status\":\"open\"}'\npython3 scripts/ontology.py get --id task_001\npython3 scripts/ontology.py related --id proj_001 --rel has_task\n\nLink Entities\npython3 scripts/ontology.py relate --from proj_001 --rel has_task --to task_001\n\nValidate\npython3 scripts/ontology.py validate  # Check all constraints\n\nConstraints\n\nDefine in memory/ontology/schema.yaml:\n\ntypes:\n  Task:\n    required: [title, status]\n    status_enum: [open, in_progress, blocked, done]\n  \n  Event:\n    required: [title, start]\n    validate: \"end >= start if end exists\"\n\n  Credential:\n    required: [service, secret_ref]\n    forbidden_properties: [password, secret, token]  # Force indirection\n\nrelations:\n  has_owner:\n    from_types: [Project, Task]\n    to_types: [Person]\n    cardinality: many_to_one\n  \n  blocks:\n    from_types: [Task]\n    to_types: [Task]\n    acyclic: true  # No circular dependencies\n\nSkill Contract\n\nSkills that use ontology should declare:\n\n# In SKILL.md frontmatter or header\nontology:\n  reads: [Task, Project, Person]\n  writes: [Task, Action]\n  preconditions:\n    - \"Task.assignee must exist\"\n  postconditions:\n    - \"Created Task has status=open\"\n\nPlanning as Graph Transformation\n\nModel multi-step plans as a sequence of graph operations:\n\nPlan: \"Schedule team meeting and create follow-up tasks\"\n\n1. CREATE Event { title: \"Team Sync\", attendees: [p_001, p_002] }\n2. RELATE Event -> has_project -> proj_001\n3. CREATE Task { title: \"Prepare agenda\", assignee: p_001 }\n4. RELATE Task -> for_event -> event_001\n5. CREATE Task { title: \"Send summary\", assignee: p_001, blockers: [task_001] }\n\n\nEach step is validated before execution. Rollback on constraint violation.\n\nIntegration Patterns\nWith Causal Inference\n\nLog ontology mutations as causal actions:\n\n# When creating/updating entities, also log to causal action log\naction = {\n    \"action\": \"create_entity\",\n    \"domain\": \"ontology\", \n    \"context\": {\"type\": \"Task\", \"project\": \"proj_001\"},\n    \"outcome\": \"created\"\n}\n\nCross-Skill Communication\n# Email skill creates commitment\ncommitment = ontology.create(\"Commitment\", {\n    \"source_message\": msg_id,\n    \"description\": \"Send report by Friday\",\n    \"due\": \"2026-01-31\"\n})\n\n# Task skill picks it up\ntasks = ontology.query(\"Commitment\", {\"status\": \"pending\"})\nfor c in tasks:\n    ontology.create(\"Task\", {\n        \"title\": c.description,\n        \"due\": c.due,\n        \"source\": c.id\n    })\n\nQuick Start\n# Initialize ontology storage\nmkdir -p memory/ontology\ntouch memory/ontology/graph.jsonl\n\n# Create schema (optional but recommended)\npython3 scripts/ontology.py schema-append --data '{\n  \"types\": {\n    \"Task\": { \"required\": [\"title\", \"status\"] },\n    \"Project\": { \"required\": [\"name\"] },\n    \"Person\": { \"required\": [\"name\"] }\n  }\n}'\n\n# Start using\npython3 scripts/ontology.py create --type Person --props '{\"name\":\"Alice\"}'\npython3 scripts/ontology.py list --type Person\n\nReferences\nreferences/schema.md — Full type definitions and constraint patterns\nreferences/queries.md — Query language and traversal examples\nInstruction Scope\n\nRuntime instructions operate on local files (memory/ontology/graph.jsonl and memory/ontology/schema.yaml) and provide CLI usage for create/query/relate/validate; this is within scope. The skill reads/writes workspace files and will create the memory/ontology directory when used. Validation includes property/enum/forbidden checks, relation type/cardinality validation, acyclicity for relations marked acyclic: true, and Event end >= start checks; other higher-level constraints may still be documentation-only unless implemented in code."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/oswalpalash/ontology",
    "publisherUrl": "https://clawhub.ai/oswalpalash/ontology",
    "owner": "oswalpalash",
    "version": "1.0.4",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/ontology",
    "downloadUrl": "https://openagent3.xyz/downloads/ontology",
    "agentUrl": "https://openagent3.xyz/skills/ontology/agent",
    "manifestUrl": "https://openagent3.xyz/skills/ontology/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/ontology/agent.md"
  }
}