GithubHelp home page GithubHelp logo

chrome-cgi / schema-org-json-schemas Goto Github PK

View Code? Open in Web Editor NEW

This project forked from charlestati/schema-org-json-schemas

0.0 1.0 0.0 2.26 MB

Generate JSON Schemas from Schema.org classes

License: Apache License 2.0

Shell 1.13% JavaScript 98.87%

schema-org-json-schemas's Introduction

Schema.org to JSON Schema

CircleCI

Generate JSON Schemas from Schema.org classes

You can find the generated schemas in the schemas/ directory.

To match the JSON-LD approach, properties that accept an array also accept a single value.

Example

Schema.org class for a Book

Property Expected Type Description
abridged Boolean Indicates whether the book is an abridged edition.
bookEdition Text The edition of the book.
bookFormat BookFormatType The format of the book.
illustrator Person The illustrator of the book.
isbn Text The ISBN of the book.
numberOfPages Integer The number of pages in the book.

Generated JSON Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "schema:Book",
  "title": "Book",
  "description": "A book.",
  "type": "object",
  "allOf": [
    {
      "description": "The most generic kind of creative work, including books, movies, photographs, software programs, etc.",
      "$ref": "schema:CreativeWork"
    }
  ],
  "properties": {
    "abridged": {
      "description": "Indicates whether the book is an abridged edition.",
      "type": "boolean"
    },
    "bookEdition": {
      "description": "The edition of the book.",
      "type": "string"
    },
    "bookFormat": {
      "description": "The format of the book.",
      "$ref": "schema:BookFormatType"
    },
    "illustrator": {
      "description": "The illustrator of the book.",
      "$ref": "schema:Person"
    },
    "isbn": { "description": "The ISBN of the book.", "type": "string" },
    "numberOfPages": {
      "description": "The number of pages in the book.",
      "type": "integer"
    }
  }
}

To do

Credits

Thanks to geraintluff for the property multiplicity and the hardcoded schemas (licensed under the MIT License).

schema-org-json-schemas's People

Contributors

dependabot[bot] avatar charlestati avatar semantic-release-bot avatar jyasskin avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.