polydb:rest:intro

The polyDB can be accessed via a REST API

Base path:

https://polydb.org/beta/rest/current/

The API implements the following endpoints:

  • Info on collections
    • section
    • sections
    • collection
    • collections
  • Schema
    • schema
  • Querying the Database
    • find
    • find_one
    • count
    • distinct
    • id

For more information see below.

section

This returns section documentation and a list of subsections and collections in this section:

https://polydb.org/beta/rest/current/section/<sectionname>/<subsectionname>/... 

with possible parameters

recursive={0,1}

and

short={0,1}

. Example:

https://polydb.org/beta/rest/current/section/Polytopes?recursive=1

returns

{

    "description": "A collection of families of polytopes",
    "subsections": [
        "Polytopes.Combinatorial",
        "Polytopes.Geometric",
        "Polytopes.Lattice"
    ],
    "collections": [
        "Polytopes.Combinatorial.01Polytopes",
        "Polytopes.Combinatorial.CombinatorialTypes",
        "Polytopes.Combinatorial.FacesBirkhoffPolytope",
        "Polytopes.Combinatorial.SmallSpheresDim4",
        "Polytopes.Geometric.01Polytopes",
        "Polytopes.Lattice.01Polytopes",
        "Polytopes.Lattice.ExceptionalMaximalHollow",
        "Polytopes.Lattice.Reflexive",
        "Polytopes.Lattice.SmoothReflexive"
    ]

}

sections

This returns a list of subsections of the given one

collection

This prints full information on a collection. The collection is given as

/section/<sectionname>/<subsectionname>/.../<collectionname>

Here is an example:

https://polydb.org/beta/rest/current/collection/Tropical/SchlaefliFan

collections

This lists all collections contained in a section.

/section/<sectionname>/<subsectionname>/.../

Example:

https://polydb.org/beta/rest/current/collections/Tropical/

returns

[

    "Tropical.Cubics",
    "Tropical.Polytropes",
    "Tropical.SchlaefliFan",
    "Tropical.TOM"

]

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.

Example:

https://polydb.org/beta/rest/current/find/Polytopes/Lattice/Reflexive?query={"N_VERTICES"%3A5}&limit=10&skip=100

will return at most 10 reflexive polytopes with 5 vertices, skipping the first 100 matches.

find_one

This works as find, but returns at most one match. The option limit does not apply here.

Example:

https://polydb.org/beta/rest/current/find_one/Polytopes/Lattice/Reflexive?query={"N_VERTICES"%3A5}

distinct

count

This counts the number of results that match a given query. Example:

https://polydb.org/beta/rest/current/count/Polytopes/Combinatorial/01Polytopes?query={"N_VERTICES"%3A15}

returns

139983

id

Returns a single document by its id.

Example

https://polydb.org/beta/rest/current/id/Polytopes/Combinatorial/01Polytopes/5d.15v.10f.C8

schema

Example

https://polydb.org/beta/rest/current/schema/Polytopes/Lattice/Reflexive
  • polydb/rest/intro.txt
  • Last modified: 2020/04/01 19:12
  • by paffenholz