是否可以使用内置的SPARQL函数按情况拆分字符串?
例如,接受下面的测试AllDrugs
是否可以使用返回“所有药物”的功能?
发布于 2016-03-22 19:42:44
当然,您只需要将模式( and )(And)替换为$1 $2 (其中$1是小写字母,$2是大写字母)。下面是一个例子:
select * where {
values ?string { "AllDrugs" "FourScoreAndSevenYearsAgo" }
bind(replace(?string, "([a-z])([A-Z])", "$1 $2") as ?splitString)
}------------------------------------------------------------------
| string | splitString |
==================================================================
| "AllDrugs" | "All Drugs" |
| "FourScoreAndSevenYearsAgo" | "Four Score And Seven Years Ago" |
------------------------------------------------------------------https://stackoverflow.com/questions/36163538
复制相似问题