Classification: Public Hi Florent. Would it be a problem to just call the query (multiple times) with a single subject for each of the different subjects that you want, and then combine the results?
Cheers, Tony. -----Original Message----- From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Florent Georges Sent: 15 May 2016 12:42 To: MarkLogic Developer Discussion <general@developer.marklogic.com> Subject: [MarkLogic Dev General] sem.sparql: get bound placeholders in the result 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 General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures and to http://www.db.com/unitedkingdom/content/privacy.htm for information about privacy. _______________________________________________ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general