Hi Gerrit,
On Aug 25, 2011, at 6:54 PM, Gerrit wrote:
> I have a spin:UpdateTemplate with a DELETE WHERE clause:
>
> DELETE {
> ?this sc:hasMediaPath ?mp .
> }
> WHERE {
> ?this sc:hasMediaPath ?mp .
> ?mp bonding:mediaSourceSO ?mediaSource .
> ?mp bonding:mediaOriginator ?device2 .
> FILTER NOT EXISTS {
> ?this sc:connectedTo ?device2 .
> } .
> }
This does not look like a DELETE WHERE. That would be something like
DELETE WHERE {
?this sc:hasMediaPath ?mp
}
Anyway, just as an aside because I don't think this is the problem.
> I created the template by subclassing spin:UpdateTemplates and filling
> in spin:body with the above, and spin:labelTemplate with a human-
> readable string.
>
> This seems to work fine in TBC FE. When using it with SPIN 1.2.0, I
> get the following error:
>
> Exception in thread "main" java.lang.NullPointerException
> at org.topbraid.spin.util.UpdateUtil.addUpdatedGraphs(UpdateUtil.java:
> 58)
That line is
if(quad.isDefaultGraph()) {
results.add(graphStore.getDefaultModel().getGraph());
}
which indicates to me that your query is trying to update the default graph,
but your Dataset does not define a default graph. So please either check your
code where you construct the Dataset to make sure you give it a default graph,
or change your query so that it explicitly mentions a named graph using
DELETE {
GRAPH [g] {
...
}
}
WHERE {
...
}
If the triple you are trying to delete is inferred then it may be in a graph
that doesn't even have a name in the default Dataset, so you would need to
overload ARQFactory.getDataset() so that it returns a Dataset that has the
inferred graph as default graph, or the [g] above.
Cheers,
Holger
--
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