Datasets:

Modalities:
Text
Formats:
parquet
ArXiv:
Libraries:
Datasets
pandas
License:
Dataset Viewer
Auto-converted to Parquet
json_schema
stringlengths
43
1.28M
unique_id
stringlengths
2
41
{ "title": "JSON Patch", "description": "A JSON Schema describing a JSON Patch", "$schema": "http://json-schema.org/draft-04/schema#", "notes": [ "Only required members are accounted for, other members are ignored" ], "type": "array", "items": { "description": "one JSON Patch operation", "allOf": [ { "description": "Members common to all operations", "type": "object", "required": [ "op", "path" ], "properties": { "path": { "$ref": "#/definitions/jsonPointer" } } }, { "$ref": "#/definitions/oneOperation" } ] }, "definitions": { "jsonPointer": { "type": "string", "pattern": "^(/[^/~]*(~[01][^/~]*)*)*$" }, "add": { "description": "add operation. Value can be any JSON value.", "properties": { "op": { "enum": [ "add" ] } }, "required": [ "value" ] }, "remove": { "description": "remove operation. Only a path is specified.", "properties": { "op": { "enum": [ "remove" ] } } }, "replace": { "description": "replace operation. Value can be any JSON value.", "properties": { "op": { "enum": [ "replace" ] } }, "required": [ "value" ] }, "move": { "description": "move operation. \"from\" is a JSON Pointer.", "properties": { "op": { "enum": [ "move" ] }, "from": { "$ref": "#/definitions/jsonPointer" } }, "required": [ "from" ] }, "copy": { "description": "copy operation. \"from\" is a JSON Pointer.", "properties": { "op": { "enum": [ "copy" ] }, "from": { "$ref": "#/definitions/jsonPointer" } }, "required": [ "from" ] }, "test": { "description": "test operation. Value can be any JSON value.", "properties": { "op": { "enum": [ "test" ] } }, "required": [ "value" ] }, "oneOperation": { "oneOf": [ { "$ref": "#/definitions/add" }, { "$ref": "#/definitions/remove" }, { "$ref": "#/definitions/replace" }, { "$ref": "#/definitions/move" }, { "$ref": "#/definitions/copy" }, { "$ref": "#/definitions/test" } ] } } }
o89003
{ "properties": { "customer_name": { "description": "The name of the customer", "type": "string" }, "items": { "description": "The list of items purchased by the customer", "items": { "properties": { "price": { "description": "The price of the product", "type": "number" }, "product_name": { "description": "The name of the product", "type": "string" }, "quantity": { "description": "The quantity of the product", "type": "integer" } }, "required": [ "product_name", "quantity", "price" ], "type": "object" }, "type": "array" } }, "required": [ "customer_name", "items" ], "type": "object" }
generate_invoice_9f46fdc0
{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Scenario Reasoner output for evaluate method", "type": "object", "properties": { "result": { "type": "object", "title": "Result of the method evaluate", "description": "This sub-schema describes the result of the method evaluate", "name": "result", "additionalProperties": { "type": "object", "properties": { "value": {} }, "required": [ "value" ] } }, "id": { "description": "A value identifying this response, equal to the id of the request or null" }, "error": { "type": "null" }, "version": { "type": "string" } }, "required": [ "result", "error", "id", "version" ], "additionalProperties": false }
o16041
{ "$schema": "http://json-schema.org/draft-06/schema#", "title": "Unit Settings", "description": "Settings that describe the behaviour and formatting of rewards corresponding to the configured unit or unit pattern", "type": "object", "properties": { "id": { "type": "string", "title": "Reward Unit Settings Id", "description": "A unique identifier generated by combining reward type and unit or unit pattern (e.g. CREDIT/USD)" }, "config": { "type": "object", "title": "Unit Settings Configuration", "description": "Behaviour and formatting supported by this unit setting", "properties": { "rewardModifications": { "type": "object", "title": "Reward Modifications", "description": "The modifications supported by rewards applicable for this unit setting", "properties": { "isCancellable": { "type": "boolean", "title": "Is Cancellable", "description": "Indicates whether rewards of this unit can be cancelled via SaaSquatch API/Portal" }, "isRedeemable": { "type": "boolean", "title": "Is Redeemable", "description": "Indicates whether rewards of this unit can be redeemed via SaaSquatch API/Portal" }, "isExpirable": { "type": "boolean", "title": "Is Expirable", "description": "Indicates whether expiration is applicable to this reward of this unit" } }, "additionalProperties": false, "required": [ "isCancellable", "isRedeemable", "isExpirable" ] }, "supportsCurrencies": { "type": "boolean", "title": "Supports Currencies", "description": "Whether this unit supports multi-currencies. false by default." }, "translatableConfig": { "type": "object", "title": "Translatable Configuration", "description": "Locale-specific configuration for rewards of this unit", "properties": { "name": { "type": "string", "title": "Name", "description": "The name of this reward unit" }, "prettyValueFormat": { "type": "object", "title": "Pretty Value Format", "description": "Format for prettyValue for rewards of this unit", "properties": { "templateType": { "type": "string", "title": "Template Type", "description": "The type of this template, \"ICU\" by default.", "enum": [ "ICU" ] }, "template": { "type": "string", "title": "Template", "description": "The template string for reward prettyValue" } }, "additionalProperties": false, "required": [ "template" ] } }, "additionalProperties": false } }, "additionalProperties": false, "required": [ "rewardModifications", "supportsCurrencies" ] } }, "additionalProperties": false, "required": [ "id", "config" ] }
o72199
{ "description": "A **custom field answer** stores arbitrary data about an applicant, answering the question posed by a **custom field**.", "links": [ { "description": "Display an existing custom field answer.", "href": "/api/v1/user_identities/:user_identity_id/programs/:program_id/applicants_by_cas_id/:applicant_cas_id/custom_field_answers/:custom_field_id", "http_header": { "x-api-key": "0123456789abcdef0123456789abcdef" }, "method": "GET", "rel": "self", "title": "Show" }, { "description": "Store a **custom field** value. If a value has not previously been stored, this *creates* an answer. Otherwise, this *updates* an existing answer.", "href": "/api/v1/user_identities/:user_identity_id/programs/:program_id/applicants_by_cas_id/:applicant_cas_id/custom_field_answers/:custom_field_id", "http_header": { "x-api-key": "0123456789abcdef0123456789abcdef" }, "method": "PUT", "rel": "update", "schema": { "properties": { "custom_field_answer": { "properties": { "field_type": { "description": "Type of data that the **custom field** stores.", "enum": [ "select" ], "example": "select", "type": "string" }, "value": { "description": "The select value to be stored as an answer to the **custom field**. The value must be one of the valid values configured on the custom field.", "example": "Gryffindor", "type": [ "string", "null" ] } }, "required": [ "field_type", "value" ], "type": "object" } }, "type": "object" }, "title": "Store" }, { "description": "Clear an existing custom field answer. (Same semantics as `PUT` with `\"value\": null`.) This is a \"soft delete\" that tracks who made the change.", "href": "/api/v1/user_identities/:user_identity_id/programs/:program_id/applicants_by_cas_id/:applicant_cas_id/custom_field_answers/:custom_field_id", "http_header": { "x-api-key": "0123456789abcdef0123456789abcdef" }, "method": "DELETE", "rel": "destroy", "targetSchema": { "properties": { "custom_field_answer": { "properties": { "custom_field_id": { "example": 4, "type": "integer" }, "field_type": { "enum": [ "select" ], "example": "select", "type": "string" }, "href": { "example": "/api/v1/user_identities/1/programs/42023191739237/applicants_by_cas_id/3/custom_field_answers/4", "pattern": "/api/v1/user_identities/\\d+/programs/\\d+/applicants_by_cas_id/\\d+/custom_field_answers/\\d+", "type": "string" }, "label": { "example": "Preferred house", "type": "string" }, "value": { "example": null, "type": "null" } }, "type": "object" } }, "type": "object" }, "title": "Destroy" } ], "properties": { "custom_field_answer": { "properties": { "custom_field_id": { "description": "Unique identifier of the **custom field** that this answers.", "example": 4, "type": "integer" }, "field_type": { "description": "Type of data that the **custom field** stores.", "enum": [ "select" ], "example": "select", "type": "string" }, "href": { "description": "Hypertext reference to this resource.", "example": "/api/v1/user_identities/1/programs/42023191739237/applicants_by_cas_id/3/custom_field_answers/4", "pattern": "/api/v1/user_identities/\\d+/programs/\\d+/applicants_by_cas_id/\\d+/custom_field_answers/\\d+", "type": "string" }, "label": { "description": "Human-readable label of the **custom field** that this answers.", "example": "Preferred house", "type": "string" }, "value": { "description": "The select value stored as an answer to the **custom field**. The value must be one of the valid values configured on the custom field.", "example": "Gryffindor", "type": [ "string", "null" ] } }, "type": "object" } }, "title": "Custom Field Answer (Select)", "type": "object" }
o9507
{ "description": "ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).", "properties": { "audience": { "description": "Audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.", "type": [ "string", "null" ] }, "expirationSeconds": { "description": "ExpirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.", "format": "int64", "type": [ "integer", "null" ] }, "path": { "description": "Path is the path relative to the mount point of the file to project the token into.", "type": [ "string", "null" ] } }, "required": [ "path" ], "type": "object" }
kb_976_Normalized
"{\n \"definitions\": {\n \"https:__kubernetesjsonschema_dev_master__defs_json_defs_io_k8s(...TRUNCATED)
kb_741_Normalized
"{\n \"title\": \"TextFixed\",\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n (...TRUNCATED)
o91001
"{\n \"type\": \"object\",\n \"description\": \"DForms Form Schema\",\n \"required\": [\n \"se(...TRUNCATED)
o36016
"{\n \"properties\": {\n \"measurements\": {\n \"description\": \"The measurements required(...TRUNCATED)
calculate_volume_56fe1b99
End of preview. Expand in Data Studio

JSONSchemaBench

Paper GitHub

JSONSchemaBench is a benchmark of real-world JSON schemas designed to evaluate structured output generation for Large Language Models (LLMs). It contains approximately 10,000 JSON schemas, capturing diverse constraints and complexities.

import datasets
from datasets import load_dataset

def main():
    # Inspect the available subsets of the dataset
    all_subsets = datasets.get_dataset_config_names("epfl-dlab/JSONSchemaBench")
    print("Available subsets:", all_subsets)
    # Example output: ['Github_easy', 'Github_hard', 'Github_medium', 'Github_trivial', 'Github_ultra', 'Glaiveai2K', 'JsonSchemaStore', 'Kubernetes', 'Snowplow', 'WashingtonPost', 'default']

    # Access a specific subset of the dataset
    subset_name = "Github_easy"
    github_easy = load_dataset("epfl-dlab/JSONSchemaBench", subset_name)
    print(f"Loaded subset '{subset_name}':", github_easy)

    # Load the entire dataset as a whole
    entire_dataset = load_dataset("epfl-dlab/JSONSchemaBench", "default")
    print("Loaded entire dataset:", entire_dataset)

if __name__ == "__main__":
    main()

⚠️ Important Update (March 10th, 2025)

We have restructured the dataset to include train/val/test splits. If you downloaded the dataset before this date, you might encounter errors like KeyError: 'Github_easy'.

To fix this issue, please follow one of the options below:

  1. Update How Subsets Are Accessed: If you previously used:
from datasets import load_dataset, concatenate_datasets, DatasetDict, Dataset

subset: DatasetDict = load_dataset("epfl-dlab/JSONSchemaBench")
subset["Github_easy"]

You can update it to:

from datasets import load_dataset, concatenate_datasets, DatasetDict, Dataset

subset: DatasetDict = load_dataset("epfl-dlab/JSONSchemaBench", name="Github_easy")
subset: Dataset = concatenate_datasets([subset["train"], subset["val"], subset["test"]])
  1. Load the Dataset in the Old Structure: If you need the previous structure, you can use a specific revision:
dataset = load_dataset("epfl-dlab/JSONSchemaBench", revision="e2ee5fdba65657c60d3a24b321172eb7141f8d73")

We apologize for the inconvenience and appreciate your understanding! 😊

πŸ“Œ Dataset Overview

  • Purpose: Evaluate the efficiency and coverage of structured output generation.
  • Sources: GitHub, Kubernetes, API specifications, curated collections.
  • Schemas: Categorized based on complexity and domain.

πŸ“Š Dataset Breakdown

Dataset Category Count
GlaiveAI-2K Function Call 1707
Github-Trivial Misc 444
Github-Easy Misc 1943
Snowplow Operational API 403
Github-Medium Misc 1976
Kubernetes Kubernetes API 1064
Washington Post Resource Access API 125
Github-Hard Misc 1240
JSONSchemaStore Misc 492
Github-Ultra Misc 164
Total 9558

πŸ“₯ Loading the Dataset

from datasets import load_dataset

dataset = load_dataset("epfl-dlab/JSONSchemaBench")
print(dataset)

πŸ” Data Structure

Each dataset split contains:

  • "json_schema": The schema definition.
  • "unique_id": A unique identifier for the schema.

πŸš€ For more details, check out the paper.

πŸ“š Citation

@misc{geng2025jsonschemabench,
      title={Generating Structured Outputs from Language Models: Benchmark and Studies},
      author={Saibo Geng et al.},
      year={2025},
      eprint={2501.10868},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2501.10868}
}

License

This dataset is provided under the MIT License. Please ensure that you comply with the license terms when using or distributing this dataset.

Acknowledgements

We would like to thank the contributors and maintainers of the JSON schema projects and the open-source community for their invaluable work and support.

Downloads last month
1,054