1

I have downloaded the Posts.7z dataset from here. I have not been able to find a README file, so I go by intuition regarding the content of the file.

To my understanding, a single line of the file is a post on Stack Overflow. Each line/post is an OrderedDict with keys containing, for example, the text of the post (whatever it is a question or an answer).

I have not been able to find/identify the key containing the ID of the user who originally posted. I can only see the key containing the ID of the user who owns the post and of the user who lastly modified it.

How can I get the ID of the user who originally posted a Stack Overflow post?

BONUS: How is it possible that two posts can have different IDs of the user who owns it, but the same DisplayName of the user who owns the post?

0
7

You are looking for the attribute owneruserid. That holds the id of the user that can be found in the Users.xml, or -1 if it is owned by the community user, or empty / non-existing if the user has been deleted.

The Displayname for users don't need to be unique. There are lots of users named Andy, John or Tim.

The PostTypeid will determine what the type of a post is. There are a few but 1 indicates a question and 2 indicates an answer.

See also:

Database schema documentation for the public data dump and SEDE

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .