Test query e

From Wikisphere
Revision as of 08:27, 29 April 2025 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
{{#visualdataquery:[[name::Afghanistan]]   [[states/name::Badakhshan]] [[states/cities/name::A~]][[states/cities/restaurants/name::bbb]]    
|schema=Country
|?states/cities/name
|?states/cities/latitude
|format=json
|hierarchical-conditions=true
|pagetitle-name=article 
}}

SELECT t0.page_id AS `page_id`,GROUP_CONCAT(t0.value SEPARATOR 0x1E) AS `c0`,GROUP_CONCAT(t1.value SEPARATOR 0x1E) AS `c1`,GROUP_CONCAT(t2.path SEPARATOR 0x1E) AS `p2`,GROUP_CONCAT(t2.value SEPARATOR 0x1E) AS `c2`,GROUP_CONCAT(t3.path SEPARATOR 0x1E) AS `p3`,GROUP_CONCAT(t3.value SEPARATOR 0x1E) AS `c3` FROM (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'name' ) `t0` LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/name' ) `t1` ON (((t1.page_id=t0.page_id))) LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/cities/name' ) `t2` ON (((t2.page_id=t0.page_id) AND (LOCATE( t1.path_parent, t2.path_parent ) = 1))) LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_numeric` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/cities/latitude' ) `t3` ON (((t3.page_id=t0.page_id) AND (t2.path_parent = t3.path_parent))) JOIN `page` `page_alias` ON ((page_alias.page_id = t0.page_id)) WHERE t0.schema_id = '3' AND ((t0.value = 'Afghanistan')) AND ((t1.value = 'Badakhshan')) GROUP BY t0.page_id HAVING ((c2 LIKE 'A%' ESCAPE '`')) LIMIT 100

title"Data:Countries/Afghanistan"
pageid710
data
states
cities
name"Ashkāsham"
latitude36.68333
name"Fayzabad"
latitude37.11664
name"Jurm"
latitude36.86477
name"Khandūd"
latitude36.95127
name"Rāghistān"
latitude37.66079
name"Wākhān"
latitude37.0571