dlbis
(Daniel Lavoie)
February 11, 2019, 3:23pm
1
Hi,
I have an event class with start and end dates and there is no end date triple for the event before its actual end. To select unfinished events, I usually do something like:
optional { ?s ontology:endDate ?endDate}
filter (?endDate = "")
However, with StarDog,that does not return anything. I have also used the following without success:
filter (str(?endDate) = "")
filter (strlen(str(?endDate)) = 0)
filter( isBLANK(?endDate) )
filter( ?endDate = UNDEF)
filter( ?endDate = NIL)
How can I handle null in StarDog?
Thanks
stephen
(stephen)
February 11, 2019, 4:25pm
2
If by NULL you mean there is no binding for ?endDate, then you want the following:
optional { ?s ontology:endDate ?endDate}
filter (!bound(?endDate))
Or, more concisely:
filter not exists { ?s ontology:endDate ?endDate }
dlbis
(Daniel Lavoie)
February 11, 2019, 5:23pm
3
The two solutions are working fine but the first one is faster.
Thanks for your fast answer Stephen!
system
(system)
Closed
February 25, 2019, 5:23pm
4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.