Created
November 4, 2016 03:24
-
-
Save moskomule/ad7f034952f48be7d26efab9fc3f25f8 to your computer and use it in GitHub Desktop.
create lists of vertices and edges from Wikipedia page.sql and redirects.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## verex list | |
SELECT p.page_id, p.page_title | |
FROM page p | |
WHERE p.page_namespace=0 | |
INTO OUTFILE '/tmp/vertices.tsv' | |
FIELDS TERMINATED BY ' '; | |
## edge list | |
SELECT l.pl_from, p.page_id | |
FROM page p, pagelinks l | |
WHERE l.pl_title=p.page_title AND l.pl_namespace=0 AND p.page_namespace=0 | |
INTO OUTFILE '/tmp/edges.tsv' | |
FIELDS TERMINATED BY ' '; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment