Mo7art commited on
Commit
dbf7e8a
·
verified ·
1 Parent(s): d7ad7e7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -157
README.md CHANGED
@@ -12,100 +12,40 @@ size_categories:
12
  - 100M<n<1B
13
  ---
14
 
15
- # Dataset Card for StackOverflow Knowledge Graph
16
 
17
- ## Dataset Summary
18
 
19
- This dataset contains the knowledge graph component of Stack2Graph, a structured representation of Stack Overflow data introduced in the paper Stack2Graph: A Structured Knowledge Representation of Stack Overflow Data for Retrieval-based Question Answering.
20
 
21
- The graph is generated from the Stack Overflow data dump after SQL ingestion and serialized as TriG RDF datasets. It preserves structural relations between questions, answers, comments, tags, votes, duplicates, and question-to-question links instead of reducing Stack Overflow to isolated question-answer pairs.
22
 
23
- As described in the paper, Stack2Graph combines a knowledge graph with a vector database. This Hugging Face dataset card covers only the knowledge graph artifact. The paper reports a resource scale of more than 117 million nodes and 275 million edges for Stack2Graph.
24
 
25
  ## Repository Layout
26
 
27
- The uploaded repository stores compressed TriG shards under the `trig_files` directory.
28
-
29
  ```text
30
- trig_files/
 
31
  archive_manifest.json
32
- part_0.tar.gz
33
- part_1.tar.gz
34
- part_2.tar.gz
35
  ...
36
  ```
37
 
38
- Each archive contains multiple TriG shard files such as `part0.trig`, `part1.trig`, and `part2.trig`.
39
-
40
- The `archive_manifest.json` file records:
41
-
42
- - the archive batch size
43
- - the number of archive files
44
- - the number of source `.trig` files
45
- - the exact shard files contained in each archive
46
-
47
- ## Graph Organization
48
-
49
- Each `.trig` file is a serialized RDF dataset containing:
50
-
51
- - a default graph with schema definitions
52
- - one named graph per supported programming-language tag
53
-
54
- Named graph IRIs follow this pattern:
55
-
56
- ```text
57
- http://stackoverflow.com/<language>
58
- ```
59
-
60
- Examples:
61
-
62
- - `http://stackoverflow.com/python`
63
- - `http://stackoverflow.com/java`
64
- - `http://stackoverflow.com/javascript`
65
-
66
- A question can appear in more than one named graph when it carries multiple supported language tags.
67
-
68
- ## Graph Content
69
-
70
- For each retained question, the graph may contain:
71
-
72
- - the question node
73
- - accepted and non-accepted answers
74
- - comments on the question
75
- - comments on the answers
76
- - attached tags
77
- - tag wiki content for supported programming-language tags when available
78
- - aggregate vote counts
79
- - related-question links
80
- - duplicate-question links
81
-
82
- Questions are only included if they contain at least one supported programming-language tag.
83
-
84
- ## Supported Language Tags
85
-
86
- The current pipeline retains questions when at least one tag matches this set:
87
-
88
- - `java`, `c`, `c++`, `python`, `c#`, `javascript`, `assembly`, `php`, `perl`, `ruby`, `vb.net`, `swift`, `r`, `objective-c`, `go`, `sql`, `matlab`, `typescript`, `scala`, `kotlin`, `rust`, `lua`, `haskell`, `cobol`, `fortran`, `lisp`, `erlang`, `elixir`, `f#`, `dart`, `shell`, `bash`, `powershell`, `css`, `html`, `.net`, `julia`, `prolog`, `abap`
89
 
90
- ## Ontology and Namespaces
 
91
 
92
- The dataset uses a Stack Overflow-specific namespace and resource layout.
93
 
94
- Core namespaces:
95
 
96
- - `http://stackoverflow.com/schema#` as the ontology namespace (`so:`)
97
- - `http://stackoverflow.com/q/` for question instances
98
- - `http://stackoverflow.com/a/` for answer instances
99
- - `http://stackoverflow.com/comment/` for comment instances
100
- - `http://stackoverflow.com/tag/` for tag instances
101
 
102
- Example resource IRIs:
103
-
104
- - Question: `http://stackoverflow.com/q/12345`
105
- - Answer: `http://stackoverflow.com/a/67890`
106
- - Comment: `http://stackoverflow.com/comment/111`
107
- - Tag: `http://stackoverflow.com/tag/python`
108
- - Tag wiki: `http://stackoverflow.com/tag/python/info`
109
 
110
  ## Schema Overview
111
 
@@ -113,95 +53,24 @@ Example resource IRIs:
113
 
114
  *Figure 1. High-level schema of Stack2Graph. Questions are the central entities and connect to answers, comments, tags, tag-wiki content, vote aggregates, and question-to-question links. Schema triples are stored in the default graph, while content triples are written into one named graph per supported programming-language tag.*
115
 
116
- Core entity types:
117
-
118
- - `so:Question`
119
- - `so:Answer`
120
- - `so:Comment`
121
- - `so:Tag`
122
- - `so:TagWiki`
123
-
124
- Key structural relations:
125
-
126
- - question-answer: `so:acceptedAnswer`, `so:hasAnswer`, `so:answersQuestion`, `so:possibleBetterAnswer`
127
- - post-comment: `so:hasComment`, `so:commentOn`
128
- - question-tag: `so:taggedWith`, `so:tagsQuestion`
129
- - tag-wiki: `so:hasTagWiki`, `so:tagWikiOf`
130
- - question-question: `so:linkedTo`, `so:duplicateOf`
131
-
132
- Core literal properties:
133
-
134
- - textual content: `so:hasTitle`, `so:hasBody`, `so:hasText`
135
- - interaction signals: `so:score`, `so:answerCount`, `so:upvoteCount`, `so:downvoteCount`, `so:favoriteCount`
136
- - tag label: `so:tagName`
137
-
138
- Additional ontology notes:
139
-
140
- - `so:hasAnswer` is the inverse of `so:answersQuestion`
141
- - `so:hasComment` is the inverse of `so:commentOn`
142
- - `so:hasTagWiki` is the inverse of `so:tagWikiOf`
143
- - `so:taggedWith` is the inverse of `so:tagsQuestion`
144
- - `so:linkedTo` is modeled as a symmetric property
145
-
146
- ## Construction Rules
147
-
148
- The current generation pipeline applies the following rules:
149
-
150
- 1. Questions are loaded from SQL in chunks.
151
- 2. Only questions with at least one recognized programming-language tag are retained.
152
- 3. Related answers, comments, links, and vote aggregates are fetched in batches.
153
- 4. Tag resources are created for all question tags in the retained set.
154
- 5. Tag wiki nodes are added for supported programming-language tags when a tag wiki post exists.
155
- 6. Each retained question is written into one named graph per matching programming-language tag.
156
- 7. Schema triples are included in the default graph of each TriG shard.
157
-
158
- Special cases:
159
-
160
- - `so:possibleBetterAnswer` is a heuristic edge used when a question has an accepted answer and another answer with a higher score.
161
- - Stack Overflow post link type `1` becomes `so:linkedTo`.
162
- - Stack Overflow post link type `3` becomes `so:duplicateOf`.
163
-
164
- ## Data Generation
165
-
166
- The graph is generated from the Stack Overflow XML dump after ingestion into a SQL database.
167
-
168
- Primary source tables include Stack Overflow post, comment, vote, tag, and post-link data.
169
-
170
- The dataset is produced by these repository components:
171
-
172
- - `knowledgeGraph/xmlToSql.py`
173
- - `knowledgeGraph/generateKnowledgeGraph.py`
174
- - `knowledgeGraph/graphHelper.py`
175
- - `knowledgeGraph/upload_hf_trig_files.py`
176
-
177
- Serialization and packaging:
178
 
179
- - RDF format: TriG
180
- - repository packaging: `.tar.gz`
181
- - sharding: multiple `.trig` shards grouped into archive parts
182
 
183
- ## Limitations
184
 
185
- - The graph only includes questions that match the repository's supported language-tag list.
186
- - A single question may be duplicated across multiple named graphs when it has multiple language tags.
187
- - Bodies and comment text are stored as escaped HTML, not plain text.
188
- - The graph uses aggregate vote counts instead of individual vote events.
189
- - `so:possibleBetterAnswer` is heuristic and should not be treated as ground truth.
190
- - Tag wiki coverage depends on whether a corresponding wiki post exists in the source dump.
191
- - The dataset inherits the biases, moderation artifacts, and temporal drift of Stack Overflow content.
192
 
193
- ## Figures
194
 
195
- This card is intentionally concise. Figures exported from the paper can be embedded here later to replace part of the textual explanation of the graph structure and pipeline.
196
 
197
- ## Licensing
198
 
199
- This dataset is distributed under the `CC-BY-SA-4.0` license.
200
 
201
- If you redistribute derived artifacts or use this dataset in downstream resources, you should preserve the attribution and share-alike requirements of `CC-BY-SA-4.0`.
202
 
203
  ## Citation
204
 
205
- If you use this dataset, cite:
206
 
207
- TODO
 
12
  - 100M<n<1B
13
  ---
14
 
15
+ # Dataset Card for StackOverflow Vector Snapshot Dataset
16
 
17
+ ## Summary
18
 
19
+ This dataset contains the vector-database component of Stack2Graph as restorable Qdrant snapshots.
20
 
21
+ The artifacts are intended for direct restore into Qdrant rather than row-wise reuse as a plain text or parquet dataset.
22
 
23
+ The repository covers the vector side of Stack2Graph only, not the accompanying knowledge graph artifact.
24
 
25
  ## Repository Layout
26
 
 
 
27
  ```text
28
+ qdrant_snapshots/
29
+ collections_manifest.json
30
  archive_manifest.json
31
+ stackoverflow_python_vector.tar.xz
32
+ stackoverflow_java_vector.tar.xz
33
+ stackoverflow_javascript_vector.snapshot.xz.part_000
34
  ...
35
  ```
36
 
37
+ Each language is stored as exactly one restore unit:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
+ - a single `tar.xz` archive for regular-size snapshots
40
+ - split `xz` parts for oversized snapshots
41
 
42
+ ## Content
43
 
44
+ The snapshots represent per-language Qdrant collections derived from Stack Overflow questions tagged with supported programming-language tags.
45
 
46
+ Each collection stores the vector index used by the Stack2Graph retrieval pipeline.
 
 
 
 
47
 
48
+ The current pipeline covers major programming-language tags such as Python, Java, JavaScript, C, C++, C#, Go, Rust, TypeScript, SQL, Shell, and additional languages used throughout the project.
 
 
 
 
 
 
49
 
50
  ## Schema Overview
51
 
 
53
 
54
  *Figure 1. High-level schema of Stack2Graph. Questions are the central entities and connect to answers, comments, tags, tag-wiki content, vote aggregates, and question-to-question links. Schema triples are stored in the default graph, while content triples are written into one named graph per supported programming-language tag.*
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
+ ## Intended Use
 
 
58
 
59
+ This dataset is meant to be downloaded and restored into a running Qdrant instance.
60
 
61
+ The repository manifest files describe which artifact files belong to which Qdrant collection.
 
 
 
 
 
 
62
 
63
+ It is primarily intended for retrieval experiments and system reconstruction, not for direct training from the packaged artifacts.
64
 
65
+ ## Source
66
 
67
+ The snapshots are generated from Stack Overflow data after preprocessing, embedding, and Qdrant ingestion in the Stack2Graph pipeline.
68
 
69
+ ## License
70
 
71
+ This dataset is distributed under `CC-BY-SA-4.0`.
72
 
73
  ## Citation
74
 
75
+ If you use this dataset, cite the Stack2Graph project and preserve the attribution requirements of `CC-BY-SA-4.0`.
76