Re: [Virtuoso-users] DB.DBA.RDF_GEO_FILL exits with error

2010-07-14 Thread Patrick van Kleef

Hi Claus,

The first time the after a DB start DB.DBA.RDF_GEO_FILL () is  
called, the error occurs after less than a half a minute.

On consecutive attempts it then only takes a few seconds.

The error occurs independent of whether resources carry the virtuoso  
specific geo-literals. However, as already mentionend, adding those  
seems to be a workaround for that issue.





This problem is fixed in the new build.

I will contact you shortly where to get a new binary from.

Patrick




Re: [Virtuoso-users] Mac re-install error

2010-07-14 Thread Patrick van Kleef

Hi Nico,



I installed virtuoso already once on another server.

But this time I have some problems while compiling.
This files are not there, and they are not in the files I downloaded.


The source archive does not have this file either, but sometimes  
external tools like editors etc create such local files. I will see if  
i can fix the script so it filters out such files in a following  
release of VOS.


In the mean time, please perform the following commands:

First we clean up the directory:

  cd binsrc/rdf_mappers
  gmake clean

Next we check this unwanted file is there and remove it:

  cd main/xslt
  ls -l ._abmeta2rdfxml.xsl
  rm ._abmeta2rdfxml.xsl

Next we rebuild the vad package:

  cd ../..
  gmake


Please let me know if this resolves your build problem.


Patrick




The output:

=
=  STARTED RDF Mappers PACKAGING
=  Mon Jul 12 18:51:07 BST 2010
=

Shutdown Virtuoso Server...
VAD Sticker vad_dav.xml creation...
VAD Sticker vad_fs.xml creation...
Virtuoso.ini creation...
Waiting Virtuoso Server start on port ...
PASSED: Virtuoso Server successfully started on port 
***FAILED: execution of DB.DBA.VAD_PACK('vad_fs.xml', '.',  
'rdf_mappers_filesystem.vad')

 SQL ERROR -

*** Error 42VAD: [Virtuoso Driver][Virtuoso Server]Inexistent file  
resource (./vad/vsp/rdf_mappers/xslt/main/._abmeta2rdfxml.xsl)

in
signal:(BIF),
VAD.DBA.VAD_FAIL_CHECK,
VAD.DBA.VAD_OUT_ROW_FILE,
VAD.DBA.VAD_TEST_CREATE,
DB.DBA.VAD_PACK,
Top Level
at line 0 of Top-Level:
DB.DBA.VAD_PACK('vad_fs.xml', '.', 'rdf_mappers_filesystem.vad')

PASSED: commit work
PASSED: checkpoint
***FAILED: execution of DB.DBA.VAD_PACK('vad_dav.xml', '.',  
'rdf_mappers_dav.vad')

 SQL ERROR -

*** Error 42VAD: [Virtuoso Driver][Virtuoso Server]Inexistent file  
resource (./vad/vsp/rdf_mappers/xslt/main/._abmeta2rdfxml.xsl)

in
signal:(BIF),
VAD.DBA.VAD_FAIL_CHECK,
VAD.DBA.VAD_OUT_ROW_FILE,
VAD.DBA.VAD_TEST_CREATE,
DB.DBA.VAD_PACK,
Top Level
at line 0 of Top-Level:
DB.DBA.VAD_PACK('vad_dav.xml', '.', 'rdf_mappers_dav.vad')

PASSED: commit work
PASSED: checkpoint
Shutdown Virtuoso Server...

=
=  Checking log file /data/virtuoso-opensource-6.1.0/binsrc/ 
rdf_mappers/make_rdf_mappers_vad.log for statistics:

=
=  Total number of tests PASSED  : 5
=  Total number of tests FAILED  : 2
=  Total number of tests ABORTED : 0
=

*** Not all tests completed successfully
*** Check the file /data/virtuoso-opensource-6.1.0/binsrc/ 
rdf_mappers/make_rdf_mappers_vad.log for more information # egrep \* 
\*.*FAILED:|\*\*.*ABORTED: /data/virtuoso-opensource-6.1.0/binsrc/ 
rdf_mappers/make_rdf_mappers_vad.log

make[2]: *** [rdf_mappers_dav.vad] Error 1
make[2]: Leaving directory `/data/virtuoso-opensource-6.1.0/binsrc/ 
rdf_mappers'

make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/data/virtuoso-opensource-6.1.0/binsrc'
make: *** [all-recursive] Error 1






Re: [Virtuoso-users] SQL subquery embedded in a SPARQL query

2010-07-14 Thread Sören Auer

On 14.07.2010 4:38, Ted Thibodeau Jr wrote:

While not exactly what you're asking for, this may be sufficient for
what you want to achieve --

http://docs.openlinksw.com/virtuoso/rdfsparql.html#rdfsqlfromsparql


Yes, we have seen this, but this will be very inefficient for large 
datasets. We actually want to experiment with such a feature for 
increasing the performance of the triple store, by replicating commonly 
queried information structures in relational tables. The second use case 
would be integration of really large datasources and also there it would 
be crucial, that the whole resulting query could be optimized by 
Virtuoso's query optimizer.


Best,

Sören



Re: [Virtuoso-users] SQL subquery embedded in a SPARQL query

2010-07-14 Thread Ivan Mikhailov
Hello Sören,

First of all, placing the SQL query into SPARQL is required less
frequently than it seems to be. Virtuoso's optimizer does not treat
subquery as an instruction to preserve the order. As a result,

PREFIX : http://people.example/
SELECT ?y ?name ?age WHERE {
   :alice :knows ?y .
   {
 SQL SELECT y, name, age FROM people
   }
}

and

select q1.y, q2.name, q2.age
from (sparql
  PREFIX : http://people.example/ 
  SELECT ?y WHERE { :alice :knows ?y } ) as q1.
  people as q2
where q2.y=q1.y

will probably produce equivalent execution plans.

However, native SQLs could be very useful (and sometimes unavoidable) in nested 
scalar subqueries, e.g. in FILTER(bif:exists(...))
or in
SPARQL select
 (select ...) as ?calculated-value1
 (select ...) as ?calculated-value-2
where ...

The problem is that the sparql compiler may copy the content of the sql 
subquery into many places of the resulting big sql query.
If the subquery refers to some aliases then multiple copies of these aliases 
may cause weird SQL compilation errors.
Even worse, the subquery may omit aliases making things more obfuscating.
Finally, the subquery will probably refer to variables bound in surrounding 
SPARQL so that variables should be recognized in the text of the query and 
appropriate aliases should be imprinted before them.

A dirty hack is to write an RDF view that creates triples using tables, joins 
and filter conditions from the SQL query in question.
That will make the optimizer happy and provide best possible SQL code but it's 
next to unusable if there are many different subqueries.
Or better write an RDF view that creates triples using tables and maybe some 
joins from the SQL query in question but place filters and remaining joins into 
SPARQL query over that view.
That's more flexible and the quality of the generated code will stay good.

However the RDF View is a bad choice if an SQL view should be used as a source, 
or not applicable at all if the SQL view is actually procedure view.
So I should think what could be done.
Right now SPARQL compiler is a preprocessor at the front of the compiler.
To handle arbitrary SQL subqueries, the SQL processor should be divided in 
parts, so there will be an SQL+SPARQL preprocessor, then SPARQL processor then 
core of the SQL compiler, not a small change.
As a variant, the SQL inside SPARQL will contain special easily recognizable 
syntax extensions to refer to variables of surrounding SPARQL (and variables of 
SQL code around surrounding SPARQL).

I will discuss the issue with others and return to this topic after the release 
that will contain SPARQL 1.1 extensions.

Best Regards,
Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com


On Wed, 2010-07-14 at 13:55 +0200, Sören Auer wrote:
 Hi,
 
 For some experiments we plan to run it would be very useful to embed an 
 SQL query as a subquery inside a SPARQL query. We want to combine 
 relational with RDF data for example in the following way:
 
 Lets assume we have foaf profiles in the triple store and a relational 
 table with information about people (e.g. from a CRM system). A query 
 similar to the following would be really useful in that case:
 
 PREFIX : http://people.example/
 SELECT ?y ?name ?age WHERE {
:alice :knows ?y .
{
  SQL SELECT y, name, age FROM people
}
 }
 
 Instead of joining with the triple table a join with the SQL subquery 
 would occur and SPARQL variables would be matched against columns of the 
 SQL result set with the same name.
 
 Does this make sense? Are there already plans to implement something 
 along these lines in Virtuoso? I think this functionality would 
 dramatically simplify a number of data integration tasks and be a 
 wonderful USP for Virtuoso.
 
 Best,
 
 Sören