This is an old revision of the document!
Querying the Database
There are three commands that can be used to query the database:
db_query
: Obtain one or more objects that satisfy a querydb_count
: Count objects that satisfy a querydb_ids
: Obtainid
s of objects that satisfy a query
Queries
Queries are given as perl hashes. In its most basic form a query has the form
{ "PROPERTY1" => <value1>, "PROPERTY2" => <value2>, ... }
for example
{ "DIM" => 3, "N_VERTICES" => 7 }
Note that the database is pretty strict with types, so strings always need to be quoted, while integers should not be. The following would fail:
{ "DIM" => "3" }
You can query elements in an array with their index, e.g.
{ "F_VECTOR.1" => 12 }
gives polytopes with 5 edges (the entry at position one of the f-vector.