[Developers] mjt script to display any topic with a specified date
Nick Thompson
nix at metaweb.com
Tue Mar 27 21:59:16 UTC 2007
you can do this by wrapping the mjt.task inside a mjt.def. when you invoke
the function created by mjt.def, it will fire off the subquery. so you
can't put the mjt.task inside a mjt.for loop, but if you put the task
inside a mjt.def and call that function inside your for loop, it should
do the right thing.
i don't have good examples or documentation of this on mjtemplate.org yet,
but i've used it quite a bit.
nick
Jack Alves wrote:
> I want to get all properties that use a datetime then for each property get
> instances in a specified date range. What is the best way to accomplish what
> I want to do? I am writing a mjt script. I initially thought I would get the
> list of properties with datetime then iterate doing queries for each type
> that has a datetime property.
>
> I figured out how to get all properties that use datetime,
>
> <div mjt.task="q1">
> mjt.mqlread([{
> "properties":[{
> "expected_type":"/type/datetime",
> "name":null,
> "schema":{
> "/freebase/type_profile/instance_count":null,
> "name":null
> }
> }],
> "sort":"-properties.schema./freebase/type_profile/instance_count",
> "limit": 75,
> "type":"/type/type"
> }])
> </div>
>
>
> and I know how to get instances with values in a specific date range,
>
> <div mjt.task="q2">
> mjt.mqlread([{
> "date_of_birth":[{
> "value":null,
> "value<":"1959-01-01",
> "value>":"1957-12-31"
> }],
> "name":null,
> "type":"/people/person"
> }])
> </div>
>
>
> I don't know how or if I can do the second query in a mjt.for loop. I
> noticed the mjt documentation says, "mjt.task= is very special and doesn't
> combine with any other attributes,".
> http://www.mjtemplate.org/tour/intro.html#combining-mjt-attributes.
>
>
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
More information about the Developers
mailing list