Microservice query language

Overview

Build Status

restQL-core-java

restQL-core allows you to run restQL queries directly from JVM applications, making easy to fetch information from multiple services in the most efficient manner. e.g.:

from search
    with
        role = "hero"

from hero as heroList
    with
        name = search.results.name

You can learn more about restQL query language here and here

restQL-core is built upon the battle proven HttpKit and Clojure core.async to maximize performance and throughtput.

If you're using Clojure you may want to check restQL-core or restQL-Server if you're using another languagem or working in a client application.

Getting Started

Installation

Add Clojars repository and restQL dependency to your project

Maven

<repositories>
    <repository>
        <id>clojars.org</id>
        <url>http://clojars.org/repo</url>
    </repository>
</repositories>
...
<dependency>
	<groupId>com.b2wdigital</groupId>
        <artifactId>restql-core-java</artifactId>
       	<version>3.5.5</version>
</dependency>

Gradle

repositories {
    maven { 
        url "http://clojars.org/repo"
  }
}
...
compile 'com.b2wdigital:restql-core-java:3.5.5'

First query

ClassConfigRepository config = new ClassConfigRepository();
config.put("planets", "https://swapi.co/api/planets/:id");

RestQL restQL = new RestQL(config);
QueryResponse response = restQL.executeQuery("from planets with id = ?", 1);

System.out.println("The response JSON is: " + response.toString());

In the example above restQL will call StarWars planet API passing "1" as param.

Configuration

restQL receives a configuration class with the API mappings. You can use the available configuration repositories -- SystemPropertiesConfigRepository, PropertiesFileConfigRepository or ClassConfigRepository -- or implement your own, using the ConfigRepository interface.

You can check more about endpoints configuration here

Examples

Simple Query

Retrieving all magic cards

ClassConfigRepository config = new ClassConfigRepository();
config.put("cards", "http://api.magicthegathering.io/v1/cards");

RestQL restQL = new RestQL(config);

String query = "from cards as cardslist params type = ?";

QueryResponse response = restQL.executeQuery(query, "Artifact");

// The JSON String
String jsonString = response.toString();

// The mapped object
List<MTGCard> cards = result.getList("cardslist", MTGCard.class);

Chained Query

Listing all cards and then fetching its details.

ClassConfigRepository config = new ClassConfigRepository();
config.put("cards", "http://api.magicthegathering.io/v1/cards");
config.put("card", "http://api.magicthegathering.io/v1/cards/:id");

RestQL restQL = new RestQL(config);

String queryCardsAndDetails = "from cards as cardsList params type = ? \n"
                            + "from card as cardWithDetails params id = cardsList.id";

QueryResponse response = restQL.executeQuery(queryCardsAndDetails, "Artifact");

// The JSON String
String jsonString = response.toString();

// The mapped object
List<MTGCard> cards = result.getList("cardWithDetails", MTGCard.class);

Building From Source Code

As prerequisites to build restQL from source we have:

  • Java 11
  • Maven 3

Just clone this repo and run "mvn compile".

License

Copyright © 2016 B2W Digital

Distributed under the MIT License.

You might also like...

A Java library to query pictures with SQL-like language

A Java library to query pictures with SQL-like language

PicSQL A Java library to query pictures with SQL-like language. Features : Select and manipulate pixels of pictures in your disk with SQL-like dialect

Dec 25, 2022

A Java library to query pictures with SQL-like language.

A Java library to query pictures with SQL-like language.

PicSQL A Java library to query pictures with SQL-like language. Features : Select and manipulate pixels of pictures in your disk with SQL-like dialect

Dec 25, 2022

This application can recognize the sign language alphabets and help people who do not understand sign language to communicate with the speech and hearing impaired.

This application can recognize the sign language alphabets and help people who do not understand sign language to communicate with the speech and hearing impaired.

Sign Language Recognition App This application can recognize the sign language alphabets and help people who do not understand sign language to commun

Oct 7, 2021

Kotlin-decompiled - (Almost) every single language construct of the Kotlin programming language compiled to JVM bytecode and then decompiled to Java again for better readability

Kotlin: Decompiled (Almost) every single language construct of the Kotlin programming language compiled to JVM bytecode and then decompiled to Java ag

Dec 14, 2022

Jamal is a macro language (JAmal MAcro Language)

Jamal is a macro language (JAmal MAcro Language)

Jamal Macro Language Jamal is a complex text processor with a wide variety of possible use. The first version of Jamal was developed 20 years ago in P

Dec 20, 2022

For Jack language. Most of codes were commented with their usage, which can be useful for beginner to realize the running principle of a compiler for object-oriented programming language.

Instructions: Download the Java source codes Store these codes into a local folder and open this folder Click the right key of mouse and click ‘Open i

Jan 5, 2023

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)

Trino is a fast distributed SQL query engine for big data analytics. See the User Manual for deployment instructions and end user documentation. Devel

Dec 31, 2022

requery - modern SQL based query & persistence for Java / Kotlin / Android

requery - modern SQL based query & persistence for Java / Kotlin / Android

A light but powerful object mapping and SQL generator for Java/Kotlin/Android with RxJava and Java 8 support. Easily map to or create databases, perfo

Jan 5, 2023

The official home of the Presto distributed SQL query engine for big data

Presto Presto is a distributed SQL query engine for big data. See the User Manual for deployment instructions and end user documentation. Requirements

Dec 30, 2022

The official home of the Presto distributed SQL query engine for big data

Presto Presto is a distributed SQL query engine for big data. See the User Manual for deployment instructions and end user documentation. Requirements

Jan 5, 2023

Real-time Query for Hadoop; mirror of Apache Impala

Welcome to Impala Lightning-fast, distributed SQL queries for petabytes of data stored in Apache Hadoop clusters. Impala is a modern, massively-distri

Dec 28, 2022

Dynamically filters JPA entities with a simple query syntax. Provides JPA/Hibernate predicates and Spring Data specifications.

Spring Filter You need a way to dynamically filter entities without any effort? Just add me to your pom.xml. Your API will gain a full featured search

Dec 13, 2022

blockchain database, cata metadata query

Drill Storage Plugin for IPFS 中文 Contents Introduction Compile Install Configuration Run Introduction Minerva is a storage plugin of Drill that connec

Dec 7, 2022

Apache Drill is a distributed MPP query layer for self describing data

Apache Drill Apache Drill is a distributed MPP query layer that supports SQL and alternative query languages against NoSQL and Hadoop data storage sys

Jan 7, 2023

A simple utility that allows you to query which items can be placed in a specific slot by holding down Left-Alt

A simple utility that allows you to query which items can be placed in a specific slot by holding down Left-Alt

What's That Slot This mod is a simple utility that allows you to query which items can be placed in a specific slot by holding down Left-Alt. You can

Dec 25, 2022

Koios Java Client Library is based on Koios Elastic Query Layer for Cardano Node by Cardano Community Guild Operators

Koios Java Client What is Koios? Koios Java Client Library is based on Koios Elastic Query Layer for Cardano Node by Cardano Community Guild Operators

Dec 4, 2022

Spring JPA Native Query example in Spring Boot

Spring JPA Native Query example in Spring Boot

Nov 30, 2022

Aggregation query proxy is a scalable sidecar application that sits between a customer application and Amazon Keyspaces/DynamoDB

Aggregation query proxy is a scalable sidecar application that sits between a customer application and Amazon Keyspaces/DynamoDB

Aggregation query proxy is a scalable sidecar application that sits between a customer application and Amazon Keyspaces/DynamoDB. It allows you to run bounded aggregation queries against Amazon Keyspaces and DynamoDB services.

Jul 18, 2022

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.

Greetings, Java Hipster! Full documentation and information is available on our website at https://www.jhipster.tech/ Please read our guidelines befor

Jan 5, 2023
Owner
B2W Digital
B2W Inovação e Tecnologia
B2W Digital
Microservice query language

restQL-core-java restQL-core allows you to run restQL queries directly from JVM applications, making easy to fetch information from multiple services

B2W Digital 43 Jan 26, 2022
Microservice query language

restQL-clojure allows to run restQL queries, making easy to fetch information from multiple services in the most efficient manner Getting Started Inst

B2W Digital 131 Oct 16, 2021
Allows you to use the MongoDB query syntax to query your relational database.

Spring Data JPA MongoDB Expressions How it works: Customize JPA Repository base class: @SpringBootApplication @EnableJpaRepositories(repositoryBaseCla

Muhammad Hewedy 86 Dec 27, 2022
Spring JPA @Query for custom query in Spring Boot example

Spring JPA @Query example (Custom query) in Spring Boot Use Spring JPA @Query for custom query in Spring Boot example: Way to use JPQL (Java Persisten

null 17 Dec 3, 2022
lazy-language-loader improves loading times when changing your language by only reloading the language instead of all the game resources!

lazy-language-loader lazy-language-loader improves loading times when changing your language by only reloading the language instead of all the game re

Shalom Ademuwagun 7 Sep 7, 2022
LINE 4.1k Jan 2, 2023
LINE 4.1k Dec 31, 2022
JSON query and transformation language

JSLT JSLT is a complete query and transformation language for JSON. The language design is inspired by jq, XPath, and XQuery. JSLT can be used as: a q

Schibsted Media Group 510 Dec 30, 2022
Representational State Transfer + Structured Query Language(RSQL): Demo application using RSQL parser to filter records based on provided condition(s)

Representational State Transfer + Structured Query Language: RSQL Demo application using RSQL parser to filter records based on provided condition(s)

Hardik Singh Behl 9 Nov 23, 2022
A query language for JSON and a template engine to generate text output.

Josson & Jossons Josson is a query language for JSON. Jossons is a template engine to generate text output. Features and Capabilities of Josson Query

Octomix Software 16 Dec 14, 2022