Project

General

Profile

Feature #1275

Updated by Bernhard Koschiček-Krombholz over 3 years ago

As discussed at the [[Meeting_API_2020-06-15|API meeting]], the API need more parameters, so a frontend can used it.   

 *Branch name:* feature_api_pagination 

 First wave parameters: 
 * Pagination -> Seek Method (done) 
 * Filtering (=, !=, <, <=, >, >=, LIKE, IN, AND, OR, AND NOT, OR NOT)(done) 
 * Sorting (done)  

 Second wave parameters: 
 * Real queries:  
 ** show subunits for classes and types #1206 
 ** Give me the entity and all linked entities 
 ** Give me the entity and all subunits of this entity 
 ** Give me the entity and all super types of this entity 
 ** Show only specific entries of entities --> selective query (e.g.: Show only name and geo data) (done) 

  

 Please change the parameters to your needs.  

 Example of path. 
 <pre><code class="xml"> 
   /query/: /class/{class}: 
     get: 
       tags: 
       
        - Users 
       summary: retrieves a list of geojson based on multiple query parameters representations wich share a specified class code 
       operationId: retrieveQuery retrieveEntitiesByClass 
       security:  
       
         - cookieAuth: [] 
             
       parameters:  
       
         - in: query 
         path 
           name: entities[] 
         description: get specific entities by id 
         schema: class 
           type: number  
       - in: query 
         name: classes[] 
         description: get specific classes by cidoc a cidocCRM class code e.g. E18 
         eg E21 
           required: true 
           schema: 
           
             type: string 
       
         - in: query 
         name: items[] 
         description: get specific menu items e.g. actor, place 
         schema: 
           type: string           
       - in: query 
         name: limit 
         
           description: number of geojson representations to be returned 
         
           schema: 
           
             type: number 
       
         - in: query 
         
           name: column 
         
           description: the column wich should be sorted and filtered 
         
           schema: 
           
             type: string 
           enum: 
             
         - id 
             -    class_code 
             -    name 
             -    description 
             -    created 
             -    modified 
             -    system_type 
             -    begin_from 
             -    begin_to 
             -    end_from 
             -    end_to 
       - in: query 
         
           name: sort 
         
           description: sort direction asc/desc 
         
           schema: 
           
             type: string 
           enum: 
             
         - asc 
             - desc 
       - in: query 
         
           name: filter 
         
           description: filter operator to be applied 
         schema: 
           type: string     
       - in: query 
         name: first 
         description: first id of a page 
         schema: 
           
             type: number 
       - in: query 
         name: last 
         description: last id of a page 
         schema: 
           type: number 
       - in: query 
         name: show 
         description: select which key should be shown e.g. when, types, relations, names, links, geometry, depictions, not 
         schema: 
           type: string 
           enum: 
             - when 
             - types 
             - relations 
             - names 
             - links 
             - geometry 
             - depictions 
             - not 
                   
       responses: 
         '200': 
           description: a geojson representation of the specified entities 
           content: 
               application/ld+json: 
                 schema: 
                   $ref: '#/components/schemas/featureCollectionGeoJSON' 
         '404': 
           description: not found 

 </code></pre>

Back