tags:

views:

63

answers:

2

Can get all triples with value null in specific field? All people with date_of_birth equal null?

[
  "type": "/people/person",  
  "date_of_birth":null,
  "name":null
]
+2  A: 

You need to use "optional":"forbidden" directive:

[{
  "type": "/people/person",
  "date_of_birth": {
    "value":    null,
    "optional": "forbidden"
  },
  "name": null,
  "id":   null
}]​

(I added "id":null so that the Query Editor gives clickable links)

Note that query has a default "limit":100, if you want more results then add an explicit limit clause. If that times out, then you'll need to use a MQL cursor.

Will Moffat
+1  A: 

If you need to deal with lots of results, the undocumented envelope parameter "page" provides more flexibility than "cursor", allowing you to move forward, back, or access a page at random, as opposed to just going forward like you can with the cursor.

The "optional": "forbidden" clause is the key to lots of useful queries. The "!everything" == "nothing" equivalency is just one of the most common ones.

Tom

Tom Morris