[Developers] Searching for missing data

John Giannandrea jg at metaweb.com
Thu Dec 13 03:58:05 UTC 2007


Daniel Renfer wrote:
> I have been looking for a way to do this, and have so far been  
> unsuccessful. Is there any way to do a search for topics of a given  
> type that do not have anything set for a given property? For  
> instance: The list of People that do not have a Gender property.

yes, you can use the (under documented) forbidden feature to do  
something like this:

   "query" : [
     {
       "gender" : {
         "id" : null,
         "optional" : "forbidden"
       },
       "id" : null,
       "name" : null,
       "type" : "/people/person"
     }
   ]

counting also works, like this:

  "query" : [
     {
       "id" : null,
       "name" : null,
       "parents" : {
         "optional" : true,
         "return" : "count"
       },
       "type" : "/people/person"
     }

unfortunately you cant currently sort on the count or constrain it  
further.

-jg







More information about the Developers mailing list