首页 > 解决方案 > StackExchange API 标签同义词返回 Stack Overflow 上不存在的标签

问题描述

我正在尝试为 Stack Overflow 标签构建一个类似于分类的关系图。我提取了所有标签和近 37000 个这些 wiki。在根据 wiki 确定关系之前,我决定先看看 Stack Overflow/tags/{tag}/synonyms提供的内容。结果中的一些from_tags 不是 Stack Overflow 中的实际标签。我想我可能错过了我的数据集中的那些。因此尝试使用 搜索那些,/tags/{tag}/info但它返回了 的信息to_tag

例如:

{
  "creation_date": 1377674210,
  "last_applied_date": 1602368899,
  "applied_count": 1172,
  "to_tag": "java",
  "from_tag": "jre"
}

tags/java/synonyms端点的结果之一。但是,没有标签。如果搜索/tag/jre/info我会得到 Java 的信息。

我对这种行为感到困惑。如何tags/java/synonyms获取不是 Stack Overflow 标签的标签?

标签: resultsetstackexchange-api

解决方案


The API results are correct. As you can see here, exists and was synonymised and merged with Java. In addition, https://stackoverflow.com/questions/tagged/jre redirects to https://stackoverflow.com/questions/tagged/java (the page doesn't return a 404!). Apparently, you can only find tags that have been synonymised via the /tags/{tag}/synonyms. Thus, this route is not that useful for your task.

For more information, see: What are tag synonyms and merged tags? How do they work?


推荐阅读