Hi,
How is a missing optional value from SPARQL represented in JavaScript?
If I execute the following JavaScript code on a database with a triple
":foo :bar 42" but nothing like ":foo :xxx 42":
var sem = require('/MarkLogic/semantics');
var res = sem.sparql(
'PREFIX : <http://example.org/foo#> \
SELECT * WHERE { \
:foo :bar ?bar . \
OPTIONAL { :foo :xxx ?xxx } \
}');
var val = res.next().value;
if ( val.xxx ) 'true'; else 'false';
then it returns "true" anyway. Even though xdmp.describe(val.xxx)
returns "null".
What is the exact type of val.xxx? How can I test whether a variable
in an optional graph pattern has been bound or not, in JavaScript?
Regards,
--
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general