Skip to content

endswith

relationalai.semantics.std.strings
endswith(s: StringValue, suffix: StringValue) -> Expression

Check whether s ends with suffix.

  • Expression - An Expression that evaluates to true if s ends with suffix.

Filter strings that end with a suffix:

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