Hi again,

I have a sparqlmotion script called via a web service that takes in four 
variables all passed in as Strings

currentBook
rdfPropertyToBeUpdated
rdfPropertyOldValue
rdfPropertyNewValue.

the script then performs an update query on a graph.

The script works fine if the "rdfPropertyToBeUpdated" has already been 
assigned a value, but if it hasnt then I get an UnboundQuad warning.

Unbound quad: <http://example.com/library/publishedBook> ?currentBookUri 
?propertyToUpdateUri ?rdfPropertyOldValueUri

My question is this, how do I adjust the following UpdateQuery to remove 
this warning , ie allow the query to ignore the delete clause if 
?rdfPropertyOldValue has no existing value, whilst still updating the graph 
with the new value.

I have tried smf:if and passing in a dummy uri from the ui (ie 
http://example.com/library/coreModel#undefined) but as of yet to no avail. 
Apologies once again if I a missing something obvious, and I still rate my 
sparql knowledge as poor

Regards

John 

DELETE {
    GRAPH <http://example.com/library/publishedBook> {
        ?currentBookUri ?propertyToUpdateUri ?rdfPropertyOldValueUri .
    } .
}
INSERT {
    GRAPH <http://example.com/library/publishedBook> {
        ?currentBookUri ?rdfPropertyToUpdateUri ?rdfPropertyNewValueUri .
    } .
}
WHERE {
    GRAPH <http://example.com/library/publishedBook> {
        BIND (spif:buildURI("<{?currentBook}>") AS ?currentBookUri) .
        BIND (spif:buildURI("<{?rdfPropertyToUpdate}>") AS 
?rdfPropertyToUpdateUri) .
        BIND (spif:buildURI("<{?rdfPropertyOldValue}>") AS 
?rdfPropertyOldValueUri) .
        BIND (spif:buildURI("<{?rdfPropertyNewValue}>") AS 
?rdfPropertyNewValueUri) .
    } .
}

-- 
-- 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