CQL, pronounced "cockle", stands for Card Query Language — a query language inspired by cards and their relationships.  CQL provides syntax for finding lists of cards.

(CQL was formerly known as WQL, for Wagn Query Language, before Wagn was renamed to Decko)

 

The following is a search card for all the User cards:

If you edited that card, you would find the following CQL query:

{ "type": "User" }

which roughly translates to:

Find all cards of the type "User."

or, more casually:

Gimme all the User cards.

See many more examples at CQL Syntax.

 

To create a search, you set a card's type to Search and then enter CQL Syntax.

 

(Note for developers: in Search cards, CQL is expressed in JSON, but in the code, it can be expressed in Ruby.)

 

  • CQL is made of queries within queries.  For example, you might do a search for "Person cards with +employee cards that link to Banana Computers".   This CQL would include a query for "cards that link to Banana Computers".  Often, it's best to build your CQL from the inside out.  In our example, you would first try to get a query that returns "cards that link to Banana Computers".  Once that works you move on to the rest of the query.
  • There are two main ways of creating lists on Decko: by Pointer, in which users create lists manually, and by Search which use CQL to find cards dynamically.
  • See the "set item views" section of the nesting card to learn how to configure presentation of search results.

 


I'm having a CQL problem and don't know where to ask for help.

 

My User cards have a +Locations Visited pointer, and I want a Location+Visitors to be a search that lists everyone who included the location in their Locations Visited plus card.

 

Visitors+*rform looks like this:

{"plus":["Locations Visited", {"refer_to":"_left"}]}

 

Which gives me this:

NoMethodError: undefined method `to_key' for nil:NilClass

 

If I replace "_left" with the location name in quotes, it works.

 

What do I need to do to make it work? Also, I'd be happy to move this discussion elsewhere if it doesn't belong.

  --Brandon Quinn.....Mon Oct 12 12:29:36 -0700 2009


try "_self" instead of "_left". Currently, "_self" refers to the card on which the search is based (ie, the left card), *not* to the search card itself. This is inexcusably confusing, so we're very likely to introduce and migrate to a new nomenclature eventually, but we haven't really determined the best solution yet.

 

Re belonging, we're now moving to a system where we're trying to steer most of these questions through "Support Ticket", where we think our community of power users will be more likely to see it. But no need to move this one :)

  --Ethan McCutchen.....Mon Oct 12 13:06:54 -0700 2009


NOTE: in general, the best way to get CQL help (or any kind of Decko help) is to submit a Support Ticket

--Ethan McCutchen.....2013-11-04 18:50:33 +0000