Skip to content

Add verified queries (draft)#81

Draft
rlittle08 wants to merge 1 commit into
open-semantic-interchange:mainfrom
rlittle08:feature/verified_queries
Draft

Add verified queries (draft)#81
rlittle08 wants to merge 1 commit into
open-semantic-interchange:mainfrom
rlittle08:feature/verified_queries

Conversation

@rlittle08
Copy link
Copy Markdown

Extends the spec for new section - verified_queries.

What will this be used for?

  • For humans: documenting approved query patterns within a semantic model
  • For AI: In tools like Cortex Analyst in Snowflake, will be directly used for query generation by AI tools

Why does it warrant inclusion in this spec?

  • For both use cases listed above, example queries are universally helpful
  • Having a namespace defined in the standard supports interoperable use, and allows data vendors to share proper query patterns with multiple downstream applications (AI or otherwise), in one place

@rlittle08 rlittle08 marked this pull request as draft March 6, 2026 20:52
@GabrielBarberini
Copy link
Copy Markdown

+1 from a downstream consumer migrating a proprietary cookbook (~25 named SQL templates). Two gaps:

1. Typed parameters. Without them, verified_queries is fixed SQL, not a reusable template. Suggested:

- name: top_n_by_category
  question: "Top N items for {category}?"
  parameters:
    - name: category
      datatype: string          # leans on https://github.com/open-semantic-interchange/OSI/pull/113
      description: "category code"
      sample_values: ["A", "B", "C"]
    - name: days
      datatype: integer
      default: 30
    - name: n_limit
      datatype: integer
      default: 10
  expression:
    dialects:
      - dialect: ANSI_SQL
        expression: |
          SELECT ... LIMIT {n_limit}

2. Placeholder convention. Pin one ({name} / :name / ${name}) so consumers can substitute deterministically.

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.

2 participants