0

I am trying to query freebase to get all the award winning movies that a person directed or acted in. If I run this with Steven Spielberg (who has both directed AND acted in award winning movies), it works fine:

[{
  "/type/object/mid": "/m/06pj8",
  "/film/director/film": [{
    "type": "/award/award_winning_work",
    "name": null
  }],
  "/film/actor/film": [{
    "film": [{
      "type": "/award/award_winning_work",
      "name": null
    }]
  }]
}]

But the same query with Matt Damon (/m/0169dl) (who has not directed award winning movies but acts in those movies) returns nothing. I would expect to return all the movies Matt Damon acted in, in this case.

thanks

jamborta
  • 5,130
  • 6
  • 35
  • 55

1 Answers1

2

You can't do this in a single query without a little bit of post-processing, but adding optional:true to the subqueries will get you close

[{
  "/type/object/mid": "/m/06pj8",
  "/film/director/film": [{
    "type": "/award/award_winning_work",
    "name": null,
    "optional": true
  }],
  "/film/actor/film": [{
    "film": [{
      "type": "/award/award_winning_work",
      "name": null,
      "optional": true
    }]
  }]
}]
Tom Morris
  • 10,490
  • 32
  • 53
  • brilliant! exactly what I was looking for. just wondering if you know why it does not return anything by default? is that the expected behavior? – jamborta Jun 07 '13 at 08:59
  • 1
    The default is equivalent to optional:false and all filters are ANDed together, so any topics which don't match both subqueries by having award winning works will fail to meet the criteria. – Tom Morris Jun 07 '13 at 22:19