如何在sparql查询中转义撇号

时间:2014-05-29 05:52:51

标签: sparql

我有一个查询,我在protege(owl版本3.4.2)中运行。我中间有一个撇号。

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wel: <http://www.semanticweb.org/dell/ontologies/2014/2/untitled-ontology-11#>
SELECT (strafter(str(?o), '#') AS ?gender) 
WHERE { wel:Grandmother's_house ?classOf  ?o . }

查询从撇号中断开。我尝试在'前面'使用\。但它没有用。我找到了这个链接。 http://www.w3.org/TR/rdf-sparql-query/#QSynLiterals。 在接下来我做了这样的事情, 在哪里{wel:祖母&lt; STRING_LITERAL1&gt; s_house?classOf?o。 }。仍然没有用。如何在查询中转义撇号?

1 个答案:

答案 0 :(得分:4)

你可以写wel:Grandmother\'s_house。也就是说,这是SPARQL 1.1的一个相当晚的补充,你可能正在使用一个具有该语言的最终规范版本的系统。

否则,您需要在<>中写出完整的URI。