tags:

views:

13

answers:

1

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": [{
        "id":   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.

+2  A: 

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

Will Moffat