Giter Site home page Giter Site logo

opendatahacklab / jb4jsonld-jackson Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kbss-cvut/jb4jsonld-jackson

0.0 1.0 0.0 77 KB

JSON-LD serialization and deserialization for Java REST services. Jackson integration.

License: GNU Lesser General Public License v3.0

Java 100.00%

jb4jsonld-jackson's Introduction

Java Binding for JSON-LD - Jackson

Build Status

Java Binding for JSON-LD - Jackson (JB4JSON-LD-Jackson) is a binding of JB4JSON-LD for Jackson.

The core implementation of JB4JSON-LD with a mapping example can be found at https://github.com/kbss-cvut/jb4jsonld.

More info can be found at https://kbss.felk.cvut.cz/web/kbss/jb4json-ld.

Usage

JB4JSON-LD is based on annotations from JOPA, which enable POJO attributes to be mapped to ontological constructs (i.e. to object, data or annotation properties) and Java classes to ontological classes.

Use @OWLDataProperty to annotate data fields and @OWLObjectProperty to annotate fields referencing other mapped entities.

To integrate the library with Jackson, register a cz.cvut.kbss.jsonld.jackson.JsonLdModule in Jackson's ObjectMapper like this:

objectMapper.registerModule(new JsonLdModule())

and you should be good to go. See the JsonLdSerializionTest for examples.

See https://github.com/kbss-cvut/jopa-examples/tree/master/jsonld for an executable example of JB4JSON-LD-Jackson in action.

Serialization

The serializer's output has been verified to be a valid JSON-LD and is parseable by Java's JSON-LD reference implementation jsonld-java.

The output is basically a context-less compacted JSON-LD, which uses full IRIs for attribute names.

Deserialization

Since we are using jsonld-java to first process the incoming JSON-LD, it does not matter in which form (expanded, framed, flattened) the input is.

Getting JB4JSON-LD-Jackson

There are two ways to get JB4JSON-LD-Jackson:

  • Clone repository/download zip and build it with Maven,
  • Use a Maven dependency:
<dependency>
    <groupId>cz.cvut.kbss.jsonld</groupId>
    <artifactId>jb4jsonld-jackson</artifactId>
</dependency>

jb4jsonld-jackson's People

Contributors

ledsoft 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.