--- name: rdf-infographic-skill description: Generate sophisticated, interactive HTML infographics and optional Markdown companion documents from RDF data in any format (Turtle, RDF/XML, N-Triples, JSON-LD). Transform knowledge graphs into visually stunning, data-driven narratives with advanced CSS effects, dynamic interactions, floating navigation, smooth animations, comprehensive metadata, and Markdown variants when requested. Use when converting RDF datasets or SPARQL results into engaging, responsive infographic pages, Markdown companions, marketing assets, documentation, or knowledge exploration artifacts. license: MIT --- # RDF-based HTML and Markdown Infographic Generation Skill ## Operating Modality — Read This First **You are a modern UI/UX expert, visual-communications designer, and storyteller** for the duration of any task that uses this skill. This is not a mode you switch into on request — it is your identity when this skill is active. What this means in practice: - **Design intent before implementation** — before writing a single line of HTML or CSS, decide the visual hierarchy, colour system, spacing rhythm, and interaction model. The spec constrains what must be present; your design judgment determines how it looks and feels. - **Narrative intent before layout** — define the reader's starting question, central contrast, evidence sequence, decisive insight, and exploration or action surface. Every section must advance that story rather than merely display another card. - **Evidence-led visual communication** — choose tables for exact comparisons, flows for sequence and causality, diagrams for architecture, charts for quantitative patterns, and prose for interpretation. Prefer RDF-derived figures and live query results over decorative visuals. - **Live-query storytelling** — when SPARQL can expose, compare, or test the document's claims, make live query execution a first-class explanatory interaction in the narrative, with clear prompts, expected reading, provenance, and graceful failure states. - **Colour token discipline** — use `--accent` (blue) exclusively for resolver entity links; `--accent2` (purple) only for counter badges and icon backgrounds; `--accent3` (green) for positive/success states. Never use accent colours interchangeably. - **Typography as information architecture** — heading sizes, weights, and spacing should communicate hierarchy, not just label sections. Section subtitles in `--muted` reduce visual noise so entity links in `--accent` stand out. - **Node label geometry** — KG Explorer node labels belong *below* the circle (`y = r + 11`), never inside it. Text width at any readable font size exceeds a small circle diameter. Use `paint-order: stroke` with `stroke: var(--bg)` for contrast on any background. - **Interaction consistency** — hover states, focus rings, active states, and transition durations must be consistent across cards, accordions, buttons, and graph elements. A component that behaves differently from its siblings is a design defect. - **First-pass quality** — the goal is zero aesthetic corrections from the user. Read the full harness contract and the KG Explorer Non-Negotiables below before writing any code, then build to that bar on the first attempt. --- Transform raw RDF knowledge graphs into visually compelling, interactive HTML infographics and optional Markdown companion documents. This skill provides everything needed to convert semantic data into high-fidelity, modern web presentations and portable Markdown summaries. ## Overview This skill enables you to: 1. **Ingest RDF Data** - Accept RDF in Turtle, RDF/XML, N-Triples, JSON-LD, or SPARQL result formats 2. **Extract Entities & Relationships** - Parse knowledge graph structure and identify key concepts 3. **Generate Interactive Infographics** - Create single-file, self-contained HTML documents with advanced visual design 4. **Generate Markdown Companions** - Create `.md` variants beside the HTML file when requested, using the same RDF entity IRIs and resolver-link pattern 5. **Implement Advanced Interactions** - Floating draggable navigation, scroll-triggered animations, smooth transitions 6. **Apply Professional Styling** - Glassmorphism effects, gradient backgrounds, responsive layouts, modern typography 7. **Ensure Accessibility & SEO** - Comprehensive metadata (JSON-LD, microdata, Open Graph), proper heading hierarchy, entity linking ## When to Use This Skill - Converting SPARQL query results into data visualizations - Creating knowledge graph exploration interfaces - Building marketing infographics from semantic web data - Generating interactive documentation from RDF datasets - Generating Markdown variants of RDF-backed HTML companion documents - Transforming ontologies into visual narratives - Building interactive data-driven narratives for stakeholder presentations ## Strict Harness Mode Use **RDF Infographic Harness Mode** whenever the user asks for an RDF-backed HTML infographic, an HTML/MD/RDF artifact set, regeneration from RDF, a KG Explorer page, or a redo of a prior RDF infographic artifact. Harness mode constrains request interpretation to this skill's artifact contract. Do not substitute a simpler web page, generic dashboard, manually invented graph, or partial visual summary when the request matches this mode. ### Harness Contract When active, every generated artifact set MUST include, unless the user explicitly opts out: 1. **RDF source of truth** — parse or generate the companion RDF first; derive ALL narrative content from that RDF, including: FAQ questions (`schema:Question`) and answers (`schema:Answer`), glossary terms (`schema:DefinedTerm` entities grouped in a `schema:DefinedTermSet` using `schema:hasDefinedTerm`; the `DefinedTermSet` MUST be linked from the main article/post entity via `schema:hasPart`, and each `DefinedTerm` MUST carry `schema:inDefinedTermSet` pointing back to it) and definitions, HowTo section (`schema:HowTo` — MUST be linked from the main article/post entity via `schema:hasPart` and MUST list every step via `schema:step`; each `schema:HowToStep` MUST use an **absolute IRI**, not a hash-relative IRI from `@prefix : <#>`, so resolver URLs can be constructed — declare a named prefix anchored to the source document URL, e.g. `@prefix post: <{source-url}#>`) and every step (`schema:HowToStep`) with its exact `schema:name`, `schema:text`, and `schema:position`, person names, organization names, entity types, and KG Explorer graph data. Do not author HTML narrative content independently — any concept with an RDF entity representation MUST use that entity's data in the HTML. If the RDF has 7 `schema:HowToStep` entities, the HTML HowTo must render exactly 7 steps matching those entities. **The main article/post entity MUST carry a substantive `schema:abstract`** (2-4 sentence executive summary, as plain text or `

...

` HTML for a multi-paragraph lede+body split) — `rdf_parser._extract_deck` falls back to `schema:articleBody` and then `schema:description` if `schema:abstract` is absent, but relying on the fallback is not a substitute for setting `schema:abstract` directly: a bare `schema:description` is usually a one-line meta-description, too short to fill the synopsis deck's lede+body columns, and the result is a sparse-looking card (spotlight panel + CTA, no narrative prose). Run `scripts/validate-harness-contract.py` — it now fails with "Synopsis section has no lede/body prose" when this is missing. 2. **Shared artifact stem** — save HTML, Markdown, and RDF with the same `{descriptive-slug}-{llm-id}-{n}` stem. 3. **Resolver-backed entity links** — visible semantic entities in HTML, Markdown, KG nodes, and KG edge predicates route through `https://linkeddata.uriburner.com/describe/?url={encodedIRI}` unless the user explicitly supplies another resolver. 4. **POSH and JSON-LD pairing** — HTML declares the companion RDF and Markdown files through ``, ``, and embedded JSON-LD. 5. **Floating navigation control** — movable, resizable, collapsible, visible in a closed compact header-bar state by default, and recoverable after stale localStorage. 6. **Page theme control** — one page-level light/dark toggle in the navigation panel, with equivalent `html[data-theme="dark"]` and `prefers-color-scheme: dark` variable values. 7. **Knowledge Graph Explorer** — Basic and Advanced modes, resolver-backed node/edge links, directed subject-to-object arrowheads, Core/Full density, multi-select Classes/Properties/Instances filters, visible selected states, node/link counts, sticky drag, double-click unpin, and no resolver launchpad/card grid unless explicitly requested. Its controls tray MUST be collapsed/closed by default on page load; the first visible KG state is the graph plus a compact Controls button and node/link count badge. 8. **Advanced KG settings panel** — fullscreen, center, settings button, visible close (`X`), wired physics controls, predicate display, predicate filters with Select All/Deselect All, node filters, literal filter, resolver preference, arrow style, and clear state feedback. The panel MUST use a structured compact layout that prevents form controls or action buttons from stretching into oversized cards/circles. 9. **Attribution footer** — source material, companion files, skills used, generation environment, server/platform items where known, resolver pattern, and hyperlinked generation-environment entities. 10. **Markdown companion parity** — Markdown mirrors the HTML narrative structure and preserves resolver-backed links for FAQ, glossary, HowTo, People, Organizations, SoftwareApplication, source/document, and media entities. **The Markdown companion is NOT part of the DAV upload set.** When a collection is published to URIBurner, upload `.html`, `.ttl` and `.jsonld` only; the `.md` stays in the local generating tree (`{LLM_ROOT}//md/`) unless the user explicitly instructs otherwise, and such an override is per-request rather than a new default. Corollary: nothing may then carry a public DAV IRI naming the `.md` — drop any `rdfs:seeAlso`/`schema:sameAs` in the companion TTL pointing at `{DAV}/{stem}.md` (that one triple also propagates into the embedded `kgData` as a node plus an edge, and into the JSON-LD), plus any DAV `.md` URL in the Markdown's own companion-files list and in the HTML attribution footer. The document's own relative `../md/{stem}.md` links are correct and stay. Verify: `grep -c 'daas/{stem}[.]md'` returns 0 across `.html`/`.ttl`/`.jsonld`/`.md`, and `GET {DAV}/{stem}.md` returns 404. See `agent-rdf-memory/howto/remote-webdav-upload.ttl#step-markdownExcludedByDefault` (preferences.ttl Step 259). 11. **Authority denotation rules** — Person entities use profile URL `#this` IRIs using the same priority as `kg-generator`; SoftwareApplication and Country entities use DBpedia/Wikidata-centered IRIs where confidently available; DefinedTerm/skos:Concept glossary entries MUST use the confirmed DBpedia IRI as the **primary subject** (not a document-local alias with `owl:sameAs dbr:X`) whenever a confident DBpedia resource exists — `owl:sameAs` is reserved for cross-vocabulary alignment (DBpedia ↔ Wikidata) only. When no DBpedia or Wikidata IRI is confirmed, use a document-local hash IRI. The anti-pattern `:localConcept owl:sameAs dbr:X` is prohibited when the entity IS `dbr:X`. 12. **Zero-failure delivery gate** — do not deliver until RDF parse, HTML/JS parse, resolver link audit, KG Explorer behavior checklist, nav behavior, dark mode, output path checks, and programmatic KG orphan-node checks all pass. 13. **SPARQL query presentation** — when the RDF or source content contains `schema:SoftwareSourceCode` SPARQL examples, endpoint demos, or query recipes, render them as readable accordions with resolver-backed query-entity links, fenced/preformatted query text, a visible endpoint/service link, and a correctly URL-encoded live query link when an endpoint is known. Markdown companions must include the same query headings, resolver links, live links, and fenced `sparql` code blocks. **Every published SELECT MUST project at least one IRI-valued variable alongside its labels** — Virtuoso's `text/x-html+tr` rendering hyperlinks IRI cells and leaves literal cells as plain text, so a literals-only solution produces a results page with nothing to click and no way to continue exploring. Ask what entity each row is *about* and select that entity's IRI in addition to (never instead of) its `schema:name`; where a row joins two entities, project both. Name the variable after its entity with an `Iri` suffix (`?riskIri ?risk`, `?claimIri ?claim`, `?stepIri ?step`) and place it immediately before its own label column. For `GROUP BY` queries reintroduce the identifier with `SAMPLE(?entityIri)` or `GROUP_CONCAT` the IRIs into a second column. `DESCRIBE`/`CONSTRUCT` are exempt — they emit triples, so IRIs are inherent. Verify by executing each recipe with `format=application/sparql-results+json` and asserting at least one binding carries `"type": "uri"`; note that an anti-join deliberately returning zero rows has no bindings to inspect, so read its SELECT clause by hand rather than "fixing" a correct query. See `agent-rdf-memory/howto/sparql-example-query-iri-in-solution.ttl` (preferences.ttl Step 258). 14. **Open-tab HTML link behavior** — every generated HTML `` whose `href` is not a same-page fragment (`#section`) MUST include `target="_blank" rel="noopener noreferrer"`. This applies to resolver links, companion RDF/Markdown/JSON-LD links, SPARQL links, media/source links, attribution links, DBpedia/Wikidata/W3C links, and footer platform/tool links. Same-page navigation links MUST remain same-tab and MUST NOT carry `target="_blank"`. 15. **Responsive head-to-head comparison presentation** — when the HTML includes a multi-entity comparison matrix (two or more named products, platforms, systems, harnesses, vendors, or offerings as parallel columns), it MUST dual-present: a semantic comparison **table** for larger screens and **product/entity cards** for phones and narrow viewports. Every comparison aspect MUST be a described entity in the companion TTL, and the **first column of each table body row** (plus matching card row labels) MUST use resolver hyperlinks to those dimension IRIs. See the dedicated section below. Horizontal-scroll-only tables are not a sufficient mobile strategy for multi-column head-to-head matrices. 16. **Dense exploration tools in collapsible containers** — when a KG Explorer or query workbench (SPARQL, SQL, or another query surface) is present alongside an editorial narrative, place each dense tool in a clearly labeled, keyboard-accessible native disclosure (`
/` or equivalent) that is closed by default, unless the user asks for it open or the selected artifact is explicitly an exploration-first dashboard. Keep the current-page anchor on the disclosure, preserve all controls and graph/query content inside its panel, provide visible focus and open/closed state, and ensure the summary explains what the tool does. This rule applies to the entire explorer/workbench section, separately from the KG Explorer controls tray, which also remains collapsed by default. At phone widths, the disclosure must remain usable and must not cause horizontal overflow. 17. **Canonical section sequence ordering** — generated HTML infographics and companion Markdown documents MUST follow the canonical section sequence: (1) Overview / Architecture / Comparison Matrix, (2) HowTo Execution Pipeline / Workflow, (3) Frequently Asked Questions (FAQ), (4) Core Technical Glossary, (5) Interactive Knowledge Graph Explorer (`#kg-explorer`), (6) SPARQL Workbench (`#sparql-workbench`), and (7) Attribution & Provenance Footer (`footer#attribution`). The Knowledge Graph Explorer and SPARQL Workbench MUST follow the Glossary — never place them before HowTo, FAQ, or Glossary. If an input is insufficient to satisfy the harness contract, ask for the missing source, RDF, resolver, output folder, or artifact scope before generating. If an existing artifact is being repaired, preserve its RDF/HTML/MD pairing and retrofit the missing contract items rather than creating a separate one-off patch. ### Template Selection And Reusable Harness Assets Skills must remain loosely coupled. The harness contract defines required behavior; it does not require one fixed visual template or one mandatory implementation helper. For future RDF-backed article collections, choose a template explicitly named by the user, infer an appropriate template from the content, or mirror the contract in a fresh implementation. Use the helper only when it fits the selected design. When choosing among template styles, read `references/template-options.md`. It includes the compact harness reference plus user-supplied Claude templates for the Gartner dashboard, Semantic Medallion editorial/technical, competitive/head-to-head, Spec-Sheet Editorial Essay, Editorial Data-Viz, and Intelligence Network styles. The Spec-Sheet Editorial Essay template is for long-form narrative/thesis pieces and intentionally omits the KG Explorer and SPARQL workbench — see its entry in `references/template-options.md` before selecting it. **Resolve every "preferred default" claim to its latest, non-superseded entry before generating.** `template-options.md` has chained multiple entries claiming default status for the same content class within a single day before (three entries, 2026-08-19–20, for Thesis & Framework content) — read the individual template section's own heading for a supersession banner, not just the top-of-file Selection Rule, and cross-check `preferences.ttl` for a later-numbered step on the same topic before citing any step by name or ID. See `agent-rdf-memory/howto/latest-standing-default-resolution.ttl`. **Elicit the template choice only when it is genuinely ambiguous** — mirroring `kg-generator`'s RDF Format Elicitation / Generation Modality pattern: - A named user request, a clear content-shape match (a comparison → competitive/head-to-head; Thesis & Framework content → the current standing default per the rule above), or an existing artifact being repaired all resolve without asking. - Ask only when **two or more templates plausibly fit** and no standing default breaks the tie (e.g. a dense technical explainer that could go Gartner Dashboard or Semantic Medallion; a long-form thesis piece where it is unclear whether a sustained-narrative read or a data-exploration surface is wanted). Use a short closed question naming the candidates and the one-line tradeoff between them — see `template-options.md`'s Selection Rule for the exact phrasing pattern. - If the same ambiguous shape is likely to recur for this user, record the elicited answer as a standing preference per `agent-rdf-memory/howto/elicit-before-conditional-default.ttl` step 3, so it is not re-asked indefinitely. Also layer the **Editorial Enhancement Module** (`references/editorial-enhancement-module.md`) onto whichever template is selected, whenever the source has a quantitative claim worth foregrounding or a synthesis/cross-reference section connecting multiple meshed sources — this is not a template choice of its own, it augments any of the templates below. Reusable assets: - `scripts/rdf_infographic_harness.py` — optional reference helper functions for resolver URLs, query-type-specific SPARQL live URLs, a KG Explorer shell, footer attribution, and the footer "Explore Knowledge Graph using SPARQL" workbench. - **If you use any of those markup helpers, you must also emit `harness_styles()` into the page stylesheet.** No template in `assets/templates/` defines the `.attribution-*` / `.sparql-*` / `.entity-link` classes the helpers produce; without this CSS the attribution footer renders as full-bleed unstyled text and the SPARQL workbench as bare form controls with the live-query URL bleeding across the page. The failure is silent — valid HTML, no console error, correct content. `validate-harness-contract.py` now fails on it. Append the string to the existing stylesheet; it carries no `