sparna-git / Sparnatural

Sparnatural : visual SPARQL query builder for knowledge graphs in the browser, configurable with SHACL
http://sparnatural.eu
GNU Lesser General Public License v3.0
219 stars 41 forks source link

integrate expandSparql #454

Open SteinerPascal opened 1 year ago

SteinerPascal commented 1 year ago

@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?