Skip to content
cccskills
FreePublished on GitHub

neo4j-ontology-skill

Author and validate Neo4j Ontology Graph Specification (ontology graph spec) documents. Use when writing or editing an ontology, defining nodes and relationships with properties, Neo4jType data types, constraints (key/unique/must_exist), labels, and endpoint cardinality, in YAML or JSON, or validating an ontology document against the live-resolved spec schema. Does NOT handle Cypher or loading an ontology into a database — use neo4j-cypher-skill. Does NOT cover generic graph data modeling advice — use neo4j-modeling-skill.

The English summary is being prepared. Showing the original description.

Run score Not tested

See how to install

Files included (4)

  • SKILL.md7.5 KB
  • README.md2.9 KB
  • references/format-reference.md14.7 KB
  • scripts/validate.py6.6 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

When to Use

  • Authoring an ontology document (Neo4j Ontology Graph Specification) from a domain description
  • Editing existing ontology YAML/JSON: nodes, relationships, properties, types, constraints, cardinality, extensions
  • Validating an ontology document against the spec schema

When NOT to Use

  • Cypher queries, or loading/applying an ontology into a database → neo4j-cypher-skill (ontology Cypher procedures do not exist yet — later work there)
  • Generic graph modeling advice (node vs property vs label, anti-patterns, supernodes) → neo4j-modeling-skill

Authoring Workflow

Step 1 — Gather domain intent

Identify what is being modeled: entity types (nodes), connections (relationships + direction), properties per element, identifying keys, mandatory fields, cardinality. If the domain or required shape is unclear, ask the user what is being modeled and which questions the ontology must answer. Do NOT guess a domain.

Step 2 — Draft the document

YAML or JSON per user preference; default YAML (more readable). Apply the Core Facts below. Load references/format-reference.md when anything beyond the minimal example is needed (full labels object, constraint objects, extensions, full data-type grammar).

Step 3 — Validate

# From the skill directory:
uv run scripts/validate.py <document.{yaml,yml,json}>
# From the repo root:
uv run neo4j-ontology-skill/scripts/validate.py <document.{yaml,yml,json}>

Exit 0 = valid · exit 1 = schema violations (one line per field path) · exit 2 = parse/read/fetch error. PEP 723 script — uv resolves deps (jsonschema, pyyaml) itself.

The validator fetches the schema live — nothing is vendored. Resolution order: --schema <path-or-url> (explicit, no fallback) → the document's own schema field when it is a URL → the published current alias → transitional repo raw fallback. The document's schema URL decides which version it validates against: set it to the published versioned URL of the version being authored (older versions validate against their published schema).

Step 4 — Fix and re-validate

Fix every reported error; re-run Step 3. Repeat until exit 0. Validation is MANDATORY — never present an ontology as done with a non-zero exit.


Core Facts

  • Required root fields: schema, id (unique ontology id string), version (STRING — user-defined revision label; quote it in YAML: version: "1"). Root rejects unknown fields (additionalProperties: false).
  • schema value: the published URL of the version being authored, e.g. https://neo4j.com/docs/ontology-graph-spec/1.0.0/schema.json. Root key is plain schema, NOT $schema.
  • nodes / relationships are maps keyed by LOCAL IDS, not labels/types. Label lives in label or labels.identifier; relationship type lives in type. Endpoints reference node ids (from.node / to.node) — label renames never break references.
  • label: X is shorthand for labels: {identifier: X}. Use the full labels object only when implied or optional labels exist.
  • Type tokens come from the Neo4jType enum exactly — case-sensitive. Tokens incl. STRING, INTEGER, FLOAT, BOOLEAN, DATE, DURATION, POINT, UUID; temporal tokens contain a space (ZONED DATETIME, LOCAL TIME); parameterized tokens use angle brackets (LIST<STRING>, VECTOR<FLOAT32>). UUID and VECTOR<...> have no LIST arm. No unions, no nested lists. dimension (integer|null) sits on the property, paired with VECTOR types.
  • Constraints — two forms:
    • Flags on a property: key: true, unique: true, must_exist: true (snake_case — NOT mustExist). Single-property shorthands; key = unique + exists per Neo4j key-constraint semantics.
    • Object form: constraints is a MAP id → constraint object {type: EXISTS|KEY|PROPERTY_TYPE|UNIQUE, properties: [p1, ...], name: optional} — required for composites (≥ 2 properties) and nameable constraints. properties must name properties declared on the SAME element.
  • Endpoint cardinality: count exact, or min_count/max_count ranged; absent = unconstrained (0..*).
  • Extensions: fixed extensions shape per element — node: indexes/display/custom; relationship: indexes/custom; root: tables/mappings/custom; labels/property/constraint/index: custom only. Unknown extension keys rejected. custom is free-form — arbitrary owner data, never validated by the spec schema.
  • Absent means none — never write empty maps/lists (properties: {}, aliases: [], custom: {}); omit them.

Minimal Example

library.ontology.yaml — 2 nodes, 1 relationship:

schema: "https://neo4j.com/docs/ontology-graph-spec/1.0.0/schema.json"
id: library
version: "1"
name: Library
nodes:
  author:
    label: Author
    properties:
      id: { type: STRING, key: true }
      name: { type: STRING, must_exist: true }
  book:
    label: Book
    properties:
      isbn: { type: STRING, key: true }
relationships:
  wrote:
    type: WROTE
    from: { node: author, max_count: 1 }
    to: { node: book }

Validates exit 0 via scripts/validate.py. Full YAML+JSON worked examples in references/format-reference.md.


References

Load on demand:

  • references/format-reference.md — full field reference: every node/relationship/property/endpoint field, labels object, constraint objects, extension shapes, data-type grammar, gotchas, YAML+JSON examples
  • Published schema base: https://neo4j.com/docs/ontology-graph-spec/ — immutable /<version>/schema.json per spec version, moving alias /current/schema.json

Spec Status

Published: the ONT-31 URLs above are live and are the canonical schema source. If the published host is unreachable, the validator falls back to the raw schema from neo4j/ontology-graph-spec main (moving). Ontology Cypher procedures do not exist yet; applying an ontology to a database is out of scope here.


Checklist

  • Root fields schema, id, version present; version a quoted string; schema = the published versioned URL under plain schema key
  • No unknown root fields; no $schema
  • nodes/relationships keyed by local ids; relationship from/to reference node ids
  • Every node has label or labels.identifier
  • Type tokens exact from the Neo4jType enum (case-sensitive; spaced temporal tokens); dimension on the property with VECTOR types
  • Flags only for single-property constraints; object form (type ∈ EXISTS/KEY/PROPERTY_TYPE/UNIQUE) for composites/named; constraint properties exist on the same element
  • Extension keys match the element's fixed shape; arbitrary data only under custom
  • No empty maps/lists written
  • uv run scripts/validate.py <file> exits 0 (every reported error fixed and re-validated)

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Authoritative reference for the neo4j-agent-memory Python package — a graph-native memory system for AI agents built on Neo4j — and for the hosted service (NAMS) at memory.neo4jlabs.com. Use this skill whenever the user mentions neo4j-agent-memory, agent memory with Neo4j, context graphs, the POLE+O model, MemoryClient/MemorySettings, the memory MCP server, or any of the framework integrations (LangChain, PydanticAI, CrewAI, AWS Strands, Google ADK, Microsoft Agent Framework, OpenAI Agents, LlamaIndex). Also use when the user mentions the hosted service at memory.neo4jlabs.com, NAMS, the Neo4j Agent Memory Service, the `nams_` API key prefix, or the hosted MCP endpoint. Also use when writing documentation, blog posts, tutorials, PRDs, or code samples for the project, when comparing agent memory approaches, or when positioning graph-native memory against vector-only approaches — even if the user doesn't explicitly name the package.

The English summary is being prepared. Showing the original description.

neo4j-contrib/neo4j-skills116Updated Oct 22, 2026

Manages Neo4j Aura Agents via the v2beta1 REST API — create, list, get, update, delete, and invoke Aura agents backed by an AuraDB instance. Use when configuring Aura Agent tools (CypherTemplate, SimilaritySearch, Text2Cypher), setting system prompts, deploying agents to REST or MCP endpoints, invoking agents with natural language queries, or generating evaluation datasets (max 50 questions) for the Aura Agent evaluation feature. Covers OAuth2 auth, organization/project scoping, tool parameter schemas, and InvokeAgentResponse format. Does NOT cover AuraDB instance provisioning — use neo4j-aura-provisioning-skill. Does NOT cover vector index creation — use neo4j-vector-index-skill.

The English summary is being prepared. Showing the original description.

neo4j-contrib/neo4j-skills116Updated Oct 22, 2026

Serverless Aura Graph Analytics (AGA) GDS Sessions — covers GdsSessions, AuraGraphDataScience, AuraAPICredentials, DbmsConnectionInfo, SessionMemory, get_or_create, remote graph projection with gds.graph.project.cypher and gds.graph.project.remote, gds.graph.project.native, gds.graph.construct, graphdatascience client 2.0 session endpoints, async compute and gds.jobs, AuraDB Cypher API memory/sessionId projection, algorithms, write-back, and session lifecycle. Use for AuraDB-connected, self-managed Neo4j, or standalone DataFrame/Spark session workloads. Does NOT cover the embedded GDS plugin on Aura Pro or self-managed Neo4j — use neo4j-gds-skill. Does NOT handle Cypher authoring — use neo4j-cypher-skill. Does NOT cover Snowflake Graph Analytics — use neo4j-snowflake-graph-analytics-skill.

The English summary is being prepared. Showing the original description.

neo4j-contrib/neo4j-skills116Updated Oct 22, 2026

Provisions and manages Neo4j Aura instances via CLI (aura-cli v1.7+) or REST API. Use when creating, pausing, resuming, resizing, or deleting AuraDB Free/Professional/Business Critical/VDC instances; downloading credentials; scripting CI/CD pipelines; polling async status; or using the Terraform neo4j-labs/neo4jaura provider. Covers auth setup (client credentials OAuth2), credential lifecycle (download once — never recoverable), instance type selection, region codes, and Python provisioning scripts. Does NOT handle Cypher queries — use neo4j-cypher-skill. Does NOT cover Graph Data Science algorithms — use neo4j-gds-skill or neo4j-aura-graph-analytics-skill. Does NOT cover neo4j-admin/cypher-shell — use neo4j-cli-tools-skill.

The English summary is being prepared. Showing the original description.

neo4j-contrib/neo4j-skills116Updated Oct 22, 2026

Use when working with Neo4j command-line tools — neo4j-cli (modern unified CLI — Cypher via Bolt, schema inspection, Aura management, Docker containers, credential management, agent skill catalog install; install with curl -sSfL https://neo4j.sh/install.sh | bash), neo4j-admin (backup, restore, import, memory sizing), cypher-shell (ad-hoc queries, scripting, CI/CD), or neo4j-mcp (quick MCP server install). Does NOT cover Cypher query authoring — use neo4j-cypher-skill. Does NOT cover driver upgrades — use neo4j-migration-skill. Does NOT cover full MCP editor configuration — use neo4j-mcp-skill.

The English summary is being prepared. Showing the original description.

neo4j-contrib/neo4j-skills116Updated Oct 22, 2026

Generates, optimizes, and validates Cypher 25 queries for Neo4j 2025.x and 2026.x. Use when writing new Cypher queries, optimizing slow queries, graph pattern matching, vector or fulltext search, subqueries, or batch writes. Covers MATCH, MERGE, CREATE, WITH, RETURN, CALL, UNWIND, FOREACH, LOAD CSV, SEARCH, expressions, functions, indexes, and subqueries. Does NOT handle driver migration or API changes — use neo4j-migration-skill. Does NOT cover DB administration or server ops — use neo4j-cli-tools-skill.

The English summary is being prepared. Showing the original description.

neo4j-contrib/neo4j-skills116Updated Oct 22, 2026

See all skills by neo4j-contrib

Report a problem with this skill