fix(schema): rename v1 to v1.0, add umbrella + READMEs + self-contain…#9
Open
ameetdesh wants to merge 1 commit into
Open
fix(schema): rename v1 to v1.0, add umbrella + READMEs + self-contain…#9ameetdesh wants to merge 1 commit into
ameetdesh wants to merge 1 commit into
Conversation
…ed schema.json
Brings the schema/ tree into compliance with the schema.beckn.io
publisher checks. Fixes 8 errors:
- missing-root-context → adds schema/context.jsonld
- missing-root-vocab → adds schema/vocab.jsonld
- missing-class-readme → adds DatasetItem/README.md, DatasetFulfillment/README.md
- invalid-version-name x2 → renames DatasetItem/v1 → v1.0 and DatasetFulfillment/v1 → v1.0
- missing-readme x2 → adds DatasetItem/v1.0/README.md, DatasetFulfillment/v1.0/README.md
Beyond the publisher errors, this also rationalises the JSON-LD layout
for SSOT so cross-version concerns live in one place:
schema/context.jsonld namespace prefixes (dataset:, fulfillment:)
+ class IRI mappings (DatasetItem, DatasetFulfillment)
schema/vocab.jsonld rdfs:Class declarations for both classes
<Class>/v1.0/context.jsonld inherits root via @context: [<root URL>, {properties}]
— declares only v1.0 property mappings
<Class>/v1.0/vocab.jsonld declares only v1.0 rdf:Property nodes
(no rdfs:Class — that's in root)
<Class>/v1.1/context.jsonld inherits v1.0 via @context: [<v1.0 URL>, {new properties}]
— declares only v1.1-new property mappings
<Class>/v1.1/vocab.jsonld declares only v1.1-new rdf:Property nodes
Adds a self-contained JSON Schema (draft 2020-12) per version so
runtime validators don't need to dereference any external $ref:
<Class>/v1.0/schema.json
<Class>/v1.1/schema.json
Self-contained means schema.json inlines all property definitions
(intentionally duplicating across v1.0 and v1.1) — JSON Schema's
allOf semantics (intersection on enums) make safe schema inheritance
impossible for v1.1's extended accessMethod enum, so each version
gets its own full schema. The SSOT in context/vocab is sufficient
for the JSON-LD layer; the JSON Schema layer trades duplication
for hermetic per-version validation.
URLs in @context arrays use https://schema.beckn.io/... as the
canonical publish target.
Out of scope (would break other PRs):
example/v1/ and testnet/rain-probability-devkit/ still reference
raw.githubusercontent.com/.../v1/ URLs. These need a follow-up
pass after this PR merges and the v1.0 paths are live.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ed schema.json
Brings the schema/ tree into compliance with the schema.beckn.io publisher checks. Fixes 8 errors:
Beyond the publisher errors, this also rationalises the JSON-LD layout for SSOT so cross-version concerns live in one place:
schema/context.jsonld namespace prefixes (dataset:, fulfillment:)
+ class IRI mappings (DatasetItem, DatasetFulfillment)
schema/vocab.jsonld rdfs:Class declarations for both classes
/v1.0/context.jsonld inherits root via @context: [, {properties}]
— declares only v1.0 property mappings
/v1.0/vocab.jsonld declares only v1.0 rdf:Property nodes
(no rdfs:Class — that's in root)
/v1.1/context.jsonld inherits v1.0 via @context: [<v1.0 URL>, {new properties}]
— declares only v1.1-new property mappings
/v1.1/vocab.jsonld declares only v1.1-new rdf:Property nodes
Adds a self-contained JSON Schema (draft 2020-12) per version so runtime validators don't need to dereference any external $ref:
/v1.0/schema.json
/v1.1/schema.json
Self-contained means schema.json inlines all property definitions (intentionally duplicating across v1.0 and v1.1) — JSON Schema's allOf semantics (intersection on enums) make safe schema inheritance impossible for v1.1's extended accessMethod enum, so each version gets its own full schema. The SSOT in context/vocab is sufficient for the JSON-LD layer; the JSON Schema layer trades duplication for hermetic per-version validation.
URLs in @context arrays use https://schema.beckn.io/... as the canonical publish target.
Out of scope (would break other PRs):
example/v1/ and testnet/rain-probability-devkit/ still reference
raw.githubusercontent.com/.../v1/ URLs. These need a follow-up
pass after this PR merges and the v1.0 paths are live.