[Developers] Limiting mql results by count
James Taylor
jame0taylor at gmail.com
Tue Apr 21 04:40:29 UTC 2009
hmmm... ok I'll give that a try. I also vote for constrain by count :)
Cheers,
-JT
On Mon, Apr 20, 2009 at 9:34 PM, Warren Harris <warren at metaweb.com> wrote:
> Interesting... we were just discussing at Metaweb today the need to
> constrain by count. I'm sorry to say that the only way to do this
> currently is to have mql return the counts and filter the results on
> the receiving end. For a large set of potential results, you could
> sorting the results by count, and then use a cursor (or the new "page"
> envelop parameter) to iterate through chunks of them until your
> maximum count is exceeded.
>
> Warren
>
>
> On Apr 20, 2009, at 7:18 PM, James Taylor wrote:
>
> > Hi,
> > I'm wondering if anyone knows how to limit results by properties
> > that return a specific number of results. For example, I want to
> > find all of the 'science_or_technology_company' topics that have
> > 0,1,or 2 'develops_treatments_for_disease' properties.
> >
> > Using the count directive, I'm able to find out how many such
> > properties exist for each topic:
> >
> > [
> > {
> > "/base/bioventurist/science_or_technology_company/
> > develops_treatments_for_disease" : [
> > {
> > "count" : null,
> > "name" : null
> > }
> > ],
> > "guid" : null,
> > "name" : null,
> > "type" : "/base/bioventurist/science_or_technology_company"
> > }
> > ]
> >
> > However, trying to use the count to limit results does not seem to
> > work:
> >
> > [
> > {
> > "/base/bioventurist/science_or_technology_company/
> > develops_treatments_for_disease" : [
> > {
> > "count" : 1,
> > "name" : null
> > }
> > ],
> > "guid" : null,
> > "name" : null,
> > "type" : "/base/bioventurist/science_or_technology_company"
> > }
> > ]
> >
> > Returns the error message: "message" : "'count' directive
> > must be null",
> >
> > Thanks in advance!
> > -JT
> > _______________________________________________
> > Developers mailing list
> > Developers at freebase.com
> > http://lists.freebase.com/mailman/listinfo/developers
>
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freebase.com/pipermail/developers/attachments/20090420/6962c8b4/attachment.htm
More information about the Developers
mailing list