FreeBase MQL filter, where is the value! = Null?

I am trying to write an MQL query that filters out null values.

Now I have a query (can be done using the MQL Query Editor ):

[ { "/common/topic/image" : [ { "id" : null } ], "article" : [ { "content" : null } ], "name" : "bill gates", "type" : "/common/topic" } ] 

The results that I get:

 [ { "/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 am trying to figure out how I can filter out the "content": null match in the "article" array during the request. I looked through the MQL documentation, but I did not see a clear way to do this.

+7
freebase mql
source share
1 answer

To filter out articles that do not have any content assigned to them, you will have to expand the content id attribute and set the optional directive to false.

 [ { "/common/topic/image" : [ { "id" : null } ], "article" : [ { "content" : { "id" : null, "optional" : false } } ], "name" : "bill gates", "type" : "/common/topic" } ] 

This will give you the following result:

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

For more information on using the additional directive, see the documentation here .

+10
source share

All Articles