strixonomy_swrl/
builtins.rs1pub const SWRLB_NS: &str = "http://www.w3.org/2003/11/swrlb#";
4
5pub const SUPPORTED_BUILTINS: &[&str] = &[
7 "equal",
8 "notEqual",
9 "lessThan",
10 "lessThanOrEqual",
11 "greaterThan",
12 "greaterThanOrEqual",
13 "add",
14 "subtract",
15 "multiply",
16 "divide",
17 "stringEqualIgnoreCase",
18 "stringConcat",
19 "substring",
20 "stringLength",
21 "contains",
22 "startsWith",
23 "endsWith",
24 "matches",
25 "booleanNot",
26];
27
28pub fn is_supported_builtin(predicate_iri: &str) -> bool {
29 let Some(local) = predicate_iri.strip_prefix(SWRLB_NS) else {
32 return false;
33 };
34 SUPPORTED_BUILTINS.contains(&local)
35}
36
37#[allow(dead_code)]
38pub fn builtin_iri(local: &str) -> String {
39 format!("{SWRLB_NS}{local}")
40}