Home › Resources & tools › Schemas are everywhere

Schemas are everywhere

Broadly speaking, schemas describe how data is organized in data structures.

Relational schemas

Relational schemas describe how data is organized in relational databases. These schemas are often captured as DDL (data definition language) statements.

Here is an example of a relational schema expressed using DDL commands:

CREATE TABLE books
( book_id INT NOT NULL PRIMARY KEY,
  title VARCHAR(100),
  author VARCHAR(100),
 );

GraphQL schemas

GraphQL schemas describe the shape of the data provided by GraphQL service.

Here is an example of a GraphQL schema:

type Book {
  title: String!
  author: String!
}

JSON schemas

JSON schemas describe the shapes of JSON documents. This then enables the annotation and validation of JSON documents.

Below is an example of a JSON schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/book.schema.json",
  "title": "Book",
  "description": "A book from the product catalog",
  "type": "object",
  "properties": {
    "title": {
      "description": "The title of the book",
      "type": "string"
    },
    "author": {
      "description": "The author of the book",
      "type": "string"
    }
  },
  "required": [
    "title",
    "author"
  ]
}

XML schemas

Similar to JSON schemas, XML schemas describe the shapes of XML documents.

Below is an example of an XML schema:

<?xml version="1.0"?>  
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">  
  
<xs:element name="book">  
  <xs:complexType>  
    <xs:sequence>  
      <xs:element name="title" type="xs:string"/>  
      <xs:element name="author" type="xs:string"/>  
    </xs:sequence>  
  </xs:complexType>  
</xs:element>  
  
</xs:schema>

OpenAPI

OpenAPI documents describe entire APIs and utilise JSON Schema to describe the data structures.

Apache Avro

Below is an example of an Avro schema:

{
   "namespace": "example.avro",
   "type": "record",
   "name": "Book",
   "fields": [
      {"name": "title", "type": "string"},
      {"name": "author", "type": "string"}
   ] 
 }

Protocol buffers

Below is an example of a protocol buffers message:

message Book {
  string title = 1;
  string author = 2;
}

See also

kryp·ton Poster
$14.99

A poster featuring the word "kryp·ton".

языковедение IPA Transcription Poster
$14.99

A poster featuring the phonetic transcription of "языковедение" in the International Phonetic Alphabet (IPA).

кругосветный Morphemic Analysis Poster
$14.99

A poster featuring the morphemic analysis of the Russian word кругосветный.

Vitamin C Molecule Poster, Ball-and-Stick Model, Stylized, English-Labeled
$19.99

A poster featuring the ball-and-stick model (stylized) of the vitamin C molecule.

The list of schema registries

An overview of the technologies used to discover and manage event or message schemas.

One schema, one API: Inside the world of Data Commons

Data Commons brings thousands of public datasets together into one data graph to give data analysts and researchers a jump-start on analysing open data.

Cricket Crossword

A daily crossword puzzle for cricket terms.

Countries of the world in Odia

The list of names of countries and regions in the Odia language.

Working with ChemDraw JS

ChemDraw JS makes it possible to create, view, and edit chemical structures in the browser.

All prices listed are in United States Dollars (USD). Visual representations of products are intended for illustrative purposes. Actual products may exhibit variations in color, texture, or other characteristics inherent to the manufacturing process. The products' design and underlying technology are protected by applicable intellectual property laws. Unauthorized reproduction or distribution is prohibited.