synthetic-rdf
Use when generating deterministic RDF/JS instances from SHACL shapes, defining synthetic persona overrides, adding generator plugins, or integrating @jeswr/synthetic-rdf validation and Turtle output.
- License 许可
- MIT
- 所属仓库
- jeswr/solid-sdk
- 最近更新
- 2026-11-15
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- synthetic-rdf
- description
- Use when generating deterministic RDF/JS instances from SHACL shapes, defining synthetic persona overrides, adding generator plugins, or integrating @jeswr/synthetic-rdf validation and Turtle output.
02 资源文件 24
- 许可证LICENSE1.0 KB
- 参考文档package.json1.9 KB
- 参考文档README.md2.9 KB
- 脚本scripts/check-browser-safe.mjs1.2 KB
- 脚本src/constraints.ts15.8 KB
- 脚本src/generate.ts49.6 KB
- 脚本src/index.ts4.8 KB
- 脚本src/pattern.ts16.5 KB
- 脚本src/prng.ts3.4 KB
- 脚本src/shacl-engine.d.ts457 B
- 脚本src/types.ts3.1 KB
- 脚本src/validate.ts1.0 KB
- 脚本src/vocab.ts3.5 KB
- 脚本test/browser.test.ts869 B
- 其他test/fixtures/golden.ttl492 B
- 脚本test/generation.test.ts50.1 KB
- 脚本test/helpers.ts1.5 KB
- 脚本test/identity-and-unsupported.test.ts13.7 KB
- 脚本test/serializer.test.ts1.1 KB
- 脚本test/types.test.ts388 B
- 参考文档tsconfig.build.json83 B
- 参考文档tsconfig.json269 B
- 参考文档tsconfig.test.json187 B
- 脚本vitest.config.ts157 B
03 SKILL.md 正文
<!-- AUTHORED-BY GPT-5.6 Sol via codex -->
Deterministic synthetic RDF
Use generate() by default and inject an independent ShaclValidator. Import
shaclEngineValidator() from @jeswr/synthetic-rdf/validate when shacl-engine is available.
generateUnchecked() is an explicit escape hatch only for exact inputs already validated in CI.
Load-bearing rules
- Pass a stable string
seed; never introduce ambient entropy. - Pass
nowwhenever a temporal default can fire. Do not read the wall clock in a plugin. - Plugins may draw only from
context.random; fork it for logically separate choices. - Preserve coordinate identity: shape IRI, instance index, predicate path, and occurrence determine a stream. Do not add shared sequential random state.
- Use
{ fragment }for identities that solid-seed will rebase. Use{ external }only for real absolute IRIs, and exact-list each one inallowedExternalIris. - Treat an override as replacement of the property's full value set. Never post-process generated quads to implement a persona.
- Keep shapes and ontology graphs caller-supplied. The package performs no fetch or RDF parsing.
- Serialize through
SyntheticRdfResult.toTurtle()so canonical quad order and prefixes remain stable.
Resolution and failures
Resolution order is override, sh:hasValue, sh:in, sh:node/sh:class, datatype facets,
pattern, plugins, defaults. The selected tier drives generation; every other supported constraint
is still checked. Unsupported constraints, recursive shapes, invalid overrides, and failed
independent validation are errors, never best-effort output.
Tests
Pin seed and now in golden tests. For a new constraint, test its driving tier, conflicting
conjunctive facets, deterministic output, and an invalid override. For a plugin, test that changing
an unrelated coordinate does not perturb its output.
04 同仓库更多 Skills
storage-conformance
Work on @jeswr/storage-conformance, the shared storage conformance suite package in the Solid SDK workspace.
fetch-rdf-engine-tests
Maintain fetch-rdf's real Node WASM parser integration tests without introducing a reverse engine dependency in fetch-rdf.
alpha
Use when checking fixtures, including folded YAML descriptions.
widget
Use when testing package skills: YAML quoting works.
web-seo
Use when improving technical and entity SEO for a modern personal, portfolio, documentation, or marketing site, including crawlable HTML, canonical metadata, sitemap and robots, Person/ProfilePage JSON-LD, Core Web Vitals, and honest ranking expectations.
solid-wac
Use when implementing or auditing Solid server WAC authorization, ACL creation and inheritance, auxiliary-resource escalation, method-to-mode mapping, 401 versus 403 challenges, WAC-Allow, or defensive typed ACL parsing with @solid/object and @rdfjs/wrapper.