Hi,
I have a use case to expose web services (on EDG i.e. appearing in the Swagger page) which are basically parameterised SPARQL queries. I've got this working for SELECT and ASK queries, using dash:SPARQLMultiFunction and dash:ScriptFunction respectively. I'd like something similar for CONSTRUCT, that can return RDF. So far, I've only been able to get close using a dash:ScriptFunction e.g. using the below:
```
exfun:test5
a dash:ScriptFunction ;
dash:apiStatus dash:Stable ;
dash:canWrite true ;
dash:js """
function collectTriples(subject, triples) {
graph.triples(subject, null, null, true).forEach(t => {
triples.push(t);
if(t.object.isBlankNode()) {
collectTriples(t.object, triples);
}
})
}
let triples = [];
collectTriples(focusNode, triples);
IO.serializeRDF(triples)
""" ;
rdfs:label "test 5" ;
.
```
However the above ADS script is more complex than the SELECT and ASK cases, which are just wrapped SPARQL. It seems unnecessarily complex for what could be a parameterised SPARQL CONSTRUCT. Is there a simpler way to achieve this? (and ideally obey content negotiation/deliver other RDF serialisations, as per the SPARQL endpoint).
Thanks