function resultToScalar(binding) {
            if (!binding) {
                return null;
            }
            var value = binding.value;
            var type = binding.type;
            switch (type) {
                case "literal":
                case "typed-literal":
                    var datatype = binding.datatype;
                    if (datatype) {
                        var parsedValue = typedLiteralToScalar(value, datatype);
                        if (typeof parsedValue !== "undefined") {
                            return parsedValue;
                        }
                    }

                    // if no (known) datatype is given, try same parsing algorithm as for CSV
                    return util['default'].toScalar(value);
                case "uri":
                case "bnode":
                    return simplifyURI(value);
                default:
                    return value;
            }
        }
/*
         * Takes a vexport default sparql_data_module;ariable binding from a json sparql result and converts it to a scalar
         */
Takes a vexport default sparql_data_module;ariable binding from a json sparql result and converts it to a scalar
Takes a vexport default sparql_data_module ; ariable binding from a json sparql result and converts it to a scalar
function resultToScalar(binding) {
            if (!binding) {
                return null;
            }
            var value = binding.value;
            var type = binding.type;
            switch (type) {
                case "literal":
                case "typed-literal":
                    var datatype = binding.datatype;
                    if (datatype) {
                        var parsedValue = typedLiteralToScalar(value, datatype);
                        if (typeof parsedValue !== "undefined") {
                            return parsedValue;
                        }
                    }
                    return util['default'].toScalar(value);
                case "uri":
                case "bnode":
                    return simplifyURI(value);
                default:
                    return value;
            }
        }
function resultToScalar ( binding ) { if ( ! binding ) { return null ; } var value = binding . value ; var type = binding . type ; switch ( type ) { case "literal" : case "typed-literal" : var datatype = binding . datatype ; if ( datatype ) { var parsedValue = typedLiteralToScalar ( value , datatype ) ; if ( typeof parsedValue !== "undefined" ) { return parsedValue ; } } return util [ 'default' ] . toScalar ( value ) ; case "uri" : case "bnode" : return simplifyURI ( value ) ; default : return value ; } }
Takes a vexport default sparql_data_module;ariable binding from a json sparql result and converts it to a scalar
Takes a vexport default sparql_data_module ; ariable binding from a json sparql result and converts it to a scalar
// if no (known) datatype is given, try same parsing algorithm as for CSV