← 返回 Skills 市场
kidehen

Knowledge Graph Generator

作者 Kingsley Idehen · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
246
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install kg-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...
使用说明 (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
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install kg-generator
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /kg-generator 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug kg-generator
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 246 次。

如何安装 Knowledge Graph Generator?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install kg-generator」即可一键安装,无需额外配置。

Knowledge Graph Generator 是免费的吗?

是的,Knowledge Graph Generator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Knowledge Graph Generator 支持哪些平台?

Knowledge Graph Generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Knowledge Graph Generator?

由 Kingsley Idehen(@kidehen)开发并维护,当前版本 v1.0.0。

💬 留言讨论