document-to-kg-skill

document-to-kg-skill is a skill for Claude Code, Codex from OpenLinkSoftware/ai-agent-skills. It costs 124 tokens per session (6,784 once invoked), scanned A, original, MIT.

A workflow that turns documents or text into RDF knowledge graphs using schema.org terms. RDF is a structured format for representing facts and relationships, and the output can include JSON-LD or Turtle files.

In plain words
What is it for?
Use it to convert articles, PDFs, web pages, pasted text, or other source material into RDF, JSON-LD, Turtle, or related graph-based files.
Why use it?
It gives document information a machine-readable structure instead of leaving it as unconnected prose. The workflow also includes reviewing the generated graph before saving it.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node scripts/index.js <target-directory>.

Good fit Use it to convert articles, PDFs, web pages, pasted text, or other source material into RDF, JSON-LD, Turtle, or related graph-based files.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/OpenLinkSoftware/ai-agent-skills
agentmods
npx agentmods add skills/openlinksoftware/ai-agent-skills/document-to-kg-skill

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for document-to-kg-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/openlinksoftware/ai-agent-skills/document-to-kg-skill/github.svg)](https://agentmods.dev/skills/openlinksoftware/ai-agent-skills/document-to-kg-skill)
Your own site
<a href="https://agentmods.dev/skills/openlinksoftware/ai-agent-skills/document-to-kg-skill"><img src="https://agentmods.dev/badge/skills/openlinksoftware/ai-agent-skills/document-to-kg-skill/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for document-to-kg-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/openlinksoftware/ai-agent-skills/document-to-kg-skill"><img src="https://agentmods.dev/badge/skills/openlinksoftware/ai-agent-skills/document-to-kg-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 124 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,784 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 68
    Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.
    Fix: Restrict tool access to only the tools required for the skill's stated purpose. Use an explicit allowlist rather than granting blanket access.
  • medium Excessive Agency · line 106
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00124 $0.06784
Opus 5 $0.00062 $0.03392
Sonnet 5 $0.00025 $0.01357
Haiku 4.5 $0.00012 $0.00678

Measured 10d ago against content hash cfe53345bee4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

document-to-kg-skill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

document-to-kg-skill/SKILL.md · 355 lines

How it starts

The opening of the file, as written. The whole thing — 355 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Document to Knowledge Graph Skill — Specification (v1.0.0)


MANDATORY PRE-TOOL SEQUENCE — READ BEFORE CALLING ANY TOOL

After getSkillResource loads this skill, the next action must be text only — send the Opening Announcement and wait for the user's reply. Do not call any other tool first.


Skill Identity

Field Value
Name document-to-kg-skill
Version 1.0.0
Purpose Transform documents or text into RDF Knowledge Graphs using schema.org terms.
Scope Four-step pipeline: collect source + page_url + format + destination → generate RDF → post-generation review → save to folder.

Strict Harness Mode

Use Document-to-KG Harness Mode whenever the user asks to transform a document, URL, pasted text, PDF, thread, article, or source mesh into RDF, JSON-LD, Turtle, a Knowledge Graph, or an RDF-backed HTML/MD artifact set.

Harness mode constrains interpretation to this skill's document-to-RDF contract. Do not drift into a generic summary, article rewrite, standalone HTML page, or manually invented graph.

Harness Contract

When active:

  1. Collect or derive required inputs — document source, canonical {page_url}, output RDF format, destination path, and whether HTML/Markdown companions are required.
  2. Use {page_url} as entity namespace for generated document-local IRIs, never file: IRIs when a canonical HTTP/HTTPS URL exists.
  3. Generate RDF first using schema.org and approved vocabularies; RDF is the source of truth for any companion HTML/Markdown.
  4. Apply authority denotation rulesschema:SoftwareApplication, schema:Organization, schema:Country, and schema:DefinedTerm/skos:Concept entities must use DBpedia/Wikidata-centered IRIs as described below, with owl:sameAs for confirmed cross references.
  5. Inspect collection sources as collections — when the source is a manual, documentation site, sitemap-backed site, MkDocs/Docusaurus/VitePress collection, GitBook, docs portal, or other multi-page source, inspect sitemap/search index/navigation for high-signal child pages before finalizing RDF. Always review child pages about APIs, SPARQL, endpoints, query examples, services, reporting workflows, data models, server/runtime platforms, and integration instructions when present.
  6. Preserve SPARQL-bearing content — when source content includes SPARQL queries, query examples, endpoint demos, or reporting/query recipes, do not summarize the query body away. Model each material query as a named schema:SoftwareSourceCode resource with schema:programmingLanguage "SPARQL", schema:text, schema:codeSampleType, schema:target pointing to the endpoint/service, and schema:potentialAction pointing to a correctly URL-encoded live query URL when the endpoint accepts GET query parameters. Preserve documented placeholders visibly.
  7. Validate before save — RDF syntax, expanded DBpedia/Wikidata IRIs, no fabricated IRIs, no double-encoded resolver IRIs, no file: IRIs, and required prefix declarations.
  8. If HTML/Markdown companions are requested, hand off to the rdf-infographic-skill RDF Infographic Harness Mode and satisfy its full HTML/MD/RDF pairing, resolver, KG Explorer, navigation, attribution, and validation contract.
  9. Fail closed on missing requirements — if a required source, page URL, destination, resolver, or artifact scope is ambiguous and cannot be safely inferred, ask before generating.

Read the full file on GitHub · 355 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 355 lines · 124 tokens per session scan A cfe53345bee4

Subscribe to this mod's changes

document-to-kg-skill is a skill published in the GitHub repository OpenLinkSoftware/ai-agent-skills (38 stars, last pushed yesterday), licensed MIT. It adds 124 tokens to every session and 6,784 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

agent-platform-rag-engine-management

Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…

google/skills · 85 tokens

agent-platform-model-registry

Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.

google/skills · 60 tokens

foundry-config-setup

Resolve missing setup caused by a hardcoded Foundry project endpoint or model in a sample. Use when a sample fails because it uses a placeholder/hardcoded projectendpoint (for example "https://your-project.services.ai.azure.com") or a hardcoded model instead of reading them from the environment.

microsoft/agent-framework · 65 tokens

google-cloud-solution-agentic-analytics-spark-knowledge-catalog

Discovers requirements and generates guidance to design and deploy a governed, secure agentic-analytics solution for data that's distributed across Google Cloud, other cloud providers, or on-premises. Data that's outside Google Cloud (such as data from Databricks, Snowflake, Salesforce, SAP, or Oracle systems) is…

google/skills · 138 tokens

training-check

Interactively monitor training metrics from the current Codex session, periodically checking WandB or fallback logs for NaN, divergence, plateaus, and broken runs.

wanshuiyin/Auto-claude-code-research-in-sleep · 35 tokens

nemo-automodel-launcher-config

Configure NeMo AutoModel job launches for interactive runs, Slurm clusters, and SkyPilot cloud execution.

NVIDIA/skills · 30 tokens