Skip to content

feat: Claim and Attestation schemas for claims engine interop#53

Open
glandua wants to merge 1 commit intoregen-network:mainfrom
glandua:feat/claims-attestation-schemas
Open

feat: Claim and Attestation schemas for claims engine interop#53
glandua wants to merge 1 commit intoregen-network:mainfrom
glandua:feat/claims-attestation-schemas

Conversation

@glandua
Copy link
Collaborator

@glandua glandua commented Mar 12, 2026

Summary

Adds Claim and Attestation LinkML schemas as the semantic backbone for KOI (off-chain) and CLAMS (on-chain) claims engine interoperability, per ADR-004.

  • Claim.yaml — verifiable claims with typed impact, temporal bounds, entity references (claimant/subject/operator), quantity + unit, methodology, credit class link, and chain bridge fields (contentHash, dataIri)
  • Attestation.yaml — reviewer attestations with verdict, rationale, evidence URIs, and on-chain anchoring (contentHash, graphIri for MsgAttest)
  • 3 new enums in taxonomy.yaml: ClaimType (ECOLOGICAL, SOCIAL, FINANCIAL, GOVERNANCE, BIOCULTURAL), VerificationStatus (SELF_REPORTED → LEDGER_ANCHORED), VerdictType (PENDING, APPROVED, REJECTED, NEEDS_INFO)
  • Entity.yaml extensions: walletAddress attribute (identity bridge for CLAMS/EAS), COMMUNITY entity type (PACTO collective entities)
  • schema.yaml: Claim and Attestation added to imports

Design decisions

Decision Rationale
Entity refs use range: Entity, inlined: true Matches ProjectInfo patterns (hasProjectDeveloper, etc.)
Taxonomy refs follow eligibleActivities → ActivityType pattern Consistent with CreditClassInfo
Temporal bounds as explicit date attributes Not buried in metadata JSONB — queryable and validatable
Quantity promoted to typed float + unit string Enables SPARQL aggregation across claims
contentHash + dataIri on both Claim and Attestation Bridges off-chain semantic data to on-chain Regen Data Module
hasCreditClass as string (not inlined CreditClassInfo) References credit class by ID (e.g., C01) — lightweight link
Omitted tx_hash, ledger_timestamp Operational fields, not semantic — belong in implementation layer

Verification

  • linkml-lint passes (warnings only — all pre-existing camelCase convention warnings)
  • gen-json-schema generates valid JSON Schema with all new types
  • gen-jsonld-context generates JSON-LD context with Claim/Attestation resolvable

Merge conflict note

PR #51 (feat/governance-schema-extensions) touches Entity.yaml (adds AGENT to EntityTypes), taxonomy.yaml (adds governance enums), and schema.yaml (adds governance imports). Our changes are additive to different sections — trivially resolvable after #51 merges.

Downstream consumers

Closes #52

Test plan

  • linkml-lint passes on full schema (no new errors)
  • gen-json-schema generates valid output including Claim and Attestation
  • gen-jsonld-context generates context with new types
  • Existing schemas still validate (no regressions)
  • make in schema/ completes without errors (after feat: Governance schema extensions for agentic framework #51 merges)

🤖 Generated with Claude Code

Introduces the semantic foundation for the KOI claims engine and CLAMS
CosmWasm contract to share a governed vocabulary via regen-data-standards.

New schemas:
- Claim.yaml: verifiable claims with typed impact, temporal bounds,
  entity references, quantity, methodology, and chain bridge fields
- Attestation.yaml: reviewer attestations with verdict, rationale,
  evidence, and on-chain anchoring fields

Extended schemas:
- taxonomy.yaml: ClaimType, VerificationStatus, VerdictType enums
- Entity.yaml: walletAddress attribute, COMMUNITY entity type
- schema.yaml: Claim and Attestation imports

Designed for:
- KOI off-chain claims engine (@context + JSON-LD)
- CLAMS on-chain contract (content hash + data IRI bridge)
- EAS Ethereum attestations (wallet address identity bridge)
- PACTO biocultural claims (BIOCULTURAL claim type, COMMUNITY entity)

Closes regen-network#52

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes the foundational semantic schemas for claims and attestations, crucial for enabling interoperability between off-chain (KOI) and on-chain (CLAMS) claims engines. By defining structured data models for claims and their reviews, it provides a robust framework for tracking regenerative outcomes, facilitating verification pathways, and bridging semantic data to on-chain anchors.

Highlights

  • New Claim Schema: Introduced a comprehensive Claim.yaml schema to define verifiable claims with attributes for typed impact, temporal bounds, entity references (claimant, subject, operator), quantity and unit, methodology, credit class linkage, and on-chain bridging fields (contentHash, dataIri).
  • New Attestation Schema: Added an Attestation.yaml schema for reviewer attestations, including fields for verdict, rationale, evidence URIs, and on-chain anchoring (contentHash, graphIri).
  • Expanded Taxonomy: Extended taxonomy.yaml with three new enums: ClaimType (ECOLOGICAL, SOCIAL, FINANCIAL, GOVERNANCE, BIOCULTURAL), VerificationStatus (SELF_REPORTED to LEDGER_ANCHORED), and VerdictType (PENDING, APPROVED, REJECTED, NEEDS_INFO).
  • Entity Schema Enhancements: Modified Entity.yaml to include a walletAddress attribute for identity bridging and added a COMMUNITY entity type to represent collective entities.
  • Schema Integration: Updated schema.yaml to import the newly defined Claim and Attestation schemas, integrating them into the overall framework.
Changelog
  • schema/src/Attestation.yaml
    • Added the Attestation class definition, including attributes for referencing claims, reviewers, verdicts, rationales, evidence, attestation dates, and on-chain content hashes and graph IRIs.
  • schema/src/Claim.yaml
    • Added the Claim class definition, specifying attributes for claim type, claimant, subject, operator, primary and co-benefits impact, verification status, temporal bounds, quantity and unit, methodologies, credit class, and on-chain content hashes and data IRIs.
  • schema/src/Entity.yaml
    • Added a walletAddress attribute to the Entity class to link semantic identities with on-chain signing capabilities.
    • Introduced the COMMUNITY value to the EntityTypes enum, representing collective entities.
  • schema/src/schema.yaml
    • Imported the new Claim and Attestation schemas into the main schema.yaml file.
  • schema/src/taxonomy.yaml
    • Added the ClaimType enum with categories like ECOLOGICAL, SOCIAL, FINANCIAL, GOVERNANCE, and BIOCULTURAL.
    • Added the VerificationStatus enum to define the lifecycle states of a claim, from self-reported to ledger-anchored.
    • Added the VerdictType enum to specify possible outcomes of an attestation, such as PENDING, APPROVED, REJECTED, or NEEDS_INFO.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces Claim and Attestation LinkML schemas, which is a significant step for interoperability. The schemas are well-structured and documented. I've provided a few suggestions to enhance data integrity and consistency. Specifically, I recommend making temporal bounds (claimStartDate, claimEndDate, attestationDate) required fields, as they are fundamental to claims and attestations. I also suggest a refactoring for quantity and quantityUnit to ensure they are always specified together, and adding explicit slot_uris for consistency. Overall, these are solid additions to the schema.

claimStartDate:
slot_uri: schema:startDate
description: The start date of the period covered by this claim.
range: date

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

A claim should have a defined temporal bound. The PR description highlights 'Temporal bounds as explicit date attributes', underscoring their importance. To ensure all claims specify the period they cover, consider making claimStartDate a required field.

        range: date
        required: true

claimEndDate:
slot_uri: schema:endDate
description: The end date of the period covered by this claim.
range: date

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

A claim should have a defined temporal bound. The PR description highlights 'Temporal bounds as explicit date attributes', underscoring their importance. To ensure all claims specify the period they cover, consider making claimEndDate a required field.

        range: date
        required: true

attestationDate:
slot_uri: rfs:attestationDate
description: Date when the attestation was made.
range: date

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The attestationDate is a crucial piece of information for an attestation, but it's currently optional. To ensure data integrity and completeness, consider making it a required field.

        range: date
        required: true

required: true
inlined: true
hasCoBenefits:
description: Secondary impacts or co-benefits associated with the claim.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with other attributes in this schema that explicitly define a slot_uri, consider adding one here. Based on the attribute name, slot_uri: rfs:hasCoBenefits would be appropriate.

        slot_uri: rfs:hasCoBenefits
        description: Secondary impacts or co-benefits associated with the claim.

Comment on lines +96 to +106
quantity:
slot_uri: rfs:quantity
description: >-
Numeric quantity associated with the claim (e.g., tonnes CO2e,
hectares restored).
range: float
quantityUnit:
slot_uri: qudt:unit
description: >-
Unit of measurement for the quantity (e.g., unit:TON, unit:HA).
range: string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The quantity and quantityUnit attributes are defined separately, which could allow for a quantity to be specified without a quantityUnit, leading to ambiguity. To improve data integrity, consider grouping these into a single structure.

For example, you could define a new Quantity class:

# In a shared file like core.yaml or a new Quantity.yaml
classes:
  Quantity:
    attributes:
      value:
        range: float
        required: true
        description: "The numeric value of the quantity."
      unit:
        range: string
        required: true
        description: "The unit of measurement."
        slot_uri: qudt:unit

And then use it in Claim.yaml by replacing the current quantity and quantityUnit attributes with:

# In Claim.yaml
      quantity:
        range: Quantity
        inlined: true
        description: >-
          Numeric quantity associated with the claim (e.g., tonnes CO2e,
          hectares restored).

Unit of measurement for the quantity (e.g., unit:TON, unit:HA).
range: string
usesMethodology:
description: The methodology used to measure or verify the claimed outcome.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with other attributes in this schema that explicitly define a slot_uri, consider adding one here. Based on the attribute name, slot_uri: rfs:usesMethodology would be appropriate.

        slot_uri: rfs:usesMethodology
        description: The methodology used to measure or verify the claimed outcome.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 59d9e683ee

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +134 to +136
IRI or RID of a previous claim that this claim supersedes,
forming a version chain.
range: uri

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Accept RID identifiers in supersedes

supersedes is described as accepting “IRI or RID”, but the declared range is uri, which excludes non-URI RID formats. In claim versioning flows that store prior claims by RID (instead of full IRIs), this field will fail schema validation despite being documented as valid input, blocking interoperability for update chains. Use a range that can represent both forms (for example string or uriorcurie) or tighten the description to URI-only.

Useful? React with 👍 / 👎.

@DarrenZal
Copy link

Hey Greg — just implemented the two KOI Processor issues that don't depend on this PR:

One alignment point on data_iri: the current derive_ledger_iri() uses file_extension="json" (not .rdf). If the schema here expects .rdf for graph content, we should sync on that before #11.

#11 (schema integration — @context/@type, credit_class_id, claim type validation) is queued for after this PR merges. Ready to go as soon as FWG review is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Claim and Attestation schemas to data standards

2 participants