[Developers] Problem with event query
Christopher R. Maden
crism at metaweb.com
Wed Mar 11 17:21:54 UTC 2009
Thimon Sistermans wrote:
> I just discovered freebase and I love it:) Great work!
(-:
> Im trying to get the names of the documents with the type
> "/military/military_conflict" and "/time/event" within a start and
> end date.
> I only want the documents without the "included_in_event" property. Or
> when it has a "included_in_event" property, the document attached to
> the event may not be of the same type (/military/military_conflict in
> my example).
>
> Below query dousnt seem to do the trick.
>
> Can someone help me fix this query?
Your query matches military conflicts such that there is an including
event which is not a military conflict.
You want military conflicts such that there are no including events
which are military conflicts.
The way to do that is with the optional:forbidden directive.
[
{
"/time/event/end_date" : null,
"/time/event/end_date<=" : "1948",
"/time/event/included_in_event" : [
{
"optional" : "forbidden",
"type" : "/military/military_conflict"
}
],
"/time/event/start_date" : null,
"/time/event/start_date>=" : "1937",
"a:type" : "/military/military_conflict",
"b:type" : "/time/event",
"limit" : 1000,
"name" : null,
"sort" : "name"
}
]
HTH,
Chris
--
Christopher R. Maden
Data Architect
Freebase.com: <URL: http://www.freebase.com/ >
Metaweb Technologies, Inc. <URL: http://www.metaweb.com/ >
More information about the Developers
mailing list