Stack Overflow for Property Graph Benchmark

Read full text Summarise with VIRAT
Authors: Zhao, Zachary, Ujjwal Reddy
Cited by: 0

Summary

No summary yet. VIRAT can read this paper and write a plain-language summary of its aim, methods, key findings and limitations.

Summarise with VIRAT Free to try with your Science Catalogs account.

Abstract

This dataset is adapted from the Stack Overflow dataset (https://www.kaggle.com/datasets/stackoverflow/stackoverflow). We modified certain csv files for easier data import into graph database platforms. 1 users.csv → users_clean.csv The users file contains one row per registered user with fields such as id, display_name, about_me, age, creation_date, last_access_date, location, reputation, up_votes, down_votes, views, profile_image_url, and website_url. The raw users.csv had significant issues because the 'about_me' field contains freeform text written by users. This text frequently included double and single quotes, newlines, carriage returns, tabs, and backslashes, all of which interfere with standard CSV parsing. cleaned versions of this file were produced —Neo4j, TigerGraph and PuppyGraph/GraphFrames (users_clean.csv) : all double-quote and single-quote characters were removed from every field, all newline and carriage return characters were replaced with spaces, all tab characters were replaced with spaces, all backslash characters were removed, and any sequences of multiple spaces were collapsed into a single space. Rows with an empty ID in the first column were skipped entirely. The resulting file has the same columns as the original, with the same number of rows (minus any malformed or ID-less rows), but with all problematic characters removed from the field values. 2 comments.csv → comments_final.csv The comments file contains one row per comment, with fields id, text, creation_date, post_id, user_id, user_display_name, and score. The 'text' field contains the actual content of user comments and can include special characters, quotes, and line breaks. The file used across all database systems is named comments_final.csv. This is the cleaned version of the raw comments file in which text fields were sanitized to remove embedded quotes and newlines that would otherwise break CSV parsing. 3 posts_answers.csv → posts_answers_fixed.csv The raw posts export from Stack Exchange contains both questions and answers in a single Posts.xml file. After converting to CSV, the posts were split into two separate files based on the post_type_id field: type 1 corresponds to questions and type 2 corresponds to answers. The posts_answers.csv file contains answer posts, with fields including id, title, body, accepted_answer_id, answer_count, comment_count, community_owned_date, creation_date, favorite_count, last_activity_date, last_edit_date, last_editor_display_name, last_editor_user_id, owner_display_name, owner_user_id, parent_id, post_type_id, score, tags, and view_count. The parent_id field links each answer to the question it was written in response to. The 'body' field (which contains the full HTML content of the answer) and the 'title' field both contained embedded newlines and double-quote characters that prevented clean CSV parsing. The cleaning script read the file row by row and for each row replaced all newline characters (\n) and carriage return characters (\r) in the body field with spaces, and replaced double-quote characters with single-quote characters. The title field had the same newline/carriage return treatment applied. All other fields were left unchanged. The output is posts_answers_fixed.csv. 4 posts_questions.csv → posts_questions_cleaned1.csv The posts_questions.csv file contains question posts with the same columns as the answers file, except that questions have a meaningful tags field (formatted as ) and a meaningful accepted_answer_id field pointing to the accepted answer. Because the questions file is very large (tens of millions of rows), it was processed in chunks of 100,000 rows at a time using pandas to avoid running out of memory. The cleaning steps applied were: any cell containing an empty string, a space, 'NULL', 'null', or 'None' was replaced with a proper null/NaN value; rows where the id column was null or missing were dropped; the body field had embedded newlines and carriage returns replaced with spaces, and double-quote characters replaced with single-quote characters; the title field had the same newline and carriage return treatment. The output is posts_questions_cleaned1.csv. 5 posts_tag_wiki.csv → posts_tag_wiki_clean.csv Tag wiki posts are detailed descriptions associated with each tag on Stack Overflow, providing context about what the tag means and how it should be used. The posts_tag_wiki.csv file has the same column structure as the other post files (20 columns total). Because tag wiki content is written in Markdown and HTML, it contains an especially wide variety of special characters: various types of quotation marks including Unicode left and right single quotes and double quotes, angle brackets, backslashes, and many formatting characters. The cleaning applied was more aggressive than for the other post files. A function called 'ultra_clean' was applied to every field in every row. This function removed backslashes by replacing them with spaces; removed all forms of quotation marks (standard double quotes, standard single quotes, backticks, and Unicode fancy quotes) entirely; replaced all newline, carriage return, and tab characters with spaces; and collapsed multiple spaces into one. Rows missing an ID in the first column were skipped, and each row was padded with empty strings to ensure it always had exactly 20 columns. The output is posts_tag_wiki_clean.csv. 6 posts_tag_wiki_excerpt.csv → posts_tag_wiki_excerpt_100PCT.csv Tag wiki excerpts are short one or two sentence summaries of each tag, shown in tag tooltips on Stack Overflow. They follow the same column structure as the tag wiki posts (20 columns). This file required the most thorough cleaning of all, for two reasons. First, the raw file contained duplicate rows with the same ID, which would cause problems when loading into graph databases that require unique vertex IDs. Second, the excerpt content, while shorter than full wiki posts, contained the same variety of special characters plus additional formatting artifacts from the excerpt extraction process. The cleaning script tracked every ID it encountered in a set. If an ID was seen a second time, that row was skipped and counted as a duplicate. Beyond deduplication, the cleaning applied to text fields removed backslashes, HTML-like angle brackets (< and >), square brackets, parentheses, commas, semicolons, and all forms of quotation marks, then collapsed whitespace. Additionally, each of the 20 columns was handled individually based on its data type: integer fields (such as answer_count, comment_count, favorite_count, and various user ID fields) were filled with '0' if empty rather than left blank; datetime fields (community_owned_date, creation_date, last_activity_date, last_edit_date) had the ' UTC' suffix removed since TigerGraph's datetime parser expects a specific format without that suffix; the body field was given a fallback of 'No description available' if it was empty, because a completely empty body caused parsing errors; and the accepted_answer_id and parent_id fields were kept as strings (potentially empty strings) rather than being converted to integers, because unlike other posts, these fields are not expected to contain meaningful values for excerpt posts. The output is posts_tag_wiki_excerpt_100PCT.csv. 7 edge_tag_to_question.csv (derived file) This file does not come from the raw Stack Exchange dump. It is a derived edge file created specifically for loading into graph databases. The tags field in each question row is stored as a single string in the format , which compactly encodes which tags apply to that question. To represent these as explicit graph edges between Tag nodes and Post_question nodes, this compact string format needed to be expanded. A Python script read through all cleaned question rows and for each question parsed the tags field by replacing >< with a pipe character and removing the remaining angle brackets, producing a list of individual tag names. For each tag name, the script looked up the corresponding tag ID from tags.csv using a dictionary built from the tags file (with case-insensitive matching). For every tag that was found in the tags dictionary, the script wrote a row with the tag ID as the source and the question ID as the destination. The result is edge_tag_to_question.csv, a two-column file with columns 'src' (tag ID) and 'dst' (question ID), containing approximately 68 million rows representing every tag-to-question assignment in the dataset. 8 users.csv → Users_fixed.csv A preprocessed version of users.csv generated by the CSV cleaning script in section 2.1. The raw users.csvcontained quote-escaping issues, embedded newlines, carriage returns, and tab characters that prevented Neo4j from parsing it correctly. The script strips all quote characters (" and '), replaces \n, \r, and \t with spaces, collapses extra whitespace, and skips rows with empty IDs. 9 Posts_tag_wiki.csv → Posts_tag_wiki_fixed.csv A preprocessed version of posts_tag_wiki.csv generated by the CSV cleaning script, using the same aggressive quote-stripping approach as users_fixed.csv. The raw file contained quote characters and embedded control characters in text fields like body and title that caused parsing failures. The script strips all ", \n, \r, and \tcharacters, normalizes whitespace, and skips empty rows.

Fields of Study & Subjects

Graph Theory and Algorithms Advanced Database Systems and Queries Complex Network Analysis Techniques

Publication details

Journal / source
Harvard Dataverse
Publication date
11 March 2026
Language
EN
Document type
Dataset