Freebase MQL 过滤器的值!= null?
我正在尝试编写一个过滤掉空值的 MQL 查询。
我现在的查询(可以使用 MQL 查询编辑器 执行):
[
{
"/common/topic/image" : [
{
"id" : null
}
],
"article" : [
{
"content" : null
}
],
"name" : "bill gates",
"type" : "/common/topic"
}
]
我得到的结果:
[
{
"/common/topic/image" : [
{
"id" : "/guid/9202a8c04000641f8000000004fb4c01"
},
{
"id" : "/wikipedia/images/commons_id/4486276"
}
],
"article" : [
{
"content" : null
},
{
"content" : "/guid/9202a8c04000641f800000000903535d"
}
],
"name" : "Bill Gates",
"type" : "/common/topic"
}
]
我试图弄清楚如何在查询时过滤掉“article”数组中的“content”:null 匹配。 我浏览了 MQL 文档,但没有找到明确的方法来执行此操作。
I'm trying to write an MQL query that filters out null values.
The query I have now (can be executed using the MQL Query Editor):
[
{
"/common/topic/image" : [
{
"id" : null
}
],
"article" : [
{
"content" : null
}
],
"name" : "bill gates",
"type" : "/common/topic"
}
]
The results I am getting:
[
{
"/common/topic/image" : [
{
"id" : "/guid/9202a8c04000641f8000000004fb4c01"
},
{
"id" : "/wikipedia/images/commons_id/4486276"
}
],
"article" : [
{
"content" : null
},
{
"content" : "/guid/9202a8c04000641f800000000903535d"
}
],
"name" : "Bill Gates",
"type" : "/common/topic"
}
]
I'm trying to figure out how I can filter out the "content" : null match in the "article" array at query time. I looked through the MQL documentation but I didn't see a clear way to do this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要过滤掉没有分配任何内容的文章,您必须扩展内容 id 属性并将可选指令设置为 false。
这将为您提供以下结果:
有关使用可选指令的更多信息,请参阅文档此处。
To filter out articles that don't have any content assigned to them you'll have to expand the content id attribute and set the optional directive to false.
This will give you the following result:
For more information about using the optional directive see the documentation here.