inspect()#

relationalai.std.inspect
#inspect(type: Type, props: list[str]|None, limit: int = 20, silent = False) -> DataFrame

Gets a pandas DataFrame containing a sample of the objects in type and their statically known properties.

Parameters#

NameTypeDescription
typeTypeThe type to inspect.
propslist[str] or NoneThe properties to inspect. If None, inspects all statically known properties.
limitintThe maximum number of objects to sample. (Default: 20)

Returns#

A pandas Dataframe object.

Example#

Use inspect() to get a sample of objects in a Type and their statically known properties:

#import relationalai as rai
from relationalai.std.inspect import inspect


# =====
# SETUP
# =====

model = rai.Model("people")
Person = model.Type("Person")

with model.rule():
    Person.add(name="Joe", age=30)
    Person.add(name="Susan", age=32)


# =======
# EXAMPLE
# =======

df = inspect(Person)

print(df)
#                   person   name  age
# 0 aiTt+pn1Y6IexW+u9SgXhg  Susan   32
# 1 ppSccXmTLAgcxu4ZWgcKug    Joe   30

See Also#