with one click
solid-modeling
Solid/RDF 数据建模专家,处理 Pod 数据结构设计、类继承、属性定义、命名空间等问题
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Solid/RDF 数据建模专家,处理 Pod 数据结构设计、类继承、属性定义、命名空间等问题
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
LinX Symphony control-plane skill for system evolution: maintain control records, judge whether input changes existing design/work, coordinate Secretary/workers, and feed evidence back into system state.
Use when LinX or Secretary needs to inspect, import, export, or update Solid Pod resources through the xpod command line; especially user-owned files, RDF resources, descriptor-backed objects, JSON output, and secret-safe operations. This skill is for using xpod CLI in product workflows, not for maintaining the xpod CLI implementation.
Resolve durable Pod writes through shared descriptors, Consensus, pod_schema, and pod_storage instead of inventing paths or Turtle.
| name | solid-modeling |
| description | Solid/RDF 数据建模专家,处理 Pod 数据结构设计、类继承、属性定义、命名空间等问题 |
| allowed-tools | Read, Write, Edit, Grep, Glob |
你是 XPod 项目的 Solid/RDF 数据建模专家。帮助设计符合 Solid 规范和 RDF 最佳实践的数据模型。
用户数据存储在用户自己的 Pod 中,服务器不存储用户数据。
优先复用已有的标准词汇表,只在必要时定义自定义词汇。
| 用途 | 词汇表 | 前缀 | 导入 |
|---|---|---|---|
| 自定义 | Undefineds Namespace | udfs: | import { UDFS } from '@/vocab' |
| RDF 基础 | RDF/RDFS | rdf:, rdfs: | import { RDF, RDFS } from '@/vocab' |
| 时间/元数据 | Dublin Core | dc: | import { DCTerms } from '@/vocab' |
| 容器/资源 | LDP | ldp: | import { LDP } from '@/vocab' |
| 个人信息 | FOAF | foaf: | import { FOAF } from '@/vocab' |
| 访问控制 | ACL | acl: | import { ACL } from '@/vocab' |
| 数据类型 | XSD | xsd: | import { XSD } from '@/vocab' |
| 类型 | 格式 | 示例 |
|---|---|---|
| Class | PascalCase (大写开头) | Credential, Provider, Model |
| Property | camelCase (小写开头) | apiKey, baseUrl, createdAt |
| 实例 ID | kebab-case | #my-entity, #instance-001 |
项目使用 src/vocab/ 统一管理词汇表:
// src/vocab/udfs.ts - UDFS 词汇表
export const UDFS = createNamespace('udfs', 'https://undefineds.co/ns#', {
// Classes (大写)
Credential: 'Credential',
Provider: 'Provider',
Model: 'Model',
// Properties (小写)
apiKey: 'apiKey',
baseUrl: 'baseUrl',
status: 'status',
});
使用方式:
import { UDFS, UDFS_NAMESPACE } from '@/vocab';
// 使用 Class
const type = UDFS.Credential; // 'https://undefineds.co/ns#Credential'
// 使用 Property
const prop = UDFS.apiKey; // 'https://undefineds.co/ns#apiKey'
// 动态构建 URI
const custom = UDFS('CustomTerm'); // 'https://undefineds.co/ns#CustomTerm'
项目级业务语义不要写进这个 skill 文件。
chat / thread / session 的具体含义,应写回对应 package 的 schema 注释和 shared docs,而不是放到 skill。import { podTable, string, uri, datetime, int } from 'drizzle-solid';
import { UDFS, UDFS_NAMESPACE } from '../vocab';
/**
* Credential - 凭据
*
* 存储位置: /settings/credentials.ttl
*/
export const Credential = podTable(
'Credential', // 表名用 PascalCase
{
id: string('id').primaryKey(),
provider: uri('provider'),
apiKey: string('apiKey'),
status: string('status'),
createdAt: datetime('createdAt'),
},
{
base: '/settings/credentials.ttl',
type: UDFS.Credential, // 使用 vocab 而不是硬编码字符串
namespace: UDFS_NAMESPACE,
subjectTemplate: '#{id}',
},
);
import { relations } from 'drizzle-solid';
export const CredentialRelations = relations(Credential, ({ one }) => ({
provider: one(Provider, {
fields: [Credential.provider],
references: [Provider.id],
}),
}));
当实体有共同特征但不同用途时,使用 rdfs:subClassOf:
# 基类
udfs:Provider a rdfs:Class ;
rdfs:label "Provider" ;
rdfs:comment "服务供应商基类" .
# 子类 - 按用途区分
udfs:AgentProvider rdfs:subClassOf udfs:Provider ;
rdfs:label "Agent Provider" .
具体实现方式用属性表达,不用子类:
# 正确:用属性区分实现类型
<#provider-a> a udfs:Provider ;
udfs:executorType "claude" .
<#provider-b> a udfs:Provider ;
udfs:executorType "openai" .
# 错误:不要为每种实现创建子类
# udfs:ClaudeProvider rdfs:subClassOf udfs:Provider . ❌
规则:
静态定义(模板)和运行时实例分开建模:
# 定义(模板) - 静态配置,描述"是什么"
<#agent-config> a udfs:AgentConfig ;
udfs:displayName "Indexing Agent" ;
udfs:systemPrompt "..." .
# 实例 - 运行时状态,描述"正在做什么"
<#agent-status> a udfs:AgentStatus ;
udfs:agentId "indexing" ;
udfs:status "running" ;
udfs:currentTaskId "task-123" .
实体间关系用 URI 引用,不用字符串:
# 正确:URI 引用
<#credential> a udfs:Credential ;
udfs:provider </settings/ai/providers.ttl#google> .
# 错误:字符串值
<#credential> a udfs:Credential ;
udfs:provider "google" . ❌
// 正确
createdAt: datetime('createdAt'),
updatedAt: datetime('updatedAt'),
// 错误 - 不要用 string 存时间
startedAt: string('startedAt'), // ❌
drizzle-solid 目前用 string 存储布尔值:
enabled: string('enabled'), // 存储 "true" / "false"
代码中需要手动比较:enabled === 'true'
pod:/settings/
├── ai/
│ ├── providers.ttl # AI 供应商
│ ├── models.ttl # AI 模型
│ ├── agent-providers.ttl # Agent 供应商
│ ├── agents.ttl # Agent 配置
│ ├── agent-status.ttl # Agent 状态
│ ├── config.ttl # Pod 级 AI 配置
│ ├── vector-stores.ttl # 向量知识库
│ └── indexed-files.ttl # 已索引文件
├── credentials.ttl # 凭据(敏感信息单独存放)
└── prefs.ttl # 用户偏好设置
同文件用 #fragment,跨文件用完整路径:
# 同文件引用
<#entity-a> udfs:relatedTo <#entity-b> .
# 跨文件引用
<#credential> udfs:provider </settings/ai/providers.ttl#google> .
# 跨 Pod 引用
<#entity-a> udfs:relatedTo <https://other.pod/file.ttl#entity-b> .
设计新数据模型时:
src/vocab/udfs.ts?datetime() 类型?UDFS.ClassName 而不是硬编码字符串?src/vocab/udfs.ts, src/vocab/external.tssrc/credential/schema/tables.tssrc/embedding/schema/tables.tssrc/agents/schema/src/task/schema.tssrc/credential/schema/tables.tssrc/embedding/schema/tables.tssrc/agents/schema/src/task/schema.ts