[Developers] query for empty properties?
Kurt Bollacker
kurt at metaweb.com
Thu Aug 21 06:41:19 UTC 2008
On Thu, Aug 21, 2008 at 12:39:52AM -0400, Christopher R. Maden wrote:
> Jason Douglas wrote:
> > I want to get only the objects that don't have a specific property
> > filled in (expected type is an object). Is there a way to do that?
>
> "property":{"id":null,"optional":"forbidden"}
>
> should do it. No?
I take it back. I was oversimplifying the problem. Consider the
query:
[
{
"*" : null,
"/people/person/parents" : {
"id" : null,
"optional" : "forbidden"
},
"limit":1,
"type" : "/people/person"
}
]
which will return someone whose parents we do not know. However, I
will point out that this is not reliable because MQL is doing the
query-then-filtering as I mentioned you needed to do manually. For
example, the query:
[
{
"*" : null,
"/type/object/name" : {
"optional" : "forbidden",
"value" : null
},
"limit":1,
"type" : "/people/person"
}
]
is the same shape as the one above, but people without names are very
rare, so this query times out. So what I should have said is that the
only *reliable* way to find topics without a specific property is to
query (possibly with cursors), and then filter externally to MQL.
Kurt :-)
> ~Chris
> --
> Christopher R. Maden
> Data Architect
> Freebase.com: <URL: http://www.freebase.com/ >
> Metaweb Technologes, Inc. <URL: http://www.metaweb.com/ >
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
More information about the Developers
mailing list