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" ;
.
```
This is close to what I want (need to remove newline characters etc.: ""@prefix 
arg: <http://spinrdf.org/arg#> .\n@prefix dash: 
<http://datashapes.org/dash#> .\n@prefix dc:")

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

-- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/ae6710aa-eb5a-4adb-891d-dbbb6fc47ce1n%40googlegroups.com.

Reply via email to