fix broken WQL combining plus and or

Ticket

+commit
 

 

 

(These are included together on http://grouppatternlanguage.org/wagn/broken_search_example )

 

http://grouppatternlanguage.org/wagn/assigned_images finds captioned images where +Patterns points to Pattern cards with:

{"type": "captioned image",
  "plus": ["Patterns", {"refer_to": {"type": "Pattern"}} ]
}

http://grouppatternlanguage.org/wagn/images_missing_creator finds captioned images lacking a creator with:

{"type": "captioned image",
  "or": {"not": {"plus": "creator"},
         "plus": ["creator", {"content": "" } ] }
}

So why does http://grouppatternlanguage.org/wagn/combined_search_broken find the same cards as the latter (mostly not plussed to Patterns at all)? Its WQL:

{"type": "captioned image",
  "plus": ["Patterns", {"refer_to": {"type": "Pattern"}} ],
  "or": {"not": {"plus": "creator"},
         "plus": ["creator", {"content": ""} ] }
}

This works, see http://grouppatternlanguage.org/wagn/assigned_images_missing_creator :

{"type": "captioned image",
  "plus": ["Patterns", {"refer_to": {"type": "Pattern"}} ],
  "not": {"plus": ["creator", {"ne": ""} ] }
}

 

fixed and added test.  (problem was that :plus actually used :or, and the two uses conflicted)