inspect()#
relationalai.std.inspect
#inspect(type: Type, props: list[str]|None, limit: int = 20, silent = False) -> Var
Retrieves a sample of the objects in type
.
Parameters#
Name | Type | Description |
---|---|---|
type | Type | The type to inspect. |
props | list[str] or None | The properties to retrieve. If unspecified, retrieve all statically-known properties. |
limit | int | The maximum number of objects to retrieve (default: 20). |
silent | bool | Whether to suppress printing the returned dataframe. |
Returns#
A Dataframe
object.
Example#
#import relationalai as rai
from relationalai.std.inspect import inspect
model = rai.Model("people")
Person = model.Type("Person")
with model.rule():
Person.add(name="Joe", age=30)
Person.add(name="Susan", age=32)
inspect(Person)
# Output:
# person name age
# ──────────────────────────────────────
# aiTt+pn1Y6IexW+u9SgXhg Susan 32
# ppSccXmTLAgcxu4ZWgcKug Joe 30