Hi all, I was hoping to make this to work with Fuseki 2.3.0:
PREFIX ex: <http://www.example.com/data#>
CONSTRUCT {
?id ex:has-name ?name; ex:has-surname ?mySurname
}
WHERE
{
OPTIONAL { BIND ( ?surname AS ?mySurname ). FILTER ( ?surname != '' ) }
#BIND ( ?surname AS ?mySurname )
VALUES (?id ?name ?surname)
{
( ex:1 "John" "Smith" )
( ex:2 "Zak" "Mc Kracken" )
( ex:3 "Ben" "" )
( ex:4 "Alice" "Wonderland" )
( ex:5 "Mickey" "" )
}
}
i.e., I've a list of rows to build some RDF from, where certain field
values are empty or should be ignored. The result should produce triples
with name+surname, when surname is valid, only name, when it is invalid.
I always get back triples with name only, even when I use the
non-optional binding. So, how can I get this result, when using VALUES?
The longer story is that the problem have arisen from tests I was doing
with the very nice tool TARQL (https://github.com/tarql/tarql,
https://github.com/tarql/tarql/issues/55)
Thanks in advance,
Marco