John; The issue here is that the SPARQL syntax does not allow variables in the WITH statement - see http://www.w3.org/TR/sparql11-update/ and you will find that the syntax references WITH IRIref, meaning only the <> syntax is allowed.

However... we have a workaround.  If you use the URN <urn:var:Var_Name>, where Var_Name is the name of a bound variable (an IRI in this case), it will get the variable name.

As an example, let's say you have defined the argument:
     sp:arg1
this is interpreted in the script as:
     ?arg1
and can be used in places where SPARQL doesn't allow variables as:
     <urn:var:arg1>

Yea, it's a bit of syntax, but workable given some extensions to the standards.

-- Scott

On 3/1/2013 4:22 PM, John Perdoni wrote:
Hi again,

Is it possible to use a variable for the GRAPH clause using sml:updateQuery in a performUpdate script module called via a webservice.

I have a need to pass the a variable called current which is the baseUri/graph to a script that will then first delete then update the value of a property within this graph.

In the past (and not really understanding why) I have used GRAPH <urn:x-var:result> {} ,but I really want to understand the nuances involved. Reading this forum I have have come across some possible solutions using sparql WITH, however my attempts have come to a halt(probably due to syntax) . I tried inserting a WITH with a variable ?current but TBC resolved it as this

WITH <file:///J:/Documents/Semantic%20Web/TBCME_CORE%20overwrite%20when%20new%20version%20available/tbcme/?current>
DELETE {
}
INSERT {
}
WHERE {
}

So if possible could someone give me the correct syntax for an updateQuery template that follows the following

arguments passed in via sparql motion script  ?current   ?propertyToBeUdated ?oldValue ?newValue


WITH {?current}
       
DELETE {
    ?current ?propertyToBeUpdated ?oldValue
}
INSERT {
    ?current ?propertyToBeUpdated ?newValue
}
WHERE {
   .........

}

Regards

John
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
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/groups/opt_out.
 
 

--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
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/groups/opt_out.
 
 

Reply via email to