year()函数在SPARQL中不起作用(Protege)

时间:2018-11-26 02:40:40

标签: sparql protege

此查询引发错误

  

未知函数'http://www.w3.org/xpath-functions#year-from-dateTime'

我的代码:

select ?age where { 
  bind( "1799-12-14"^^<http://www.w3.org/2001/XMLSchema#date> as ?death )
  bind( "1732-02-22"^^<http://www.w3.org/2001/XMLSchema#date> as ?birth )
  bind(year(?death)-year(?death) AS ?age)
}

我已经搜查了好几个小时,却找不到任何有用的信息。我是否必须在某处添加引用该函数的前缀?为什么Protege没有内置的dateTime转换功能?

select ?age where { 
  bind( "1799-12-14"^^<http://www.w3.org/2001/XMLSchema#date> as ?death )
  bind( "1732-02-22"^^<http://www.w3.org/2001/XMLSchema#date> as ?birth )
  bind(int(?death)-int(?death) AS ?age)
}

我尝试将日期转换为整数,但这会引发另一条错误消息。有谁知道如何正确地将dateTime转换为Protege SPARQL的int?

0 个答案:

没有答案