How to get list of statements for a given Wikidata ID?

拜拜、爱过 提交于 2019-12-05 09:29:42

The information you want is in your query, except it's hard to decode. For example, this:

"P246": [
          {
            "id": "q568$E47B8CE7-C91D-484A-9DA4-6153F132997D",
            "mainsnak": {
              "snaktype": "value",
              "property": "P246",
              "datatype": "string",
              "datavalue": {
                "value": "Li",
                "type": "string"
              }
            },
            "type": "statement",
            "rank": "normal",
            "references": …
          }
        ]

means that the “element symbol” (property P246) is “Li”. So, you will need to read all the properties from your query and then find out the name for each of the properties you found.

To get just the statements, you could also use action=wbgetclaims, but it's in the same format as above.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!