https://github.com/kropp/jsonld-metadata
Java classes and builders for http://schema.org
https://github.com/kropp/jsonld-metadata
Last synced: about 1 year ago
JSON representation
Java classes and builders for http://schema.org
- Host: GitHub
- URL: https://github.com/kropp/jsonld-metadata
- Owner: kropp
- Created: 2015-07-20T16:17:40.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2017-06-14T16:50:44.000Z (almost 9 years ago)
- Last Synced: 2025-05-08T20:57:56.362Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 7.76 MB
- Stars: 7
- Watchers: 4
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: license/LICENSE
Awesome Lists containing this project
README
java-jsonld-mappings
====================
Library provides easy to use Java classes and builders for [schema.org](http://schema.org/) entities.
All classes are auto generated from schema.rdfa
Example usage:
```
import static org.schema.SchemaOrg.*;
final Article article = SchemaOrg.article() // with static import you can skip `SchemaOrg.`, left here for clarity
.name("88th Oscars ceremony will be held on February 28th")
.text("Lorem ipsum")
.author(nGO().name("The Academy of Motion Picture Arts and Sciences").build())
.comment(
// note that you may provide Builder instead of object where it is unambiguous
comment().text("Hooray!").author(person().name("Max Mustermann"))
).build();
```
Than one can serialize it to JSON with __Jackson__ as follows:
```
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
objectMapper.writeValue(System.out, event);
```