Skip to content

Commit d91a753

Browse files
committed
Refactor Python bindings to replace Gremlin with OpenCypher support
- Added benchmark results for Gremlin vs OpenCypher vs SQL in markdown format. - Updated jar exclusions to remove unnecessary Gremlin dependencies. - Introduced a script to list JARs by size from the latest ArcadeDB Docker image. - Modified mkdocs configuration to reflect OpenCypher queries instead of Gremlin. - Adjusted vector index parameters in core.py for better performance and defaults. - Updated exporter.py to clarify GraphML and GraphSON support requirements. - Revised tests to remove Gremlin references and replace them with OpenCypher tests. - Removed deprecated Gremlin tests and ensured all documentation reflects OpenCypher usage. - Updated plan documentation to outline the transition from Gremlin to OpenCypher.
1 parent bb2761d commit d91a753

48 files changed

Lines changed: 2339 additions & 1079 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bindings/python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ with arcadedb.create_database("./mydb") as db:
7777
- 🌐 **Server Mode**: Optional HTTP server with Studio web interface
7878
- 📦 **Self-contained**: All dependencies bundled (~209-215MB wheel)
7979
- 🔄 **Multi-model**: Graph, Document, Key/Value, Vector, Time Series
80-
- 🔍 **Multiple query languages**: SQL, Cypher, Gremlin, MongoDB
80+
- 🔍 **Multiple query languages**: SQL, OpenCypher, MongoDB
8181
-**High performance**: Direct JVM integration via JPype
8282
- 🔒 **ACID transactions**: Full transaction support
8383
- 🎯 **Vector storage**: Store and query vector embeddings with HNSW (JVector) indexing

bindings/python/docs/api/database.md

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Execute a query and return results. Queries are read-only and don't require a tr
131131

132132
**Parameters:**
133133

134-
- `language` (str): Query language - `"sql"`, `"cypher"`, `"gremlin"`, `"mongo"`, `"graphql"`
134+
- `language` (str): Query language - `"sql"`, `"opencypher"`, `"mongo"`, `"graphql"`
135135
- `command` (str): Query string
136136
- `*args`: Optional parameters to bind to the query
137137

@@ -154,8 +154,8 @@ for record in result:
154154
# Parameterized query
155155
result = db.query("sql", "SELECT FROM Person WHERE age > ?", 25)
156156

157-
# Cypher query
158-
result = db.query("cypher", """
157+
# OpenCypher query
158+
result = db.query("opencypher", """
159159
MATCH (p:Person)-[:Knows]->(friend)
160160
WHERE p.age > $min_age
161161
RETURN friend.name
@@ -167,9 +167,8 @@ result = db.query("cypher", """
167167
| Language | Notes |
168168
|----------|-------|
169169
| `sql` | ArcadeDB SQL |
170-
| `cypher` | OpenCypher graph query language |
170+
| `opencypher` | OpenCypher graph query language |
171171
| `mongo` | MongoDB query syntax |
172-
| `gremlin` | Apache TinkerPop traversal |
173172
| `graphql` | GraphQL queries |
174173

175174
---
@@ -184,7 +183,7 @@ Execute a command (write operation). Commands modify data and **require a transa
184183

185184
**Parameters:**
186185

187-
- `language` (str): Command language (usually `"sql"` or `"cypher"`)
186+
- `language` (str): Command language (usually `"sql"` or `"opencypher"`)
188187
- `command` (str): Command string
189188
- `*args`: Optional parameters
190189

@@ -774,30 +773,18 @@ db.query("sql", "SELECT expand(out('Knows')) FROM Person WHERE name = 'Alice'")
774773
db.query("sql", "SELECT count(*) as total, avg(age) as avg_age FROM Person")
775774
```
776775

777-
### Cypher
776+
### OpenCypher
778777

779778
OpenCypher graph query language:
780779

781780
```python
782-
db.query("cypher", """
781+
db.query("opencypher", """
783782
MATCH (person:Person)-[:Knows]->(friend)
784783
WHERE person.age > 25
785784
RETURN friend.name, friend.age
786785
""")
787786
```
788787

789-
### Gremlin
790-
791-
Apache TinkerPop graph traversals:
792-
793-
```python
794-
db.query("gremlin", """
795-
g.V().has('Person', 'name', 'Alice')
796-
.out('Knows')
797-
.values('name')
798-
""")
799-
```
800-
801788
---
802789

803790
## Best Practices

bindings/python/docs/api/exceptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ except ArcadeDBError as e:
6767
# Query error: ... syntax error near 'SELCT'
6868
```
6969

70-
**Solution:** Check query syntax, use proper SQL/Cypher/Gremlin.
70+
**Solution:** Check query syntax, use proper SQL/OpenCypher.
7171

7272
---
7373

bindings/python/docs/api/server.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ The server provides:
1010
- **Studio Web UI**: Visual database exploration and query editor
1111
- **Multi-database Management**: Create and access multiple databases
1212
- **Remote Access**: Access from other applications via HTTP
13-
- **GraphQL/Gremlin Support**: Extended query languages
13+
- **GraphQL/OpenCypher Support**: Extended query languages
1414

1515
**When to Use Server Mode:**
1616

1717
- Interactive development and debugging
1818
- Web applications needing HTTP API
1919
- Visual data exploration via Studio
2020
- Remote database access
21-
- GraphQL or Gremlin queries
21+
- GraphQL or OpenCypher queries
2222

2323
**When to Use Embedded Mode:**
2424

bindings/python/docs/development/architecture.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ The Python binding is distributed as a **single, self-contained package** (`arca
500500
**Features:**
501501

502502
- **Bundled JRE**: Includes a minimal Java 21 Runtime Environment (JRE) via the `arcadedb-embedded-jre` package.
503-
- **Full Feature Set**: Includes all ArcadeDB engines (SQL, Cypher, Gremlin, GraphQL, MongoDB).
503+
- **Full Feature Set**: Includes all ArcadeDB engines (SQL, OpenCypher, GraphQL, MongoDB).
504504
- **Zero Configuration**: No external Java installation required.
505505

506506
```python
@@ -509,8 +509,7 @@ import arcadedb_embedded as arcadedb
509509

510510
db = arcadedb.create_database("./mydb")
511511
db.query("sql", "SELECT FROM User") #
512-
db.query("cypher", "MATCH (n) RETURN n") #
513-
db.query("gremlin", "g.V()") #
512+
db.query("opencypher", "MATCH (n) RETURN n") #
514513
db.query("graphql", "{users{name}}") #
515514
db.query("mongodb", "db.User.find()") #
516515
```
@@ -673,7 +672,7 @@ def download_arcadedb_jars(version):
673672
jar_url = f"{base_url}arcadedb/{version}/arcadedb-{version}.jar"
674673
download_jar(jar_url, f"arcadedb-{version}.jar")
675674

676-
# Download all dependencies (Gremlin, GraphQL, etc.)
675+
# Download all dependencies (GraphQL, etc.)
677676
pass
678677

679678
# Called during package build

bindings/python/docs/development/contributing.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ arcadedb/bindings/python/
115115
│ ├── test_exporter.py # Exporter tests
116116
│ ├── test_vector.py # Vector search tests
117117
│ ├── test_vector_sql.py # Vector SQL tests
118-
│ ├── test_gremlin.py # Gremlin tests
118+
│ ├── test_cypher.py # OpenCypher tests
119119
│ ├── test_batch_context.py # Batch operations tests
120120
│ ├── test_async_executor.py # Async execution tests
121121
│ ├── test_type_conversion.py # Type conversion tests
@@ -224,8 +224,8 @@ pytest tests/test_server.py
224224
# Importer
225225
pytest tests/test_importer.py
226226

227-
# Gremlin tests
228-
pytest tests/test_gremlin.py -m gremlin
227+
# OpenCypher tests
228+
pytest tests/test_cypher.py -k cypher
229229
```
230230

231231
### Test Markers
@@ -234,11 +234,8 @@ pytest tests/test_gremlin.py -m gremlin
234234
# Skip server tests
235235
pytest -m "not server"
236236

237-
# Only Gremlin tests
238-
pytest -m gremlin
239-
240-
# Skip Gremlin tests
241-
pytest -m "not gremlin"
237+
# Only OpenCypher tests
238+
pytest -k cypher
242239
```
243240

244241
### Writing Tests
@@ -513,7 +510,7 @@ class Database:
513510
Execute a query and return results.
514511
515512
Args:
516-
language: Query language (sql, cypher, gremlin, etc.)
513+
language: Query language (sql, opencypher, mongo, graphql, etc.)
517514
command: Query command string
518515
params: Optional query parameters
519516
@@ -543,7 +540,7 @@ Execute a query and return results.
543540

544541
**Parameters:**
545542

546-
- `language` (str): Query language (sql, cypher, gremlin, mongodb, graphql)
543+
- `language` (str): Query language (sql, opencypher, mongodb, graphql)
547544
- `command` (str): Query command string
548545
- `params` (Optional[dict]): Query parameters for parameterized queries
549546

bindings/python/docs/development/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ db.close()
222222
| Feature | Current Package | Notes |
223223
|---------|----------------|--------|
224224
| SQL | ✅ Yes | All SQL features |
225-
| Gremlin | ✅ Yes | Graph queries |
225+
| OpenCypher | ✅ Yes | Graph queries |
226226
| Studio UI | ✅ Yes | Web interface |
227227
```
228228

bindings/python/docs/development/testing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Comprehensive testing documentation for ArcadeDB Python bindings.
66
**222 tests** across 6 test files, 100% passing
77

88
- **Current package**: 222 passed, 0 skipped
9-
- All ArcadeDB features working (SQL, Cypher, Gremlin, Studio)
9+
- All ArcadeDB features working (SQL, OpenCypher, Studio)
1010

1111
## Quick Navigation
1212

@@ -48,7 +48,7 @@ Comprehensive testing documentation for ArcadeDB Python bindings.
4848

4949
CSV import with type inference (16 tests)
5050

51-
- :material-graph: **[Gremlin Tests](testing/test-gremlin.md)**
51+
- :material-graph: **[OpenCypher Tests](testing/test-opencypher.md)**
5252

5353
---
5454

@@ -94,7 +94,7 @@ pytest --cov=arcadedb_embedded --cov-report=html
9494
| **Concurrency** | File locking, thread safety, multi-process limitations |
9595
| **Server Patterns** | Embedded+HTTP combinations, lock management |
9696
| **Data Import** | CSV with type inference, batch commits |
97-
| **Query Languages** | SQL, Cypher, Gremlin |
97+
| **Query Languages** | SQL, OpenCypher |
9898
| **Advanced Features** | Unicode support, schema introspection, large datasets |
9999

100100
## Key Concepts
@@ -155,7 +155,7 @@ tests/
155155
├── test_concurrency.py # Concurrency (4 tests)
156156
├── test_server_patterns.py # Patterns (4 tests)
157157
├── test_importer.py # Import (13 tests)
158-
├── test_gremlin.py # Gremlin (1 test)
158+
├── test_cypher.py # OpenCypher (tests)
159159
└── conftest.py # Shared fixtures
160160
```
161161

bindings/python/docs/development/testing/overview.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The ArcadeDB Python bindings have a comprehensive test suite covering all major
66

77
!!! success "Test Results"
88
- **Current package**: ✅ 222 passed, 0 skipped
9-
- All features available (SQL, Cypher, Gremlin, Studio UI, Vector search)
9+
- All features available (SQL, OpenCypher, Studio UI, Vector search)
1010

1111
**Total: 222 tests + 7 examples** across all platforms, 100% passing
1212

@@ -18,7 +18,7 @@ The test suite covers:
1818
-**Server mode** - HTTP API, multi-client access
1919
-**Concurrency patterns** - File locking, thread safety, multi-process
2020
-**Graph operations** - Vertices, edges, traversals
21-
-**Query languages** - SQL, Cypher, Gremlin
21+
-**Query languages** - SQL, OpenCypher
2222
-**Vector search** - HNSW (JVector) based Vector indexes, similarity search
2323
-**Data import** - CSV with batch commits and type inference
2424
-**Unicode support** - International characters, emoji
@@ -74,7 +74,7 @@ pytest -v -s
7474
| [`test_concurrency.py`](test-concurrency.md) | 4 | File locking, thread safety, multi-process behavior |
7575
| [`test_server_patterns.py`](test-server-patterns.md) | 4 | Best practices for embedded + server mode |
7676
| [`test_importer.py`](test-importer.md) | 16 | CSV import with type inference |
77-
| [`test_gremlin.py`](test-gremlin.md) | 1 | Gremlin query language (if available) |
77+
| [`test_cypher.py`](test-opencypher.md) | 1 | OpenCypher query language |
7878

7979
## Common Testing Workflows
8080

@@ -115,8 +115,8 @@ Tests are organized with pytest markers:
115115
# Run only server tests
116116
pytest -m server
117117

118-
# Run only Gremlin tests
119-
pytest -m gremlin
118+
# Run only OpenCypher tests
119+
pytest -k cypher
120120

121121
# Run all except slow tests
122122
pytest -m "not slow"
@@ -138,7 +138,7 @@ When all tests pass, you should see:
138138
- **Using server mode?** See [Server Tests](test-server.md) and [Server Patterns](test-server-patterns.md)
139139
- **Confused about concurrency?** Read [Concurrency Tests](test-concurrency.md)
140140
- **Importing data?** Check [Data Import Tests](test-importer.md)
141-
- **Using Gremlin?** See [Gremlin Tests](test-gremlin.md)
141+
- **Using OpenCypher?** See [OpenCypher Tests](test-opencypher.md)
142142

143143
## Related Documentation
144144

bindings/python/docs/development/testing/test-core.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Tests validate:
1414
- Graph operations (vertex/edge creation and traversal)
1515
- Query result handling and iteration
1616
- Error handling
17-
- Cypher queries (when available)
17+
- OpenCypher queries (when available)
1818
- Vector search with HNSW indexes
1919
- Unicode/international character support
2020
- Schema introspection and metadata
@@ -46,9 +46,8 @@ Tests validate:
4646

4747
### Query Languages
4848

49-
- **cypher_queries**: Tests Cypher CREATE statements, MATCH queries, property access (when Cypher available)
49+
- **cypher_queries**: Tests OpenCypher CREATE statements, MATCH queries, property access (when OpenCypher available)
5050
- **sql_queries**: Tests SQL queries, aggregation, filtering, joins
51-
- **gremlin_queries**: Tests Gremlin traversal queries (when available)
5251

5352
### Advanced Features
5453

0 commit comments

Comments
 (0)