ApacheAGE

This Release
ApacheAGE 1.4.0
Date
Status
Stable
Other Releases
Abstract
Apache AGE is a PostgreSQL Extension that provides graph database functionality
Description
Apache AGE is a PostgreSQL Extension that provides graph database functionality. AGE is an acronym for A Graph Extension, and is inspired by Bitnine's fork of PostgreSQL 10, AgensGraph, a multi-model database. The project's goal is to create a single storage that can handle relational and graph model data so that users can use standard ANSI SQL along with openCypher, the Graph query language. A graph consists of a set of vertices (also called nodes) and edges, where each individual vertex and edge possesses a map of properties. A vertex is the basic object of a graph, that can exist independently of everything else in the graph. An edge creates a directed connection between two vertices. A graph database is composed of vertices and edges. This type of database is useful when the meaning is in the relationships between the data. Relational databases can easily handle direct relationships, but indirect relationships are more difficult to deal with in relational databases. A graph database stores relationship information as a first-class entity. Apache AGE gives you the best of both worlds, simultaneously.
Released By
ibrar
License
Apache 2.0
Resources
Special Files
Tags

Extensions

ApacheAGE 1.3.0
Apache AGE is a PostgreSQL Extension that provides graph database functionality

Documentation

README
age AGType parser and driver support for Golang
README
nodejs-pg-age
README
ANTLR4 Python3 Agtype parser generation rules for apache-age
bug_report
bug_report
feature_request
feature_request
README
AGE AGType parser and driver support for Java
question
question
CONTRIBUTING
Contributing to Apache AGE
README
AGE AGType parser and driver support for Python
TYPES
Apache AGE - Go driver Type mapping

README



is a leading multi-model graph database

Graph Processing & Analytics for Relational Databases


           


  What is Apache AGE?

Apache AGE is an extension for PostgreSQL that enables users to leverage a graph database on top of the existing relational databases. AGE is an acronym for A Graph Extension and is inspired by Bitnine's AgensGraph, a multi-model database fork of PostgreSQL. The basic principle of the project is to create a single storage that handles both the relational and graph data model so that the users can use the standard ANSI SQL along with openCypher, one of the most popular graph query languages today.

Since AGE is based on the powerful PostgreSQL RDBMS, it is robust and fully featured. AGE is optimized for handling complex connected graph data. It provides plenty of robust database features essential to the database environment, including ACID transactions, multi-version concurrency control (MVCC), stored procedure, triggers, constraints, sophisticated monitoring, and a flexible data model (JSON). Users with a relational database background who require graph data analytics can use this extension with minimal effort because they can use existing data without going through migration.

There is a strong need for cohesive, easy-to-implement multi-model databases. As an extension of PostgreSQL, AGE supports all the functionalities and features of PostgreSQL while also offering a graph model to boot.

  Overview

Apache AGE is :

  • Powerful: adds graph database support to the already popular PostgreSQL database: PostgreSQL is used by organizations including Apple, Spotify, and NASA.
  • Flexible: allows you to perform openCypher queries, which makes complex queries much easier to write. It also enables querying multiple graphs at the same time.
  • Intelligent: allows you to perform graph queries that are the basis for many next-level web services such as fraud detection, master data management, product recommendations, identity and relationship management, experience personalization, knowledge management, and more.

  Features

  • Cypher Query: supports graph query language
  • Hybrid Querying: enables SQL and/or Cypher
  • Querying: enables multiple graphs
  • Hierarchical: graph label organization
  • Property Indexes: on both vertices(nodes) and edges
  • Full PostgreSQL: supports PG features

  Documentation

Refer to our latest Apache AGE documentation to learn about installation, features, built-in functions, and Cypher queries.

  Pre-Installation

Install the following essential libraries according to each OS. Building AGE from the source depends on the following Linux libraries (Ubuntu package names shown below):

  • CentOS bash yum install gcc glibc glib-common readline readline-devel zlib zlib-devel flex bison
  • Fedora bash dnf install gcc glibc bison flex readline readline-devel zlib zlib-devel
  • Ubuntu bash sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison

  Installation

Apache AGE is intended to be simple to install and run. It can be installed with Docker and other traditional ways.

 Install PostgreSQL

You will need to install an AGE compatible version of Postgres, for now AGE supports Postgres 11, 12, 13, 14 & 15. Supporting the latest versions is on AGE roadmap.

 Installation via Package Manager

You can use a package management that your OS provides to download AGE.


```bash sudo apt install postgresql

```

 Installation From Source Code

You can download the Postgres source code and install your own instance of Postgres. You can read instructions on how to install from source code for different versions on the official Postgres Website.

 Install AGE on Linux and MacOS

Clone the github repository or download the download an official release. Run the pg_config utility and check the version of PostgreSQL. Currently, only PostgreSQL versions 11, 12, 13, 14 & 15 are supported. If you have any other version of Postgres, you will need to install PostgreSQL version 11, 12, 13, 14, or 15.

bash pg_config Run the following command in the source code directory of Apache AGE to build and install the extension.

bash make install

If the path to your Postgres installation is not in the PATH variable, add the path in the arguments: bash make PG_CONFIG=/path/to/postgres/bin/pg_config install

 Run using Docker

Get the docker image

```bash docker pull apache/age

```

Create AGE docker container

bash docker run \ --name age \ -p 5455:5432 \ -e POSTGRES_USER=postgresUser \ -e POSTGRES_PASSWORD=postgresPW \ -e POSTGRES_DB=postgresDB \ -d \ apache/age

  Post Installation

For every connection of AGE you start, you will need to load the AGE extension.

bash CREATE EXTENSION age; bash LOAD 'age'; bash SET search_path = ag_catalog, "$user", public;

  Quick Start

To create a graph, use the create_graph function located in the ag_catalog namespace.

bash SELECT create_graph('graph_name');

To create a single vertex, use the CREATE clause.

bash SELECT * FROM cypher('graph_name', $$ CREATE (n) $$) as (v agtype);

To create a single vertex with the label, use the CREATE clause.

bash SELECT * FROM cypher('graph_name', $$ CREATE (:label) $$) as (v agtype);

To create a single vertex with label and properties, use the CREATE clause.

bash SELECT * FROM cypher('graph_name', $$ CREATE (:label {property:value}) $$) as (v agtype);

To query the graph, you can use the MATCH clause.

bash SELECT * FROM cypher('graph_name', $$ MATCH (v) RETURN v $$) as (v agtype);

You can use the following to create an edge, for example, between two nodes.

bash SELECT * FROM cypher('graph_name', $$ MATCH (a:label), (b:label) WHERE a.property = 'Node A' AND b.property = 'Node B' CREATE (a)-[e:RELTYPE]->(b) RETURN e $$) as (e agtype);

To create an edge and set properties.

bash SELECT * FROM cypher('graph_name', $$ MATCH (a:label), (b:label) WHERE a.property = 'Node A' AND b.property = 'Node B' CREATE (a)-[e:RELTYPE {property:a.property + '<->' + b.property}]->(b) RETURN e $$) as (e agtype);

Example

bash SELECT * FROM cypher('graph_name', $$ MATCH (a:Person), (b:Person) WHERE a.name = 'Node A' AND b.name = 'Node B' CREATE (a)-[e:RELTYPE {name:a.name + '<->' + b.name}]->(b) RETURN e $$) as (e agtype);

  Language Specific Drivers

Starting with Apache AGE is very simple. You can easily select your platform and incorporate the relevant SDK into your code.

Built-in

Community-driven Driver

  Community

Join the AGE community for help, questions, discussions, and contributions.

  • Check our website
  • Join the Live Chat on Discord
  • Follow us on Twitter
  • Subscribe to our developer mailing list by sending an email to dev-subscribe@age.apache.org
  • Subscribe to our user mailing list by sending an email to users-subscribe@age.apache.org
  • Subscribe to our committer mailing list (To become a committer) by sending an email to commits-subscribe@age.apache.org

  Graph Visualization Tool for AGE

Apache AGE Viewer is a user interface for Apache AGE that provides visualization and exploration of data. This web visualization tool allows users to enter complex graph queries and explore the results in graph and table forms. Apache AGE Viewer is enhanced to proceed with extensive graph data and discover insights through various graph algorithms. Apache AGE Viewer will become a graph data administration and development platform for Apache AGE to support multiple relational databases: https://github.com/apache/age-viewer.

This is a visualization tool. After installing AGE Extension, you may use this tool to get access to the visualization features.

Viewer gdb, and graph

You can also get help from these videos.

  Contributing

You can improve ongoing efforts or initiate new ones by sending pull requests to this repository. Also, you can learn from the code review process, how to merge pull requests, and from code style compliance to documentation by visiting the Apache AGE official site - Developer Guidelines. Send all your comments and inquiries to the user mailing list, users@age.apache.org.