| | -# Syntax does not include comments. |
| | +# Overview |
| | |
| | -root > people, # "root" is a special keyword |
| | -person > person, # > is a node to table relation |
| | -person.first_name -> name/first, # -> is a node/attribute to column relation |
| | -person.last_name -> name/last, |
| | -person.age -> [@age], |
| | -account.person_id => person.person_id, # => is a join |
| | -account > person/account, |
| | -account.id -> [@id]; # ; starts the WHERE clause |
| | +root > people, # "root" is a keyword |
| | +person > person, # maps a node to table context |
| | +.first_name > first, # maps a node to column |
| | +.last_name > name/last, # maps an ancestor node to a column |
| | +.age > @age, # @ maps an attribute to table node |
| | +account.person_id > person.person_id, # performs an inner join |
| | +account > account, # context is now "account" node |
| | +.id > @id; # ; starts the WHERE clause |
| | |
| | -# Where clause syntax |
| | +# Wildcard |
| | |
| | -account.id = :id # : starts a named parameter |
| | -account.id != :id # inequality parameter comparison |
| | -account.id = {:id, 1} # { ... } denotes set (IN) |
| | -account.id = null # null keyword |
| | +root > people, |
| | +person > person, |
| | +.*; # Columns mapped to correspondingly named elements. |
| | + |
| | +# Namespaces |
| | + |
| | +root > people(html, http://www.w3.org/TR/html4/), |
| | +person > html:person, |
| | + |
| | +person.id > people:id( people, http://www.people.com ), |
| | + |
| | +# Where clause |
| | + |
| | +account.id = $id # $ starts a named parameter |
| | +account.id <> $id # inequality parameter comparison |
| | +account.id = {$id, 1} # IN set |
| | +account.id <> {$id, 1} # NOT IN set |
| | account.id = null # becomes IS NULL |
| | -account.id != null # becomes IS NOT NULL |
| | +account.id <> null # becomes IS NOT NULL |
| | account.id = 'text' # string equality comparison |
| | account.id = -42 # numeric equality comparison |