Maven Central

Metreeca/Java

Metreeca/Java is a model‑driven Java framework for rapid REST/JSON‑LD development.

Its engines automatically convert high-level declarative JSON-LD models into extended REST APIs supporting CRUD operations, faceted search, data validation and fine‑grained role‑based access control, relieving backend developers from low-level chores and completely shielding frontend developers from linked data technicalities.

While collectively providing a floor-to-ceiling development solution, Metreeca/Java modules are loosely coupled and may be easily plugged as a specialized component into your framework of choice.

Documentation

Modules

area javadocs description
core metreeca‑json shape-based JSON modelling framework
metreeca‑rest model-driven REST publishing framework
data metreeca‑xml XML/HTML codecs and utilities
metreeca‑rdf RDF codecs and utilities
server metreeca‑jse Java SE HTTP server connector
metreeca‑jee Servlet 3.1 containers connector
storage metreeca‑rdf4j RDF4J-based SPARQL repository connector

Getting Started

  1. Add the framework to your Maven configuration
<project>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId></groupId>
                <artifactId>metreeca-java</artifactId>
                <version>1.0.3</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <dependencies>

        <dependency> <!-- server connector -->
            <groupId>com.metreeca</groupId>
            <artifactId>metreeca-jse</artifactId>
        </dependency>

        <dependency> <!-- storage connector -->
            <groupId>com.metreeca</groupId>
            <artifactId>metreeca-rdf4j</artifactId>
        </dependency>

    </dependencies>

</project>
  1. Write your first server and launch it
import com.metreeca.jse.JSEServer;

import static com.metreeca.rest.Response.OK;
import static com.metreeca.rest.formats.TextFormat.text;

public final class Hello {

   public static void main(final String... args) {
      new JSEServer()

          .delegate(context -> request ->
              request.reply(response -> response
                  .status(OK)
                  .body(text(), "Hello world!")
              )
          )

          .start();
   }

}
  1. Access you API
% curl -i http://localhost:8080/

HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 12

Hello world!
  1. Delve into the the docs to learn how to publish and consume your data as model-driven REST/JSON‑LD APIs…

Support

License

This project is licensed under the Apache 2.0 License – see LICENSE file for details.