Freebase MQL Test for Not True
I have a simple script that retrieves all of the Freebase types within a domain. Now I want to filter out the CVT types, but I can't figure out how to write that test. If I write it the way that seems most obvious:
<acre:script>
var q_categories = [{
"id": null,
"name": null,
"sort": "name",
"type": '/freebase/domain_category',
"domains": [{
"id": null,
"name": null,
"sort": "name",
"!/type/type/domain": [{
"i开发者_JS百科d": null,
"name": null,
"sort": "name",
"/freebase/type_hints/mediator!=": true
}],
}]
}];
var categories = acre.freebase.mqlread( q_categories ).result;
</acre:script>
I get an error:
JS exception: acre.freebase.Error: /api/status/error: Can't use comparison operators on boolean values
I'm guessing that this may be a use case for the "optional": "forbidden"
directive, but I'm not sure how to structure the syntax even if my guess is correct.
Any nudge in the right direction would be much appreciated.
This should work:
"/freebase/type_hints/mediator": {
"optional": "forbidden",
"value": true
}
P.S. I suggest working in the Query Editor when you're trying to develop a query. Here's a working example of the query using optional:forbidden. http://tinyurl.com/2co63sy
精彩评论