Re: [topbraid-users] Getting tangled in XML parsing and encoding

2017-07-01 Thread Jack Hodges
Holger, thank you for your (very much appreciated) help. Because you asked 
why we are asking these questions, we (Steve and I) are collaborating on a 
system that uses TBL as a triple store and reasoner. It (TBL) is one 
component of a system and has a separate proxy web service as a front end. 
We will not allow its web services to be called directly by anyone and that 
is why message sent to TBL must be done through more than one layer. Thanks 
again!

Jack

On Thursday, June 29, 2017 at 3:37:51 PM UTC-7, Holger Knublauch wrote:
>
> 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:stev...@sv.cmu.edu 
>
> Phone: (650) 587-3780
>
> Cell:  (202) 316-6481
>
> Skype: steverayconsulting
>
> [image: cid:A9ED74CE-68DA-4276-847C-3C08B21B97C0@wv.cc.cmu.edu]
>
>  
>
> *From:* topbrai...@googlegroups.com  [
> mailto:top...@googlegroups.com ] *On Behalf Of *Holger 
> Knublauch
> *Sent:* Wednesday, June 28, 2017 4:50 PM
> *To:* topbrai...@googlegroups.com 
> *Subject:* Re: [topbraid-users] Getting tangled in XML parsing and 
> encoding
>
>  
>
> You can use triple-quotes, as in
>
> SELECT ?xmlArgument 
> WHERE {
> BIND (""" 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> 
> > ei:schemaVersion="2.0b">"""
>  
> 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* (" 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*>" 
> *AS* ?xmlArgument)} 
>
>  
>
>  
>
> I have tried:
>
>  
>
> . replacing any embedded “ with
>
> . doing that, plus replacing all the < and > with  and 
>
> . escaping the “ with \
>
> . uuencoding the XML string
>
>  
>
> …all with no luck. I’m doing my testing using the SPARQL query pan

Re: [topbraid-users] Getting tangled in XML parsing and encoding

2017-06-30 Thread Jack Hodges
We have "Enable SPARQL Updates" enabled on our TBL instance, and they work 
just fine. We are using endpoints because this is a Web Service call and 
our TBL instance is behind a RESTful API firewall. Support@topquadrant is 
familiar with this workflow.

Jack

On Friday, June 30, 2017 at 9:55:07 AM UTC-7, Steve Ray wrote:
>
> Holger,
>
> I see some enticing references to enabling endpoint updates in 
> your literature for EVN. Specifically, from 
> http://www.topquadrant.com/docs/5.1/_TopBraid_EVN_Developer_Guide_1802252.html
>  
> :
>
> *3.3 EVN SPARQL Endpoint Update*
>
> SPARQL Update statements can be executed on EVN project graphs. By 
> default, SPARQL Endpoint Updates are disabled. To enable updates set the 
> "Enable SPARQL updates" to true in in the Server Configuration Parameters 
> <http://download.topquadrant.com/evn/46doc/index.html#tbladmindoc_ServerConfigurationParams>
>  
> page. Access controls are also available for SPARQL Endpoint Updates. For 
> more information on setup for SPARQL Endpoint update, see SPARQL Endpoint 
> Update 
> <http://download.topquadrant.com/evn/46doc/devguide/permissionGroupMgmt/index.html#permissionGroupMgmt_SparqlEndpointUpdate>.
>  
>
>
> The final link above doesn’t work for me, but is this only available for 
> EVN, or is there some way we can enable this for TBL? 
>
>  
>
> - 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:stev...@sv.cmu.edu 
>
> Phone: (650) 587-3780
>
> Cell:  (202) 316-6481
>
> Skype: steverayconsulting
>
> [image: cid:A9ED74CE-68DA-4276-847C-3C08B21B97C0@wv.cc.cmu.edu]
>
>  
>
> *From:* topbrai...@googlegroups.com  [mailto:
> topbrai...@googlegroups.com ] *On Behalf Of *Holger Knublauch
> *Sent:* Thursday, June 29, 2017 3:38 PM
> *To:* topbrai...@googlegroups.com 
> *Subject:* Re: [topbraid-users] Getting tangled in XML parsing and 
> encoding
>
>  
>
> 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:stev...@sv.cmu.edu 
>
> Phone: (650) 587-3780
>
> Cell:  (202) 316-6481
>
> Skype: steverayconsulting
>
> [image: cid:A9ED74CE-68DA-4276-847C-3C08B21B97C0@wv.cc.cmu.edu]
>
>  
>
> *From:* topbrai...@googlegroups.com  [
> mailto:top...@googlegroups.com ] *On Behalf Of *Holger 
> Knublauch
> *Sent:* Wednesday, June 28, 2017 4:50 PM

RE: [topbraid-users] Getting tangled in XML parsing and encoding

2017-06-29 Thread Steve Ray
The system I’m building is part of a larger system that is able to issue SPARQL 
queries against arbitrary SPARQL endpoints, but is not able to issue RESTful 
calls to web services. So I am trying to provide such an endpoint that is able 
to perform a sequence of tasks (implemented as a SPARQLmotion script) such as 
accepting an XML message, converting it to triples, SPIN-mapping it to a 
neutral schema and adding the mapped triples to our triple-store (currently 
using the native store in TBL). I have been doing it by bypassing the web 
service call, and embedding the associated SPIN function directly in the SPARQL 
query to the endpoint. The script gets all the way through until the final step 
of adding the mapped triples to the triple store.

 

I will add that your theory sounds right, because the same approach works fine 
for a call that issues a SELECT query against our triple store, then SPIN-maps 
the result back from our neutral schema to the native schema, then returns an 
XML encoding of the result. No new triples being INSERTed on this one, and it 
works.

 

Hmm. I’ll need to talk to the team about alternatives…

 

 

- 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:steve@sv.cmu.edu

Phone: (650) 587-3780

Cell:  (202) 316-6481

Skype: steverayconsulting

cid:A9ED74CE-68DA-4276-847C-3C08B21B97C0@wv.cc.cmu.edu

 

From: topbraid-users@googlegroups.com [mailto:topbraid-users@googlegroups.com] 
On Behalf Of Holger Knublauch
Sent: Thursday, June 29, 2017 3:38 PM
To: topbraid-users@googlegroups.com
Subject: Re: [topbraid-users] Getting tangled in XML parsing and encoding

 

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:steve@sv.cmu.edu

Phone: (650) 587-3780

Cell:  (202) 316-6481

Skype: steverayconsulting

cid:A9ED74CE-68DA-4276-847C-3C08B21B97C0@wv.cc.cmu.edu

 

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

 

You can use triple-quotes, as in

SELECT ?xmlArgument 
WHERE {
BIND ("""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; 
>"""
 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 ("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; 
>"
 AS ?xmlArgument)} 

 

 

I have tried:

 

. replacing any embedded “ with

. doing that, plus replac

Re: [topbraid-users] Getting tangled in XML parsing and encoding

2017-06-29 Thread Holger Knublauch
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: steve@sv.cmu.edu

Phone: (650) 587-3780

Cell:  (202) 316-6481

Skype: steverayconsulting

cid:A9ED74CE-68DA-4276-847C-3C08B21B97C0@wv.cc.cmu.edu

*From:*topbraid-users@googlegroups.com 
[mailto:topbraid-users@googlegroups.com] *On Behalf Of *Holger Knublauch

*Sent:* Wednesday, June 28, 2017 4:50 PM
*To:* topbraid-users@googlegroups.com
*Subject:* Re: [topbraid-users] Getting tangled in XML parsing and 
encoding


You can use triple-quotes, as in

SELECT ?xmlArgument
WHERE {
BIND ("""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> 
>ei:schemaVersion="2.0b">""" 
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*("<_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">"
*AS*?xmlArgument)}

I have tried:

. replacing any embedded “ with 

. doing that, plus replacing all the < and > with  and 

. 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: steve@sv.cmu.edu <mailto:steve@sv.cmu.edu>

Phone: (650) 587-3780

Cell: (202) 316-6481

Skype: steverayconsulting

cid:A9ED74CE-68DA-4276-847C-3C08B21B97C0@wv.cc.cmu.edu

-- 
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 topbraid-users+unsubscr...@googlegroups.com
<mailto:topbraid-users+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

<http://www.avg.com/email-signature?utm_medium=email_source=link_campaign=sig-email_content=emailclient>



Virus-free. www.avg.com 
<http://www.avg.com/email-signature?utm_medium=email_source=link_campaign=sig-email_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 topbraid-users+unsubscr...@googlegroups.com 
<mailto:topbraid-users+unsub

RE: [topbraid-users] Getting tangled in XML parsing and encoding

2017-06-29 Thread Steve Ray
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:steve@sv.cmu.edu

Phone: (650) 587-3780

Cell:  (202) 316-6481

Skype: steverayconsulting

cid:A9ED74CE-68DA-4276-847C-3C08B21B97C0@wv.cc.cmu.edu

 

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

 

You can use triple-quotes, as in

SELECT ?xmlArgument 
WHERE {
BIND ("""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; 
>"""
 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 ("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; 
>"
 AS ?xmlArgument)} 

 

 

I have tried:

 

. replacing any embedded “ with

. doing that, plus replacing all the < and > with  and 

. 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:steve@sv.cmu.edu

Phone: (650) 587-3780

Cell:  (202) 316-6481

Skype: steverayconsulting

cid:A9ED74CE-68DA-4276-847C-3C08B21B97C0@wv.cc.cmu.edu

 

-- 
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 topbraid-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

 


 
<http://www.avg.com/email-signature?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
 

Virus-free.  
<http://www.avg.com/email-signature?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
 www.avg.com 

-- 
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 topbraid-users+unsubscr...@googlegroups.com.
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 topbraid-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [topbraid-users] Getting tangled in XML parsing and encoding

2017-06-28 Thread Holger Knublauch

You can use triple-quotes, as in

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


I have tried:

. replacing any embedded “ with 

. doing that, plus replacing all the < and > with  and 

. 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: steve@sv.cmu.edu

Phone: (650) 587-3780

Cell: (202) 316-6481

Skype: steverayconsulting

cid:A9ED74CE-68DA-4276-847C-3C08B21B97C0@wv.cc.cmu.edu

--
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 topbraid-users+unsubscr...@googlegroups.com 
.

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 topbraid-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[topbraid-users] Getting tangled in XML parsing and encoding

2017-06-28 Thread Steve Ray (CMU)
 

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

 

SELECT ?xmlArgument  WHERE {BIND ("http://docs.oasis-open.org/ns/energyinterop/201110;
xmlns:oadr="http://openadr.org/oadr-2.0b/2012/07;
><
/oadr:oadrPayload>" AS ?xmlArgument)} 

 

 

I have tried:

 

. replacing any embedded " with

. doing that, plus replacing all the < and > with  and 

. 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:steve@sv.cmu.edu

Phone: (650) 587-3780

Cell:  (202) 316-6481

Skype: steverayconsulting

cid:A9ED74CE-68DA-4276-847C-3C08B21B97C0@wv.cc.cmu.edu

 

-- 
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 topbraid-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.