0

我有一个形式为 Apache Jena ARQ SPARQL 查询

SELECT DISTINCT  (count(*) AS ?rowCount) ......

rowCount 值作为1^^http://www.w3.org/2001/XMLSchema#integer

这导致解析整数值出现问题,如何确保在这种情况下只返回数字 1 ?

谢谢。

4

1 回答 1

2

那就是数字 1 - 一个 xsd:integer,词法形式为“1”。你已经完整地展示了它。像 Turle 这样的语法将其写成 1(不带引号)——它只是“1”^^xsd:integer 的简写缩写。

如果您只想要词法部分,请获取文字然后解析词法形式(Literal.getLexicalForm)。

于 2015-03-06T08:40:53.800 回答