7

I apologize for the influx of data explorer questions, lately. (This time though, I have a feeling I'm more confused about how suggested edits work in general, rather than the uploaded data itself.)

First, there's the Votes table, in which ApproveEditSuggestion votes appear to be up-to-date:

SELECT TOP 30
  PostId AS [Post Link],
  CreationDate
FROM Votes
WHERE VoteTypeId = 16 -- ApproveEditSuggestion
ORDER BY CreationDate DESC

enter image description here

And here's a query that counts the number of ApproveEditSuggestion votes per day:

SELECT TOP 30
  CreationDate as Date,
  MAX(Count(*)) OVER(PARTITION BY CreationDate) as [ApproveEditSuggestion Votes]
FROM Votes
WHERE VoteTypeId = 16 -- ApproveEditSuggestion
GROUP BY CreationDate
ORDER BY CreationDate DESC

enter image description here

Okay, fine. But then, what's SuggestedEditVotes for? This table appears to be up-to-date too:

SELECT TOP 30
  e.PostId AS [Post Link],
  e.CreationDate as [Edit Suggested On],
  v.CreationDate as [Suggested Edit Voted On],
  v.VoteTypeId
FROM SuggestedEditVotes as v
INNER JOIN SuggestedEdits as e ON e.Id = v.SuggestedEditId
ORDER BY v.CreationDate DESC

enter image description here

It was my understanding that suggested edits are either approved or rejected. I can see how the latter table, SuggestedEditVotes, might store these approvals and rejections via VoteTypeId 2 (UpMod) and 3 (DownMod). But then, what do the Votes records represent? A different kind of approval?

  • 1
    IIUC ApproveEditSuggestion is for whole bunch of approved suggested edit. While SuggestedEditVotes give us individual vote on any suggested edit. For e.g. There can be only single entry for single suggested edit on Votes table while in SuggestedEditVotes table the number of entry for a single suggested edit can be (up to) five (e.g. 3 approved 2 rejected). – hims056 Nov 25 '13 at 5:44
2

Data Explorer contains Stack Exchange data that has been mapped via a migration script into the publicly consumable format that you see, so when the underlying data changes there can sometimes be information lost in translation when the migration script isn't updated to specifically account for the changes.

I highly suspect that's what happened here, as the ApproveEditSuggestion vote type is most likely used internally to track reputation changes associated with a user getting their suggested edit approved. Assuming that's the case, the UserId in the Votes table should probably be populated with the suggested edit author's user ID for those records since that vote type isn't one that's cast so much as it's one awarded internally to a given user.

That leaves the SuggestedEditVotes table, which is pretty much just what it says - votes on suggested edits, i.e. the reviewer decisions, which have individual approve/reject votes recorded as you suspected. The actual outcome of the suggested edit is recorded in the SuggestedEdits table, and is determined by the population of the ApprovalDate or RejectionDate fields.

Given this, the ApproveEditSuggestion vote mores directly correspond to

SELECT *
FROM SuggestedEdits
WHERE ApprovalDate IS NOT NULL and OwnerUserId IS NOT NULL
  • Sorry for the late accept! Thanks for the clarification, as well as the corresponding query. – Andrew Cheong Dec 8 '13 at 21:40

You must log in to answer this question.

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