Having the GRAPH keyword solved my problem. Thanks fore the quick reply
Scott!
Bart
On Thursday, June 26, 2014 5:15:10 PM UTC-6, Scott Henninger wrote:
>
> Bart; Yes you assumption is correct. The INSERT query is inserting into
> the default graph, which is the SPARQLMotion script in this case. Whenever
> using INSERT, it should be used with the GRAPH clause unless the context
> for the default graph is set to the graph targeted for the insert. So your
> query will look like:
>
> INSERT
> { GRAPH <...graph_name...>
> { ?s ?p ?o
> }
> }
> WHERE
> { ?s ?p ?o
> }
>
> -- Scott
>
> On 6/26/2014, 7:03 PM, Barton Petersen wrote:
>
> I'm sure it's something simple, but I've beaten my head against the wall
> long enough that I'm going to ask for some help. I'll explain the scenario
> first in case my approach is fundamentally wrong.
>
> For a proof of concept, I need to be able to get data and create data
> easily (hopefully via a restful web service). To query data, I've had a
> lot of success with the SPIN select templates. Those are awesome, easy to
> create and consume for a client. Now I need to be able to easily insert
> data. I did not see a way to do that with SPIN Templates, but if that is
> possible, I would love to know how to do that. Instead, I thought a
> SPARQLMotion web service might be the best approach.
>
> I'm playing around with a simple script to insert a name with the vCard
> ontology. I have two variables, first and last name. Then I send that to
> an Apply Construct module. Then I send that to a Perform Update.
>
>
>
> <https://lh5.googleusercontent.com/-DOZD0UWjHAc/U6ylE_1ZwbI/AAAAAAAAC0I/sPbx7LaeIWk/s1600/SparqlMotionGraph.PNG>
>
> Inside the Apply Construct module, I have the following statement:
>
> CONSTRUCT {
>
> ?nameUri a ns:Individual .
>
> ?nameUri ns:given-name ?firstName .
>
> ?nameUri ns:family-name ?lastName .
>
> }
>
> WHERE {
>
> BIND (URI(CONCAT("http://names.example.com/"
> <http://names.example.com/>, ?lastName, "_", ?firstName)) AS ?nameUri) .
>
> }
>
> And Inside the Perform Update, I have the following statement:
>
> INSERT {
>
> ?s ?p ?o .
>
> }
>
> WHERE {
>
> ?s ?p ?o .
>
> }
> I figured that would insert all the triples generated by the apply
> construct. When I hit the perform update, the graph contains the correct
> triples, but upon stepping into the perform update module, I get a
> nullPointerException. I'm figuring the module doesn't know where to insert
> the triples, but I don't know how to fix that if it is the issue. Any help
> would be much appreciated.
>
> Bart
> --
> -- 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
> Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
> To post to this group, send email to
> [email protected] <javascript:>
> To unsubscribe from this group, send email to
> [email protected] <javascript:>
> 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] <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
--
-- 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 Insight,
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/d/optout.