5

How can I query the Stack Exchange Data Explorer for tags I've created?

1
  • You can't...I don't think.
    – jjnguy
    Nov 9, 2010 at 17:20

4 Answers 4

5

This is not possible. The public data dump includes only some of the information the team keeps track of, and tag authorship is one of the private fields.

2
  • 1
    So I can't see how many posts more tagged by a tag I created is needed to get Taxonomist badge, right? Nov 9, 2010 at 17:29
  • @abatishchev, sadly, that is correct. At least until you can somehow remember which tags you've created.
    – Pops
    Dec 3, 2010 at 15:05
4

The best I could do is to query The tags where the oldest question with this tag was created by given user, but the tags created by retags are not counted here. You would have to go through all the revisions (these are in the tables) and find out in which revision the tag was created. Pretty complex thing to do.

2
  • I tried... timeout error. Feb 12, 2019 at 1:52
  • Oh, now it works. Feb 12, 2019 at 1:54
3

Now that SEDE exposes the PostHistory table, it is technically possible to get this information.*

That being said, it may be a somewhat difficult query to construct because you'll have to parse the tags field -- the PostTags table can't be relied upon because that's only the current state of the tags for each post.

* Well, a very good approximation anyway. If you created a tag, and then edited it out within the 5 minute grace period, the result you get for that tag will be incorrect, because it won't show up in the original PostHistory entry. The correct information is kept in the database, but isn't currently exposed through the Data Dump.

2

The following query looks into the PostHistory table and searches for the oldest occurrence of the tag. This query runs without problems on a smaller site, such as Mathematics. However, on SO I got timeout on this query. Here is a modified query which returns at least some results on SO - although it runs for a long time, too. (I will also mention that various other tag-related queries can be found in the Tagging chatroom on Mathematics.)

Interestingly, for you the above query did not return the tag for which you have the Taxonomist badge and the tag-info says it was created in 2012. SEDE actually returns also some older occurrences of the tag. Maybe som other tags was merged into this tag?

I will add that the above query looks at the actual text of the revision, so it returns also tags which no longer exist - since they have been deleted. (For example, a tag which was created just as a typo will be listed, too.)

Still, this cannot be considered perfectly reliable - for example, the oldest question with some tag might have been deleted in the meantime. And moderators occasionally merge tags - this action changes the tags shown in the revision history.

3
  • Do know that PostsWithDeleted does have the tags field populated for deleted posts.
    – rene
    Dec 26, 2020 at 14:55
  • As for the tag creation date: I assume the tags table in the production db does have a "creationdate". When a tag gets removed from the system due to it having 0 posts, its row will actually be deleted from the tags table. When the tag is later recreated, a new record wil be inserted, with the currentdate in creationdate. In other words: The tags table doesn't hold history or at least doesn't bother about it.
    – rene
    Dec 26, 2020 at 15:04
  • 1
    @rene Yes, I am aware that I can check deleted posts with (bit-fields). However, the above queries look also at the PostHistory table to find who added the first occurrence of the tag - this is not available for deleted posts. Concerning removal and recreation, you can see that there is a post which show (bit-fields) in the revision from 2008 and no tag edits in the subsequent revisions: stackoverflow.com/posts/282019/revisions
    – Martin
    Dec 26, 2020 at 15:14

You must log in to answer this question.

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