Catrina; I have not been able to verify this.  Attached, please find a file with two scripts that tests urn variable binding in PerformUpdate.  If you run the scripts without change, the inserts and deletes work as expected.  If you change the value of the variable in the BindBySelect module to a graph names that does not exist in your workspace, then both the INSERT and DELETE will fail.

If this isn't quite the use case you mention, then modify this example as needed to reproduce your issue.

-- Scott

On 9/17/10 1:36 PM, Catrina wrote:
I have a SPARQLMotion script that contains PerformUpdate modules for
INSERTs and DELETEs where the graph being updated is set dynamically
using urn:var.  If I incorrectly set this graph, an error is only
occuring where the PerformUpdate module is attempting a DELETE.  There
is no error shown when the graph variable is set incorrectly for
PerformUpdate modules attempting an INSERT.

For example, a PerformUpdate DELETE error shows the following from
Composer:
Could not execute SPARQLMotion script
No such graph: urn:var:upOntBaseURI

While a PerformUpdate INSERT shows no error at all.  The script
appears to have run successfully even though the inserts didn't make
it to any graphs in the project's workspace.

Thanks,
Catrina

--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion 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
# Saved by TopBraid on Mon Sep 20 14:34:50 CDT 2010
# baseURI: http://support.tbl.com/PerformUpdateGraphSetViaURN
# imports: http://topbraid.org/sparqlmotionfunctions
# imports: http://topbraid.org/sparqlmotionlib

@prefix geo:     <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix kennedys:  <http://topbraid.org/examples/kennedys#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sm:      <http://topbraid.org/sparqlmotion#> .
@prefix sml:     <http://topbraid.org/sparqlmotionlib#> .
@prefix sp:      <http://spinrdf.org/sp#> .
@prefix spin:    <http://spinrdf.org/spin#> .
@prefix spl:     <http://spinrdf.org/spl#> .
@prefix urntst:  <http://support.tbl.com/PerformUpdateGraphSetViaURN#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .

<http://support.tbl.com/PerformUpdateGraphSetViaURN>
      rdf:type owl:Ontology ;
      owl:imports <http://topbraid.org/sparqlmotionfunctions> , 
<http://topbraid.org/sparqlmotionlib> ;
      owl:versionInfo "Created with TopBraid Composer"^^xsd:string .

urntst:BindBySelect_1
      rdf:type sml:BindBySelect ;
      rdfs:label "Bind by select 1"^^xsd:string ;
      sm:next urntst:InsertLabels , urntst:PerformUpdate_1 ;
      sm:nodeX 507 ;
      sm:nodeY 140 ;
      sml:selectQuery
              [ rdf:type sp:Select ;
                sp:resultVariables (_:b1) ;
                sp:where ([ rdf:type sp:Let ;
                            sp:expression 
<http://topbraid.org/examples/kennedys> ;
                            sp:variable _:b1
                          ])
              ] .

<http://support.tbl.com/PerformUpdateGraphSetViaURN#Import-kennedys.rdf_1>
      rdf:type sml:ImportRDFFromWorkspace ;
      rdfs:label "Import kennedys.rdf"^^xsd:string ;
      sm:next urntst:BindBySelect_1 ;
      sml:baseURI "http://topbraid.org/examples/kennedys"^^xsd:string .

urntst:InsertLabels
      rdf:type sml:PerformUpdate ;
      rdfs:label "Insert labels"^^xsd:string ;
      sm:nodeX 579 ;
      sm:nodeY 336 ;
      sml:updateQuery
              [ rdf:type sp:Insert ;
                sp:graphIRI <urn:var:agraphId> ;
                sp:insertPattern ([ sp:object _:b2 ;
                            sp:predicate rdfs:label ;
                            sp:subject _:b3
                          ]) ;
                sp:where ([ sp:object _:b2 ;
                            sp:predicate kennedys:name ;
                            sp:subject _:b3
                          ])
              ] .

urntst:PerformUpdate_1
      rdf:type sml:PerformUpdate ;
      rdfs:label "Delete Labels"^^xsd:string ;
      sm:nodeX 402 ;
      sm:nodeY 332 ;
      sml:updateQuery
              [ rdf:type sp:Delete ;
                sp:deletePattern ([ sp:object _:b4 ;
                            sp:predicate rdfs:label ;
                            sp:subject _:b5
                          ]) ;
                sp:graphIRI <urn:var:agraphId> ;
                sp:where ([ sp:object _:b4 ;
                            sp:predicate rdfs:label ;
                            sp:subject _:b5
                          ])
              ] .

urntst:TestURNBindings
      rdf:type spin:Function ;
      rdfs:label "Test URNBindings"^^xsd:string ;
      rdfs:subClassOf spin:Functions ;
      sm:returnModule urntst:PerformUpdate_1 .

_:b2  sp:varName "label"^^xsd:string .

_:b3  sp:varName "person"^^xsd:string .

_:b1  sp:varName "agraphId"^^xsd:string .

_:b4  sp:varName "label"^^xsd:string .

_:b5  sp:varName "person"^^xsd:string .

Reply via email to