Pregunta

I want to query all recipients of the Nobel Peace Prize and the date (year) from Freebase. I looked at the site, which shows me all winners, but if I do the query here, I do only get "null" results!

What I have so far: [{ "id": "/m/05f3q", "/award/award_category/winners": [] }]

¿Fue útil?

Solución

If you look at the schema for the information that you're trying to query, you can see that what you are getting back is actually an Award Honor object which has a schema like this. It's got a bunch of different properties, but it doesn't have any meaningful name which is why it's coming back as null.

Try something more along the lines of the below (add additional properties as needed):

[{
  "type": "/award/award_honor",
  "award": {
    "id": "/m/05f3q"
  },
  "award_winner": [{
    "id": null,
    "name": null
  }],
  "year": null
}]

Otros consejos

[{
  "id": "/en/nobel_prize_in_economics",
  "/award/award_category/winners": [{
    "/award/award_honor/award_winner": [],
    "/award/award_honor/year": null,
    "/award/award_honor/award": null,
    "/award/award_honor/honored_for": []
  }]
}]

I cannot do it in just one call, so I do the same for "/en/nobel_prize_in_physiology_or_medicine", "/en/nobel_prize_in_chemistry", "/en/nobel_peace_prize", "/en/nobel_prize_in_literature".

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top