我在C#中使用SemWeb.Sparql.dll通过C#在sparql中执行一些查询我需要将给定的字符串变量与本体(rdfs:label)中的字符串进行比较,但我需要这种比较不区分大小写,所以我使用了regex函数。我使用了这个查询:
disease = "'^" + disease + "'";
string query = prefixes + @"
Select ?a ?name Where{
?a ?c owl:Class .
?a rdfs:label ?name.
FILTER (Regex(?name," + @disease + ",'i'))}";它在某些情况下工作正常,但在others.can中没有任何人帮助我。
发布于 2012-05-25 22:33:44
你能试试下面的方法吗:
FILTER (regex(str(?name), ...例如,在str()中包装?name。这将确保第一个参数是字符串。
https://stackoverflow.com/questions/10755979
复制相似问题