CQL+Design+braindump
The Lewis card (which has id 27)
{ :name=> 'Lewis' } # ORAll of the following are hashes -- the outer {} is implicit
{ :id=> 27 } # OR
'Lewis' #OR
27
Cards with "lew" in the name
:name => [:match, 'lew'] #ORAll company cards
:name => ['~', 'lew']
:type => :Company #codename OR
:type => 'Company' #cardname
All company cards
:type => :Company #codename ORCards where the content is 'off':
:type => 'Company' #cardname
:content => [:eq, 'off'] #ORCards where the content is "30".
:content => ['=', 'off] #OR
:content => 'off' #OR
:eq => 'off' #OR
'=' => 'off'
:content => 30 #ORCards where the content matches 'pleeze':
:content => '30' #OR
:eq => 30 .....
:content => [:match, 'pleeze'] #ORCards where the content is greater than "30"
:content => ['~', 'pleeze'] #or, I guess... :val => %{ ~ pleeze } OR
:match => 'pleeze' #OR
'~' => 'pleeze'
:content => ['>', 30] #ORCards where the cardtype is Person or Company
:content => [:gt, 30] #OR
:gt => 30
'~' => 30
:type => [:in, 'Person', :Company]Cards with SiteMaster role
:role => 'SiteMaster' #returns cards with user (account) extension ORCards with Anonymous role
:role => 4 #role id
:role => :anonRole Cards of roles that Lewis belongs to
:member => 'Lewis' #returns role cards (cards with role extension). ORCards Lewis has edited
:member => 27 # user id
:editor => 'Lewis' # ORCards connected to Lewis card
:editor => 27 # user id
(note we could also do card defs for these role,user, and cardtype things eventually, but I don't think it's pressing)
Cards with a connection card that is a date
:plus => [ {:name => 'Lewis' }, nil ] # full plus def -- [part, connection] OR
:plus => ['Lewis', nil ] # full plus def -- [part, connection] OR
:plus => { :name=>'Lewis' } # if only one card def, assumes part OR
:plus => 'Lewis' #card def shorthand with name OR
:plus => 27 #card def shorthand with id
:plus => [nil, { :type =>'Date' }]Cards that connect to Lewis and form Image cards
:plus => ['Lewis', { :type => 'Image' }]Connection cards of which Lewis is part
:part => {:name=>'Lewis' } #ORConnection cards of which Lewis is the right part
:part => 'Lewis'
:right=>'Lewis'Image cards that are connections of which Lewis is part
:type => 'Image',Cards that link to -- or transclude -- 'Site Map'
:part => 'Lewis'
:refer_to => { :name => 'Site Map' } #ORCard that are linked to or transcluded by 'Foo'
:refer_to => 'Site Map'
:referred_to_by => 'Foo'
Cards that link to 'Site Map'
:link_to => 'Site Map'Cards that transclude 'Site Map'
:include => 'Site Map'Cards with broken links
:link_to => :_noneCards that are linked to from - or transcluded by - 'Site Map'
:included_by => 'Site Map'Cards that are linked to from 'Site Map'
:linked_to_by => 'Site Map'Organizations that work for Immigrants in Lane County (where both are connected to the organization by pointers
:type => 'Organization',
:plus => ['place', { :refer_to => 'Lane County' } ],
:plus => ['topic', { :refers_to => 'Immigrants' } ]
CONTEXT: LEWIS CARD
Cards Lewis has edited
:editor => :_selfCards connected to Lewis card
:plus => :_self
CONTEXT: COMPANY CARD
Company Cards
:type => :_self
CONTEXT: Lewis+address
Lewis+state Card
:left=> :_left,Cards Lewis has edited
:right=>'state'
:editor => :_leftUp to 20 User cards
:type => :User,User cards in alphabetical order
:limit => 20
:type => :User,User cards in alphabetical order, number 20 to 40
:sort => :alpha
:type => :User,User cards in reverse alphabetical order
:sort => :alpha,
:limit => '20,20' #or however that works in SQL
:type => :User,Cards that are commonly connected to Company cards
:sort => :alpha,
:dir => :desc
:plus => {:type=>'Company'},NOTE Sort orders: :alpha, :update, :create, :plusses (kind of thinking last edit should be default?)
:sort => :plusses
Number of user cards
:type => :User,NOTE Return values: :list, :count (for first we just do limit 1...)
:return => :count
FUTURE:
(I don't think we should bother with this yet)
Card that are Address cards or have "home" as their tag
:or => { :type=>:Address,
:right => 'home' }