门户数据目录生成器
安装方式
先用 Prompt 核对来源,也可切换到安装命令或下载可用的安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "portaljs-add-dcat":https://skillpi.com/zh/skills/deepskill-da13496bc36d32f73e2d00fc0de6be8c5a9d11ea5995cb3492a64145778714e0。安装前核对上游来源和版本:https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/6ea46b08dce892944db7c16f28d0b5308d402402/plugins/community/portaljs/skills/portaljs-add-dcat/SKILL.md。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
此命令从 GitHub 来源仓库获取指定技能。运行前请先查看源文件。
npx skills add https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/6ea46b08dce892944db7c16f28d0b5308d402402/plugins/community/portaljs/skills/portaljs-add-dcat --skill portaljs-add-dcat来源与配置
查看 GitHub 源码jeremylongshore/tons-of-skills-marketplace固定提交 6ea46b08dce892944db7c16f28d0b5308d402402
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
本条目介绍 门户数据目录生成器 的公开用途。DeepSkill 当前公开目录说明:“使 PortalJS 门户可被各国/欧盟/美国开放数据门户收割 —— 在构建时生成符合标准的 DCAT 目录数据源(DCAT 2/3、DCAT-AP、DCAT-US、各国规范),支持 JSON-LD、Turtle 和 RDF/XML 格式,并提供自动发现功能及针对各规范的合规性检查。适用于需要被 data.europa.eu、data.gov 或国家开放数据目录收割的门户。” 适用场景包括应用接入与集成。本页根据公开目录资料和固定版本的上游仓库整理,建议使用前核对该版本的环境、工具、权限及数据处理要求。Skillπ 提供站方用途介绍与原站链接;原始 SKILL.md 和附件仅在对应许可允许时开放。
文件浏览
---
name: portaljs-add-dcat
description: 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.
allowed-tools: Read, Write, Edit, Bash(npm:*), Bash(npx:*), Bash(node:*), WebFetch
version: 1.0.0
author: Datopian <hello@datopian.com>
license: MIT
compatibility: Claude Code with PortalJS portals (Next.js 14, React 18, Node 18+). Runs from any project via the plugin, a personal ~/.claude/commands install, or a portaljs clone.
tags:
- portaljs
- data-portal
- dcat
- interoperability
- rdf
- jsonld
---
# 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`](https://github.com/datopian/portaljs/blob/main/.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
| Symptom | Cause | Fix |
| --- | --- | --- |
| `NO_METADATA_CONTRACT` | `lib/metadata/` not found | Portal predates the metadata-profile contract; scaffold with `portaljs-new-portal` or add `lib/metadata` first. |
| `NO_DCAT_CORE` | `lib/metadata/dcat.ts` not found | The DCAT-3 core is missing; update the portal template before adding profiles. |
| `BAD_CONFIG` | `dcat.config.json` is not valid JSON | Fix the syntax and re-run `npm run generate:dcat`. |
| `UNKNOWN_PROFILE` | Profile id not in the registry | Use 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-conformant | `publisher`/`contactPoint` missing for DCAT-AP or DCAT-US | Ask the user for the publishing organization and contact, add to `dcat.config.json`, regenerate. |
| DCAT-US SHACL rejects the publisher | Publisher has no IRI (blank node) | Set `publisher.uri` (or `homepage`) in `dcat.config.json`. |
| `next build` fails after config change | Malformed JSON in `dcat.config.json` or `datasets.json` | Print 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
- Full workflow: [`.claude/commands/portaljs-add-dcat.md`](https://github.com/datopian/portaljs/blob/main/.claude/commands/portaljs-add-dcat.md)
- Profile registry, serialization formats, and validator details: [`references/reference.md`](references/reference.md)
- Related skills: `portaljs-define-schema`, `portaljs-new-portal`, `portaljs-deploy`, `portaljs-migrate`
- DCAT specification: <https://www.w3.org/TR/vocab-dcat-3/>
当前收录版本
1.0.0
质量评测
满分 100。前四项来自 DeepSkill 收录的质量报告。
评分依据
为 PortalJS 门户提供标准化的 DCAT 支持,实现与各国开放数据门户的互操作性
评分依据
触发词精准完整,清晰描述了 Skill 的核心功能和适用场景
评分依据
文档结构完整,包含详细的先决条件、步骤、输出、错误处理和示例
评分依据
提供了全面的先决条件检查和详细的执行步骤
计算方式
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
安装或获取外部依赖
使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。
主文档提及 · 第 4, 67, 80 行
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- data.example.gov
- data.example.org
- daten.example.de
- github.com
- www.w3.org
安全评级与访问范围
risk · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。