Sparnatural
Sparnatural copied to clipboard
integrate expandSparql
@tfrancart, I'm currently looking into the expandSparql mechanism and I don't understand why the expandSparql method is not an internal part of Sparnatural. Currently the expandSparql query must be called like this:
sparnatural.addEventListener("queryUpdated", (event) => {
var queryString = sparnatural.expandSparql(event.detail.queryString);
yasqe.setValue(queryString);
// store JSON in hidden field
document.getElementById('query-json').value = JSON.stringify(event.detail.queryJson);
});
Is there a reason this method is not called internally? It fear it might be confusing for people using it.
My suggestion is that we leave the possibility to call it from the outside (for backwards compability) but it is also called internally. What do you think?