维基百科和维基数据在 pageid 上不一致
Wikipedia and Wikidata don't agree on pageid
寻找 Le Havre Libre 的 pageid 我查询了维基数据并得到以下内容
https://www.wikidata.org/w/api.php?action=wbgetentities&format=json&titles=Le_Havre_libre&sites=enwiki|frwiki&origin=*
{
"entities": {
"-1": {
"site": "enwiki",
"title": "Le_Havre_libre",
"missing": ""
},
"Q3223483": {
"pageid": 3077366,
"ns": 0,
"title": "Q3223483",
"lastrevid": 480198576,
"modified": "2017-04-30T13:53:38Z",
"type": "item",
"id": "Q3223483",
"labels": {
"fr": {
"language": "fr",
"value": "Le Havre libre"
}
},
"descriptions": {},
"aliases": {
"fr": [
{
"language": "fr",
"value": "Havre Libre"
},
{
"language": "fr",
"value": "Le Havre Libre"
}
]
},
"claims": {
...
},
"sitelinks": {
"frwiki": {
"site": "frwiki",
"title": "Le Havre libre",
"badges": []
}
}
}
},
"success": 1
}
所以我认为 pageid
会是 3077366
然而 https://en.wikipedia.org/?curid=3077366 nor https://fr.wikipedia.org/?curid=3077366 都没有指向正确的页面!
根据维基百科,我知道实际的 pageid
是 1649668
。
这是怎么回事?
这是维基数据的页面id:https://www.wikidata.org/?curid=3077366
要获取 Wikipedia pageid,您需要知道 Wikipedia pageid API API https://fr.wikipedia.org/w/api.php?action=query&titles=Le%20Havre%20libre&format=json
这将为您提供维基百科页面 ID:
{"batchcomplete":"","query":{"pages":{"1649668":{"pageid":1649668,"ns":0,"title":"Le Havre libre"}}}}
寻找 Le Havre Libre 的 pageid 我查询了维基数据并得到以下内容
https://www.wikidata.org/w/api.php?action=wbgetentities&format=json&titles=Le_Havre_libre&sites=enwiki|frwiki&origin=*
{
"entities": {
"-1": {
"site": "enwiki",
"title": "Le_Havre_libre",
"missing": ""
},
"Q3223483": {
"pageid": 3077366,
"ns": 0,
"title": "Q3223483",
"lastrevid": 480198576,
"modified": "2017-04-30T13:53:38Z",
"type": "item",
"id": "Q3223483",
"labels": {
"fr": {
"language": "fr",
"value": "Le Havre libre"
}
},
"descriptions": {},
"aliases": {
"fr": [
{
"language": "fr",
"value": "Havre Libre"
},
{
"language": "fr",
"value": "Le Havre Libre"
}
]
},
"claims": {
...
},
"sitelinks": {
"frwiki": {
"site": "frwiki",
"title": "Le Havre libre",
"badges": []
}
}
}
},
"success": 1
}
所以我认为 pageid
会是 3077366
然而 https://en.wikipedia.org/?curid=3077366 nor https://fr.wikipedia.org/?curid=3077366 都没有指向正确的页面!
根据维基百科,我知道实际的 pageid
是 1649668
。
这是怎么回事?
这是维基数据的页面id:https://www.wikidata.org/?curid=3077366
要获取 Wikipedia pageid,您需要知道 Wikipedia pageid API API https://fr.wikipedia.org/w/api.php?action=query&titles=Le%20Havre%20libre&format=json
这将为您提供维基百科页面 ID:
{"batchcomplete":"","query":{"pages":{"1649668":{"pageid":1649668,"ns":0,"title":"Le Havre libre"}}}}