如何在sparql查询中转义撇号

use*_*940 1 sparql

我在protege(猫头鹰版本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 . }
Run Code Online (Sandbox Code Playgroud)

查询从撇号中断。我尝试在'前面使用\。但这没有用。我找到了此链接。http://www.w3.org/TR/rdf-sparql-query/#QSynLiterals。在执行完类似的操作之后,WHERE {wel:Grandmother <STRING_LITERAL1> s_house?classOf?o。}。还是没用。如何在查询中转义撇号?

And*_*dyS 5

你可以写wel:Grandmother\'s_house。就是说,这是对SPARQL 1.1的较新的添加,您可能正在使用具有最终规范版本的语言的系统。

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