SPARQLMotion IterateOnSelect examples

8 views
Skip to first unread message

Jack Hodges

unread,
Jul 23, 2019, 3:40:27 PM7/23/19
to TopBraid Suite Users
I have a question. Does anyone have an example of an IterateOverSelect that has a body that performs an insert on the results of the IterateOverSelect variables?

My Intent: execute a IterateOnSelect SELECT that produces multiple rows of several bindings, use body of IterateOnSelect to INSERT each row

sml:selectQuery:

SELECT ?a ?b ?c
WHERE {
    something related to input argument .
}

sm:body:

INSERT {
    qname, label, and properties of qname
}
WHERE {
   something using ?a, ?b, and ?c
   create unique qname and labels
}


sm:next:

Do something with the items that were inserted by the sm:body

But the IterateOverSelect never seems to get executed (at least, I cannot see it binding ?a, ?b, or ?c and no insertions are performed.

The SPARQL MOTION library reference has no examples.

Thank you...

Jack

Holger Knublauch

unread,
Jul 23, 2019, 6:42:18 PM7/23/19
to topbrai...@googlegroups.com

I am attaching a script that looks as in the screenshot:

You need to make sure that the PerformUpdate specifies the target graphs, using the GRAPH keyword. Otherwise it doesn't know where the triples shall go.

The Merge step is just there as a dummy placeholder for some module that handles the result graph.

Depending on your setup, SWP might be a better choice for such SPARQL-based transformation scripts.

HTH
Holger

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/87db2c97-5c2a-4b2e-8723-8e543e0ad221%40googlegroups.com.
iterateOverInsert.ttl

Jack Hodges

unread,
Jul 24, 2019, 2:25:40 PM7/24/19
to TopBraid Suite Users
I was debugging this problem with Steve and we found that the IterateOverSelect is not executing because it has two magic property calls referenced and they are not being resolved. Their graphs 'are' being imported, and everything in them can be seen in the 'query' tab in SPARQL MOTION and, even though I use their prefixes in the select statement, in the SM query tab they have been converted to their full namespaces. Interestingly, they do not resolve from their namespaces in that query tab, but if I retype their prefixes they do resolve and execute in that tab just fine. So I am confused about this and hope that you know what is going on and I might then move forward...I should add that all of the graphs that are needed are imported into the SM script and resolve in the imported graphs tab in SM.

Jack
To unsubscribe from this group and stop receiving emails from it, send an email to topbrai...@googlegroups.com.

Holger Knublauch

unread,
Jul 24, 2019, 8:02:27 PM7/24/19
to topbrai...@googlegroups.com

If a magic property is not resolving, have you tried renaming its file to something like .spin.ttl - this should have the system register all SPIN functions and magic properties globally.

Holger

To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/b677db84-80cb-467f-86a5-2d53093a588d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages