FAQs
These FAQs (frequently asked questions) can be extended, if you help us. Please submit an issue if you have a question that should be answered here.
How do I declare a LIST property?
Use the datatype parameter (available with Property constructors and
with the add_property method and the LIST function.
# with constructor
p = caosdb.Property(name="ListOfDoubles", datatype=caosdb.LIST(caosdb.DOUBLE))
# with add_property method
my_entity.add_property(name="ListOfIntegers", datatype=caosdb.LIST(caosdb.INTEGER))
my_entity.add_property(name="ListOfThings", datatype=caosdb.LIST("Thing"))
my_entity.add_property(name="ListOfThings", datatype=caosdb.LIST(caosdb.RecordType('Thing'))
Which data types are there?
There are 7 basic data types:
INTEGERDOUBLEDATETIMETEXTBOOLEANFILEREFERENCE
There is (so far) 1 data type for collections:
LIST(Actually, LIST-of-another-data-type, e.g.LIST(INTEGER))
And furthermore,…
Any RecordType can be used as a
REFERENCEdata type with a limited scope. That is, a propertyp = caosdb.Property(name="Conductor", datatype="Person")
will only accept those Entities as value which have a “Person” RecordType as a direct or indirect parent.
See also: Datatype.