Delete Nodes & Edges

Remove entities and relationships with cascade handling and integrity checks.

Overview

This tutorial covers the safe deletion of nodes and edges from your ResearchArcade graph database. You'll learn how to remove individual entities, handle cascade deletions, maintain referential integrity, and implement soft deletion strategies for critical data.

Deleting Nodes

Select a node type below to see the code example for deleting that entity:

Select a node type from the dropdown above to view the code example.

Deleting a ArXiv Papers Node

Example code for deleting a arxiv papers entry:

# Delete a paper by ID
paper_id = {"arxiv_id": "1706.03762v7"}
deleted_paper = research_arcade.delete_node_by_id("arxiv_papers", paper_id)
print("Deleted paper:")
print(deleted_paper)

No example code available for this operation in the tutorial.

No example code available for this operation in the tutorial.

No example code available for this operation in the tutorial.

No example code available for this operation in the tutorial.

No example code available for this operation in the tutorial.

No example code available for this operation in the tutorial.

Deleting a OpenReview Authors Node

Example code for deleting a openreview authors entry:

author_id = {"author_openreview_id": "~ishmam_zabir1"}
author_features = research_arcade.delete_node_by_id("openreview_authors", author_id)
print(author_features.to_dict(orient="records")[0])

Deleting a OpenReview Papers Node

Example code for deleting a openreview papers entry:

paper_id = {"paper_openreview_id": "zGej22CBnS"}
paper_features = research_arcade.delete_node_by_id("openreview_papers", paper_id)
print(paper_features.to_dict(orient="records")[0])

Deleting a OpenReview Reviews Node

Example code for deleting a openreview reviews entry:

review_id = {"review_openreview_id": "DHwZxFryth"}
review_features = research_arcade.delete_node_by_id("openreview_reviews", review_id)
print(review_features.to_dict(orient="records")[0])

Deleting a OpenReview Revisions Node

Example code for deleting a openreview revisions entry:

revision_id = {"revision_openreview_id": "yfHQOp5zWc"}
revision_feature = research_arcade.delete_node_by_id("openreview_revisions", revision_id)
print(revision_feature.to_dict(orient="records")[0])

Deleting a OpenReview Paragraphs Node

Example code for deleting a openreview paragraphs entry:

paper_id = {"paper_openreview_id": "xujj_test"}
paragraph_feature = research_arcade.delete_node_by_id("openreview_paragraphs", paper_id)
print(len(paragraph_feature))
print(paragraph_feature.to_dict(orient="records")[0])

Deleting a OpenReview-ArXiv Link Node

Example code for deleting a openreview-arxiv link entry:

openreview_id = {"paper_openreview_id": "zkNCWtw2fd"}
openreview_arxiv_df = research_arcade.delete_edge_by_id("openreview_arxiv", openreview_id)
print(openreview_arxiv_df.to_dict(orient="records")[0])

arxiv_id = {"arxiv_id": "http://arxiv.org/abs/2408.10536v1"}
openreview_arxiv_df = research_arcade.delete_edge_by_id("openreview_arxiv", arxiv_id)
print(openreview_arxiv_df.to_dict(orient="records")[0])

openreview_arxiv_id = {"paper_openreview_id": "zkNCWtw2fd", "arxiv_id": "http://arxiv.org/abs/2408.10536v1"}
openreview_arxiv_df = research_arcade.delete_edge_by_id("openreview_arxiv", openreview_arxiv_id)
print(openreview_arxiv_df.to_dict(orient="records")[0])

Deleting Edges

Select an edge type below to see the code example for deleting that relationship:

Select an edge type from the dropdown above to view the code example.

Deleting an ArXiv Author-Paper Relationship

Example code for deleting a arxiv author-paper entry:

relation_id = {'paper_arxiv_id': '1706.03762v7', 'author_id': 'ss_ashish_vaswani'}
research_arcade.delete_edge_by_id("arxiv_paper_author", primary_key=relation_id)
print("Relationship deleted!")

Deleting a ArXiv Paper-Category Relationship

Example code for deleting a arxiv paper-category entry:

relation_id = {'paper_arxiv_id': '1706.03762v7', 'category_id': 'cs.AI'}
research_arcade.delete_edge_by_id("arxiv_paper_category", primary_key=relation_id)
print("Relationship deleted!")

Deleting a ArXiv Citation

Example code for deleting a arxiv citation entry:

citation_id = {
    'citing_paper_id': '1810.04805v2',
    'cited_paper_id': '1706.03762v7'
}
research_arcade.delete_edge_by_id("arxiv_citation", primary_key=citation_id)
print("Citation deleted!")

No example code available for this operation in the tutorial.

No example code available for this operation in the tutorial.

Deleting arxiv_paragraph_citations Edges

Code example placeholder - Add your Python/API code here for deleting arxiv_paragraph_citations edges

No example code available for this operation in the tutorial.

Deleting a OpenReview Papers-Authors Relationship

Example code for deleting a openreview papers-authors entry:

paper_id = {"paper_openreview_id": "00SnKBGTsz"}
openreview_papers_authors = research_arcade.delete_edge_by_id("openreview_papers_authors", paper_id)
print(openreview_papers_authors.to_dict(orient="records"))

Deleting a OpenReview Papers-Reviews Relationship

Example code for deleting a openreview papers-reviews entry:

paper_review_id = {"paper_openreview_id": "00SnKBGTsz", "review_openreview_id": "13mj0Rtn5W"}
openreview_papers_reviews = research_arcade.delete_edge_by_id("openreview_papers_reviews", paper_review_id)
print(openreview_papers_reviews.to_dict(orient="records"))

Deleting a OpenReview Papers-Revisions Relationship

Example code for deleting a openreview papers-revisions entry:

paper_revision_id = {"paper_openreview_id": "00SnKBGTsz", "revision_openreview_id": "Cn0twOEX1T"}
openreview_papers_revisions = research_arcade.delete_edge_by_id("openreview_papers_revisions", paper_revision_id)
print(openreview_papers_revisions.to_dict(orient="records"))

Deleting a OpenReview Revisions-Reviews Relationship

Example code for deleting a openreview revisions-reviews entry:

revision_review_id = {"revision_openreview_id": "Cn0twOEX1T", "review_openreview_id": "13mj0Rtn5W"}
openreview_revisions_reviews = research_arcade.delete_edge_by_id("openreview_revisions_reviews", revision_review_id)
print(openreview_revisions_reviews.to_dict(orient="records"))

Next Steps

Now that you understand CRUD operations, explore data import and analysis: