like
relationalai.semantics.std.strings
like(s: StringValue, pattern: StringValue) -> ExpressionCheck whether s matches the SQL LIKE pattern pattern.
Parameters
Section titled “Parameters”
(sStringValue) - The string to match against.
(patternStringValue) - The SQL LIKE pattern (%for wildcard,_for single character).
Returns
Section titled “Returns”Expression- AnExpressionthat evaluates totrueifsmatches the pattern.
Examples
Section titled “Examples”Match strings using SQL LIKE patterns:
>>> select(Brand.name).where(strings.like(Brand.name, r"Mc%"))>>> select(Brand.name).where(strings.like(Brand.name, r"%est%"))Referenced By
Section titled “Referenced By”RelationalAI Documentation └── Build With RelationalAI └── Understand how PyRel works > Use advanced reasoning > Rules-based reasoning └── Work with strings └── Filter facts with text conditions