polydb:rest:intro

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
polydb:rest:intro [2020/04/01 12:02] paffenholzpolydb:rest:intro [2023/03/24 21:55] (current) paffenholz
Line 5: Line 5:
 Base path: Base path:
 <code> <code>
-https://polydb.org/beta/rest/current/+https://polydb.org/rest/current/
 </code> </code>
  
Line 21: Line 21:
     * count     * count
     * distinct     * distinct
 +    * id
  
-For more information see below. +Some examples are below. 
  
-==== Obtain info on available collections ====+The full documentation of all endpoints with examples for data and code **[[https://polymake.org/polytopes/paffenholz/polyDB-rest.html|is here]]**.
  
-=== section ===+==== Some examples for the REST API ==== 
 + 
 +=== Obtain info on available collections === 
 + 
 +== section ==
  
 This returns section documentation and a list of subsections and collections in this section: This returns section documentation and a list of subsections and collections in this section:
 <code> <code>
-/section/<sectionname>/<subsectionname>/... +https://polydb.org/rest/current/section/<sectionname>/<subsectionname>/... 
 </code> </code>
 with possible parameters <code>recursive={0,1}</code> and <code>short={0,1}</code>. Example: with possible parameters <code>recursive={0,1}</code> and <code>short={0,1}</code>. Example:
 <code> <code>
-https://polydb.org/beta/rest/current/section/Polytopes?recursive=1+https://polydb.org/rest/current/section/Polytopes?recursive=1
 </code> </code>
 returns returns
Line 61: Line 66:
 </code> </code>
  
-=== sections ===+== sections ==
  
 This returns a list of subsections of the given one This returns a list of subsections of the given one
  
-=== collection ===+== collection ==
  
 This prints full information on a collection. The collection is given as  This prints full information on a collection. The collection is given as 
Line 74: Line 79:
 Here is an example: Here is an example:
 <code> <code>
-https://polydb.org/beta/rest/current/collection/Tropical/SchlaefliFan+https://polydb.org/rest/current/collection/Tropical/SchlaefliFan
 </code> </code>
  
-=== collections ===+== collections ==
  
 This lists all collections contained in a section. This lists all collections contained in a section.
Line 86: Line 91:
 Example: Example:
 <code> <code>
-https://polydb.org/beta/rest/current/collections/Tropical/+https://polydb.org/rest/current/collections/Tropical/
 </code> </code>
 returns returns
Line 100: Line 105:
 </code> </code>
  
-==== Query Data ====+=== Query Data ===
  
-=== find ===+== find ==
  
 This endpoint does a general query on the given collection and returns a list of the results. You can set the options sort, limit, and skip. However, the query never returns more than 10 entries. This endpoint does a general query on the given collection and returns a list of the results. You can set the options sort, limit, and skip. However, the query never returns more than 10 entries.
Line 108: Line 113:
 Example: Example:
 <code> <code>
-https://polydb.org/beta/rest/current/find/Polytopes/Lattice/Reflexive?query={"N_VERTICES"%3A5}&limit=10&skip=100+https://polydb.org/rest/current/find/Polytopes/Lattice/Reflexive?query={"N_VERTICES"%3A5}&limit=10&skip=100
 </code> </code>
 will return at most 10 reflexive polytopes with 5 vertices, skipping the first 100 matches. will return at most 10 reflexive polytopes with 5 vertices, skipping the first 100 matches.
  
-=== find_one ===+== find_one ==
  
 This works as find, but returns at most one match. The option limit does not apply here. This works as find, but returns at most one match. The option limit does not apply here.
Line 118: Line 123:
 Example: Example:
 <code> <code>
-https://polydb.org/beta/rest/current/find_one/Polytopes/Lattice/Reflexive?query={"N_VERTICES"%3A5}+https://polydb.org/rest/current/find_one/Polytopes/Lattice/Reflexive?query={"N_VERTICES"%3A5}
 </code> </code>
    
  
-=== distinct ===+== distinct ==
  
-=== count ===+== count ==
  
 This counts the number of results that match a given query. Example: This counts the number of results that match a given query. Example:
 <code> <code>
-https://polydb.org/beta/rest/current/count/Polytopes/Combinatorial/01Polytopes?query={"N_VERTICES"%3A15}+https://polydb.org/rest/current/count/Polytopes/Combinatorial/01Polytopes?query={"N_VERTICES"%3A15}
 </code> </code>
 returns returns
 <code> <code>
 139983 139983
 +</code>
 +
 +== id ==
 +
 +Returns a single document by its id.
 +
 +Example
 +<code>
 +https://polydb.org/rest/current/id/Polytopes/Combinatorial/01Polytopes/5d.15v.10f.C8
 </code> </code>
  
  
-==== Obtain the JSON Schema for the data ====+=== Obtain the JSON Schema for the data ===
  
-=== schema ===+== schema ==
  
 Example Example
 <code> <code>
-https://polydb.org/beta/rest/current/schema/Polytopes/Lattice/Reflexive+https://polydb.org/rest/current/schema/Polytopes/Lattice/Reflexive
 </code> </code>
  
  • polydb/rest/intro.1585742537.txt.gz
  • Last modified: 2020/04/01 12:02
  • by paffenholz