Giter Site home page Giter Site logo

soyuka / schema-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from api-platform/schema-generator

2.0 3.0 0.0 1.19 MB

PHP Model Scaffolding from Schema.org vocabulary

Home Page: https://api-platform.com/docs/schema-generator/

License: MIT License

PHP 96.97% Shell 0.20% HTML 2.83%

schema-generator's Introduction

API Platform Model Generator

This Schema.org based model generator is part of the API Platform framework that instantly generates a PHP data model from the Schema.org vocabulary. Browse Schema.org, choose the types and properties you need, run our code generator and you're done! You get a fully featured PHP data model including:

  • A set of PHP entities with properties, constants (enum values), getters, setters, adders and removers. The class hierarchy provided by Schema.org will be translated to a PHP class hierarchy with parents as abstract classes. The generated code complies with PSR coding standards.
  • Full, high-quality PHPDoc for classes, properties, constants and methods extracted from Schema.org.
  • Doctrine ORM annotation mapping including database columns with type guessing, relations with cardinality guessing, class inheritance (through the @AbstractSuperclass annotation).
  • Data validation through Symfony Validator annotations including data type validation, enum support (choices) and check for required properties.
  • Interfaces and Doctrine ResolveTargetEntityListener support.
  • Custom PHP namespace support.
  • List of values provided by Schema.org with PHP Enum classes.

Bonus:

  • The code generator is fully configurable and extensible. All features can be deactivated (e.g., the Doctrine mapping generator) and a custom generator can be added (e.g., a Doctrine ODM mapping generator).
  • The generated code can be used as is in a Symfony app (but it will work too in a raw PHP project or any other framework including Laravel and Zend Framework).

Build Status Coverage Status SensioLabsInsight

What is Schema.org?

Schema.org is a vocabulary representing common data structures and their relations. Schema.org can be exposed as JSON-LD, microdata and RDFa. Extracting semantic data exposed in the Schema.org vocabulary is supported by a growing number of companies including Google (Search, Gmail), Yahoo!, Bing and Yandex.

Why use Schema.org data to generate a PHP model?

Don't Reinvent The Wheel

Data models provided by Schema.org are popular and have proved efficient. They cover a broad spectrum of topics including creative work, e-commerce, event, medicine, social networking, people, postal address, organization, place or review. Schema.org has its roots in a ton of preexisting well designed vocabularies and is successfully used by more and more websites and applications.

Pick up schemas applicable to your application, generate your PHP model, then customize and specialize it to fit your needs.

Improve SEO and user experience

Adding Schema.org markup to websites and apps may increase their ranking in search engine results and enable awesome features such as Google Rich Snippets and Gmail markup.

Mapping your app data model to Schema.org structures can be a tedious task. Using the generator, your data model will be derived from Schema.org. Adding microdata markup to your templates or serializing your data as JSON-LD will not require specific mapping nor adaptation. It's a matter of minutes.

Be ready for the future

Schema.org improves the interoperability of your applications. Used with hypermedia technologies such as Hydra it's a big step towards the semantic and machine readable web. It opens the way to generic web API clients able to extract and process data from any website or app using such technologies.

Documentation

Credits

This project was created by Kévin Dunglas and is sponsored by Les-Tilleuls.coop.

schema-generator's People

Contributors

dunglas avatar theofidry avatar keyermann avatar jlagneau avatar baspeeters avatar restotelry avatar soyuka avatar scurron avatar meyerbaptiste avatar aureluster avatar queercodinggirl avatar yohang avatar toby-griffiths avatar teohhanhui avatar kix avatar sroze avatar pfrenssen avatar pierredup avatar patrick-yi-82 avatar pborreli avatar lubomir-haralampiev avatar mlkiiwy avatar johnnypeck avatar saphyel avatar antograssiot avatar

Stargazers

 avatar Michael Antoine avatar

Watchers

James Cloos avatar  avatar  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.