此查询引发错误
我的代码:
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?