SPARQL 查询 OWL 文件
我可以向您询问有关本体的 SPARQL 查询吗?我有一个 family.owl 文件,它是从 protege 3.4 构建的本体,包含数据:
Lan haschild Tuấn,
Tùng haschild Tuấn.
我在网站上使用 Java 和 CORESE API (http://www-sop.inria.fr/edelweiss/software/corese/v2_4_0/manual/index.html)。 php#coreseapi )来查询上面的 family.owl 。使用以下 SPARQL 查询:
PREFIX fm:< http://www.owl-ontologies.com/Ontology1287989576.owl#>
SELECT ?child
WHERE
{
fm:Lan fm:haschild ?child
}
结果为 Tuấn (真实结果必须为 Tuấn)
如果我将“where”子句替换为: WHERE { fm:Tùng fm:haschild ?child }
那么结果为空(真实结果必须是 Tuấn)
我知道字符串“Tùng”和“Tuấn”的错误结果。这个字符串有字符 unicode ù, ấ
你能让我在 CORESE API 中使用 unicode 字符来使用 sparql 查询 owl 文件吗?
Could I ask you about a SPARQL query on an Ontology. I have a family.owl file is the ontology build from protege 3.4 with data:
Lan haschild Tuấn,
Tùng haschild Tuấn.
I use Java and CORESE API on site (http://www-sop.inria.fr/edelweiss/software/corese/v2_4_0/manual/index.php#coreseapi ) to query the family.owl above. With the following SPARQL query:
PREFIX fm:< http://www.owl-ontologies.com/Ontology1287989576.owl#>
SELECT ?child
WHERE
{
fm:Lan fm:haschild ?child
}
The result is Tuấn (true result must be Tuấn)
If I replace "where" clause as: WHERE { fm:Tùng fm:haschild ?child }
then the result is empty (true result must be Tuấn)
I know the wrong result at string "Tùng" and "Tuấn". This string has character unicode ù, ấ
Can you have me using unicode character in CORESE API to query owl file with sparql.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个可能的解决方案是转义 URI,而不是:
和
如果您以这种方式创建数据,您应该不会遇到问题。不太建议在 URI 中使用重音符号,因此人们倾向于对 URI 进行编码/转义,并且大多数语言都有用于编码 URI 的库。例如,在 Python 中就像这样简单......
A possible solution is to escape the URIs so instead of:
and
If you create the data in this way you should not have problems. It's not very advisable to have accents in the URIS so people tend to encode/escape URIs for that reason, and most languages have libraries to encode URIs. For instance in Python is as easy as ...