[Developers] improved topic query
Warren Harris
warren at metaweb.com
Wed Jul 9 22:02:19 UTC 2008
Here's an improved version of the topic query I sent out earlier today:
- annotation (prefixes) for roles the various properties play
(hopefully this will make the result a little easier to grock)
- most of the schema for cvt properties moved into cvt:properties
field (only the key(s) remain under the data's link master_property to
serve as back-pointers to the schema
- more optional declarations here and there (I was missing some results)
- limits removed (add at your own risk/leisure)
To use this, you have to substitute the 6 occurrences of the topic id
("/guid/9202a8c04000641f80000000002eb15e" below = the movie "Hard
Eight" -- any guid/key/id will do!). You can also restrict the types
of interest by replacing "id":null on the 4th line with "id|=":["/
award/award_winning_work","/fictional_universe/work_of_fiction"], for
example.
Enjoy (as I go nurse my headache), :-)
Warren
{
"id":"/guid/9202a8c04000641f80000000002eb15e",
"type":[{
"id":null,
"name":null,
"guid":null,
"properties":[{
"optional":true,
"id":null, "name":null, "guid":null,
"index" : null, "sort":"index",
"expected_type":{
"id": null, "name":null, "guid":null,
"cvt:properties":[{
"cvt_to_topic_key:id":null, "name":null,
"index" : null, "sort":"index",
"expected_type":null,
"/freebase/property_hints/disambiguator":true,
"topic_to_cvt_key:reverse_property": null,
"optional":true
}]
},
"o:links":[{
"source": {"id": "/guid/
9202a8c04000641f80000000002eb15e","limit":0},
"target_value":null,
"target":{
"id":null, "guid":null, "name":null,
"cvt_links:/type/reflect/any_master":[{
"name":null, "id":null, "guid":null,
"link":{"master_property":{
"/freebase/property_hints/
disambiguator":true,
"target_cvt_to_topic_key:id":null,
"topic_to_target_cvt_key:reverse_property": null},
"target": {"id": "/guid/
9202a8c04000641f80000000002eb15e","optional":"forbidden"}},
"optional":true
}],
"cvt_values:/type/reflect/any_value":[{
"value":null, "type":null,
"link":{"master_property":{
"/freebase/property_hints/
disambiguator":true,
"target_cvt_to_value_key:id":null},
"target": {"id": "/guid/
9202a8c04000641f80000000002eb15e","optional":"forbidden"}},
"optional":true
}],
"optional":true
},
"optional":true
}],
"master_property":{
"id":null, "name":null, "guid":null,
"i:links":[{
"target": {"id": "/guid/
9202a8c04000641f80000000002eb15e","limit":0},
"target_value":null,
"source":{
"name":null, "id":null, "guid":null,
"cvt_links:/type/reflect/any_master":[{
"name":null, "id":null, "guid":null,
"link":{"master_property":{
"/freebase/property_hints/
disambiguator":true,
"source_cvt_to_topic_key:id":null,
"topic_to_source_cvt_key:reverse_property": null},
"target": {"id": "/guid/
9202a8c04000641f80000000002eb15e","optional":"forbidden"}},
"optional":true
}],
"cvt_values:/type/reflect/any_value":[{
"value":null, "type":null,
"link":{"master_property":{
"/freebase/property_hints/
disambiguator":true,
"source_cvt_to_value_key:id":null,
"value_to_source_cvt_key:reverse_property": null}},
"optional":true
}],
"optional":true
},
"optional":true
}],
"optional":true
}
}]
}]
}
On Jul 9, 2008, at 12:23 PM, Jason Douglas wrote:
> On Jul 9, 2008, at 10:37 AM, Warren Harris wrote:
>
>> It occurred to me that you can get the schema information for cvt
>> properties with this all-in-one query at the same time you get
>> everything else (whether or not the object in question has values
>> for those properties) by requesting more from the expected_type
>> clauses. Unfortunately, this means your application has to look in 2
>> places in the result to know what/how to display -- first in the
>> property's expected_type's properties (for cvt schema), and then in
>> the property's links' target's any_master/any_value for whether or
>> not there are values of these cvt properties (yeah... don't try this
>> at home):
>
>
> That's what I was looking for, thanks! In some ways it's actually
> better to have the property metadata separate -- i.e., build a table
> header separately from the rows.
>
> -jason
>
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3739 bytes
Desc: not available
Url : http://lists.freebase.com/pipermail/developers/attachments/20080709/ec625429/attachment-0001.bin
More information about the Developers
mailing list