Calling a Construct/Update Template from SWP using ui:call

22 views
Skip to first unread message

Adam Kimball

unread,
Dec 7, 2016, 7:38:38 PM12/7/16
to TopBraid Suite Users
Hi there,

I'm working on an EditRule that should insert triples into the current graph when I see certain properties in the ui:addedGraph graph.  My plan was to pass in a couple of variables to a construct query and let it do the work.

EditRule
....
<ui:call arg:concept="{= ?concept }" arg:cui="{= ?cui }" ui:template="hw-int-spin:AttachCuiDataToConceptTemplate"/>
...

(I don't know if I need to declare these arguments since they are already in scope at the time of this tag)

AttachCuiDataToConceptTemplate is an UpdateTemplate (I've also tried ConstructTemplate).

CONSTRUCT {
 ...
} WHERE {
...
}


When this ui:call is executed I get an error:

Exception during evaluation of teamwork rules: java.lang.IllegalArgumentException: Unsupported query template type


I know this pattern must see a lot of use, and I see mentions of see in the definition of ui:call that it should handle an UPDATE command as it body.  But is an UPDATE body equivalent to a CONSTRUCT query?

Thanks for any help,
Adam

Holger Knublauch

unread,
Dec 7, 2016, 7:51:40 PM12/7/16
to topbrai...@googlegroups.com
Hi Adam,

I think you need to use a UpdateTemplate and replace CONSTRUCT with INSERT. Make sure you specify the correct target graph if necessary, using INSERT { GRAPH ?... { ... } } or by setting the default query graph with ui:setContext ui:queryGraph="..."

HTH
Holger
--
You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to topbrai...@googlegroups.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-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam Kimball

unread,
Dec 7, 2016, 7:57:48 PM12/7/16
to topbrai...@googlegroups.com

Holger,

 

Thanks for the prompt response!  When I try to replace CONSTRUCT with INSERT, I get an error in the editor

 

"Encountered "insert" "INSERT" at line 1.... was expecting ...

 

Screen shot included. 

 

-Adam

Screen Shot 2016-12-07 at 5.56.13 PM.png

Holger Knublauch

unread,
Dec 7, 2016, 7:59:43 PM12/7/16
to topbrai...@googlegroups.com
Did you change the type of the template to spin:UpdateTemplate, too (not just the rdfs:subClassOf statement)?

Holger

Adam Kimball

unread,
Dec 7, 2016, 10:43:53 PM12/7/16
to topbrai...@googlegroups.com

Thanks, Holger.  I knew that last bit had to be something silly.  I'm on the right track now.

Reply all
Reply to author
Forward
0 new messages