@_linked/sioc

中文文档
1.6.2发布于 2026/10/28MITTypeScriptES Module构建来源已验证近 30 天下载 2529

SIOC (Semantically-Interlinked Online Communities) vocabulary as @linkedShape classes — UserAccount, Site, Space, Container, Item, Role, Usergroup. Renamed from lincd-sioc (plan-011).

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

@_linked/sioc

SIOC (Semantically-Interlinked Online Communities) vocabulary as @linkedShape classes.

Shapes

  • UserAccount — sioc:UserAccount
  • Site — sioc:Site
  • Space — sioc:Space
  • Container — sioc:Container
  • Item — sioc:Item
  • Role — sioc:Role
  • Usergroup — sioc:Usergroup

Terms

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

static targetClass = sioc.UserAccount;

ontologies/sioc has one named export per term of http://rdfs.org/sioc/ns# (99); ontologies/sioc.data holds ns, dataFiles, _ontologyResource and loadData(). A term's export name is its local name (sioc:account_of → sioc.account_of). 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.

The data

The data is SIOC as published at its namespaces, in RDF/XML, converted to Turtle with the triples unchanged; a leading comment names the source:

FileSourceVersion
src/data/sioc.ttlhttp://rdfs.org/sioc/nsowl:versionInfo "Revision: 1.36", Last-Modified 2020-06-05
src/data/sioc-types.ttlhttp://rdfs.org/sioc/typesLast-Modified 2020-06-05

sioc-types.ttl is the SIOC Types module (http://rdfs.org/sioc/types#); its subjects are not in the sioc: namespace, so it adds data but no terms. To refresh, download each file with curl -sSL -H 'Accept: application/rdf+xml' <source>, convert it to Turtle, check that the triples match the download (an RDF/XML rdf:type attribute on an empty property element is an IRI, not a literal), put the comment back, 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.

Both files carry their own ontology header, so this package has no -added file.

Usage

import { UserAccount } from '@_linked/sioc/shapes/UserAccount';

const account = await UserAccount.select().one();
console.log(account.accountOf?.givenName);

History

Renamed from lincd-sioc to @_linked/sioc and migrated out of the lincd.org umbrella in create-now plan-011 (2026-06-12). At the time, the internal source was unchanged — only the package name and publishing infrastructure were updated to match the modern @_linked/* convention (changesets, dual-package ESM+CJS build, development conditional export for Vite HMR).

Data license

The package code is MIT licensed (see LICENSE). The bundled ontology data is the SIOC Core Ontology and SIOC Types module, (c) 2004-2018 Data Science Institute (formerly DERI), NUI Galway, and is not covered by the MIT license. The namespace documents carry no license; the SIOC specification's Creative Commons license (CC BY 1.0) states that it does not apply to SIOC ontology terms. See NOTICE.

版本与发布记录

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

版本发布日期距今
1.6.2latest2026/10/2810 天前
1.6.12026/10/2513 天前
1.6.02026/10/2414 天前
1.5.12026/10/2414 天前
1.5.02026/10/2216 天前
1.4.02026/10/0929 天前

关于 @_linked/sioc 的常见问题

@_linked/sioc 是什么?

SIOC (Semantically-Interlinked Online Communities) vocabulary as @linkedShape classes — UserAccount, Site, Space, Container, Item, Role, Usergroup. Renamed from lincd-sioc (plan-011).

如何安装 @_linked/sioc?

在项目目录运行 npm install @_linked/sioc,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.2.0 || ^19.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@_linked/sioc 支持 TypeScript 吗?

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

@_linked/sioc 支持 ESM 还是 CommonJS?

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

@_linked/sioc 可以商用吗?

@_linked/sioc 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

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

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

@_linked/sioc 还在维护吗?

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