AugmentClaude

PortalJS DCAT Publisher

Generate standards-compliant DCAT feeds for your PortalJS portal to enable harvesting by open-data registries.

Installation

  1. Make sure Claude is on your device and in your terminal.

    Skills load from ~/.claude/skills/ when Claude Code starts up β€” so you need it on your machine first. If you don't have it yet, install it once with the command below, then run claude in any terminal to verify.

    One-time setup
    npm i -g @anthropic-ai/claude-code

    Already have it? Skip ahead.

  2. Paste into Claude Code or into your terminal.

    This copies the whole skill folder into ~/.claude/skills/portaljs-add-dcat-datopian/ β€” the SKILL.md plus any scripts, reference docs, or templates the skill ships with. Safe default: works for every skill.

    Faster alternative (instruction-only skills)

    Skips the clone and grabs only the SKILL.md file. Don't use this if the skill ships Python scripts, reference markdowns, or asset templates β€” they won't be downloaded and the skill will fail when it tries to load them.

    Quick install (SKILL.md only)
    Sign up to copy
  3. Restart Claude Code.

    Quit and reopen Claude Code (or any other agent that loads from ~/.claude/skills/). New skills are picked up on startup.

  4. Just ask Claude.

    Skills auto-activate when your request matches the skill's description β€” no slash command needed. Trigger phrases live in the skill's own frontmatter; you can read them in the β€œWhat this skill does” section above.

Prefer to read the source first? Open on GitHub.

When Claude uses it

Make a PortalJS portal harvestable by national/EU/US open-data portals β€” emit standards-compliant DCAT catalog feeds (DCAT 2/3, DCAT-AP, DCAT-US, national profiles) in JSON-LD, Turtle, and RDF/XML at build, with autodiscovery and per-profile conformance checking. Use when a portal needs to be harvested by data.europa.eu, data.gov, or a national open-data catalog.

What this skill does

PortalJS β€” Add DCAT

Overview

Turn an existing PortalJS (portaljs-catalog) portal into a harvestable data catalog. PortalJS is Frictionless-native β€” a dataset is a Data Package (see portaljs-define-schema) β€” and DCAT is the serialization + harvest layer on top (lib/metadata/dcat.ts + lib/metadata/dcat-profiles.ts). This skill selects one or more DCAT application profiles, maps every dataset's metadata to them, and writes static feed files at build time β€” JSON-LD, Turtle, and RDF/XML β€” so external catalogs (data.europa.eu, data.gov, national portals) can harvest the datasets automatically, on any static host, with no runtime.

Prerequisites

  • A scaffolded PortalJS portal with datasets.json, package.json, and lib/metadata/ (the metadata-profile contract) present.
  • lib/metadata/dcat.ts (the DCAT-3 core) already in place β€” profiles augment it.
  • Node 18+ and npm available in the portal directory.
  • For DCAT-AP / DCAT-US: a publishing organization (name + homepage) and a contact (name + email) β€” both profiles require dct:publisher and dcat:contactPoint.
  • Optional but recommended: network access to run SHACL conformance checks against the official EU ITB validator or pyshacl.

Instructions

The canonical, full step-by-step workflow is .claude/commands/portaljs-add-dcat.md β€” the single source of truth. Read and follow it when executing. Summary:

  1. Gather input from $ARGUMENTS (interview if thin): portal directory (default .), profiles (default ["dcat-3"]), site URL, publisher, contact, license, themes, languages, access level.
  2. Validate the portal directory: confirm datasets.json, package.json, and lib/metadata/ exist; stop with an ERROR: if the metadata contract is missing.
  3. Ensure the DCAT profile layer is present β€” dcat-profiles.ts, dcat-rdf.ts, dcat-validate.ts β€” copying canonical versions from examples/portaljs-catalog if the portal predates this skill.
  4. Ensure scripts/generate-dcat.ts is wired to predev/prebuild and emits per-profile x serialization feeds from dcat.config.json.
  5. Write dcat.config.json with the gathered profiles, publisher, contact, license, themes, and access level.
  6. Add feed autodiscovery: a <link rel="alternate" type="application/ld+json"> to pages/_document.tsx pointing at /catalog.jsonld.
  7. Generate the feeds and check conformance: run npm run generate:dcat and surface any missing mandatory fields.
  8. Verify the RDF: confirm the JSON-LD parses, and cross-check that JSON-LD, Turtle, and RDF/XML agree; run SHACL validation (ITB for DCAT-AP, pyshacl for DCAT-US) when network/tooling allow.
  9. Verify the build with npx next build; fix errors before reporting success.
  10. Report the profiles emitted, feed paths, conformance status, and next steps (register with the harvester, run portaljs-deploy).

Output

  • Created/modified: dcat.config.json (committed config).
  • Generated (build artifacts, gitignored): public/catalog.jsonld /.ttl/.rdf (canonical feed), public/catalog.<profile>.{jsonld,ttl,rdf} per configured profile, public/catalog-feeds.json (feed index).
  • Modified: pages/_document.tsx (autodiscovery <link>), package.json (generate:dcat script wired to predev/prebuild).
  • Verified: feeds are valid JSON-LD/Turtle/RDF-XML, conformance status reported, npx next build passes.

Error Handling

SymptomCauseFix
NO_METADATA_CONTRACTlib/metadata/ not foundPortal predates the metadata-profile contract; scaffold with portaljs-new-portal or add lib/metadata first.
NO_DCAT_CORElib/metadata/dcat.ts not foundThe DCAT-3 core is missing; update the portal template before adding profiles.
BAD_CONFIGdcat.config.json is not valid JSONFix the syntax and re-run npm run generate:dcat.
UNKNOWN_PROFILEProfile id not in the registryUse one of dcat-2, dcat-3, dcat-ap, dcat-us, geodcat-ap, croissant, dcat-ap-se, dcat-ap-ch, dcat-ap-de, or register a national profile first.
Feed flagged non-conformantpublisher/contactPoint missing for DCAT-AP or DCAT-USAsk the user for the publishing organization and contact, add to dcat.config.json, regenerate.
DCAT-US SHACL rejects the publisherPublisher has no IRI (blank node)Set publisher.uri (or homepage) in dcat.config.json.
next build fails after config changeMalformed JSON in dcat.config.json or datasets.jsonPrint the build log, fix the JSON, rebuild before reporting success.

Examples

Example 1 β€” Default DCAT-3 feed, no national harvesting

/portaljs-add-dcat

Emits the canonical public/catalog.jsonld/.ttl/.rdf under the default dcat-3 profile, adds autodiscovery to _document.tsx, and wires generate:dcat into predev/prebuild. No publisher/contact required.

Example 2 β€” EU harvesting via DCAT-AP

/portaljs-add-dcat profiles=dcat-ap site=https://data.example.org

Prompts for publisher (name + homepage) and contact (name + email) since DCAT-AP requires both, writes them into dcat.config.json, and emits public/catalog.dcat-ap.{jsonld,ttl,rdf} plus the canonical feed with absolute links.

Example 3 β€” US federal harvesting via DCAT-US

/portaljs-add-dcat profiles=dcat-us site=https://data.example.gov

Requires an IRI-identified publisher (publisher.uri) for SHACL conformance; emits catalog.dcat-us.{jsonld,ttl,rdf} and validates against the DCAT-US 3.0 SHACL shapes with pyshacl when available.

Example 4 β€” Multiple profiles plus a national extension

/portaljs-add-dcat profiles=dcat-ap,dcat-ap-de site=https://daten.example.de

Emits both catalog.dcat-ap.* and catalog.dcat-ap-de.* feeds from one config; the first profile listed also becomes the canonical, un-suffixed catalog.jsonld/.ttl/.rdf.

Resources

Related skills