Getting readable results from Wikidata

前端 未结 3 1955
我寻月下人不归
我寻月下人不归 2020-12-05 12:05

Ok so I\'m trying to get information from Wikidata about movies, take this movie for example: https://www.wikidata.org/wiki/Q24871

On the page the data is clearly di

3条回答
  •  伪装坚强ぢ
    2020-12-05 12:24

    I see an accepted answer, but initially interpreted the question differently. Basically asking to have the same output in JSON one sees on the Wikidata item page.

    SPARQL query with JSON output for above case: https://query.wikidata.org/sparql?query=SELECT%20%3FwdLabel%20%3Fps_Label%20%3FwdpqLabel%20%3Fpq_Label%20%7B%0A%20%20VALUES%20(%3Fcompany)%20%7B(wd%3AQ24871)%7D%0A%0A%20%20%3Fcompany%20%3Fp%20%3Fstatement%20.%0A%20%20%3Fstatement%20%3Fps%20%3Fps_%20.%0A%0A%20%20%3Fwd%20wikibase%3Aclaim%20%3Fp.%0A%20%20%3Fwd%20wikibase%3AstatementProperty%20%3Fps.%0A%0A%20%20OPTIONAL%20%7B%0A%20%20%3Fstatement%20%3Fpq%20%3Fpq_%20.%0A%20%20%3Fwdpq%20wikibase%3Aqualifier%20%3Fpq%20.%0A%20%20%7D%0A%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20%7D%0A%7D&format=json

    I use the Wikidata Query Front End to get my query straight and to check the results. Then use the Code button... explaining why you're seeing so much unnecessary whitespace above.

    See also:

    • wikidata get all properties with labels and values of an item
    • SPARQL query service - Interfacing

提交回复
热议问题