Skip to content

Commit dd110e9

Browse files
jrgemignaniSamuel Chan
authored andcommitted
Advance to Apache AGE version 1.5.0 (apache#1482) (apache#1493)
Updated the following files to advance the Apache AGE version to 1.5.0 modified: Makefile modified: README.md modified: RELEASE modified: age.control Corrected whitespace issues in - modified: sql/age_agtype.sql modified: sql/agtype_coercions.sql modified: sql/agtype_comparison.sql modified: sql/agtype_gin.sql modified: sql/agtype_operators.sql modified: sql/agtype_string.sql Corrected the file cleanup in Makefile.
1 parent e2a3f8d commit dd110e9

20 files changed

+135
-381
lines changed

Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
MODULE_big = age
1919

20-
age_sql = age--1.4.0.sql
20+
age_sql = age--1.5.0.sql
2121

2222
OBJS = src/backend/age.o \
2323
src/backend/catalog/ag_catalog.o \
@@ -75,10 +75,12 @@ OBJS = src/backend/age.o \
7575

7676
EXTENSION = age
7777

78-
#SQLS = $(sort ($(wildcard sql/*.sql)))
78+
# to allow cleaning of previous (old) age--.sql files
79+
all_age_sql = $(shell find . -maxdepth 1 -type f -regex './age--[0-9]+\.[0-9]+\.[0-9]+\.sql')
80+
7981
SQLS := $(shell cat sql/sql_files)
80-
SQLS := $(addprefix sql/,$(SQLS))
81-
SQLS := $(addsuffix .sql,$(SQLS))
82+
SQLS := $(addprefix sql/,$(SQLS))
83+
SQLS := $(addsuffix .sql,$(SQLS))
8284

8385
DATA_built = $(age_sql)
8486

@@ -115,7 +117,7 @@ ag_regress_dir = $(srcdir)/regress
115117
REGRESS_OPTS = --load-extension=age --inputdir=$(ag_regress_dir) --outputdir=$(ag_regress_dir) --temp-instance=$(ag_regress_dir)/instance --port=61958 --encoding=UTF-8 --temp-config $(ag_regress_dir)/age_regression.conf
116118

117119
ag_regress_out = instance/ log/ results/ regression.*
118-
EXTRA_CLEAN = $(addprefix $(ag_regress_dir)/, $(ag_regress_out)) src/backend/parser/cypher_gram.c src/include/parser/cypher_gram_def.h src/include/parser/cypher_kwlist_d.h $(age_sql)
120+
EXTRA_CLEAN = $(addprefix $(ag_regress_dir)/, $(ag_regress_out)) src/backend/parser/cypher_gram.c src/include/parser/cypher_gram_def.h src/include/parser/cypher_kwlist_d.h $(all_age_sql)
119121

120122
GEN_KEYWORDLIST = $(PERL) -I ./tools/ ./tools/gen_keywordlist.pl
121123
GEN_KEYWORDLIST_DEPS = ./tools/gen_keywordlist.pl tools/PerfectHash.pm

README.md

Lines changed: 25 additions & 317 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
</a>
3131
&nbsp;
3232
<a href="https://github.com/apache/age/releases">
33-
<img src="https://img.shields.io/badge/Release-v1.4.0-FFA500?labelColor=gray&style=flat&link=https://github.com/apache/age/releases"/>
33+
<img src="https://img.shields.io/badge/Release-v1.5.0-FFA500?labelColor=gray&style=flat&link=https://github.com/apache/age/releases"/>
3434
</a>
3535
&nbsp;
3636
<a href="https://www.postgresql.org/docs/16/index.html">
37-
<img src="https://img.shields.io/badge/Version-Postgresql 16-00008B?labelColor=gray&style=flat&link=https://www.postgresql.org/docs/16/index.html"/>
37+
<img src="https://img.shields.io/badge/Version-Postgresql 17-00008B?labelColor=gray&style=flat&link=https://www.postgresql.org/docs/16/index.html"/>
3838
</a>
3939
&nbsp;
4040
<a href="https://github.com/apache/age/issues">
@@ -53,321 +53,29 @@
5353
<img src="https://img.shields.io/discord/1022177873127280680.svg?label=discord&style=flat&color=5a66f6"></a>
5454
</p>
5555

56-
<br>
57-
58-
59-
<h2><img height="30" src="/img/AGE.png">&nbsp;&nbsp;What is Apache AGE?</h2>
60-
61-
[Apache AGE](https://age.apache.org/#) 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.
62-
</br>
63-
</br>
64-
</br>
65-
66-
<p align="center">
67-
<img src="/img/age-01.png" width="80%" height="80%">
68-
</p>
69-
70-
</br>
71-
72-
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.
73-
74-
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.
75-
76-
77-
<h2><img height="30" src="/img/tick.svg">&nbsp;&nbsp;Overview</h2>
78-
79-
Apache AGE is :
80-
81-
- **Powerful**: adds graph database support to the already popular PostgreSQL database: PostgreSQL is used by organizations including Apple, Spotify, and NASA.
82-
- **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.
83-
- **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.
84-
85-
<h2><img height="30" src="/img/features.svg">&nbsp;&nbsp;Features</h2>
86-
</br>
87-
</br>
88-
89-
<p align="center">
90-
<img src="/img/age-03.png" width="80%" height="80%">
91-
</p>
92-
</br>
93-
94-
- **Cypher Query**: supports graph query language
95-
- **Hybrid Querying**: enables SQL and/or Cypher
96-
- **Querying**: enables multiple graphs
97-
- **Hierarchical**: graph label organization
98-
- **Property Indexes**: on both vertices(nodes) and edges
99-
- **Full PostgreSQL**: supports PG features
100-
101-
102-
103-
<h2><img height="30" src="/img/documentation.svg">&nbsp;&nbsp;Documentation</h2>
104-
105-
Refer to our latest [Apache AGE documentation](https://age.apache.org/age-manual/master/index.html) to learn about installation, features, built-in functions, and Cypher queries.
106-
107-
108-
109-
<h2><img height="30" src="/img/installation.svg">&nbsp;&nbsp;Pre-Installation</h2>
110-
111-
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):
112-
113-
- **CentOS**
114-
```bash
115-
yum install gcc glibc glib-common readline readline-devel zlib zlib-devel flex bison
116-
```
117-
- **Fedora**
118-
```bash
119-
dnf install gcc glibc bison flex readline readline-devel zlib zlib-devel
120-
```
121-
- **Ubuntu**
122-
```bash
123-
sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison
124-
```
125-
126-
<h2><img height="30" src="/img/installation.svg">&nbsp;&nbsp;Installation</h2>
127-
128-
Apache AGE is intended to be simple to install and run. It can be installed with Docker and other traditional ways.
129-
130-
<h4><a><img width="20" src="/img/pg.svg"></a>
131-
&nbsp;Install PostgreSQL
132-
</h4>
133-
134-
You will need to install an AGE compatible version of Postgres<a>, for now AGE supports Postgres 11, 12, 13, 14, 15 & 16. Supporting the latest versions is on AGE roadmap.
135-
136-
<h4>
137-
&nbsp;Installation via Package Manager
138-
</h4>
139-
140-
You can use a <a href="https://www.postgresql.org/download/">package management </a> that your OS provides to download AGE.
141-
142-
<br>
143-
144-
```bash
145-
sudo apt install postgresql
146-
147-
```
148-
<h4>
149-
&nbsp;Installation From Source Code
150-
</h4>
151-
152-
You can <a href="https://www.postgresql.org/ftp/source/"> download the Postgres </a> 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 <a href="https://www.postgresql.org/docs/16/installation.html">official Postgres Website.</a>
153-
154-
155-
156-
<h4><img width="20" src="/img/tux.svg"><img width="20" src="/img/apple.svg"> &nbsp;Install AGE on Linux and MacOS
157-
</h4>
158-
159-
Clone the <a href="https://github.com/apache/age">github repository</a> or download the <a href="https://github.com/apache/age/releases">download an official release.
160-
</a>
161-
Run the pg_config utility and check the version of PostgreSQL. Currently, only PostgreSQL versions 11, 12, 13, 14, 15 & 16 are supported. If you have any other version of Postgres, you will need to install PostgreSQL version 11, 12, 13, 14, 15 or 16.
162-
<br>
163-
164-
```bash
165-
pg_config
166-
```
167-
Run the following command in the source code directory of Apache AGE to build and install the extension.
168-
169-
```bash
170-
make install
171-
```
172-
173-
If the path to your Postgres installation is not in the PATH variable, add the path in the arguments:
174-
```bash
175-
make PG_CONFIG=/path/to/postgres/bin/pg_config install
176-
```
177-
178-
179-
<h4></a><img width="30" src="/img/docker.svg"></a>
180-
&nbsp;Run using Docker
181-
</h4>
182-
183-
<h5> Get the docker image </h5>
184-
185-
```bash
186-
docker pull apache/age
187-
188-
```
189-
<h5> Create AGE docker container </h5>
190-
191-
```bash
192-
docker run \
193-
--name age \
194-
-p 5455:5432 \
195-
-e POSTGRES_USER=postgresUser \
196-
-e POSTGRES_PASSWORD=postgresPW \
197-
-e POSTGRES_DB=postgresDB \
198-
-d \
199-
apache/age
200-
```
201-
202-
<h5> Enter PostgreSQL's psql: </h5>
203-
204-
```bash
205-
docker exec -it age psql -d postgresDB -U postgresUser
206-
```
207-
208-
209-
210-
<h2><img height="20" src="/img/contents.svg">&nbsp;&nbsp;Post Installation</h2>
211-
212-
For every connection of AGE you start, you will need to load the AGE extension.
213-
214-
```bash
215-
CREATE EXTENSION age;
216-
```
217-
```bash
218-
LOAD 'age';
219-
```
220-
```bash
221-
SET search_path = ag_catalog, "$user", public;
222-
```
223-
224-
225-
226-
<h2><img height="20" src="/img/contents.svg">&nbsp;&nbsp;Quick Start</h2>
227-
228-
To create a graph, use the create_graph function located in the ag_catalog namespace.
229-
230-
```bash
231-
SELECT create_graph('graph_name');
232-
```
233-
234-
To create a single vertex, use the CREATE clause.
235-
236-
```bash
237-
SELECT *
238-
FROM cypher('graph_name', $$
239-
CREATE (n)
240-
$$) as (v agtype);
241-
```
242-
243-
244-
To create a single vertex with the label, use the CREATE clause.
245-
246-
```bash
247-
SELECT *
248-
FROM cypher('graph_name', $$
249-
CREATE (:label)
250-
$$) as (v agtype);
251-
```
252-
253-
To create a single vertex with label and properties, use the CREATE clause.
254-
255-
```bash
256-
SELECT *
257-
FROM cypher('graph_name', $$
258-
CREATE (:label {property:value})
259-
$$) as (v agtype);
260-
```
261-
262-
To query the graph, you can use the MATCH clause.
263-
264-
```bash
265-
SELECT *
266-
FROM cypher('graph_name', $$
267-
MATCH (v)
268-
RETURN v
269-
$$) as (v agtype);
270-
```
271-
272-
You can use the following to create an edge, for example, between two nodes.
273-
274-
```bash
275-
SELECT *
276-
FROM cypher('graph_name', $$
277-
MATCH (a:label), (b:label)
278-
WHERE a.property = 'Node A' AND b.property = 'Node B'
279-
CREATE (a)-[e:RELTYPE]->(b)
280-
RETURN e
281-
$$) as (e agtype);
282-
```
283-
284-
285-
To create an edge and set properties.
286-
287-
```bash
288-
SELECT *
289-
FROM cypher('graph_name', $$
290-
MATCH (a:label), (b:label)
291-
WHERE a.property = 'Node A' AND b.property = 'Node B'
292-
CREATE (a)-[e:RELTYPE {property:a.property + '<->' + b.property}]->(b)
293-
RETURN e
294-
$$) as (e agtype);
295-
```
296-
297-
Example
298-
299-
```bash
300-
SELECT *
301-
FROM cypher('graph_name', $$
302-
MATCH (a:Person), (b:Person)
303-
WHERE a.name = 'Node A' AND b.name = 'Node B'
304-
CREATE (a)-[e:RELTYPE {name:a.name + '<->' + b.name}]->(b)
305-
RETURN e
306-
$$) as (e agtype);
307-
```
308-
309-
310-
311-
<h2><img height="20" src="/img/gettingstarted.svg">&nbsp;&nbsp;Language Specific Drivers</h2>
312-
313-
Starting with Apache AGE is very simple. You can easily select your platform and incorporate the relevant SDK into your code.
314-
</br>
315-
</br>
316-
317-
<p align="center">
318-
<img src="/img/age-02.png" width="80%" height="80%">
319-
</p>
320-
321-
322-
<h4>Built-in</h4>
323-
324-
- [Go driver](./drivers/golang)
325-
- [Java driver](./drivers/jdbc)
326-
- [NodeJs driver](./drivers/nodejs)
327-
- [Python driver](./drivers/python)
328-
329-
<h4>Community-driven Driver</h4>
330-
331-
- [Apache AGE Rust Driver](https://github.com/Dzordzu/rust-apache-age.git)
332-
333-
334-
335-
336-
<h2><img height="20" src="/img/contributing.svg">&nbsp;&nbsp;Community</h2>
337-
338-
Join the AGE community for help, questions, discussions, and contributions.
339-
340-
- Check our [website](https://age.apache.org/)
341-
- Join the Live Chat on [Discord](https://discord.gg/EuK6EEg3k7)
342-
- Follow us on [Twitter](https://twitter.com/apache_age?s=20&t=7Hu8Txk4vjvuEp-ryakacg)
343-
- Subscribe to our developer mailing list by sending an email to [email protected]
344-
- Subscribe to our user mailing list by sending an email to [email protected]
345-
- Subscribe to our committer mailing list (To become a committer) by sending an email to [email protected]
346-
347-
348-
<h2><img height="20" src="/img/visualization.svg">&nbsp;&nbsp;Graph Visualization Tool for AGE</h2>
349-
350-
351-
Apache AGE Viewer is a user interface for Apache AGE that provides visualization and exploration of data.
352-
This web visualization tool allows users to enter complex graph queries and explore the results in graph and table forms.
353-
Apache AGE Viewer is enhanced to proceed with extensive graph data and discover insights through various graph algorithms.
354-
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>.
355-
356-
**This is a visualization tool.**
357-
After installing AGE Extension, you may use this tool to get access to the visualization features.
358-
359-
360-
![Viewer gdb, and graph](/img/agce.gif)
361-
362-
363-
<h2><img height="20" src="/img/videos.png">&nbsp;&nbsp;Video Links</h2>
364-
365-
You can also get help from these videos.
366-
367-
- Install on [Windows](https://www.youtube.com/watch?v=ddk8VX8Hm-I&list=PLGp3huJbWNDjgwP7s99Q-9_w1vxpjNHXG)
368-
- Install on [MacOS](https://www.youtube.com/watch?v=0-qMwpDh0CA)
369-
370-
56+
## Purpose of this project
57+
Sometimes I need to work with graph databases on Windows, Neo4j is heavy and I prefer PostgreSQL and PGVector as a whole solution. Then Apache AGE is a good choice.
58+
59+
However, Apache AGE does not provide Windows support, the tutorials are based on WSL. I want to make it simple for Windows users to use the Apache AGE Along with PostgreSQL and PGVector.
60+
61+
This project is a fork of the [Apache AGE](https://github.com/apache/age) project. To provide Windows distribution for the Apache AGE project.
62+
It will provide a binary package for Windows, along with PostgreSQL 17 and PGVector 0.8.0.
63+
64+
# Steps to compile if you want to do it on your machine:
65+
1. Install MSYS2-MINGW64, and install the following packages:
66+
```
67+
pacman -Syu
68+
pacman --needed -S git mingw-w64-x86_64-gcc base-devel bison flex mingw-w64-x86_64-minizip mingw-w64-x86_64-zlib mingw-w64-x86_64-icu
69+
pacman -S mingw64/mingw-w64-x86_64-openssl
70+
```
71+
2. Install PostgreSQL
72+
`pacman -S mingw-w64-x86_64-postgresql`
73+
3. Checkout the source and build:
74+
```
75+
git clone --branch "PG17/Windows" https://github.com/ShanGor/age.git
76+
cd age
77+
make install
78+
```
37179

37280
<h2><img height="20" src="/img/community.svg">&nbsp;&nbsp;Contributing</h2>
37381

0 commit comments

Comments
 (0)