select ?lt, ("Warning") as ?severity,
(if (bif:isnotnull (sql:R2RML_MAIN_KEY_EXISTS (?ts, ?to, ?tn, 1)),
bif:concat ("rr:tableName refers to ", sql:R2RML_MAIN_KEY_EXISTS (?ts, ?to, ?tn, 1), " as to ",
bif:sprintf ("%s.%s.%s", bif:coalesce (?to, "DB"), bif:coalesce (?ts, "DBA"), ?tn),
", i.e., using wrong character case; adjust the R2RML or the table before generating an RDF View" ),
"rr:tableName refers to table that does not exist; adjust the R2RML or create the table before generating an RDF View" ) ) as ?message
where {
?lt rr:tableName ?tn .
OPTIONAL { ?lt rr:tableOwner ?to }
OPTIONAL { ?lt rr:tableSchema ?ts }
filter (bif:isnull (sql:R2RML_MAIN_KEY_EXISTS (?ts, ?to, ?tn, 0))) }