Go to file
Alexios Symeonidis f717c686df Merge pull request 'xml mediator - data models setup' (#48) from 11021-xml-json-redirect-search-api into develop
Reviewed-on: #48
2025-12-03 17:33:15 +01:00
.mvn/wrapper Initial commit: SolrJ client createad; OpenAPI UI init 2024-02-29 17:51:01 +02:00
src Merge pull request 'xml mediator - data models setup' (#48) from 11021-xml-json-redirect-search-api into develop 2025-12-03 17:33:15 +01:00
.gitignore implement checkstyle rules 2025-02-24 22:38:20 +02:00
Dockerfile Update Dockerfile to build jar file 2024-03-14 15:27:53 +02:00
README.md solr9 direct connection or with zkHosts 2025-11-04 14:11:09 +02:00
docker-compose-beta.yml solr9 direct connection or with zkHosts 2025-11-04 14:11:09 +02:00
docker-compose.yml solr9 direct connection or with zkHosts 2025-11-04 14:11:09 +02:00
mvnw Initial commit: SolrJ client createad; OpenAPI UI init 2024-02-29 17:51:01 +02:00
mvnw.cmd Initial commit: SolrJ client createad; OpenAPI UI init 2024-02-29 17:51:01 +02:00
pom.xml xml mediator - init setup 2025-11-25 12:20:44 +02:00

README.md

OpenAIRE Graph API

Welcome to the OpenAIRE Graph API code repository!

This repository houses the latest implementation of our OpenAIRE Graph API, designed to facilitate seamless access to metadata records of research products (i.e., publications, data, software, other research products), and projects within the OpenAIRE Graph.

For more information, please take a look at our documentation page.

Getting Started

Prerequisites

  • Java 21 (tested using OpenJDK 21.0.2)
  • Maven 3.6+
  • Docker (optional, for containerized deployment)

Configuration

The application uses application.properties for configuration. Key properties include:

Solr Configuration

The application supports two connection modes for Solr:

  • solr.direct-connection.enabled - Set to true for direct HTTP connection, false for ZooKeeper connection

Direct Connection Mode (when solr.direct-connection.enabled=true):

  • solr.url - Solr server URL (e.g., http://solr1-v9-coordinator.openaire.eu:8983/solr/public)

ZooKeeper Connection Mode (when solr.direct-connection.enabled=false):

  • solr.zkHosts[0], solr.zkHosts[1], solr.zkHosts[2] - ZooKeeper host addresses
  • solr.collection - Solr collection name (e.g., public)

Running Locally

mvn spring-boot:run

Option 2: Using IntelliJ IDEA

  1. Open the project in IntelliJ
  2. Find src/main/java/eu/openaire/api/OpenaireRestApiApplication.java
  3. Right-click and select "Run 'OpenaireRestApiApplication'"

Option 3: Build and run the JAR

# Build the project
mvn clean package

# Run the JAR
java -jar target/openaire-search-api-v2-*.jar

The application will be accessible at: http://localhost:8080/graph

Swagger UI: http://localhost:8080/graph/swagger-ui/index.html

Docker Support

Build the Docker image

# Build the project and create Docker image
mvn clean package
docker build -t openaire-search-api-v2:latest .

Run with Docker Compose

# Start the container
docker-compose up -d

# Stop the container
docker-compose down

Environment Variables

When running in Docker, you can override configuration using environment variables:

Solr Configuration:

  • SOLR_DIRECT_CONNECTION_ENABLED - Overrides solr.direct-connection.enabled (true/false)
  • SOLR_URL - Overrides solr.url (used in direct connection mode)
  • SOLR_ZKHOSTS_0 - Overrides solr.zkHosts[0] (used in ZooKeeper mode)
  • SOLR_ZKHOSTS_1 - Overrides solr.zkHosts[1] (used in ZooKeeper mode)
  • SOLR_ZKHOSTS_2 - Overrides solr.zkHosts[2] (used in ZooKeeper mode)
  • SOLR_COLLECTION - Overrides solr.collection (used in ZooKeeper mode)

Other Configuration:

  • SCHOLIX_SERVER_BASE_URL - Overrides scholix.server-base-url
  • OPENAPI_SERVER_BASE_URL - Overrides openapi.server-base-url
  • SERVER_SERVLET_CONTEXT_PATH - Overrides server.servlet.context-path

These are configured in docker-compose.yml (local) and docker-compose-beta.yml (beta environment).

Deployment

Building and Pushing Docker Images to OpenAIRE Registry

Login to the OpenAIRE Docker registry:

docker login https://docker-registry.openaire.eu

For beta environment:

docker build --platform linux/amd64 -t graph-api-v2:beta .
docker tag graph-api-v2:beta docker-registry.openaire.eu/graph-api/graph-api-v2:beta
docker push docker-registry.openaire.eu/graph-api/graph-api-v2:beta

For production environment:

docker build --platform linux/amd64 -t graph-api-v2:prod .
docker tag graph-api-v2:prod docker-registry.openaire.eu/graph-api/graph-api-v2:prod
docker push docker-registry.openaire.eu/graph-api/graph-api-v2:prod