0

Weird JSON itempath problem

I'm trying to use data from freebase.com to get geographical information from artists. However, I am having problems trying to isolate a specific attribute using the itemPath property. I think there might be a small error in the JSON file, but PHP seems to be able to traverse JQL's results correctly. When I start with the following code, everything looks fine:

CODE
select * from json where url="http://www.freebase.com/experimental/topic/standard/en/radiohead" and itemPath = "json.result.properties"


However, when I try to isolate the _music_artist_origin attribute i'm having troubles; using PHP everything goes right when I use this path:

CODE
$data->query->results->properties->_music_artist_origin->values->text);


I do think that it's odd that I'm basically isolating the "properties" attribute twice here; once in the YQL query, and once in the PHP code.
Translating that path to YQL however, I end up getting only the "_award_award_nominee_award_nominations" attribute.

CODE
select * from json where url="http://www.freebase.com/experimental/topic/standard/en/radiohead" and itemPath = "json.result.properties.properties._music_artist_origin.values.text"


The weird thing is that it doesn't seem to matter what I put behind the second properties attribute in the path, its still the "_award_award_nominee_award_nominations" attribute. That is not the intention of course.

So my question is twofold: Is this a bug in the JSON file or YQL? and is it still possible for me to isolate the "_music_artist_origin"?

Regards,
Marco

by
0 Replies

Recent Posts

in YQL