首页 文章

如何在sparql查询中转义撇号

提问于
浏览
1

我有一个查询,我在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 . }

查询从撇号中断开 . 我尝试在'. But it didn'工作前使用\ . 我找到了这个链接 . http://www.w3.org/TR/rdf-sparql-query/#QSynLiterals . 在接下来我做了这样的事情后,WHERE {wel:祖母<STRING_LITERAL1> s_house?classOf?o . } . 仍然没有用 . 如何在查询中转义撇号?

1 回答

  • 4

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

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

相关问题