@_linked/dcat

中文文档
1.4.0发布于 2026/10/28MIT AND CC-BY-4.0TypeScriptES Module构建来源已验证近 30 天下载 1717

DCAT 3 for Linked: the Data Catalog Vocabulary as Turtle, an accessor for every term, and shapes for the core classes. The package mirrors http://www.w3.org/ns/dcat# and holds only its terms.

原始使用文档
文档目录5 节
  1. Terms
  2. Shapes
  3. The data
  4. Development
  5. Data license

@_linked/dcat

DCAT 3 for Linked: the Data Catalog Vocabulary as Turtle, an accessor for every term, and shapes for the core classes. The package mirrors http://www.w3.org/ns/dcat# and holds only its terms.

Terms

import * as dcat from '@_linked/dcat/ontologies/dcat';

static targetClass = dcat.DataService;

ontologies/dcat has one named export per term (52); ontologies/dcat.data holds ns, dataFiles, _ontologyResource and loadData(). linked generate-ontology writes the modules from the data (package.json "linkedOntologies"), and linked build fails when they are stale; never edit them by hand.

Shapes

import '@_linked/dcat/shapes/index' registers them all; each is also shapes/<Name>.

ShapeClassProperties
Resourcedcat:Resourcetitle, description
Dataset (→ Resource)dcat:Datasetpublisher, accessRights, conformsTo, distributions
Distribution (→ Shape)dcat:Distributiontitle, accessURL, accessService
DataService (→ Resource)dcat:DataServiceendpointURL, servesDatasets

IRI-valued properties (endpointURL, accessURL, publisher, accessRights, conformsTo) are object properties: write and read them as {id}. Distribution extends Shape because DCAT gives dcat:Distribution no superclass. DCAT 3 axiomatises accessURL as the chain accessService/endpointURL, so a distribution with an access service has that service's endpointURL as its accessURL.

The data

src/data/dcat.ttl is DCAT 3 (W3C Recommendation, 2024) as the W3C publishes it, https://www.w3.org/ns/dcat.ttl (which redirects to dcat3.ttl; dcat:version "3", Last-Modified 2025-09-03), unchanged apart from a leading comment that names the source. To refresh, download it with curl -sSL https://www.w3.org/ns/dcat.ttl, put the comment back with the new version, and run npx linked generate-ontology.

The official files are the only source of the package's terms: the package never adds a class or property to a standard's namespace. What the published standard lacks, mainly metadata, goes in one extra file per prefix, src/data/<prefix>-added.ttl, listed in "linkedOntologies"' data:

  • the ontology entity itself: owl:Ontology, title, description, vann:preferredNamespacePrefix, vann:preferredNamespaceUri, the source URL and version;
  • annotations on terms the standard already defines, such as a missing rdfs:label.

New classes or properties never go there; a term a standard lacks belongs in the consumer's own ontology package.

The official file carries its own ontology header (on <http://www.w3.org/ns/dcat>, without the #), so this package has no -added file. _ontologyResource is that ontology IRI, http://www.w3.org/ns/dcat (the generator takes it from the owl:Ontology declaration).

Development

npx linked build    # checks the ontology modules, compiles, writes lib/esm/data/shapes.ttl
npm test            # runs against lib/

Data license

The package code is MIT licensed (see LICENSE). The bundled ontology data is derived from the W3C Data Catalog Vocabulary (DCAT) - Version 3 (https://www.w3.org/ns/dcat) and is not covered by the MIT license: it remains under the Creative Commons Attribution 4.0 International (CC BY 4.0), https://creativecommons.org/licenses/by/4.0/, as its vocabulary file declares (dcterms:license). See NOTICE.

版本与发布记录

@_linked/dcat 共发布 19 个版本,首次发布于 2026/04/23;过去 12 个月发布了 19 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.4.0latest2026/10/2812 天前
1.3.22026/10/2515 天前
1.3.12026/10/2516 天前
1.3.02026/10/2416 天前
1.2.12026/10/2416 天前
1.2.02026/10/2218 天前

关于 @_linked/dcat 的常见问题

@_linked/dcat 是什么?

DCAT 3 for Linked: the Data Catalog Vocabulary as Turtle, an accessor for every term, and shapes for the core classes. The package mirrors http://www.w3.org/ns/dcat# and holds only its terms.

如何安装 @_linked/dcat?

在项目目录运行 npm install @_linked/dcat,或使用 pnpm add / yarn add / bun add。

@_linked/dcat 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@_linked/dcat 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@_linked/dcat 可以商用吗?

@_linked/dcat 使用 MIT AND CC-BY-4.0 许可。声明的许可为 MIT AND CC-BY-4.0,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@_linked/dcat 的下载量有多少?

根据 npm 官方下载统计,@_linked/dcat 在 2026/10/05 – 2026/11/03 这 30 天内被下载 1,717 次,日均约 57 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@_linked/dcat 还在维护吗?

最新版本 1.4.0 发布于 2026/10/28(12 天前);至今共发布 19 个版本,其中过去 12 个月发布了 19 个;首次发布于 2026/04/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。