← Back to Skills Marketplace
kidehen

Knowledge Graph Generator

by Kingsley Idehen · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
246
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install kg-generator
Description
Generate comprehensive Knowledge Graphs (RDF-Turtle by default, or JSON-LD and other RDF serializations on request) from content at file: or http(s): scheme...
README (SKILL.md)

Knowledge Graph Generator Skill

Generate comprehensive, standards-compliant Knowledge Graphs from any file: or http[s]: URL. Produces RDF-Turtle by default; JSON-LD and other serializations available on request.


When to Use This Skill

  • "Generate a knowledge graph from [URL]"
  • "Generate RDF / RDF-Turtle from [URL]"
  • "Generate JSON-LD from [URL]"
  • "Convert this page to structured semantic data"
  • "Extract schema.org data from [URL]"
  • "Create an RDF rendition of this post/article/report"

Template Selection

Content type Template Default output
General articles, blog posts, documentation Generic JSON-LD
Business strategy, market analysis, industry threads Business & Market Analysis RDF-Turtle
User requests JSON-LD explicitly Generic JSON-LD
User requests RDF-Turtle explicitly Business & Market Analysis RDF-Turtle

When uncertain, default to the Generic template and ask the user if they want the Business & Market Analysis variant.


Workflow

  1. Identify the source URL — extract the file: or http[s]: URL from the user's request.
  2. Fetch content — retrieve page or document text using available tools (browser automation, WebFetch, file read, etc.).
  3. Select template — use the table above; check for explicit user preference.
  4. Determine output format — RDF-Turtle is the default; respect explicit requests.
  5. Populate and apply the template — substitute all {placeholders} and generate the output.
  6. Validate — confirm syntactic correctness (balanced braces/brackets for JSON-LD; valid prefixes and triple syntax for Turtle).
  7. Deliver — output in a single code block. If saving to file, use {slug}-1.ttl or {slug}-1.jsonld, incrementing as needed, saved to /Users/kidehen/Documents/LLMs/Claude Generated/web pages/.
  8. Final validation — validate the RDF syntax for the requested format (Turtle, JSON-LD, RDF/XML, etc.) before responding.

Template 1 — Generic (JSON-LD)

Use for general web pages, articles, blog posts, and documentation.

Placeholders

Placeholder Value
{page_url} Canonical URL of the source — used as @base
{selected_text} Full extracted text content of the source

Prompt

Using a code block, generate a comprehensive representation of this information in JSON-LD using valid terms from \x3Chttp://schema.org>. You MUST use {page_url} for @base, which is then used in deriving relative hash-based hyperlinks that denote subjects and objects. This rule doesn't apply to entities that are already denoted by hyperlinks (e.g., DBpedia, Wikidata, Wikipedia, etc), and expand @context accordingly. Note the following guidelines:
1. Use @vocab appropriately.
2. If applicable, include at least 10 Questions and associated Answers.
3. Utilize annotation properties to enhance the representations of Questions, Answers, Defined Term Set, HowTos, and HowToSteps, if they are included in the response, and associate them with article sections (if they exist) or article using schema:hasPart.
4. Where relevant, add attributes for about, abstract, article body, and article section limited to a maximum of 30 words.
5. Denote values of about using hash-based IRIs derived from entity home page or Wikipedia page URL.
6. Where possible, if confident, add a DBpedia IRI to the list of about attribute values and then connect the list using owl:sameAs; note, never use schema:sameAs in this regard. In addition, never assign literal values to this attribute i.e., they MUST be IRIs by properly using @id.
7. Where relevant, add article sections and fleshed out body to ensure richness of literal objects.
8. Where possible, align images with relevant article and howto step sections.
9. Add a label to each how-to step.
10. Add descriptions of any other relevant entity types.
11. If not generating JSON-LD, triple-quote literal values containing more than 20 words.
12. Whenever you encounter inline double quotes within the value of an annotation attribute, change the inline double quotes to single quotes.
13. Whenever you encounter video, handle using the VideoObject type, specifying properties such as name, description, thumbnailUrl, uploadDate, contentUrl, and embedUrl — don't guess and insert non-existent information.
14. Whenever you encounter audio, handle using the AudioObject type, specifying properties such as name, description, thumbnailUrl, uploadDate, contentUrl, and embedUrl — don't guess and insert non-existent information.
15. Where relevant, include additional entity types when discovered e.g., Product, Offer, and Service etc.
16. Language-tag the values of annotation attributes; apply properly according to JSON-LD syntax rules.
17. Describe article authors and publishers in detail.
18. Use a relatedLink attribute to comprehensively handle all inline URLs. Unless told otherwise, it should be a maximum of 20 relevant links.
19. You MUST ensure smart quotes are replaced with single quotes.
20. You MUST check and fix any JSON-LD usage errors based on its syntax rules e.g., missing @id designation for IRI values of attributes that only accept IRI values (e.g., schema:sameAs, owl:sameAs, etc.).

"""
{selected_text}
"""

Following your initial response, perform the following tasks:
1. Check and fix any syntax errors in the response.
2. Provide a list of additional questions, defined terms, or howtos for my approval.
3. Provide a list of additional entity types that could be described for my approval.
4. If the suggested additional entity types are approved, you MUST then return a revised final description comprising the original and added entity descriptions.

Post-Generation Checklist

  • @base set to {page_url}
  • All subject/object IRIs are hash-based relative IRIs (except known authority entities)
  • At least 10 schema:Question + schema:Answer pairs present
  • owl:sameAs used (not schema:sameAs) for DBpedia cross-references
  • All IRI-valued attributes use @id — no plain string literals for IRI-only properties
  • Inline double quotes within literals converted to single quotes
  • Smart/curly quotes replaced with straight single quotes
  • relatedLink includes up to 20 relevant inline URLs
  • Language tags applied to annotation literals where applicable
  • JSON-LD is syntactically valid
  • No guessed media URLs (thumbnailUrl, contentUrl, embedUrl)

Template 2 — Business & Market Analysis (RDF-Turtle)

Use for business strategy posts, X/social threads, market analyses, and industry deep-dives.

Placeholders

Placeholder Value
{url} URL of the original post or content being analysed
{post-url} Used as the Turtle @prefix : base (append #)
{current date} ISO 8601 date e.g. 2026-03-13

{post-url} and {url} are often the same value.

Prompt

You are an expert in semantic web modeling, RDF/Turtle serialization, and schema.org + lightweight ontology design.
Given the post at {url} and its thread (which discusses AI-driven "autopilots" disrupting services markets by selling outcomes rather than tools, starting with outsourced intelligence-heavy tasks such as NDA drafting, insurance brokerage (~$140–200B labor TAM), and accounting (~$50–80B labor TAM), with structural shortages like the loss of ~340k U.S. accountants, data compounding enabling eventual judgment handling, debates around copilots vs. full autopilots, the innovator's dilemma, and founder collaboration opportunities),
produce a **comprehensive RDF/Turtle document** that represents the full business & strategy analysis.
Follow ALL of these final design requirements exactly:
1. Base URI: Use relative hash URIs grounded in {post-url} as the namespace prefix :
2. Use schema.org as the primary vocabulary, supplemented by:
   - skos: for glossary/concept definitions
   - org: for organizations
   - dbo: for selected DBpedia cross-references (via rdfs:seeAlso)
   - rdfs: for class/property definitions
3. Create a small custom lightweight ontology in the same namespace:
   - Define :Industry as rdfs:Class (base class for verticals)
   - Define two subclass rdfs:Class resources: :InsuranceBrokerageIndustry and :AccountingIndustry
   - Define two custom properties on :Industry:
     - :hasLaborTAM      (range xsd:string)
     - :hasAutomationReadiness (range xsd:string)
   - Create explicit instances of these classes (e.g. :insuranceBrokerageVertical a :InsuranceBrokerageIndustry ; ...) to hold concrete data (TAM values, readiness, NAICS, offers, DBpedia links). Do NOT put instance data directly on the class definitions.
4. Use low-redundancy schema.org identifier modeling (Option 3 style):
   - Use dedicated properties when they exist: schema:naics (on industry instances), schema:isbn (on the book), schema:identifier with plain literal for unambiguous codes (e.g. "US" for ISO 3166-1 alpha-2)
   - For NAICS codes, always pair schema:naics (plain code string) with schema:identifier using the Census Bureau canonical lookup URL: https://www.census.gov/naics/?input={code}&year=2022&details={code}
   - Avoid unnecessary schema:PropertyValue wrappers unless genuinely required for disambiguation or extra metadata
5. Core entities that must be included:
   - The main analysis CreativeWork (:analysis)
   - Author (:grok), original post reference (:originalXPost), Julien Bek
   - :aiAutopilotDisruption (Product), :marketDisruptionAction, :servicesMarketDisruption
   - Example task :ndaExample
   - Concrete vertical instances :insuranceBrokerageVertical and :accountingVertical (with TAM, readiness, naics, offers WithCoverage/Rillet autopilots)
   - Organizations :withCoverage and :rillet + their autopilots
   - :shortageEvent (U.S. accountant shortage)
   - :unitedStates with ISO code
   - :threadReplies, :cursorExample, :scalingChallenges
   - :innovatorsDilemma (CreativeWork with isbn "9780060521998")
6. Mandatory structured sections (all must be present and complete):
   - schema:FAQPage (:faqSection) with **exactly 12** schema:Question items (:q1–:q12)
   - skos:ConceptScheme + schema:DefinedTermSet (:glossarySection) with **exactly 10** terms (:termAutopilot through :termVerticalMapping)
   - schema:HowTo (:howtoSection) with **exactly 7** schema:HowToStep items (:step1–:step7)
7. Include all original details:
   - Labor TAM ranges exactly as stated ($140-200B insurance, $50-80B accounting)
   - Automation readiness "High" for both
   - 340,000 accountant shortage statistic
   - Data compounding explanation
   - Outcome-as-a-Service model
   - Innovator's dilemma application
   - Copilot → autopilot transition challenges
   - Founder collaboration via tagging / datasets
8. Keep descriptions concise yet precise; avoid unnecessary verbosity in literals.
9. Output **only** the complete, valid Turtle document inside a single code block. Do not include explanations, comments outside Turtle, or any other text before/after the code block.
Current date for metadata: {current date}.

NAICS Identifier Pattern

Always use both schema:naics and schema:identifier together on industry vertical instances:

:insuranceBrokerageVertical a :InsuranceBrokerageIndustry ;
    schema:naics "524210" ;
    schema:identifier "https://www.census.gov/naics/?input=524210&year=2022&details=524210" .

:accountingVertical a :AccountingIndustry ;
    schema:naics "541211" ;
    schema:identifier "https://www.census.gov/naics/?input=541211&year=2022&details=541211" .

Never use the deprecated ?code={code} URL pattern.

schema:identifier Patterns by Entity Type

Entity type Pattern Example
Industry vertical Census Bureau NAICS URL https://www.census.gov/naics/?input=524210&year=2022&details=524210
Country ISO 3166-1 alpha-2 plain literal "US"
Book ISBN prefixed notation "ISBN:9780060521998"
Person Canonical profile URL "https://x.com/JulienBek"
Organization Official homepage URL "https://withcoverage.com"
Software/Product Product homepage URL "https://www.cursor.com"
Social media post Canonical permalink "https://x.com/user/status/123"
Web standard Spec URL "https://www.w3.org/TR/sparql11-overview/"
Formal standard Standards designation string "ISO/IEC 9075"

Anti-patterns to avoid:

  • schema:sameAs for DBpedia links → use owl:sameAs or rdfs:seeAlso
  • schema:PropertyValue wrappers for simple codes → use plain literals
  • ?code={code} NAICS URL pattern → use ?input={code}&year=2022&details={code}
  • ❌ Plain string literals for IRI-only properties → always use @id in JSON-LD

Post-Generation Checklist

  • @prefix : set to {post-url}#
  • Lightweight ontology present: :Industry, two subclasses, two custom properties
  • Instance data on instances only — not on class definitions
  • Both schema:naics and schema:identifier (Census URL) on each vertical instance
  • Exactly 12 FAQ questions (:q1:q12)
  • Exactly 10 glossary terms
  • Exactly 7 HowTo steps (:step1:step7)
  • TAM values exact: "$140-200B" and "$50-80B"
  • schema:isbn "9780060521998" on :innovatorsDilemma
  • schema:identifier "US" on :unitedStates
  • Output is the Turtle code block only — no surrounding text

Saving Output Files

  • Turtle: {descriptive-slug}-1.ttl (increment if file exists)
  • JSON-LD: {descriptive-slug}-1.jsonld (increment if file exists)
  • Default save location: /Users/kidehen/Documents/LLMs/Claude Generated/web pages/
  • Override if user specifies a path
Usage Guidance
Before installing or enabling this skill, consider the following: (1) The skill accepts file: URLs and instructs fetching via browser automation or local file reads — confirm you are comfortable allowing reads of local files and that the agent will only access files you explicitly permit. (2) The SKILL.md hard-codes an output save path (/Users/kidehen/...) — ask the publisher to remove the hard-coded path or make saving opt-in and configurable; do not allow automatic writes to arbitrary user directories. (3) Because the skill is instruction-only (no code), you cannot audit runtime binaries it might invoke — require the skill to ask for explicit permission before network access, local file reads, or writes. (4) If you plan to allow autonomous invocation, restrict its scope (disable file: handling or require interactive confirmation) to reduce exfiltration risk. (5) Ask the publisher for provenance (who authored it) and for a version of the SKILL.md that removes user-specific paths and clarifies which fetch tools are expected and which permissions will be required.
Capability Analysis
Type: OpenClaw Skill Name: kg-generator Version: 1.0.0 The skill bundle is a specialized tool for generating Knowledge Graphs (RDF/Turtle and JSON-LD) from web content using highly detailed prompts focused on semantic web standards (schema.org, SKOS, etc.). While it contains a hardcoded absolute file path for saving output (/Users/kidehen/Documents/...) and a 'Business & Market Analysis' template that is oddly specific to a particular AI industry thread, there is no evidence of malicious intent, data exfiltration, or unauthorized command execution. The instructions in SKILL.md and the prompt templates in the 'prompts/' directory are designed to ensure structural and syntactic correctness of the RDF output rather than to exploit the agent or the host system.
Capability Assessment
Purpose & Capability
Name and description match the templates and prompt content: generating RDF/JSON-LD from HTTP(S) or file: sources is coherent. However, the SKILL.md also instructs saving outputs to a hard-coded, user-specific path (/Users/kidehen/...), which is not justified by the stated purpose and is unexpected for a general-purpose skill.
Instruction Scope
Instructions instruct the agent to fetch content via 'available tools (browser automation, WebFetch, file read, etc.)' which is broad and gives the agent wide discretion to perform network and local file reads. The skill explicitly accepts file: URLs (local files) — this is a sensitive capability that can expose local data. It also mandates writing outputs to a specific local path without asking the user. The combination of arbitrary file reads and hard-coded write location is scope creep and a privacy/exfiltration risk.
Install Mechanism
Instruction-only skill with no install spec or external downloads — minimal installation risk. There is no code to be written to disk by an installer step.
Credentials
No environment variables or credentials are requested (good). But the runtime text expects network and local file access; absence of declared required permissions for file I/O or network use is a mismatch between what the instructions assume and what the registry metadata declares.
Persistence & Privilege
always:false and no autonomous-disable flags are fine. However, the skill instructs the agent to save generated files to a specific user Documents path (including a username), implying persistent writes to the host filesystem. That is a privileged action for an instruction-only skill and should require explicit confirmation and a configurable path.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install kg-generator
  3. After installation, invoke the skill by name or use /kg-generator
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of kg-generator: generate comprehensive Knowledge Graphs from file: or http(s): URLs. - Produces RDF-Turtle by default; supports JSON-LD and other RDF serializations on request. - Curated prompt templates: Generic (JSON-LD for general web content) and Business & Market Analysis (RDF-Turtle with NAICS codes and extended structure for business/strategy content). - Automatic template selection based on content type and user preference. - Validates RDF/JSON-LD syntax before delivering output. - Saves generated files using a consistent naming scheme in a specified directory.
Metadata
Slug kg-generator
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Knowledge Graph Generator?

Generate comprehensive Knowledge Graphs (RDF-Turtle by default, or JSON-LD and other RDF serializations on request) from content at file: or http(s): scheme... It is an AI Agent Skill for Claude Code / OpenClaw, with 246 downloads so far.

How do I install Knowledge Graph Generator?

Run "/install kg-generator" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Knowledge Graph Generator free?

Yes, Knowledge Graph Generator is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Knowledge Graph Generator support?

Knowledge Graph Generator is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Knowledge Graph Generator?

It is built and maintained by Kingsley Idehen (@kidehen); the current version is v1.0.0.

💬 Comments