[英]SPARQL QUERY OWL FILE
Could I ask you about a SPARQL query on an Ontology. 我可以问您一个关于本体的SPARQL查询吗。 I have a family.owl file is the ontology build from protege 3.4 with data:
我有一个family.owl文件是protege 3.4与数据的本体构建:
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. 我在网站(http://www-sop.inria.fr/edelweiss/software/corese/v2_4_0/manual/index.php#coreseapi)上使用Java和CORESE API来查询上述family.owl。 With the following SPARQL query:
使用以下SPARQL查询:
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) 结果为Tuấn(真实结果必须为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) 如果将“ where”子句替换为:
WHERE { fm:Tùng fm:haschild ?child }
则结果为空(真实结果必须为Tuấn)
I know the wrong result at string "Tùng" and "Tuấn". 我知道字符串“Tùng”和“Tuấn”的错误结果。 This string has character unicode ù, ấ
该字符串具有字符unicodeù,ấ
Can you have me using unicode character in CORESE API to query owl file with sparql. 您能否让我在CORESE API中使用Unicode字符来使用sparql查询猫头鹰文件。
A possible solution is to escape the URIs so instead of: 一个可能的解决方案是转义URI,而不是:
fm:Tùng --> fm:T%C3%B9ng
and 和
fm:Tuấn --> fm:Tu%E1%BA%A5n
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.
建议不要在URIS中带有重音,因此人们倾向于出于这个原因对URI进行编码/转义,并且大多数语言都具有对URI进行编码的库。 For instance in Python is as easy as ...
例如在Python中就像...
>>> import urllib
>>> urllib.quote("Tùng")
'T%C3%B9ng'
>>> urllib.quote("Tuấn")
'Tu%E1%BA%A5n'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.