openlink / virtuoso-opensource

Virtuoso is a high-performance and scalable Multi-Model RDBMS, Data Integration Middleware, Linked Data Deployment, and HTTP Application Server Platform
https://vos.openlinksw.com
Other
852 stars 211 forks source link

Internal Optimized compiler error : Unplaced predicate in select layout in ..\libsrc\Wi\sqldf.c:7149. #650

Open mazzogp opened 7 years ago

mazzogp commented 7 years ago

I have succeeded to load in the virtuoso RDB the content of my Oracle application DB. Currently I have a lot of non-Latin text correctly stored in virtuoso RDB as Unicode in NVARCHAR columns. I perform the R2RML mapping on its tables in order to have it accessible as RDF. Now when I execute this SPARQL statement

prefix pest:<http://test.com/dataset/pesticides/resource/> 
select *
from <http://test.com/dataset/pesticides/resource>
where 
{
  ?mainProdId    pest:productCode    "0120010" .
  ?prodSynonymId pest:productCode    ?productCode .
  ?prodSynonymId pest:hasProduct     ?mainProdId .
  ?prodSynonymId pest:languageCode   'EL' .
  #?prodSynonymId pest:scientificName ?otherProdScientificName.
  ?prodSynonymId pest:synonymName    ?otherProductName.
  ?prodSynonymId pest:codeNumber     ?otherProductCode .
}

I have the error

Virtuoso 37000 Error SQ156: Internal Optimized compiler error : Unplaced predicate in select layout in ..\libsrc\Wi\sqldf.c:7149.
Please report the statement compiled.

SPARQL query:
define sql:big-data-const 0 
#output-format:text/html
prefix pest:
select *
from 
where 
{
[...]
}

If I remove the comment in the following line of the query

  #?prodSynonymId pest:scientificName ?otherProdScientificName.

I get the following error instead

Virtuoso 37000 Error SP031: SPARQL: Internal error: The length of generated SQL text has exceeded 10000 lines of code
SPARQL query:
define sql:big-data-const 0 
#output-format:text/html
prefix pest:
select *
#?productCode ?otherProductCode 
#?otherProductName ?otherProdScientificName 
from 
where 
{
[...]
}

A further info: there is an IRI in my R2RML definitions that is composed by 5 columns. One of these columns is a field containing free-Unicode text with maximum length of 2000 characters. Here it is.

rr:subjectMap [ 
  rr:termType rr:IRI  ;
  rr:template "http://test.com/dataset/pesticides/resource/productSynonym-{SYNONYM_ID}/languageCode-{LANGUAGE_CD}/productCode-{PRODUCT_CODE}/codeNumber-{CODE_NUMBER}/scientificName-{SCIENTIFIC_NAME}";
  rr:class pest:ProductSynonym;
  rr:graph <http://test.com/dataset/pesticides/resource> 
];

This IRI is involved in the above statement execution, since its triples map defines RDF attributes used in the query.

With the same RDB content except the non-Latin text that is not present the SPARQL errors are not issued.

mazzogp commented 7 years ago

I have simplified the mentioned 5-columns IRI. Now it refers to one column only. Now the query returns an empty result. The correct result is something like below (the columns in the image currently do no match exactly with the statement, but this last should return 4 triples sanyway). capture

mazzogp commented 7 years ago

i did not mean to close it

HughWilliams commented 7 years ago

@beppem: I presume the original Oracle data has been imported into Virtuoso as SQL data which you are then mapping to RDF in Virtuoso using hand written R2RML scripts ?

I don't imagine data is required to recreate this issue this are you able to provide the schema of the SQL tables in Virtuoso and R2RML scripts being used to map to RDF such that we can attempt to recreate locally ?

mazzogp commented 7 years ago

@Hugh Sorry for the late answer, but the error seemed disappeared. Instead changing slightly the mapping it has returned back. Yes, it happens with the empty data base as well. As requested please find attached the schema and the R2RML mapping files. I had to uncomment out the third last triple pattern to get the error.

create_tables.txt pesticidesR2RML.txt

mazzogp commented 7 years ago

With the provided scripts above the following statement has to be used

prefix pest:<http://ec.europa.eu/semantic_webgate/dataset/pesticides/resource/>
select ?productCode ?otherProductCode ?otherProductName ?otherProdScientificName 
from <http://ec.europa.eu/semantic_webgate/dataset/pesticides/resource>
where 
{
  ?mainProdId    pest:productCode    "0120010" .
  ?prodSynonymId pest:productCode    ?productCode .
  ?prodSynonymId pest:hasProduct     ?mainProdId .
  ?prodSynonymId pest:languageCode   'EN' .
  ?prodSynonymId pest:scientificName ?otherProdScientificName.
  ?prodSynonymId pest:synonymName    ?otherProductName.
  ?prodSynonymId pest:codeNumber     ?otherProductCode .
}
HughWilliams commented 7 years ago

When I try to run your R2RML triple mapping I get the error:

OVL validation has signalled VECSL: VECSL: Internal error, ssl refd before set, please report query to support on query select sample (?s), (if (count (1), "Info", "Error")) as ?severity, bif:concat ("Graph <", ?::source_g_iri, "> contains ", count (1), " triples") as ?message where { ?s ?p ?o } limit 1

looking into why this is occurring ...

mazzogp commented 7 years ago

@HughWilliams With the current R2RML mapping (that is not the one attached to this report) the error thrown is the same of issue #664