Freebase MQL query issues -
below query code.. trying put several types 1 query build set of data off of...but query not work php, work inside of query editor on freebase.com
<?php function getquery($type,$id=null){ //leaves off closing can return , append end of following... $query = "[{ \"type\":\"$type\", \"limit\":10, \"id\":null, \"name\":null,"; return $query; } function getsportsteamsstructure(){ $query = "\"/sports/sports_team/sport\":null,"; $query .="\"/sports/sports_team/league\":[{\"team\":null,\"league\":null,\"from\":null,\"to\":null}],"; $query .="\"/sports/sports_team/location\":[{".getlocationstructure()."}],"; $query .="\"/sports/sports_team/founded\":null,"; $query .="\"/sports/sports_team/arena_stadium\":[{".getarchitecturestructure()."}],"; $query .="\"/sports/sports_team/colors\":[{}],"; $query .="\"/sports/sports_team/team_mascot\":[{}],"; $query .="\"/sports/sports_team/championships\":[{}],"; $query .="\"/sports/sports_team/fight_song\":[{}],"; $query .="\"/sports/sports_team/roster\":[{\"position\":[{}],\"team\":[{}],\"number\":[],\"from\":null,\"to\":null}],"; $query .="\"/sports/sports_team/coaches\":[{\"position\":[{}],\"from\":null,\"to\":null,\"team\":[{}],\"coach\":[{}]}]"; return $query; } function getpeoplepersonstructure(){ $query = ''; $query .= "\"/people/person/date_of_birth\":null,"; $query .="\"/people/person/place_of_birth\":null,"; $query .="\"/people/person/nationality\":null,"; $query .="\"/people/person/gender\":null,"; $query .="\"/people/person/profession\":[{}],"; $query .="\"/people/person/religion\":[{}],"; $query .="\"/people/person/ethnicity\":[{}],"; $query .="\"/people/person/parents\":[{}],"; $query .="\"/people/person/children\":[{}],"; $query .="\"/people/person/sibling_s\":[{}],"; $query .="\"/people/person/spouse_s\":[{}],"; $query .="\"/people/person/height_meters\":null,"; $query .="\"/people/person/weight_kg\":null,"; $query .="\"/people/person/education\":[{}],"; $query .="\"/people/person/age\":[{}],"; $query .="\"/people/person/notable_professions\":[{}],"; $query .="\"/people/person/languages\":[{}]"; return $query; } function getcommontopicstructure(){ $query = ''; $query .="\"/common/topic/image\":[{}],"; $query .="\"/common/topic/article\":[{}],"; $query .="\"/common/topic/notable_for\":[],"; $query .="\"/common/topic/notable_types\":[],"; $query .="\"/common/topic/alias\":[],"; $query .="\"/common/topic/description\":[],"; $query .="\"/common/topic/official_website\":[],"; $query .="\"/common/topic/topic_equivalent_webpage\":[],"; $query .="\"/common/topic/subjects\":[],"; $query .="\"/common/topic/subject_of\":[],"; $query .="\"/common/topic/weblink\":[],"; $query .="\"/common/topic/social_media_presence\":[{}]"; return $query; } function getarchitecturestructure(){ $query = ''; $query = "\"/architecture/structure/architect\":[{".getpeoplepersonstructure()."}],"; $query = "\"/architecture/structure/architectural_style\":[],"; $query .="\"/architecture/structure/owner\":[{}],"; $query .="\"/architecture/structure/architecture_firm\":[{}],"; $query .="\"/architecture/structure/height_meters\":null,"; $query .="\"/architecture/structure/construction_cost\":null,"; $query .="\"/architecture/structure/destruction_date\":null,"; $query .="\"/architecture/structure/destroyed_by\":null,"; $query = "\"/architecture/structure/address\":[{".getmailingaddressstructure()."}],"; $query .="\"/architecture/venue/capacity\":null"; return $query; } function getlocationstructure(){ $query = ''; $query .= "\"/location/location/geolocation\":[{\"id\":null,\"longitude\":null,\"latitude\":null,\"daturn\":null,\"elevation\":null}],"; $query .= "\"/location/location/contains\":[{}],"; $query .="\"/location/location/containedby\":[{}],"; $query .="\"/location/location/adjoin_s\":[{}],"; $query .= "\"/location/location/area\":null,"; $query .="\"/location/location/time_zones\":[{}],"; $query .= "\"/location/location/people_born_here\":[{}],"; $query .= "\"/location/location/events\":[{}],"; $query .="\"/location/location/nearby_airports\":[{}],"; $query .="\"/location/location/near\":[{}],"; $query .="\"/location/location/street_address\":{{".getmailingaddressstructure()."}],"; return $query; } function getmailingaddressstructure(){ $query = ''; $query = "\"street_address\":null,\"street_address_2\":null,\"citytown\":null,\"state_province_region\":null,\"postal_code\":null,\"country\":null"; return $query; } ?>
Comments
Post a Comment