[Developers] List Of Properties
Kendra Kuhl
kendra.kuhl at juggle.com
Sun Jul 6 22:14:36 UTC 2008
I need some advice on the best way to do something. What I have isn't
working for me anymore.
A while ago I had asked for a way to get all the properties associated to a
topic and Alexander was nice enough to give me this query:
{
"query" : [
{
"master_property" : null,
"source" : {
"id" : "topicId"
},
"target" : {
"id" : null
},
"target_value" : null,
"type" : "/type/link"
}
]
}
So, I modified it a bit to look like this:
{
"query" : [
{
"master_property" : null,
"source" : {
"id" : null,
"guid" : null,
"name" : "Something"
},
"target_value" : null,
"type" : "/type/link"
}
]
}
That worked out quite nicely until I started messing around with locations
(and I'm sure locations aren't unique in this regard). But, if you send that
query to freebase with Kansas as the name, you wind up getting back 2700
properties. Most of them "/location/location/contains" but still, 2700. It
takes forever if it doesn't time out on me. (Even if I send in the exact
guid, I still wind up with 2400 properties - 2300 of which are the
/location/location/contains.).
What I do with those properties is loop through them, filter out anything
that starts with /guid, /type, /user as well as any duplicates and create
another query to get the values for those properties.
So, my question is this: given what I'm trying to accomplish, is there an
easier way to go about it? Is there a way to get the properties for the
topic, without duplicates, without /type, /guid, /user so I can then query
to get the information I really want about the topic? I don't really want to
hard code all the properties I want to go after for each and every type. I
know I could use cursors to "page" through the data, but that would still
take forever and I'm trying to make it as fast as possible.
Thanks,
Kendra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freebase.com/pipermail/developers/attachments/20080706/69600c4a/attachment.htm
More information about the Developers
mailing list