Skip to content

Commit 2c44a7d

Browse files
committed
Refactor edge type creation to remove UNIDIRECTIONAL specification
- Updated multiple examples and tests to create edge types without the UNIDIRECTIONAL keyword, allowing for default bidirectional edge storage. - Adjusted related documentation and benchmark results to reflect changes in edge type creation. - Ensured consistency across various test cases and examples by removing the UNIDIRECTIONAL specification from edge type creation commands.
1 parent 545fa28 commit 2c44a7d

31 files changed

Lines changed: 196 additions & 135 deletions

bindings/python/docs/api/importer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ db.command(
9898
### Import Graph Edges
9999

100100
```python
101-
db.command("sql", "CREATE EDGE TYPE Follows UNIDIRECTIONAL")
101+
db.command("sql", "CREATE EDGE TYPE Follows")
102102
db.command(
103103
"sql",
104104
(

bindings/python/docs/api/server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ except:
579579

580580
# Initialize schema
581581
db.command("sql", "CREATE VERTEX TYPE TestNode")
582-
db.command("sql", "CREATE EDGE TYPE TestEdge UNIDIRECTIONAL")
582+
db.command("sql", "CREATE EDGE TYPE TestEdge")
583583

584584
db.close()
585585

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import arcadedb_embedded as arcadedb
1818

1919
with arcadedb.create_database("./opencypher_test_db") as db:
2020
db.command("sql", "CREATE VERTEX TYPE Person")
21-
db.command("sql", "CREATE EDGE TYPE Knows UNIDIRECTIONAL")
21+
db.command("sql", "CREATE EDGE TYPE Knows")
2222

2323
with db.transaction():
2424
alice = db.new_vertex("Person")

bindings/python/docs/examples/02_social_network_graph.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ with db.transaction():
7979
)
8080
```
8181

82-
!!! note "Directed-edge migration note"
83-
Current graph examples explicitly declare `CREATE EDGE TYPE ... UNIDIRECTIONAL`.
84-
That means you should not assume reverse edges are automatically materialized in
85-
storage. If you need incoming traversal behavior, express it in the query pattern.
82+
!!! note "Directed-edge storage note"
83+
Graph relationships are still directed from source to target, but the examples now
84+
rely on ArcadeDB's default bidirectional edge storage. That keeps reverse traversal
85+
efficient without changing the semantic direction of the relationship.
8686

8787
### Schema Definition
8888

@@ -104,7 +104,7 @@ with arcadedb.create_database("./social_network_db") as db:
104104
db.command("sql", "CREATE PROPERTY Person.reputation FLOAT") # Optional (can be NULL)
105105

106106
# Create edge type with properties
107-
db.command("sql", "CREATE EDGE TYPE FRIEND_OF UNIDIRECTIONAL")
107+
db.command("sql", "CREATE EDGE TYPE FRIEND_OF")
108108
db.command("sql", "CREATE PROPERTY FRIEND_OF.since DATE")
109109
db.command("sql", "CREATE PROPERTY FRIEND_OF.closeness STRING")
110110

bindings/python/docs/examples/05_csv_import_graph.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,11 @@ db.command("sql", "CREATE PROPERTY Movie.title STRING")
314314
db.command("sql", "CREATE INDEX ON Movie (movieId) UNIQUE_HASH")
315315

316316
# Create edge types
317-
db.command("sql", "CREATE EDGE TYPE RATED UNIDIRECTIONAL IF NOT EXISTS")
317+
db.command("sql", "CREATE EDGE TYPE RATED IF NOT EXISTS")
318318
db.command("sql", "CREATE PROPERTY RATED.rating FLOAT")
319319
db.command("sql", "CREATE PROPERTY RATED.timestamp LONG")
320320

321-
db.command("sql", "CREATE EDGE TYPE TAGGED UNIDIRECTIONAL IF NOT EXISTS")
321+
db.command("sql", "CREATE EDGE TYPE TAGGED IF NOT EXISTS")
322322
db.command("sql", "CREATE PROPERTY TAGGED.tag STRING")
323323
db.command("sql", "CREATE PROPERTY TAGGED.timestamp LONG")
324324
```

bindings/python/docs/examples/basic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import arcadedb_embedded as arcadedb
8181
with arcadedb.create_database("./mydb") as db:
8282
# Create graph schema (schema ops are auto-transactional)
8383
db.command("sql", "CREATE VERTEX TYPE Person")
84-
db.command("sql", "CREATE EDGE TYPE Knows UNIDIRECTIONAL")
84+
db.command("sql", "CREATE EDGE TYPE Knows")
8585
db.command("sql", "CREATE PROPERTY Person.name STRING")
8686

8787
# Create vertices and edges

bindings/python/docs/examples/import.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ with arcadedb.create_database("./import_demo") as db:
8585
```python
8686
with arcadedb.create_database("./graph_import_demo") as db:
8787
db.command("sql", "CREATE VERTEX TYPE User")
88-
db.command("sql", "CREATE EDGE TYPE Follows UNIDIRECTIONAL")
88+
db.command("sql", "CREATE EDGE TYPE Follows")
8989

9090
db.command(
9191
"sql",

bindings/python/docs/guide/core/database.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def init_database(path: str):
305305
db.command("sql", "CREATE VERTEX TYPE Post")
306306
db.command("sql", "CREATE PROPERTY Post.title STRING")
307307

308-
db.command("sql", "CREATE EDGE TYPE Authored UNIDIRECTIONAL")
308+
db.command("sql", "CREATE EDGE TYPE Authored")
309309

310310
print(f"Database initialized at {path}")
311311

@@ -373,7 +373,7 @@ def migrate_database(old_path: str, new_path: str):
373373
# Copy schema
374374
new_db.command("sql", "CREATE VERTEX TYPE User")
375375
new_db.command("sql", "CREATE VERTEX TYPE Post")
376-
new_db.command("sql", "CREATE EDGE TYPE Authored UNIDIRECTIONAL")
376+
new_db.command("sql", "CREATE EDGE TYPE Authored")
377377

378378
# Copy data
379379
batch_size = 1000

bindings/python/docs/guide/core/queries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ with db.transaction():
3333
```python
3434
# Create schema
3535
db.command("sql", "CREATE VERTEX TYPE Person")
36-
db.command("sql", "CREATE EDGE TYPE Knows UNIDIRECTIONAL")
36+
db.command("sql", "CREATE EDGE TYPE Knows")
3737

3838
# Insert using SQL (RECOMMENDED)
3939
with db.transaction():

bindings/python/docs/guide/core/transactions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ with arcadedb.create_database(temp_db_path) as db:
7575
```python
7676
with arcadedb.create_database(temp_db_path) as db:
7777
db.command("sql", "CREATE VERTEX TYPE Person")
78-
db.command("sql", "CREATE EDGE TYPE Knows UNIDIRECTIONAL")
78+
db.command("sql", "CREATE EDGE TYPE Knows")
7979

8080
with db.transaction():
8181
db.command("sql", "INSERT INTO Person SET name = 'Alice'")

0 commit comments

Comments
 (0)