Quite possibly you are running into a locking issue: No SPARQL SELECT/CONSTRUCT query can have side effects such as writing new triples. So doing a sml:PerformUpdate as part of a SPARQL function is not a supported use case.

Why do you plan to use the SPARQL end point in the first place. Is it because you want a certain response format? That could be achieved by other means, even from SPARQLMotion (or SWP for that matter).

Holger


On 30/06/2017 4:01, Steve Ray wrote:

Holger,

Thanks for the super-fast response. That solved my parsing problem. Unfortunately, the larger goal I am pursuing is still not working:

I have defined a SPARQLMotion module / web service that takes several arguments, one of which is the XML message I was having trouble with, passed in as an xsd:string. The module works great when I call it using Postman.

Now, I’m trying to get the same functionality, but using the SPARQL endpoint service (i.e. http://localhost:8083/tbl/sparql), where I send a SPARQL query, inside of which is a call to the SPIN function associated with my SPARQLMotion module. In this case, TBC accepts the call and progresses through the script until it comes to a PerformUpdate module. At this point, it is either hanging, or taking so long that after a half hour I manually stop TBC.

My question: Does PerformUpdate behave differently when the SM script is called as a web service, versus my calling the SPIN function in a SPARQL endpoint query?

The SPARQL code inside my PerformUpdate is quite simple:

*INSERT*{

*GRAPH*?graphURI{

?s?p?o.

    } .

}

*WHERE*{

?s?p?o.

}

…where some newly created triples are added to the graph identified in ?graphURI.

- Steve

Steven R. Ray, Ph.D.

Distinguished Research Fellow

Carnegie Mellon University

NASA Research Park

Building 23 (MS 23-11)

P.O. Box 1
Moffett Field, CA 94305-0001

Email: [email protected]

Phone: (650) 587-3780

Cell:      (202) 316-6481

Skype: steverayconsulting

cid:[email protected]

*From:*[email protected] [mailto:[email protected]] *On Behalf Of *Holger Knublauch
*Sent:* Wednesday, June 28, 2017 4:50 PM
*To:* [email protected]
*Subject:* Re: [topbraid-users] Getting tangled in XML parsing and encoding

You can use triple-quotes, as in

SELECT ?xmlArgument
WHERE {
BIND ("""<?xml version="1.0"; encoding="UTF-8"?><oadr:oadrPayload xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110"; <http://docs.oasis-open.org/ns/energyinterop/201110> xmlns:oadr="http://openadr.org/oadr-2.0b/2012/07"; <http://openadr.org/oadr-2.0b/2012/07> ><oadr:oadrSignedObject><oadr:oadrDistributeEvent ei:schemaVersion="2.0b"></oadr:oadrDistributeEvent></oadr:oadrSignedObject></oadr:oadrPayload>""" AS ?xmlArgument)
}

HTH
Holger

On 29/06/2017 9:32, Steve Ray (CMU) wrote:

    How does one pass an XML argument like the one below to a SPARQL
    query? See this trivial example:

    *SELECT*?xmlArgument *WHERE*{*BIND*("<?xmlversion="1.0";
    encoding="UTF-8"?><_oadr:oadrPayload_
    _xmlns:ei_="http://docs.oasis-open.org/ns/energyinterop/201110";
    <http://docs.oasis-open.org/ns/energyinterop/201110>
    _xmlns:oadr_="http://openadr.org/oadr-2.0b/2012/07";
    <http://openadr.org/oadr-2.0b/2012/07>
    ><_oadr:oadrSignedObject_><_oadr:oadrDistributeEvent_
    
_ei:schemaVersion_="2.0b"></_oadr:oadrDistributeEvent_></_oadr:oadrSignedObject_></_oadr:oadrPayload_>"
    *AS*?xmlArgument)}

    I have tried:

    . replacing any embedded “ with &quot;

    . doing that, plus replacing all the < and > with &lt; and &gt;

    . escaping the “ with \

    . uuencoding the XML string

    …all with no luck. I’m doing my testing using the SPARQL query
    panel in TBC, and it chokes.

    Thanks in advance.

    - Steve

    Steven R. Ray, Ph.D.

    Distinguished Research Fellow

    Carnegie Mellon University

    NASA Research Park

    Building 23 (MS 23-11)

    P.O. Box 1
    Moffett Field, CA 94305-0001

    Email: [email protected] <mailto:[email protected]>

    Phone: (650) 587-3780

    Cell: (202) 316-6481

    Skype: steverayconsulting

    cid:[email protected]

-- 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]
    <mailto:[email protected]>.
    For more options, visit https://groups.google.com/d/optout.

<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>

        

Virus-free. www.avg.com <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>

--
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] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
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] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to