Difference between revisions of "SPQL: SPecies Query Language"
From Gcube Wiki
(→Synopsis) |
|||
Line 39: | Line 39: | ||
=== Synopsis === | === Synopsis === | ||
<code> | <code> | ||
− | SEARCH BY '''term''' [, ...] | + | SEARCH BY '''''term''''' [, ...] |
− | [ IN '''datasource''' [, ...] ] | + | [ IN '''''datasource''''' [, ...] ] |
− | [ WHERE '''condition''' [AND '''condition'''] ] | + | [ WHERE '''''condition''''' [AND '''''condition'''''] ] |
− | [ RETURN ''Product'' | ''Occurrence'' | ''Taxon'' ] | + | [ RETURN '''Product''' | '''Occurrence''' | '''Taxon''' ] |
− | [ HAVING '''having expression''' ] | + | [ HAVING '''''having expression''''' ] |
+ | </code> | ||
+ | |||
+ | Where '''''term''''' can be one of: | ||
+ | <code> | ||
+ | CN ''common name'' RESOLVE [ WITH '''''datasource''''' [, ...] ] [EXPAND [ WITH '''''datasource''''' [, ...] ] ] | ||
+ | SN ''scientific name'' [ RESOLVE [ WITH '''''datasource''''' [, ...] ] ] [EXPAND [ WITH '''''datasource''''' [, ...] ] ] | ||
</code> | </code> | ||
===Description=== | ===Description=== |
Revision as of 14:37, 3 April 2013
SPQL is a language used to query the Species Product Discovery Service
Contents
Grammar
query: terms (IN identifiers)? (WHERE expressions)? (RETURN returnExpression)? terms: term (',' term)* term: words AS (('ScientificName'|'SN') | ('CommonName'|'CN')) words: word (',' word)* word : STRING identifiers: identifier (',' identifier)* identifier: ID expressions: expression (AND expression)* expression: (bc=boundCondition | dateCondition) boundCondition: ('lowerBound' | 'upperBound') IS coordinate dateCondition: ('fromDate' | 'toDate') IS date date: INT '/' INT '/' INT coordinate: FLOAT ',' FLOAT returnExpression: '*' (havingExpression)? | 'Occurrence' | 'Taxon' havingExpression: HAVING 'Occurrence' | 'Taxon'
SPQL 2.0
Synopsis
SEARCH BY term [, ...] [ IN datasource [, ...] ] [ WHERE condition [AND condition] ] [ RETURN Product | Occurrence | Taxon ] [ HAVING having expression ]
Where term can be one of:
CN common name RESOLVE [ WITH datasource [, ...] ] [EXPAND [ WITH datasource [, ...] ] ] SN scientific name [ RESOLVE [ WITH datasource [, ...] ] ] [EXPAND [ WITH datasource [, ...] ] ]