DEV Community

Nicolas Dos Santos
Nicolas Dos Santos

Posted on

4

schema-org-java: Java library for working with Schema.org data in JSON-LD format

If you've ever worked with structured data, you're probably familiar with Schema.org.

And you must have realized that entities contain a lot of information and that inheritance can be complex.

So it can be tedious to create all the entities needed for your project and then serialize / deserialize the data in JSON-LD format.

schema-org-java is a library to work with Schema.org entities.

The entities can be easily generated with the Maven plugin, and can then be serialized / deserialized (soon) to JSON-LD format with the serializer module.

The library has the following features:

  • Fully supports the vocabulary defined in the http://schema.org namespace.
  • Fully supports type multiple inheritance, multiple values per property in http://schema.org.
  • Every Schema.org type has a corresponding Java interface which provides convenient getter/setter methods for getting/setting the values of the properties of that particular type.
  • Supports the generation of all Schema.org types at once, or specific ones.
  • Fully supports Schema.org documentation of types and properties by adding Javadoc on generated classes and methods.
  • Supports different versions of the Schema.org vocabulary.
  • Supports serializing and deserializing (soon) Schema.org objects to and from JSON-LD formats.

Here is a video illustrating the generation and creation of Schema.org entities:

Several features are not yet developed:

  • Deserialization
  • Adding methods to set the data of the fields in list
  • Added javadoc on setter methods
  • ...

If you are interested, please take a look and give me your feedback :)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (1)

Collapse
 
kobee1203 profile image
Nicolas Dos Santos

I released a new version 0.3.1 with a lot of features:

  • Deserialization
  • Added javadoc on setter methods
  • Use a custom JSON LD file

The full documenation is here: github.com/Kobee1203/schema-org-java

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more