Skip to content

startswith

relationalai.semantics.std.strings
startswith(s: StringValue, prefix: StringValue) -> Expression

Check whether s starts with prefix.

  • Expression - An Expression that evaluates to true if s starts with prefix.

Filter strings that start with a prefix:

>>> select(Person.name).where(strings.startswith(Person.last_name, Person.name))
RelationalAI Documentation
└──  Build With RelationalAI
    └──  Understand how PyRel works > Use advanced reasoning > Rules-based reasoning
        └──  Work with strings
            └──  Filter facts with text conditions