Difference between revisions of "Template:Card query"

From Yugipedia
Jump to: navigation, search
(fix $query_count when the query produces an error)
(support Cross Duel monsters sometimes having both Level and Rank)
 
(28 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
<templatestyles src="Template:Card query/styles.css" />
 
<!-- the actual query the user wants - at the top so we can do fun stuff auto-determining the needed medium/type
 
<!-- the actual query the user wants - at the top so we can do fun stuff auto-determining the needed medium/type
-->{{ #vardefine: $query_query | {{{1|}}}
+
-->{{ #vardefine: $cq_query | {{ #invoke: string | replace |{{{1|}}}|%s*::%s*|::|plain=false}}<!-- strip whitespace around :: -->
}}{{ #vardefine: $query_query_lc | {{ lc: {{ #var: $query_query }} }}
+
}}{{ #vardefine: $cq_query_lc | {{ lc: {{ #var: $cq_query }} }}
}}{{ #arraydefine: @check_query  | {{ #var: $query_query_lc }}
+
}}{{ #vardefine: $cq_query_normalized | {{ #replace: {{ #var: $cq_query_lc }} | <nowiki/> string:: | :: }}
}}{{ #vardefine: $query_medium | {{ #switch: {{ lc: {{{medium}}} }}
+
}}{{ #vardefine: $cq_query_normalized | {{ #invoke: string | replace |{{ #var: $cq_query_normalized }}|::([<>≤≥!+])|::^%1|plain=false}}<!-- fold comparators for easier matching -->
 +
}}{{ #vardefine: $cq_query_normalized | {{ #invoke: string | replace |{{ #var: $cq_query_normalized }}|::([^{{!}}%[%]]+){{!}}{{!}}|::^%1{{!}}{{!}}|plain=false}}<!-- detect || alternation -->
 +
}}{{ #vardefine: $cq_medium | {{ #switch: {{ #replace: {{ #replace: {{ #replace: {{ #replace: {{ lc: {{{medium}}} }} }} | - }} | ! }} | yugioh }}
 
   | ocg | tcg | ocg/tcg | tcg/ocg | official = official
 
   | ocg | tcg | ocg/tcg | tcg/ocg | official = official
   | anime = anime
+
  | ocgonly        = ocg-only
   | manga = manga
+
  | tcgonly        = tcg-only
   | nonofficial | non-official = non-official
+
  | rushduel      = rush duel
   | #default =  
+
   | anime         = anime
 +
   | animeonly      = anime-only
 +
  | manga          = manga
 +
  | mangaonly      = manga-only
 +
   | vg | videogame = {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | release:: }} || vg }}
 +
  | vgonly | videogameonly = vg-only
 +
  | dl | duellinks = duel links
 +
  | nonofficial    = non-official
 +
   | #default       = {{ #if: {{{medium|}}} | {{ #vardefine: $cq_medium_unknown | 1 }} }}
 
   }}
 
   }}
}}{{ #vardefine: $query_medium_query | {{ #switch: {{ #var: $query_medium }}
+
}}<!--
   | official = [[Class 1::Official]]
+
 
   | anime = [[Medium::Anime]]
+
also update the properties on [[Template:Card list]] when updating these
   | manga = [[Medium::Manga]]
+
 
   | non-official = <q>[[Medium::Anime]] OR [[Medium::Manga]]</q>
+
-->{{ #vardefine: $cq_medium_query | {{ #switch: {{ #var: $cq_medium }}
 +
   | official     = [[Concept:CG cards]]
 +
  | ocg-only    = [[Medium::OCG-only]]
 +
  | tcg-only    = [[Medium::TCG-only]]
 +
  | rush duel    = [[Concept:Rush Duel cards]]
 +
   | anime       = [[Concept:Anime cards]]
 +
  | anime-only  = [[Category:Anime cards with no OCG/TCG counterpart]]
 +
   | manga       = [[Concept:Manga cards]]
 +
  | manga-only  = [[Category:Manga cards with no OCG/TCG counterpart]]
 +
  | vg          = [[Concept:Video game cards]]
 +
  | vg-only      = [[Category:Video game cards with no OCG/TCG counterpart]]
 +
  | duel links  = [[Concept:Duel Links cards]]
 +
   | non-official = <q>[[Concept:Anime cards]] OR [[Concept:Manga cards]] OR [[Concept:Video game cards]]</q>
 
   }}
 
   }}
}}{{ #vardefine: $query_query_medium
+
}}{{ #vardefine: $cq_query_medium
 
   | {{ #if:
 
   | {{ #if:
       {{ #pos: {{ #var: $query_query_lc }} | official }}
+
       {{ #pos: {{ #var: $cq_query_lc }} | official }}
       {{ #pos: {{ #var: $query_query_lc }} | ::ocg }}
+
       {{ #pos: {{ #var: $cq_query_lc }} | ::ocg }}
       {{ #pos: {{ #var: $query_query_lc }} | ::tcg }}
+
       {{ #pos: {{ #var: $cq_query_lc }} | ::tcg }}
       {{ #pos: {{ #var: $query_query_lc }} | {{!!}}ocg }}
+
       {{ #pos: {{ #var: $cq_query_lc }} | {{!!}}ocg }}
       {{ #pos: {{ #var: $query_query_lc }} | {{!!}}tcg }}
+
       {{ #pos: {{ #var: $cq_query_lc }} | {{!!}}tcg }}
 
     | official
 
     | official
     | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | anime }}
+
     | {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | anime }}
       | anime
+
       | {{ #if: {{ #pos: {{ #var: $cq_query }} | Fairy Tale (anime) }} || anime }}
       | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | manga }}
+
       | {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | manga }}
 
         | manga
 
         | manga
 +
        | {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | video game }}
 +
                  {{ #pos: {{ #var: $cq_query_lc }} | ::vg }}
 +
          | vg
 +
        }}
 
       }}
 
       }}
 
     }}
 
     }}
 
   }}
 
   }}
}}{{ #if: {{ #var: $query_query_medium }}
+
}}{{ #vardefine: $cq_card_type | {{ #switch: {{ #replace: {{ #replace: {{ #replace: {{ lc: {{{type}}} }} }} | cards }} | card }}
  | {{ #vardefine: $query_medium_query }}
+
   | monster   = monster
}}{{ #vardefine: $query_card_type | {{ #switch: {{ #replace: {{ #replace: {{ lc: {{{type}}} }} | cards }} | card }}
+
   | spell     = spell
   | monster = monster
+
   | trap       = trap
   | spell = spell
 
   | trap = trap
 
 
   | speedspell = speed spell
 
   | speedspell = speed spell
   | virus = virus
+
   | skill      = skill
   | equip = equip
+
  | ???        = ???
   | illusion = illusion
+
  | character  = character
   | ritual = ritual
+
   | equip     = equip
 +
   | illusion   = illusion
 +
  | legendarydragon = legendary dragon
 +
   | ritual     = ritual
 +
  | slotmachinepowerunit = slot machine power unit
 +
  | trapmonster = trap monster
 
   | trap-spell | trapspell | spell-trap | spelltrap = trap spell
 
   | trap-spell | trapspell | spell-trap | spelltrap = trap spell
   | trap-equip | trapequip = trap-equip
+
   | virus      = virus
  | ??? = ???
 
 
   | spell/trap | s/t | nonmonster | non-monster = non-monster
 
   | spell/trap | s/t | nonmonster | non-monster = non-monster
   | #default =  
+
  | playable  = playable
 +
  | unplayable = unplayable
 +
  | nongame    = non-game
 +
  | command    = command
 +
  | checklist  = checklist
 +
  | faq        = faq
 +
  | rule      = rule
 +
  | strategy  = strategy
 +
  | ticket    = ticket
 +
  | tip        = tip
 +
  | all | any  = any
 +
   | #default   = {{ #if: {{{type|}}} | {{ #vardefine: $cq_card_type_unknown | 1 }} }}
 
   }}
 
   }}
}}{{ #vardefine: $query_card_type_query | {{ #switch: {{ #var: $query_card_type }}
+
}}{{ #if: {{ #var: $cq_medium }} | {{ #if: {{ #var: $cq_card_type }} | {{ #switch: {{ #var: $cq_medium }}, {{ #var: $cq_card_type }}
 +
      | official, monster  | official, spell | official, trap | official, non-monster
 +
      | duel links, monster | duel links, non-monster
 +
      | rush duel, monster  | rush duel, non-monster
 +
      | anime, monster      | anime, non-monster
 +
      | manga, monster      | manga, non-monster = <!-- already covered by concepts -->
 +
      | #default            = [[((Card query)) medium and type value::{{ #var: $cq_medium }}, {{ #var: $cq_card_type }}| ]]
 +
    }}
 +
  }}
 +
}}{{ #vardefine: $cq_card_type | {{ #var: $cq_card_type | {{ #vardefine: $cq_monster_count | {{ #ask: {{ #var: $cq_medium_query }}{{ #var: $cq_query }}[[Card type::Monster Card]] | format=count }}
 +
    }}{{ #vardefine: $cq_nonmonster_count | {{ #ask: {{ #var: $cq_medium_query }}{{ #var: $cq_query }}[[Concept:Non-monster cards]] | format=count }}
 +
    }}{{ #vardefine: $cq_spell_count      | {{ #ask: {{ #var: $cq_medium_query }}{{ #var: $cq_query }}[[Card type::Spell Card]] | format=count }}
 +
    }}{{ #vardefine: $cq_trap_count      | {{ #ask: {{ #var: $cq_medium_query }}{{ #var: $cq_query }}[[Card type::Trap Card]] | format=count }}
 +
    }}{{ #switch: {{ #ifexpr: {{ #var: $cq_monster_count }} > 0 | 1 | 0 }}/{{ #ifexpr: {{ #var: $cq_spell_count }} > 0 | 1 | 0 }}/{{ #ifexpr: {{ #var: $cq_trap_count }} > 0 | 1 | 0 }}/{{ #ifexpr: {{ #var: $cq_nonmonster_count }} > 0 | 1 | 0 }}
 +
    <!-- monster/nonmonster/spell/trap -->
 +
    | 0/0/0/0 | 0/0/1/1 | 0/1/1/1 = non-monster<!-- maybe split out the no spell/trap case later to allow auto-determination of other stuff -->
 +
    | 1/0/0/0 = monster
 +
    | 0/0/1/0 | 0/1/1/0 = {{ #ifexpr: {{ #var: $cq_nonmonster_count }} = {{ #var: $cq_spell_count }} | spell | non-monster }}
 +
    | 0/0/0/1 | 0/1/0/1 = {{ #ifexpr: {{ #var: $cq_nonmonster_count }} = {{ #var: $cq_trap_count }}  | trap  | non-monster }}
 +
    | #default = monster<!-- if you get here you need to specify {{{type}}}; maybe one day {{Card query}} will have better handling for mixed-type lists -->
 +
    }}
 +
  }}
 +
}}{{ #vardefine: $cq_card_type_query | {{ #switch: {{ #var: $cq_card_type }}
 
   | monster    = [[Card type::Monster Card]]
 
   | monster    = [[Card type::Monster Card]]
 
   | spell      = [[Card type::Spell Card]]
 
   | spell      = [[Card type::Spell Card]]
 
   | trap        = [[Card type::Trap Card]]
 
   | trap        = [[Card type::Trap Card]]
 
   | speed spell = [[Card type::Speed Spell Card]]
 
   | speed spell = [[Card type::Speed Spell Card]]
   | virus       = [[Card type::Virus Card]]
+
   | skill       = <q>[[Card type::Skill Card]] OR [[Page type::Skill page]]</q>
 +
  | ???        = [[Card type::???]]
 +
  | character  = [[Card type::Character Card]]
 
   | equip      = [[Card type::Equip Card]]
 
   | equip      = [[Card type::Equip Card]]
 
   | illusion    = [[Card type::Illusion Card]]
 
   | illusion    = [[Card type::Illusion Card]]
 +
  | legendary dragon = [[Card type::Legendary Dragon]]
 
   | ritual      = [[Card type::Ritual Card]]
 
   | ritual      = [[Card type::Ritual Card]]
 +
  | slot machine power unit = [[Card type::Slot Machine Power Unit]]
 +
  | trap monster = [[Card type::Trap Monster Card]]
 
   | trap spell  = [[Card type::Trap Spell Card]]
 
   | trap spell  = [[Card type::Trap Spell Card]]
   | trap-equip  = [[Card type::Trap-Equip Card]]
+
   | virus      = [[Card type::Virus Card]]
  | ???        = [[Card type::???]]
 
 
   | non-monster = [[Concept:Non-monster cards]]
 
   | non-monster = [[Concept:Non-monster cards]]
 +
  | playable    = [[Concept:Playable cards]]
 +
  | unplayable  = [[Concept:Unplayable cards]]
 +
  | non-game    = [[Card type::Non-game card]]
 +
  | command    = [[Card type::Command Card]]
 +
  | checklist  = [[Card type::Checklist Card]]
 +
  | faq        = [[Card type::FAQ card]]
 +
  | rule        = [[Card type::Rule Card]]
 +
  | strategy    = [[Card type::Strategy Card]]
 +
  | ticket      = [[Card type::Ticket Card]]
 +
  | tip        = [[Card type::Tip Card]]
 
   }}
 
   }}
}}{{ #vardefine: $query_card_type | {{ #var: $query_card_type | {{ #if:
+
}}{{ #vardefine: $cq_concept_query | {{ #switch: {{ #var: $cq_medium }}/{{ #var: $cq_card_type }}
    {{ #pos: {{ #var: $query_query_lc }} | monster }}
+
  | official/monster      = [[Concept:CG monsters]]
    {{ #pos: {{ #var: $query_query_lc }} | primary type:: }}
+
  | official/spell        = [[Concept:CG Spell Cards]]
    {{ #pos: {{ #var: $query_query_lc }} | secondary type:: }}
+
  | official/trap          = [[Concept:CG Trap Cards]]
    {{ #pos: {{ #var: $query_query_lc }} | attribute:: }}
+
  | official/non-monster  = [[Concept:CG non-monster cards]]
    {{ #pos: {{ #var: $query_query_lc }} | {{!((}}type:: }}
+
  | duel links/monster     = [[Concept:Duel Links monsters]]
    {{ #pos: {{ #var: $query_query_lc }} | level:: }}
+
  | duel links/non-monster = [[Concept:Duel Links non-monsters]]
     {{ #pos: {{ #var: $query_query_lc }} | rank:: }}
+
  | rush duel/monster      = [[Concept:Rush Duel monsters]]
    {{ #pos: {{ #var: $query_query_lc }} | stars:: }}
+
  | rush duel/non-monster  = [[Concept:Rush Duel non-monsters]]
    {{ #pos: {{ #var: $query_query_lc }} | pendulum scale:: }}
+
  | anime/monster          = [[Concept:Anime monsters]]
    {{ #pos: {{ #var: $query_query_lc }} | link arrows:: }}
+
  | anime/non-monster      = [[Concept:Anime non-monsters]]
    {{ #pos: {{ #var: $query_query_lc }} | {{!((}}atk }}
+
  | manga/monster          = [[Concept:Manga monsters]]
    {{ #pos: {{ #var: $query_query_lc }} | {{!((}}?atk }}
+
  | manga/non-monster      = [[Concept:Manga non-monsters]]
    {{ #pos: {{ #var: $query_query_lc }} | {{!((}}def }}
 
    {{ #pos: {{ #var: $query_query_lc }} | {{!((}}?def }}
 
    {{ #pos: {{ #var: $query_query_lc }} | link rating:: }}
 
    | monster
 
    }}<!-- might need something for Spell/Trap Monsters -->
 
 
   }}
 
   }}
 +
}}{{ #vardefine: $cq_full_query | {{ #var: $cq_concept_query | {{ #var: $cq_medium_query }}{{ #var: $cq_card_type_query }} }}{{ #var: $cq_query }}
 
}}<!--
 
}}<!--
  
Line 87: Line 159:
 
of course, if it allowed using {{!}} for pipes (as it should), this could be simplified further...
 
of course, if it allowed using {{!}} for pipes (as it should), this could be simplified further...
  
-->{{ #vardefine: $query_col_card_type | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | {{!((}}card type:: }} || ?Card type = }}
+
-->{{ #ifeq: {{ #var: $cq_card_type }} | skill
}}{{ #ifeq: {{ #var: $query_card_type }} | monster
+
| {{ #vardefine: $cq_col_character | ?Character }}
| {{ #vardefine: $query_col_primary_type | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | {{!((}}primary type:: }} | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | pendulum monster }} | ?Primary type }} | ?Primary type }}
+
| {{ #vardefine: $cq_col_japanese_name | ?Japanese name
   }}{{ #vardefine: $query_col_secondary_type | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | {{!((}}secondary type:: }} || ?Secondary type }}
+
  }}{{ #vardefine: $cq_col_card_type | {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | {{!((}}card type:: }} || ?Card type = }}
  }}{{ #vardefine: $query_col_attribute | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | {{!((}}attribute:: }} || ?Attribute = [[Attribute]] }}
+
  }}
   }}{{ #vardefine: $query_col_type | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | {{!((}}type:: }} || ?Type = [[Type]] }}
+
}}{{ #ifeq: {{ #var: $cq_card_type }} | monster
 +
| {{ #vardefine: $cq_col_primary_type | ?Primary type
 +
  }}{{ #vardefine: $cq_col_secondary_type | {{ #ifeq: {{ #ask: {{ #var: $cq_full_query }} [[Secondary type::+]] | format=count }} | 0 || {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | {{!((}}secondary type:: }} | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}secondary type::^ }} | ?Secondary type | {{ #ifeq: {{{extra_column}}} | Secondary type | ?Secondary type }} }} | ?Secondary type }} }}
 +
   }}{{ #vardefine: $cq_col_attribute | {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | {{!((}}attribute:: }} | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}attribute::^ }} | ?Attribute = [[Attribute]] }} | ?Attribute = [[Attribute]] }}
 +
   }}{{ #vardefine: $cq_col_type | {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | {{!((}}type:: }} | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}type::^ }} | ?Type = [[Type]] }} | ?Type = [[Type]] }}
 
   }}<!--
 
   }}<!--
-->{{ #vardefine: $query_col_stars
+
* if the query doesn't do anything special regarding Level, Rank, monster (sub)type, or medium, display "Level/Rank"
      | {{ #if: {{ #arraysearch: @check_query | /(\{{!(}}\{{!(}}\??(stars{{!}}level{{!}}rank){{!}}link (arrow{{!}}monster{{!}}rating))/ }}
+
* if the query searches for Rush Duel cards, display "Level"
          | {{ #if: {{ #arraysearch: @check_query | /(stars{{!}}level{{!}}rank)::(<{{!}}>{{!}}\d\d?\{{!}}\{{!}}\d)/ }}
+
* if the query searches for a Link Monster (via [[Primary type::Link Monster]], [[Link Arrows::...]], or [[Link Rating::...]]), hide the column
                | ?Stars string = {{ #if: {{ #arraysearch: @check_query | /(xyz( pendulum)? monster)/ }}
+
* if the query searches for Xyz Monsters (via [[Primary type::Xyz Monster]] or [[Rank::...]]/[[Rank string::...]]), display "Rank"
                                    |
+
* if the query searches for a specific Level/Rank value (e.g. [[Level::7]] or [[Rank string::?]]), hide the column
                                    | [[Level]]/<br />
+
* if the query searches for a nonspecific Level (e.g. [[Level::>4]]), show the column and display "Level"
                                  }}[[Rank]]
+
* if the query searches for a nonspecific Rank (e.g. [[Rank::>4]]), show the column and display "Rank"
            }}
+
-->{{ #vardefine: $cq_level_in_results | {{ #ifeq: {{ #ask: {{ #var: $cq_full_query }} [[Level string::+]] | format=count }} | 0 || 1 }}
          | ?Stars string = {{ #if: {{ #arraysearch: @check_query | /(xyz( pendulum)? monster)/ }}
+
}}{{ #vardefine: $cq_rank_in_results | {{ #ifeq: {{ #ask: {{ #var: $cq_full_query }} [[Rank string::+]] | format=count }} | 0 || 1 }}
                              |
+
}}<!--{{ #vardefine: $cq_link_in_results | {{ #ifeq: {{ #ask: {{ #var: $cq_full_query }} [[Link Rating::+]] | format=count }} | 0 || 1 }}
                              | [[Level]]/<br />
+
}}-->{{ #vardefine: $cq_col_level/rank/link_label
                            }}[[Rank]]
+
  | {{ #ifexpr: {{ #var: $cq_level_in_results | 0 }} + {{ #var: $cq_rank_in_results | 0 }} + {{ #var: $cq_link_in_results | 0 }} > 1
 +
    | {{ #if: {{ #var: $cq_level_in_results }}
 +
      | [[Level]]/<br />
 +
    }}{{ #if: {{ #var: $cq_rank_in_results }}
 +
      | [[Rank]]{{ #if: {{ #var: $cq_link_in_results }} | /<br /> }}
 +
    }}{{ #if: {{ #var: $cq_link_in_results }}
 +
      | [[Link Rating|Link]]
 +
    }}
 +
    | {{ #if: {{ #var: $cq_level_in_results }}
 +
      | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | level:: }}
 +
                {{ #pos: {{ #var: $cq_query_normalized }} | stars:: }}
 +
        | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | level::^ }}
 +
                  {{ #pos: {{ #var: $cq_query_normalized }} | stars::^ }}
 +
          | [[Level]]
 +
        }}
 +
        | [[Level]]
 +
      }}
 +
    }}{{ #if: {{ #var: $cq_rank_in_results }}
 +
      | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | rank:: }}
 +
                {{ #pos: {{ #var: $cq_query_normalized }} | stars:: }}
 +
        | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | rank::^ }}
 +
                  {{ #pos: {{ #var: $cq_query_normalized }} | stars::^ }}
 +
          | [[Rank]]
 
         }}
 
         }}
  }}<!--
+
        | [[Rank]]
-->{{ #vardefine: $query_col_scale | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | pendulum monster }} | ?Pendulum Scale = [[Pendulum Scale|Scale]] }}
+
      }}
  }}{{ #vardefine: $query_col_atk | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | {{!((}}atk }}{{ #pos: {{ #var: $query_query_lc }} | {{!((}}?atk }} || ?ATK string = [[ATK]] }}
+
    }}{{ #if: {{ #var: $cq_link_in_results }}
  }}{{ #if: {{ #arraysearch: @check_query | /(link (arrow{{!}}monster{{!}}rating))/ }}
+
      | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | link rating:: }}
    | {{ #vardefine: $query_col_link_rating | ?Link Rating = [[LINK]] }}
+
                {{ #pos: {{ #var: $cq_query_normalized }} | stars:: }}
    | {{ #vardefine: $query_col_def | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | {{!((}}def }}{{ #pos: {{ #var: $query_query_lc }} | {{!((}}?def }} || ?DEF string = [[DEF]] }} }}
+
        | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | link rating::^ }}
 +
                  {{ #pos: {{ #var: $cq_query_normalized }} | stars::^ }}
 +
          | [[Link Rating|Link]]
 +
        }}
 +
        | [[Link Rating|Link]]
 +
      }}
 +
    }}
 
   }}
 
   }}
| {{ #vardefine: $query_col_card_type_st | {{ #if: {{ #var: $query_col_card_type }} | {{ #switch: {{ #var: $query_card_type }} | non-monster | <!-- empty --> = {{ #var: $query_col_card_type }} [[Card type]] }} }}
+
}}<!-- I'm sure I'll pay for this eventually
  }}{{ #vardefine: $query_col_property | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | {{!((}}property:: }} || ?Property = [[Property]] }}
+
-->{{ #ifeq: {{{medium}}} | Cross Duel
  }}{{ #vardefine: $query_col_card_type_st | {{ #if: {{ #var: $query_col_property }} | {{ #var: $query_col_card_type_st }} }}
+
  | {{ #if: {{ #var: $cq_level_in_results }} | {{ #vardefine: $cq_col_level | ?Level string = [[Level]] }}
 +
    }}{{ #if: {{ #var: $cq_rank_in_results }} | {{ #vardefine: $cq_col_rank | ?Rank string = [[Rank]] }}
 +
    }}
 +
  | {{ #vardefine: $cq_col_level/rank/link | {{ #if: {{ #var: $cq_col_level/rank/link_label }}
 +
      | ?Stars string = {{ #var: $cq_col_level/rank/link_label }}
 +
    }}
 
   }}
 
   }}
}}{{ #vardefine: $query_col_extra | {{ #if: {{{extra_column|}}} | ?{{{extra_column}}} {{ #if: {{{extra_label|}}} | = {{{extra_label}}} }} }}
+
}}<!--
 +
-->{{ #vardefine: $cq_col_scale | {{ #ifeq: {{ #ask: {{ #var: $cq_full_query }} [[Pendulum Scale::+]] | format=count }} | 0 || ?Pendulum Scale = [[Pendulum Scale|Scale]] }}
 +
  }}{{ #vardefine: $cq_equal_atkdef | {{ #if: {{ #pos: {{ #var: $cq_query }} | Equal ATK and DEF }} | {{ #if: {{ #pos: {{ #var: $cq_query }} | !Equal ATK and DEF }} || 1 }} }}
 +
  }}{{ #vardefine: $cq_col_atk | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}atk }}
 +
    | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | atk::^ }}{{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}def }}
 +
      | ?ATK string = [[ATK]]{{ #if: {{ #var: $cq_equal_atkdef }} | /<br />[[DEF]] }}
 +
    }}
 +
    | ?ATK string = [[ATK]]{{ #if: {{ #var: $cq_equal_atkdef }} | /<br />[[DEF]] }}
 +
  }} }}{{ #ifeq: {{ #ask: {{ #var: $cq_full_query }} [[DEF string::+]] | format=count }} | 0
 +
    || {{ #vardefine: $cq_col_def | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}def }}
 +
      | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | def::^ }}{{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}atk }}
 +
        | {{ #if: {{ #var: $cq_equal_atkdef }} || ?DEF string = [[DEF]] }}
 +
      }}
 +
      | {{ #if: {{ #var: $cq_equal_atkdef }} || ?DEF string = [[DEF]] }}
 +
    }} }}
 +
  }}{{ #vardefine: $cq_col_link_rating | {{ #ifeq: {{ #ask: {{ #var: $cq_full_query }} [[Link Rating::+]] | format=count }} | 0
 +
      || {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | {{!((}}link rating:: }} | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}link rating::^ }} | ?Link Rating = [[Link Rating|Link]] }} | ?Link Rating = [[Link Rating|Link]] }}
 +
    }}
 +
  }}{{ #vardefine: $cq_col_maximum_atk | {{ #ifeq: {{ #var: $cq_medium }} | rush duel | {{ #ifeq: {{ #ask: {{ #var: $cq_full_query }} [[MAXIMUM ATK::+]] | format=count }} | 0
 +
        || {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | {{!((}}maximum atk:: }} | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}maximum atk::^ }} | ?MAXIMUM ATK#- = [[MAXIMUM ATK]] }} | ?MAXIMUM ATK#- = [[MAXIMUM ATK]] }}
 +
      }}
 +
    }}
 +
  }}
 +
| {{ #vardefine: $cq_col_property | {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | {{!((}}property:: }} | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}property::^ }} | ?Property = [[Property]] | {{ #ifeq: {{{extra_column}}} | Property | ?Property = [[Property]] }} }} | ?Property = [[Property]] }}
 +
  }}{{ #ifeq: {{ #var: $cq_card_type }} | skill
 +
  || {{ #vardefine: $cq_col_card_type_st | {{ #if: {{ #var: $cq_col_card_type }} | {{ #switch: {{ #var: $cq_card_type }} | non-monster | playable | unplayable | <!-- empty --> = {{ #var: $cq_col_card_type }} [[Card type]] }} }}
 +
    }}{{ #vardefine: $cq_col_card_type_st | {{ #if: {{ #var: $cq_col_property }} | {{ #var: $cq_col_card_type_st }} }}
 +
    }}
 +
  }}
 +
}}{{ #vardefine: $cq_col_extra | {{ #if: {{{extra_column|}}} | {{ #switch: {{{extra_column}}} | Secondary type | Property = | #default= ?{{{extra_column}}} }} }}
 +
}}{{ #vardefine: $cq_col_extra_2 | {{ #if: {{{extra_column2|}}} | ?{{{extra_column2}}} }}
 
}}<!--
 
}}<!--
  
 
some other stuff
 
some other stuff
  
-->{{ #vardefine: $query_limit | {{ #if: {{{limit|}}} | {{ #iferror: {{ #expr: {{{limit}}} }} || {{{limit}}} }} }}
+
-->{{ #vardefine: $cq_limit  | {{ #if: {{{limit|}}} | {{ #iferror: {{ #expr: {{{limit}}} }} || {{{limit}}} }} }}
}}{{ #vardefine: $query_sort   | {{{sort|#}}}
+
}}{{ #vardefine: $cq_limit   | {{ #ifexpr: {{ #var: $cq_limit | 50 }} > 500 | 500 | {{ #var: $cq_limit | 50 }} }}<!-- $smwgQMaxInlineLimit = 500 -->
}}{{ #vardefine: $query_order  | {{{order|}}}
+
}}{{ #vardefine: $cq_sort    | {{{sort|#}}}{{ #if: {{{sort|}}} | {{ #if: {{ #pos: {{{sort}}} | # }} || ,# }} }}
}}{{ #vardefine: $query_count  | {{ #explode: {{ #ask: {{ #var: $query_medium_query }}{{ #var: $query_card_type_query }}{{ #var: $query_query }} | format=count }} | < }}
+
}}{{ #vardefine: $cq_order  | {{{order|}}}
 +
}}{{ #vardefine: $cq_count  | {{ #explode: {{ #ask: {{ #var: $cq_full_query }} | format=count }} | < }}
 +
}}{{ #vardefine: $cq_default | {{{default|}}}
 
}}<!--
 
}}<!--
  
 
we finally get to the actual query
 
we finally get to the actual query
  
-->{{ #ask: {{ #var: $query_medium_query }}{{ #var: $query_card_type_query }}{{ #var: $query_query }}
+
-->{{ #ask: {{ #var: $cq_full_query }}
  |{{ #if: {{ #var: $query_query_medium | {{ #var: $query_medium }} }} | ?English name (linked) = }}
+
  |{{ #if: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }}{{ #pos: {{ #var: $cq_query_lc }} | release:: }} | {{ #ifeq: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }} | vg || ?English name (linked) = Name }} }}
   |?Japanese name
+
  |{{ #var: $cq_col_japanese_name }}
   |{{ #var: $query_col_primary_type }}
+
  |{{ #var: $cq_col_character }}
   |{{ #var: $query_col_secondary_type }}
+
  |{{ #var: $cq_col_primary_type }}
   |{{ #var: $query_col_attribute }}
+
  |{{ #var: $cq_col_secondary_type }}
   |{{ #var: $query_col_card_type_st }}
+
  |{{ #var: $cq_col_attribute }}
   |{{ #var: $query_col_type }}
+
   |{{ #var: $cq_col_card_type_st }}
   |{{ #var: $query_col_stars }}
+
   |{{ #var: $cq_col_type }}
   |{{ #var: $query_col_scale }}
+
   |{{ #var: $cq_col_level/rank/link }}
   |{{ #var: $query_col_atk }}
+
   |{{ #var: $cq_col_level }}
   |{{ #var: $query_col_def }}
+
   |{{ #var: $cq_col_rank }}
   |{{ #var: $query_col_link_rating }}
+
   |{{ #var: $cq_col_scale }}
   |{{ #var: $query_col_property }}
+
   |{{ #var: $cq_col_atk }}
   |{{ #var: $query_col_extra }}
+
   |{{ #var: $cq_col_def }}
   | {{ #if: {{ #var: $query_query_medium | {{ #var: $query_medium }} }} | mainlabel = - }}
+
   |{{ #var: $cq_col_link_rating }}
 +
   |{{ #var: $cq_col_maximum_atk }}
 +
   |{{ #var: $cq_col_property }}
 +
   |{{ #var: $cq_col_extra }}
 +
   |{{ #var: $cq_col_extra_2 }}
 +
   | {{ #if: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }}{{ #pos: {{ #var: $cq_query_lc }} | release:: }} | {{ #ifeq: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }} | vg || mainlabel = - }} | mainlabel = Name }}
 
   | headers = plain
 
   | headers = plain
   | class = sortable wikitable smwtable card-list
+
   | class = sortable wikitable smwtable card-list card-query-main
   | {{ #if: {{ #var: $query_limit }} | limit = {{ #var: $query_limit }} }}
+
   | {{ #if: {{ #var: $cq_limit }}   | limit = {{ #var: $cq_limit }} }}
   | {{ #if: {{ #var: $query_sort }} | sort  = {{ #var: $query_sort }} }}
+
   | {{ #if: {{ #var: $cq_sort }}   | sort  = {{ #var: $cq_sort }} }}
   | {{ #if: {{ #var: $query_order }} | order = {{ #var: $query_order }} }}
+
   | {{ #if: {{ #var: $cq_order }}   | order = {{ #var: $cq_order }} }}
   | searchlabel = ... further results ({{ #expr: {{ #var: $query_count }} - {{ #var: $query_limit | 50 }} }} more)
+
   | {{ #if: {{ #var: $cq_default }} | default = {{ #var: $cq_default }} }}
 +
  | searchlabel = <!-- nothing -->
 
   | {{ #if: {{{debug<includeonly>|</includeonly>}}} | format = debug }}
 
   | {{ #if: {{{debug<includeonly>|</includeonly>}}} | format = debug }}
 +
}}{{ #ifeq: {{ #var: $cq_count }} | 0 || <!--
 +
 +
footer table - currently only has results count + links to see more results
 +
 +
-->{{ #vardefine: $cq_further_results_url | https://yugipedia.com/wiki/Special:Ask<!-- unfortunately we can't use {{fullurl:}} because we're generating only part of the URL here
 +
-->?q={{ urlencode: {{ #var: $cq_full_query }} }}<!--
 +
-->&p={{ urlencode: mainlabel={{ #if: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }}{{ #pos: {{ #var: $cq_query_lc }} | release:: }} | {{ #ifeq: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }} | vg | Name | -2D }} | Name }} }}<!--
 +
-->&po={{ urlencode: {{ #if: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }}{{ #pos: {{ #var: $cq_query_lc }} | release:: }} | {{ #ifeq: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }} | vg || ?English name (linked) = Name }} }}
 +
{{ #var: $cq_col_japanese_name }}
 +
{{ #var: $cq_col_character }}
 +
{{ #var: $cq_col_primary_type }}
 +
{{ #var: $cq_col_secondary_type }}
 +
{{ #var: $cq_col_attribute }}
 +
{{ #var: $cq_col_card_type_st }}
 +
{{ #var: $cq_col_type }}
 +
{{ #var: $cq_col_level/rank/link }}
 +
{{ #var: $cq_col_level }}
 +
{{ #var: $cq_col_rank }}
 +
{{ #var: $cq_col_scale }}
 +
{{ #var: $cq_col_atk }}
 +
{{ #var: $cq_col_def }}
 +
{{ #var: $cq_col_link_rating }}
 +
{{ #var: $cq_col_maximum_atk }}
 +
{{ #var: $cq_col_property }}
 +
{{ #var: $cq_col_extra }}
 +
{{ #var: $cq_col_extra_2 }} }}<!--
 +
-->&format=broadtable<!--
 +
-->&headers=plain<!--
 +
-->&class={{ urlencode: sortable wikitable smwtable card-list }}<!--
 +
-->{{ #if: {{ #var: $cq_sort }} | &sort={{ urlencode: {{ #var: $cq_sort }} }}&order={{ urlencode: {{ #var: $cq_order | asc }} }} }}
 +
}}
 +
<table class="wikitable smwtable plainlinks card-list card-query-more-links">
 +
<tr><td>{{ #ifexpr: {{ #var: $cq_count }} < {{ #var: $cq_limit }} + 1
 +
  | {{ #ifeq: {{ #var: $cq_count }} | 1
 +
    | Showing the only result
 +
    | Showing all {{ #var: $cq_count }} results
 +
    }}
 +
  | Showing first {{ #var: $cq_limit }} results, of {{ #var: $cq_count }} total<!--
 +
    -->{{ #ifexpr: {{ #var: $cq_count }} > {{ #var: $cq_limit }} - 1
 +
    | &nbsp;&brvbar; [{{ #var: $cq_further_results_url }}&limit={{ #var: $cq_limit }}&offset={{ #var: $cq_limit }} <!--
 +
      -->{{ #ifexpr: {{ #var: $cq_count }} < {{ #var: $cq_limit }} * 2
 +
      | {{ #ifexpr: {{ #var: $cq_count }} - {{ #var: $cq_limit }} = 1
 +
        | Show remaining result
 +
        | Show remaining {{ #expr: {{ #var: $cq_count }} - {{ #var: $cq_limit }} }} results
 +
        }}
 +
      | Show next {{ #var: $cq_limit }} results
 +
      }}]
 +
    }}<!--
 +
    -->{{ #ifexpr: {{ #var: $cq_count }} > 20
 +
      | &nbsp;&brvbar; {{ #ifexpr: {{ #var: $cq_count }} < 50
 +
        | [{{ #var: $cq_further_results_url }}&limit=20 Show first 20 results]
 +
        | Show first &#91;[{{ #var: $cq_further_results_url }}&limit=20 20]&nbsp;&middot; [{{ #var: $cq_further_results_url }}&limit=50 50]<!--
 +
          -->{{ #ifexpr: {{ #var: $cq_count }} > 100 | &nbsp;&middot; [{{ #var: $cq_further_results_url }}&limit=100 100] }}<!--
 +
          -->{{ #ifexpr: {{ #var: $cq_count }} > 250 | &nbsp;&middot; [{{ #var: $cq_further_results_url }}&limit=250 250] }}<!--
 +
          -->{{ #ifexpr: {{ #var: $cq_count }} > 500 | &nbsp;&middot; [{{ #var: $cq_further_results_url }}&limit=500 500] }}<!--
 +
      -->&#93; results
 +
        }}
 +
      }}<!--
 +
    -->{{ #ifexpr: {{ #var: $cq_count }} < 501 | &nbsp;&brvbar; [{{ #var: $cq_further_results_url }}&limit=500 Show all {{ #var: $cq_count }} results] }} <!--
 +
    -->(all links open a new page)
 +
  }}
 +
</td></tr>
 +
</table>
 
}}<!--
 
}}<!--
  
Line 159: Line 369:
  
 
-->{{ #if: {{{debug<includeonly>|</includeonly>}}} | <nowiki/>
 
-->{{ #if: {{{debug<includeonly>|</includeonly>}}} | <nowiki/>
* <code>#ask</code> query: <code>{{ #tag: nowiki | {{ #var: $query_medium_query }}{{ #var: $query_card_type_query }}{{ #var: $query_query }} }}</code>
+
* <code>#ask</code> query ($cq_full_query): <code>{{ #tag: nowiki | {{ #var: $cq_full_query }} }}</code>
* <abbr title="query entered">$query_query</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_query }} }}</code>
+
* <abbr title="query entered">$cq_query</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_query }} }}</code>
* <abbr title="lowercased query entered">$query_query_lc</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_query_lc }} }}</code>
+
* <abbr title="lowercased query entered">$cq_query_lc</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_query_lc }} }}</code>
* <abbr title="normalized <nowiki>{{{medium}}}</nowiki> entered">$query_medium</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_medium }} }}</code>
+
* <abbr title="normalized lowercased query entered">$cq_query_normalized</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_query_normalized }} }}</code>
* <abbr title="processed $query_medium ready to use on the query">$query_medium_query</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_medium_query }} }}</code>
+
* <abbr title="normalized <nowiki>{{{medium}}}</nowiki> entered">$cq_medium</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_medium }} }}</code>
* <abbr title="type of the medium (if for cards, to enable/disable labels)">$query_query_medium</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_query_medium }} }}</code>
+
* <abbr title="processed $cq_medium ready to use on the query">$cq_medium_query</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_medium_query }} }}</code>
* <abbr title="normalized <nowiki>{{{type}}}</nowiki> entered">$query_card_type</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_card_type }} }}</code>
+
* <abbr title="type of the medium (if for cards, to enable/disable labels)">$cq_query_medium</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_query_medium }} }}</code>
* <abbr title="processed $query_card_type ready to use on the query">$query_card_type_query</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_card_type_query }} }}</code>
+
* <abbr title="normalized <nowiki>{{{type}}}</nowiki> entered">$cq_card_type</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_card_type }} }}</code>
* <abbr title="enable/disable «?Card type» column">$query_col_card_type</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_col_card_type }} }}</code>
+
* <abbr title="processed $cq_card_type ready to use on the query">$cq_card_type_query</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_card_type_query }} }}</code>
* <abbr title="for monster cards, enable/disable «?Primary type» column">$query_col_primary_type</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_col_primary_type }} }}</code>
+
* <abbr title="concept used to reduce load for queries asking for common medium+card type combos">$cq_concept_query</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_concept_query }} }}</code>
* <abbr title="for monster cards, enable/disable «?Secondary type» column">$query_col_secondary_type</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_col_secondary_type }} }}</code>
+
* <abbr title="determined number of monster results">$cq_monster_count</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_monster_count }} }}</code>
* <abbr title="for monster cards, enable/disable «?Attribute» column">$query_col_attribute</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_col_attribute }} }}</code>
+
* <abbr title="determined number of nonmonster results">$cq_nonmonster_count</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_nonmonster_count }} }}</code>
* <abbr title="for monster cards, enable/disable «?Type» column">$query_col_type</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_col_type }} }}</code>
+
* <abbr title="determined number of Spell Card results">$cq_spell_count</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_spell_count }} }}</code>
* <abbr title="for monster cards, enable/disable «?Stars string» column">$query_col_stars</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_col_stars }} }}</code>
+
* <abbr title="determined number of Trap Card results">$cq_trap_count</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_trap_count }} }}</code>
* <abbr title="for monster cards, enable/disable «?Pendulum Scale» column">$query_col_scale</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_col_scale }} }}</code>
+
* <abbr title="enable/disable «?Card type» column">$cq_col_card_type</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_card_type }} }}</code>
* <abbr title="for monster cards, enable/disable «?Link Rating» column">$query_col_link_rating</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_col_link_rating }} }}</code>
+
* <abbr title="enable/disable «?Character» column">$cq_col_character</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_character }} }}</code>
* <abbr title="for monster cards, enable/disable «?ATK string» column">$query_col_atk</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_col_atk }} }}</code>
+
* <abbr title="enable/disable «?Japanese name» column">$cq_col_japanese_name</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_japanese_name }} }}</code>
* <abbr title="for monster cards, enable/disable «?DEF string» column">$query_col_def</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_col_def }} }}</code>
+
* <abbr title="for monster cards, enable/disable «?Primary type» column">$cq_col_primary_type</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_primary_type }} }}</code>
* <abbr title="for Spell/Traps, enable/disable «?Card type» column">$query_col_card_type_st</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_col_card_type_st }} }}</code>
+
* <abbr title="for monster cards, enable/disable «?Secondary type» column">$cq_col_secondary_type</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_secondary_type }} }}</code>
* <abbr title="for Spell/Traps, enable/disable «?Property» column">$query_col_property</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_col_property }} }}</code>
+
* <abbr title="for monster cards, enable/disable «?Attribute» column">$cq_col_attribute</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_attribute }} }}</code>
* <abbr title="to add another column"><code><nowiki>{{{extra_column}}}</nowiki></code></abbr>: <code>{{ #tag: nowiki | {{{extra_column|}}} }}</code>
+
* <abbr title="for monster cards, enable/disable «?Type» column">$cq_col_type</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_type }} }}</code>
* <abbr title="to add a label to the new column"><code><nowiki>{{{extra_label}}}</nowiki></code></abbr>: <code>{{ #tag: nowiki | {{{extra_label|}}} }}</code>
+
* <abbr title="whether any results have a value stored in Property:Level string">$cq_level_in_results</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_level_in_results }} }}</code>
* <abbr title="full new column (with label, if passed)">$query_col_extra</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_col_extra }} }}</code>
+
* <abbr title="whether any results have a value stored in Property:Rank string">$cq_rank_in_results</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_rank_in_results }} }}</code>
* limit: {{ #var: $query_limit | 50 }}
+
* <abbr title="whether any results have a value stored in Property:Link Rating">$cq_link_in_results</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_link_in_results }} }}</code>
* <abbr title="<nowiki>{{{sort}}}</nowiki>, for sorting the results by property">$query_sort</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_sort  }} }}</code>
+
* <abbr title="determined label for Stars column">$cq_col_level/rank/link_label</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_level/rank/link_label }} }}</code>
* <abbr title="<nowiki>{{{ordering}}}</nowiki>, for ordering the results by values">$query_order</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_order }} }}</code>
+
* <abbr title="for monster cards, enable/disable «?Stars string» column">$cq_col_level/rank/link</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_level/rank/link }} }}</code>
* <abbr title="results count">$query_count</abbr>: {{ #var: $query_count }}
+
* <abbr title="for Cross Duel monster cards, enable/disable «?Level string» column">$cq_col_level</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_level }} }}</code>
 +
* <abbr title="for Cross Duel monster cards, enable/disable «?Rank string» column">$cq_col_rank</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_rank}} }}</code>
 +
* <abbr title="for monster cards, enable/disable «?Pendulum Scale» column">$cq_col_scale</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_scale }} }}</code>
 +
* <abbr title="for monster cards, enable/disable «?Link Rating» column">$cq_col_link_rating</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_link_rating }} }}</code>
 +
* <abbr title="whether the query only returns results with same ATK/DEF">$cq_equal_atkdef</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_equal_atkdef }} }}</code>
 +
* <abbr title="for monster cards, enable/disable «?ATK string» column">$cq_col_atk</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_atk }} }}</code>
 +
* <abbr title="for monster cards, enable/disable «?DEF string» column">$cq_col_def</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_def }} }}</code>
 +
* <abbr title="for monster cards, enable/disable «?MAXIMUM ATK» column">$cq_col_maximum_atk</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_maximum_atk }} }}</code>
 +
* <abbr title="for Spell/Traps, enable/disable «?Card type» column">$cq_col_card_type_st</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_card_type_st }} }}</code>
 +
* <abbr title="for Spell/Traps, enable/disable «?Property» column">$cq_col_property</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_property }} }}</code>
 +
* <abbr title="to add an extra column"><code><nowiki>{{{extra_column}}}</nowiki></code></abbr>: <code>{{ #tag: nowiki | {{{extra_column|}}} }}</code>
 +
* <abbr title="to add a second extra column"><code><nowiki>{{{extra_column2}}}</nowiki></code></abbr>: <code>{{ #tag: nowiki | {{{extra_column2|}}} }}</code>
 +
* <abbr title="full new column (with label, if passed)">$cq_col_extra</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_extra }} }}</code>
 +
* <abbr title="second full new column (with label, if passed)">$cq_col_extra_2</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_extra_2 }} }}</code>
 +
* limit: {{ #var: $cq_limit | 50 }}
 +
* <abbr title="<nowiki>{{{sort}}}</nowiki>, for sorting the results by property">$cq_sort</abbr>: <code>{{ #tag: nowiki  | {{ #var: $cq_sort  }} }}</code>
 +
* <abbr title="<nowiki>{{{order}}}</nowiki>, for ordering the results by values">$cq_order</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_order }} }}</code>
 +
* <abbr title="<nowiki>{{{default}}}</nowiki>, to be displayed if a query has no results">$cq_default</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_default }} }}</code>
 +
* <abbr title="results count">$cq_count</abbr>: {{ #var: $cq_count }}
 
}}<!--
 
}}<!--
  
 
we have to blank the column variables to keep from polluting subsequent transclusions (since they aren't always defined above, and therefore aren't guaranteed to be blank from previous transclusions)
 
we have to blank the column variables to keep from polluting subsequent transclusions (since they aren't always defined above, and therefore aren't guaranteed to be blank from previous transclusions)
  
-->{{ #vardefine: $query_col_card_type
+
-->{{ #vardefine: $cq_col_japanese_name
}}{{ #vardefine: $query_col_card_type_st
+
}}{{ #vardefine: $cq_col_character
}}{{ #vardefine: $query_col_primary_type
+
}}{{ #vardefine: $cq_col_card_type
}}{{ #vardefine: $query_col_secondary_type
+
}}{{ #vardefine: $cq_col_card_type_st
}}{{ #vardefine: $query_col_attribute
+
}}{{ #vardefine: $cq_col_primary_type
}}{{ #vardefine: $query_col_type
+
}}{{ #vardefine: $cq_col_secondary_type
}}{{ #vardefine: $query_col_stars
+
}}{{ #vardefine: $cq_col_attribute
}}{{ #vardefine: $query_col_scale
+
}}{{ #vardefine: $cq_col_type
}}{{ #vardefine: $query_col_atk
+
}}{{ #vardefine: $cq_col_level_rank_flags
}}{{ #vardefine: $query_col_def
+
}}{{ #vardefine: $cq_col_level/rank/link
}}{{ #vardefine: $query_col_link_rating
+
}}{{ #vardefine: $cq_col_level
}}{{ #vardefine: $query_col_property
+
}}{{ #vardefine: $cq_col_rank
}}{{ #vardefine: $query_col_extra
+
}}{{ #vardefine: $cq_col_scale
}}{{ #vardefine: $query_limit
+
}}{{ #vardefine: $cq_col_atk
}}{{ #vardefine: $query_sort
+
}}{{ #vardefine: $cq_col_def
}}{{ #vardefine: $query_order
+
}}{{ #vardefine: $cq_col_link_rating
}}{{ #vardefine: $query_count
+
}}{{ #vardefine: $cq_col_maximum_atk
 +
}}{{ #vardefine: $cq_col_property
 +
}}{{ #vardefine: $cq_col_extra
 +
}}{{ #vardefine: $cq_col_extra_2
 +
}}{{ #vardefine: $cq_limit
 +
}}{{ #vardefine: $cq_sort
 +
}}{{ #vardefine: $cq_order
 +
}}{{ #vardefine: $cq_default
 +
}}{{ #vardefine: $cq_count
 
}}<!--
 
}}<!--
  
last, any tracking categories
+
last, any tracking categories/properties
  
-->{{ #if: {{ #pos: {{ #var: $query_query_lc }} | card category }}
+
-->{{ #if: {{{t|}}} |<!-- stuff we don't want applied if {{Card query}} is added via another template (e.g. by {{Card list}}) -->
          {{ #pos: {{ #var: $query_query_lc }} | s/t class }}
+
  | [[((Card query)) query value::{{ #replace: {{ #replace: {{ #replace: {{ #var: $cq_query }} | {{!}} | &#124; }} | {{!(}} | &#91; }} | {{)!}} | &#93; }}| ]]
          {{ #pos: {{ #var: $query_query_lc }} | rfp:: }}<!-- replace with "Banishing" -->
+
}}{{ #if: {{ #pos: {{ #var: $cq_query_lc }} | card category }}
          {{ #pos: {{ #var: $query_query_lc }} | remove from play }}<!-- replace with "banish" -->
+
          {{ #pos: {{ #var: $cq_query_lc }} | s/t class }}
          {{ #pos: {{ #var: $query_query_lc }} | removes from play }}<!-- replace with "banishes" -->
+
          {{ #pos: {{ #var: $cq_query_lc }} | rfp:: }}<!-- replace with "Banishing" -->
          {{ #pos: {{ #var: $query_query_lc }} | removed from play }}<!-- replace with "banished" -->
+
          {{ #pos: {{ #var: $cq_query_lc }} | remove from play }}<!-- replace with "banish" -->
          {{ #pos: {{ #var: $query_query_lc }} | removing from play }}<!-- replace with "banishing" -->
+
          {{ #pos: {{ #var: $cq_query_lc }} | removes from play }}<!-- replace with "banishes" -->
          {{ #pos: {{ #var: $query_query_lc }} | monster type }}<!-- replace with "Primary type" or "Secondary type" as appropriate -->
+
          {{ #pos: {{ #var: $cq_query_lc }} | removed from play }}<!-- replace with "banished" -->
          {{ #ifeq: {{ lc: {{{extra_column}}} }} | card category | 1 }}
+
          {{ #pos: {{ #var: $cq_query_lc }} | removing from play }}<!-- replace with "banishing" -->
          {{ #ifeq: {{ lc: {{{extra_column}}} }} | s/t class | 1 }}
+
          {{ #pos: {{ #var: $cq_query_lc }} | monster type:: }}<!-- replace with "Primary type" or "Secondary type" as appropriate -->
          {{ #ifeq: {{ lc: {{{extra_column}}} }} | rfp:: | 1 }}<!-- replace with "Banishing" -->
+
          {{ #pos: {{ #var: $cq_query_lc }} | life points:: }}<!-- replace with "LP" -->
          {{ #ifeq: {{ lc: {{{extra_column}}} }} | monster type | 1 }}<!-- replace with "Primary type" or "Secondary type" as appropriate -->
+
          {{ #pos: {{ #var: $cq_query_lc }} | token monster }}<!-- replace with "Monster Token" -->
 +
          {{ #pos: {{ #var: $cq_query_lc }} | ?atk }}<!-- replace with "ATK string" (usually) -->
 +
          {{ #pos: {{ #var: $cq_query_lc }} | ?def }}<!-- replace with "DEF string" (usually) -->
 +
          {{ #pos: {{ #var: $cq_query_lc }} | ?level }}<!-- replace with "Level string" (usually) -->
 +
          {{ #pos: {{ #var: $cq_query_lc }} | ?rank }}<!-- replace with "Rank string" (usually) -->
 +
          {{ #pos: {{ #var: $cq_query_lc }} | ?stars }}<!-- replace with "Stars string" (usually) -->
 +
          {{ #ifeq: {{ lc: {{{extra_column}}} }} | card category | 1 }}
 +
          {{ #ifeq: {{ lc: {{{extra_column}}} }} | s/t class | 1 }}
 +
          {{ #ifeq: {{ lc: {{{extra_column}}} }} | rfp | 1 }}<!-- replace with "Banishing" -->
 +
          {{ #ifeq: {{ lc: {{{extra_column}}} }} | monster type | 1 }}<!-- replace with "Primary type" or "Secondary type" as appropriate -->
 +
          {{ #ifeq: {{ lc: {{{extra_column}}} }} | life points | 1 }}<!-- replace with "LP" -->
 +
          {{ #ifeq: {{ lc: {{{extra_column}}} }} | ?atk | 1 }}<!-- replace with "ATK string" (usually) -->
 +
          {{ #ifeq: {{ lc: {{{extra_column}}} }} | ?def | 1 }}<!-- replace with "DEF string" (usually) -->
 +
          {{ #ifeq: {{ lc: {{{extra_column}}} }} | ?level | 1 }}<!-- replace with "Level string" (usually) -->
 +
          {{ #ifeq: {{ lc: {{{extra_column}}} }} | ?rank | 1 }}<!-- replace with "Rank string" (usually) -->
 +
          {{ #ifeq: {{ lc: {{{extra_column}}} }} | ?stars | 1 }}<!-- replace with "Stars string" (usually) -->
 +
          {{ #ifeq: {{ lc: {{{extra_column2}}} }} | card category | 1 }}
 +
          {{ #ifeq: {{ lc: {{{extra_column2}}} }} | s/t class | 1 }}
 +
          {{ #ifeq: {{ lc: {{{extra_column2}}} }} | rfp | 1 }}<!-- replace with "Banishing" -->
 +
          {{ #ifeq: {{ lc: {{{extra_column2}}} }} | monster type | 1 }}<!-- replace with "Primary type" or "Secondary type" as appropriate -->
 +
          {{ #ifeq: {{ lc: {{{extra_column2}}} }} | life points | 1 }}<!-- replace with "LP" -->
 +
          {{ #ifeq: {{ lc: {{{extra_column2}}} }} | ?atk | 1 }}<!-- replace with "ATK string" (usually) -->
 +
          {{ #ifeq: {{ lc: {{{extra_column2}}} }} | ?def | 1 }}<!-- replace with "DEF string" (usually) -->
 +
          {{ #ifeq: {{ lc: {{{extra_column2}}} }} | ?level | 1 }}<!-- replace with "Level string" (usually) -->
 +
          {{ #ifeq: {{ lc: {{{extra_column2}}} }} | ?rank | 1 }}<!-- replace with "Rank string" (usually) -->
 +
          {{ #ifeq: {{ lc: {{{extra_column2}}} }} | ?stars | 1 }}<!-- replace with "Stars string" (usually) -->
 
   | [[Category:((Card query)) transclusions querying deprecated properties]]
 
   | [[Category:((Card query)) transclusions querying deprecated properties]]
}}{{ #if: {{ #pos: {{ #var: $query_query }} | {{!}}{{!}} }}
+
}}{{ #if: {{ #pos: {{ #var: $cq_query_lc }} | class 1 }}
           {{ #pos: {{ #var: $query_query_lc }} | {{!))}} or {{!((}} }}
+
          {{ #pos: {{ #var: $cq_query_lc }} | medium:: }}
 +
  | [[Category:((Card query)) transclusions which should use (((medium)))]]
 +
}}{{ #if: {{ #var: $cq_medium_unknown }}
 +
  | [[Category:((Card query)) transclusions with an unknown (((medium))) value]]
 +
}}{{ #if: {{ #pos: {{ #var: $cq_query_lc }} | card type:: }}
 +
  | [[Category:((Card query)) transclusions which should use (((type)))]]
 +
}}{{ #if: {{ #var: $cq_card_type_unknown }}
 +
  | [[Category:((Card query)) transclusions with an unknown (((type))) value]]
 +
}}{{ #if: {{{extra_column|}}}
 +
  | [[Category:Queries with an extra column]]{{ #if: {{{extra_column2|}}}
 +
    | [[Category:Queries with two extra columns]]{{ #ifeq: {{{extra_column}}} | {{{extra_column2}}}
 +
      | [[Category:((Card query)) transclusions with duplicate extra_column and extra_column2]]
 +
    }}
 +
  }}
 +
  | {{ #if: {{{extra_column2|}}}
 +
    | [[Category:Queries with an extra column]][[Category:((Card query)) transclusions with extra_column2 but no extra_column]]
 +
  }}
 +
}}{{ #if: {{{sort|}}}
 +
  | [[Category:Queries with a custom sort]]
 +
}}{{ #if: {{{order|}}}
 +
  | [[Category:Queries with a custom order]]
 +
}}{{ #if: {{{default|}}}
 +
  | [[Category:Queries with a custom default value]]
 +
}}{{ #if: {{{limit|}}}
 +
  | {{ #iferror: {{ #expr: {{{limit}}} }}
 +
    | [[Category:((Card query)) transclusions with junk limit values]]
 +
    | {{ #ifeq: {{{limit}}} | 50
 +
      | [[Category:((Card query)) transclusions with an unnecessary limit]]
 +
      | {{ #ifexpr: {{{limit}}} > 500
 +
        | [[Category:((Card query)) transclusions with a limit above $smwgQMaxInlineLimit]]
 +
        | [[Category:Queries with a custom limit]]
 +
      }}
 +
    }}
 +
  }}
 +
}}{{ #if: {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}} }}
 +
           {{ #pos: {{ #var: $cq_query_lc }} | {{))!}} or {{!((}} }}
 
   | [[Category:Queries with disjunctions]]
 
   | [[Category:Queries with disjunctions]]
}}{{ #if: {{ #pos: {{ #var: $query_query }} | {{!))}}{{!((}} }}
+
}}{{ #if: {{ #pos: {{ #replace: {{ #var: $cq_query }} }} | {{))!}}{{!((}} }}
          {{ #pos: {{ #var: $query_query }} | {{!))}} {{!((}} }}
 
 
   | [[Category:Queries with multiple terms]]
 
   | [[Category:Queries with multiple terms]]
}}{{ #if: {{ #pos: {{ #var: $query_query_lc }} | <q> }}
+
}}{{ #if: {{ #pos: {{ #var: $cq_query_lc }} | <q> }}
 
   | [[Category:Queries with subqueries]]
 
   | [[Category:Queries with subqueries]]
}}{{ #if: {{ #pos: {{ #var: $query_query }} | ::! }}
+
}}{{ #if: {{ #pos: {{ #var: $cq_query }} | ::~ }}
           {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}! }}
+
          {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}}~ }}
 +
          {{ #pos: {{ #var: $cq_query }} | {{!((}}~ }}
 +
          {{ #pos: {{ #var: $cq_query }} | ::!~ }}
 +
          {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}}!~ }}
 +
          {{ #pos: {{ #var: $cq_query }} | {{!((}}!~ }}
 +
  | [[Category:Queries with a like comparator]]
 +
}}{{ #if: {{ #pos: {{ #var: $cq_query_lc }} | ::like: }}
 +
           {{ #pos: {{ #var: $cq_query_lc }} | {{!}}{{!}}like: }}
 +
          {{ #pos: {{ #var: $cq_query_lc }} | ::nlike: }}
 +
          {{ #pos: {{ #var: $cq_query_lc }} | {{!}}{{!}}nlike: }}
 +
  | [[Category:Queries with a like comparator]][[Category:Queries using LIKE/NOT LIKE SQL notation]]
 +
}}{{ #if: {{ #pos: {{ #replace: {{ #var: $cq_query }} | ::!~ }} | ::! }}
 +
          {{ #pos: {{ #replace: {{ #var: $cq_query }} | {{!}}{{!}}!~ }} | {{!}}{{!}}! }}
 +
          {{ #pos: {{ #replace: {{ #var: $cq_query }} | {{!((}}!~ }} | {{!((}}! }}
 
   | [[Category:Queries with a not equal comparator]]
 
   | [[Category:Queries with a not equal comparator]]
}}{{ #if: {{ #pos: {{ #var: $query_query }} | ::< }}
+
}}{{ #if: {{ #pos: {{ #var: $cq_query }} | ::< }}
           {{ #pos: {{ #var: $query_query }} | ::> }}
+
           {{ #pos: {{ #var: $cq_query }} | ::> }}
           {{ #pos: {{ #var: $query_query }} | ::≤ }}
+
           {{ #pos: {{ #var: $cq_query }} | ::≤ }}
           {{ #pos: {{ #var: $query_query }} | ::≥ }}
+
           {{ #pos: {{ #var: $cq_query }} | ::≥ }}
           {{ #pos: {{ #var: $query_query }} | ::~ }}
+
           {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}}< }}
           {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}< }}
+
           {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}}> }}
           {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}> }}
+
           {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}}}}
           {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}}}
+
           {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}}}}
           {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}}}
+
           {{ #pos: {{ #var: $cq_query }} | {{!((}}< }}
           {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}~ }}
+
          {{ #pos: {{ #var: $cq_query }} | {{!((}}> }}
 +
           {{ #pos: {{ #var: $cq_query }} | {{!((}}≤ }}
 +
          {{ #pos: {{ #var: $cq_query }} | {{!((}}}}
 
   | [[Category:Queries with comparators]]
 
   | [[Category:Queries with comparators]]
 +
}}{{ #if: {{ #pos: {{ #var: $cq_query }} | ::+ }}
 +
          {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}}+ }}
 +
          {{ #pos: {{ #var: $cq_query }} | {{!((}}+ }}
 +
  | [[Category:Queries with wildcards]]
 +
}}{{ #if: {{ #pos: {{ #var: $cq_query_lc }} | english name }}
 +
          {{ #pos: {{ #var: $cq_query_lc }} | page name }}
 +
          {{ #pos: {{ #var: $cq_query }} | {{!((}}~ }}
 +
          {{ #pos: {{ #var: $cq_query }} | {{!((}}! }}
 +
          {{ #pos: {{ #var: $cq_query }} | {{!((}}< }}
 +
          {{ #pos: {{ #var: $cq_query }} | {{!((}}> }}
 +
          {{ #pos: {{ #var: $cq_query }} | {{!((}}≤ }}
 +
          {{ #pos: {{ #var: $cq_query }} | {{!((}}≥ }}
 +
          {{ #pos: {{ #var: $cq_query }} | {{!((}}+ }}
 +
  | [[Category:Queries which specify cards for inclusion/exclusion]]
 +
}}{{ #if: {{ #pos: {{ #var: $cq_query }} | <> }}
 +
  | [[Category:Queries with a bad comparator]]
 +
}}{{ #invoke: check for unknown parameters | check
 +
| unknown = [[Category:((Card query)) transclusions using unknown parameters]]
 +
| showblankpositional = 1
 +
| preview = unknown <nowiki>{{Card query}}</nowiki> parameter "_VALUE_"
 +
| 1 | medium | type
 +
| extra_column | extra_column2
 +
| limit | sort | order | default
 +
| debug | t
 
}}<noinclude>
 
}}<noinclude>
 
{{Documentation}}</noinclude>
 
{{Documentation}}</noinclude>

Latest revision as of 16:49, 25 January 2024

SQLStore debug output
ASK Query
[[Card type::Monster Card]]
SQL Query
SELECT DISTINCT
  t0.smw_id AS id,
  t0.smw_title AS t,
  t0.smw_namespace AS ns,
  t0.smw_iw AS iw,
  t0.smw_subobject AS so,
  t0.smw_sortkey AS sortkey, t0.smw_sort,
  t0.smw_title,
  t0.smw_subobject
FROM
  `smw_object_ids` AS t0
INNER JOIN
  `smw_di_wikipage` AS t1 ON t0.smw_id=t1.s_id
WHERE
  (t1.p_id='596' AND t1.o_id='1389')
  AND t0.smw_iw!=':smw'
  AND t0.smw_iw!=':smw-delete'
  AND t0.smw_iw!=':smw-redi'
ORDER BY
  t0.smw_sort ASC,
  t0.smw_title ASC,
  t0.smw_subobject ASC
LIMIT
  55
OFFSET
  0
SQL Explain
IDselect_typetabletypepossible_keyskeykey_lenrefrowsExtra
1SIMPLEt1refs_id,o_id,p_id,s_id_2,s_id_3,o_id_2,o_id_3o_id5const76892Using where; Using temporary; Using filesort
1SIMPLEt0eq_refPRIMARY,smw_id,smw_iw,smw_iw_2PRIMARY4ygowiki.t1.s_id1Using where
Auxilliary Tables
No auxilliary tables used.
Query Metrics
Query-Size:2
Query-Depth:1
Errors and Warnings
None
  • #ask query ($cq_full_query): [[Card type::Monster Card]]
  • $cq_query:
  • $cq_query_lc:
  • $cq_query_normalized:
  • $cq_medium:
  • $cq_medium_query:
  • $cq_query_medium:
  • $cq_card_type: monster
  • $cq_card_type_query: [[Card type::Monster Card]]
  • $cq_concept_query:
  • $cq_monster_count: 44863
  • $cq_nonmonster_count: 22330
  • $cq_spell_count: 13056
  • $cq_trap_count: 8848
  • $cq_col_card_type: ?Card type =
  • $cq_col_character:
  • $cq_col_japanese_name: ?Japanese name
  • $cq_col_primary_type: ?Primary type
  • $cq_col_secondary_type: ?Secondary type
  • $cq_col_attribute: ?Attribute = [[Attribute]]
  • $cq_col_type: ?Type = [[Type]]
  • $cq_level_in_results: 1
  • $cq_rank_in_results: 1
  • $cq_link_in_results:
  • $cq_col_level/rank/link_label: [[Level]]/<br />[[Rank]]
  • $cq_col_level/rank/link: ?Stars string = [[Level]]/<br />[[Rank]]
  • $cq_col_level:
  • $cq_col_rank:
  • $cq_col_scale: ?Pendulum Scale = [[Pendulum Scale|Scale]]
  • $cq_col_link_rating: ?Link Rating = [[Link Rating|Link]]
  • $cq_equal_atkdef:
  • $cq_col_atk: ?ATK string = [[ATK]]
  • $cq_col_def: ?DEF string = [[DEF]]
  • $cq_col_maximum_atk:
  • $cq_col_card_type_st:
  • $cq_col_property:
  • {{{extra_column}}}:
  • {{{extra_column2}}}:
  • $cq_col_extra:
  • $cq_col_extra_2:
  • limit: 50
  • $cq_sort: #
  • $cq_order:
  • $cq_default:
  • $cq_count: 44863