如何修改下面的代码,以便机器根据?描述值选择合适的VALUES模式?这样的修改是否可能?
PREFIX e: <http://learningsparql.com/ns/expenses#>
SELECT ?description ?date ?amount
WHERE
{
?meal e:description ?description ;
e:date ?date ;
e:amount ?amount .
VALUES ( ?description ?date) {
("lunch" "2011-10-15" )
("dinner" "2011-10-16" )
}
VALUES ( ?description ?amount) {
("breakfast" "2")
("brunch" "5" )
}
}
提前谢谢你......
答案 0 :(得分:1)
也许你可以这样做:
PREFIX e: <http://learningsparql.com/ns/expenses#>
SELECT ?description ?date ?amount
WHERE
{
?meal e:description ?description ;
e:date ?date ;
e:amount ?amount .
VALUES ( ?description ?date ?amount ) {
( "lunch" "2011-10-15" UNDEF )
( "dinner" "2011-10-16" UNDEF )
( "breakfast" UNDEF "2" )
( "brunch" UNDEF "5" )
}
}
UNDEF
表示该变量未绑定。