Freebase 查询 - 排除某些值
我想检索所有电影的名称及其类型。如果有关流派的信息为空也没关系,但如果流派已知,我想检索它。
"/film/film/genre": [{"id":null,"optional":"optional"}]
但我对同性恋色情不感兴趣,所以我想排除所有类型为“/en/gay_pornography”的电影。
"/film/film/genre": [{"id|=":["/en/gay_pornography"],"optional":"forbidden"}]
问题是,如何将其组合到一个查询中?即如何获取所有电影,即使是那些没有类型且排除 pr0n 的电影?
编辑:需要排除多种流派,例如/en/porngraphic_movie
I want to retrieve name of all movies and their genre. It's ok if information about genre is empty, but if genre is known I want to retrieve it.
"/film/film/genre": [{"id":null,"optional":"optional"}]
But I'm not interested in gay pornography, so I want to exclude all movies with genre "/en/gay_pornography".
"/film/film/genre": [{"id|=":["/en/gay_pornography"],"optional":"forbidden"}]
The problem is, how to combine it in one query? I.e. how to get all movies, even those with no genre and exclude pr0n?
Edit: it's required to exclude multiple genres, e.g. also /en/pornographic_movie
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你基本上就在那里:你只需要两个“流派”子句。 MQL 允许您通过在任何子句上允许任意前缀来实现此目的:
http://tinyurl.com/4449ufg
You're basically there: you just need two "genre" clauses. MQL lets you do this by allowing arbitrary prefixes on any clause:
http://tinyurl.com/4449ufg
使用 "but not" 运算符:
完整示例:http://tinyurl.com/3tjdb4j
编辑:这不能回答问题。它只是阻止该特定 ID 被列为电影的类型,但并不禁止该电影。 @phillip-kendal 的答案是正确的。
Use the "but not" operator:
Full example: http://tinyurl.com/3tjdb4j
Edit: This doesn't answer the question. It just prevents that particular id from being listed as a genre of the film but doesn't forbid the film. @phillip-kendal's answer is correct.