Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new: adjust DGL to ArangoDB interface for increased accessibility #24

Merged
merged 16 commits into from
Jun 29, 2022

Conversation

aMahanna
Copy link
Member

@aMahanna aMahanna commented Jun 12, 2022

Demo

ArangoDB to DGL use cases

dgl_karate_graph = KarateClubDataset()[0]

# Use Case 1: Let ADBDGL_Adapter handle the graph creation
adbdgl_adapter.dgl_to_arangodb("Karate", dgl_karate_graph)

# Use Case 2: Create the graph prior to ArangoDB to DGL call
edge_definitions = [...]
db.create_graph("Karate", edge_definitions, smart = True, disjoint = True, ...)
adbdgl_adapter.dgl_to_arangodb("Karate", dgl_karate_graph)

# Use Case 3: Overwrite the graph due to edge definition modifications
new_dgl_karate_graph = heterograph({("KarateMember", "to", "KarateMember"): (tensor([0, 1]), tensor([1, 2]))})
adbdgl_adapter.dgl_to_arangodb("Karate", new_dgl_karate_graph, overwrite_graph=True)

Keyword arguments for import_bulk

Users can now specify parameters for the import_bulk() API of python-arango via kwargs

adbdgl_adapter.dgl_to_arangodb("Karate", dgl_karate_graph, sync=True, on_duplicate="replace", batch_size=50)

aMahanna and others added 7 commits June 11, 2022 21:09
The DGL HeteroNodeDataView / HeteroEdgeDataView is able to track previously inserted features, so this is not needed
deprecated in favor of pyproject.toml usage
Uncessary noise as we already have proper docstring examples
@aMahanna aMahanna closed this Jun 15, 2022
@aMahanna aMahanna reopened this Jun 15, 2022
@aMahanna aMahanna closed this Jun 15, 2022
@aMahanna aMahanna reopened this Jun 15, 2022
@cw00dw0rd
Copy link

Please add test for new graph options functionality

@aMahanna
Copy link
Member Author

Please add test for new graph options functionality

Unfortunately there is not much to validate here, since python-arango cannot provide any information the main graph options like shard_count, replication_factor, write_concer, etc. I.e if we did set these values, there would be now way for us to systematically validate for it (a quick manual test however shows that these work just fine)

It does allow you however to access orphan_collections via db.graph(name).properties(), but DGL has no concept of orphaned data (nodes must always be linked via edges).

As a result, adding something like arangoml/networkx-adapter@f64c8e0 is just not possible.

@aMahanna
Copy link
Member Author

Setting PR to draft, as I need to redefine the scope in anticipation of arangodb/python-arango#207

@aMahanna aMahanna marked this pull request as draft June 17, 2022 14:12
@aMahanna aMahanna marked this pull request as ready for review June 27, 2022 19:29
@aMahanna aMahanna merged commit 84fdbd2 into master Jun 29, 2022
@aMahanna aMahanna deleted the feature/dgl-arangodb-rework branch June 29, 2022 14:44
@aMahanna aMahanna self-assigned this Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

adjust DGL to ArangoDB interface for increased accessibility
2 participants