[Developers] mjt script to display any topic with a specified date

Jack Alves jack at metaweb.com
Tue Mar 27 19:27:04 UTC 2007


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. 





More information about the Developers mailing list