Freebase MQL筛选器,其中值!=无效的

Freebase MQL筛选器,其中值!=无效的,freebase,mql,Freebase,Mql,我正在尝试编写一个MQL查询来过滤空值 我现在的查询(可以使用以下命令执行): 我得到的结果是: [ { "/common/topic/image" : [ { "id" : "/guid/9202a8c04000641f8000000004fb4c01" }, { "id" : "/wikipedia/images/commons_id/4486276" } ], "article" :

我正在尝试编写一个MQL查询来过滤空值

我现在的查询(可以使用以下命令执行):

我得到的结果是:

[
  {
    "/common/topic/image" : [
      {
        "id" : "/guid/9202a8c04000641f8000000004fb4c01"
      },
      {
        "id" : "/wikipedia/images/commons_id/4486276"
      }
    ],
    "article" : [
      {
        "content" : null
      },
      {
        "content" : "/guid/9202a8c04000641f800000000903535d"
      }
    ],
    "name" : "Bill Gates",
    "type" : "/common/topic"
  }
]

我试图找出如何在查询时过滤掉“content”:在“article”数组中的null匹配。我查看了MQL文档,但没有找到明确的方法。要筛选出未分配任何内容的文章,您必须展开content id属性并将可选指令设置为false

[
  {
    "/common/topic/image" : [
      {
        "id" : null
      }
    ],
    "article" : [
      {
        "content" : {
          "id" : null,
          "optional" : false
        }
      }
    ],
    "name" : "bill gates",
    "type" : "/common/topic"
  }
]
这将为您提供以下结果:

[
  {
    "/common/topic/image" : [
      {
        "id" : "/guid/9202a8c04000641f8000000004fb4c01"
      },
      {
        "id" : "/wikipedia/images/commons_id/4486276"
      }
    ],
    "article" : [
      {
        "content" : {
          "id" : "/guid/9202a8c04000641f800000000903535d"
        }
      }
    ],
    "name" : "Bill Gates",
    "type" : "/common/topic"
  }
]

有关使用可选指令的更多信息,请参阅文档。

您是谁以及如何了解MQL?;)哈哈,我只是Freebase社区的一名成员,已经在MQL黑客攻击了一年左右。我很高兴能够帮助人们学习诀窍,并希望有更多的开发人员使用Freebase数据构建应用程序。当我将可选标志切换为false时,它告诉我:“查询太难了。”
[
  {
    "/common/topic/image" : [
      {
        "id" : "/guid/9202a8c04000641f8000000004fb4c01"
      },
      {
        "id" : "/wikipedia/images/commons_id/4486276"
      }
    ],
    "article" : [
      {
        "content" : {
          "id" : "/guid/9202a8c04000641f800000000903535d"
        }
      }
    ],
    "name" : "Bill Gates",
    "type" : "/common/topic"
  }
]