Hi,

Using `sem.sparql()`, it is possible to bind a SPARQL placeholder to
an array, to serve as many alternatives to the placeholder in the
triples pattern.  For instance, the following query:

    require('/MarkLogic/semantics').sparql(
       'SELECT * WHERE { ?s ?p ?o }',
       { 's': [ sem.iri('#1'), sem.iri('#2') ] })

returns the predicates and values for al triples with the subject
equal to either `#1` or `#2`.

Problem is, the bound placeholder is not part of the result (in this
example, `?s`).  The result is an iterator over objects of the
following form:

    { p: "#pred", o: "value" }

So it is not possible to use the result in a way to would need to know
which subject each row is attached to (which I believe is generally
the case when binding them to arrays, as opposed to scalar values).

Is there any way to have `sem.sparql()` include bound placeholders in
the result?

Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to