Hi,
This is an interesting problem that was confusing me for a while.
The below function attempts to write four triples to one graph. Only two
of them are written to the target graph, the other two end up in a strange
place. No exception is thrown and the debug log is gives no indication
that anything went wrong.
============
create procedure test.test.inlineSparqlTest ( )
{
declare graphName, objectText1, objectText2, uri1, uri2 VARCHAR;
graphName := 'testGraph';
uri1 := 'Subject1';
uri2 := 'Subject2';
objectText1 := '111';
objectText2 := '222';
sparql
prefix : <http://MyOntology/>
insert into graph ?:graphName {
`iri(?:uri1)` a :MyClass .
`iri(?:uri1)` :Pred ?:objectText1 .
};
declare sparqlstr VARCHAR;
sparqlstr := concat('sparql
prefix : <http://MyOntology/>
insert into graph <',graphName,'> {
<',uri2,'> a :MyClass .
<',uri2,'> :Pred <',objectText2,'> .
}');
exec(sparqlstr);
};
test.test.inlineSparqlTest();
sparql
select *
from <testGraph>
{
?S a <http://MyOntology/MyClass> .
};
sparql
select *
{ GRAPH ?G {
?S a <http://MyOntology/MyClass> .
}};
============
The two queries have different results which I think is wrong but the
second one shows that something strange is happening.
The statement execution did not return a result set. The statement
execution did not return a result set. Query result:S
ANY Subject2 No. of rows in result: 1 Query result: G
ANY S
ANY iri_id_139838998340000_with_no_name_entry Subject1 testGraph
Subject2No. of rows in result: 2
Virtuoso Open Source Edition (Column Store) (multi threaded)
Version 7.1.1-dev.3207-pthreads as of Feb 17 2014
Wrapping the graph name in iri() in the inline sparql seems to make it work
properly but I still think the result is strange when you don't.
When you try and remove those strange graph-less triples though...
sparql
delete { GRAPH ?G {
?S ?P ?O }}
where
{ GRAPH ?G {
?S a <http://MyOntology/MyClass> .
?S ?P ?O .
}};
I'll leave out the crash log because it's several pages long but you get
the idea.
The highlights are probably:
12:21:51 INFO: ERRS_0 01V01 QW001 Local declaration of o_val shadows a
definition of the same name
12:21:51 INFO: ERRS_0 01V01 QW001 Local declaration of
o_dt_and_lang_twobyte shadows a definition of the same name
12:21:51 INFO: ERRS_0 01V01 QW001 Local declaration of r_o shadows a
definition of the same name
...
12:21:52 ERROR: GPF: colsearch.c:2630 for unique ts, getting range with
more than 1 rows
GPF: colsearch.c:2630 for unique ts, getting range with more than 1 rows
--
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users