Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test on different scenarios (next on empty iterator error) and (ERROR: missing FROM-clause entry) #73

Open
a-alhazmi opened this issue Mar 22, 2023 · 0 comments
Labels

Comments

@a-alhazmi
Copy link

Hello,


I am developing a benchmark for OBDA and Chase systems, ForBackBench. ForBackBench integrates 7 scenarios, and I am trying to execute SPARQL queries using Morph-RDB. Some queries worked perfectly, and I got the results. However, I got errors on others. Here is an example of these queries from OWL2Bench scenario: Q1.txt is the full query, Q2.txt I tried to shrink the query in Q1:

Files:
Note:Extension of the files was changed (or added) to .txt so it can be uploaded to github.
gav-mapping.r2rml.ttl.txt
Q1.txt
configQ1.r2rml.properties.txt
Q2.txt
configQ2.r2rml.properties copy.txt

Case 1 (Q1.txt file):

[main] INFO es.upm.fi.dia.oeg.morph.rdb.querytranslator.MorphRDBQueryTranslator - 
this.mapInferredTypes = ?0 -> Set()
?3 -> Set()
?1 -> Set(, )
?2 -> Set()
java.util.NoSuchElementException: next on empty iterator
	at scala.collection.Iterator$$anon$2.next(Iterator.scala:39)
	at scala.collection.Iterator$$anon$2.next(Iterator.scala:37)
	at es.upm.fi.dia.oeg.morph.base.querytranslator.MorphBaseQueryTranslator$$anonfun$22.apply(MorphBaseQueryTranslator.scala:1466)
	at es.upm.fi.dia.oeg.morph.base.querytranslator.MorphBaseQueryTranslator$$anonfun$22.apply(MorphBaseQueryTranslator.scala:1464)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
	at scala.collection.Iterator$class.foreach(Iterator.scala:891)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1334)
	at scala.collection.MapLike$DefaultKeySet.foreach(MapLike.scala:174)
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
	at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
	at scala.collection.SetLike$class.map(SetLike.scala:92)
	at scala.collection.AbstractSet.map(Set.scala:47)
	at es.upm.fi.dia.oeg.morph.base.querytranslator.MorphBaseQueryTranslator.translate(MorphBaseQueryTranslator.scala:1464)
	at es.upm.fi.dia.oeg.morph.base.querytranslator.MorphBaseQueryTranslator.translate(MorphBaseQueryTranslator.scala:1514)
	at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunner$$anonfun$1.apply(MorphBaseRunner.scala:218)
	at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunner$$anonfun$1.apply(MorphBaseRunner.scala:216)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
	at scala.collection.immutable.List.foreach(List.scala:392)
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
	at scala.collection.immutable.List.map(List.scala:296)
	at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunner.translateSPARQLQueriesIntoSQLQueries(MorphBaseRunner.scala:216)
	at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunner.run(MorphBaseRunner.scala:182)
	at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBRunner$.main(MorphRDBRunner.scala:82)
	at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBRunner.main(MorphRDBRunner.scala)
[main] ERROR es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBRunner$ - Exception occured: next on empty iterator
Exception in thread "main" java.util.NoSuchElementException: next on empty iterator
	at scala.collection.Iterator$$anon$2.next(Iterator.scala:39)
	at scala.collection.Iterator$$anon$2.next(Iterator.scala:37)
	at es.upm.fi.dia.oeg.morph.base.querytranslator.MorphBaseQueryTranslator$$anonfun$22.apply(MorphBaseQueryTranslator.scala:1466)
	at es.upm.fi.dia.oeg.morph.base.querytranslator.MorphBaseQueryTranslator$$anonfun$22.apply(MorphBaseQueryTranslator.scala:1464)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
	at scala.collection.Iterator$class.foreach(Iterator.scala:891)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1334)
	at scala.collection.MapLike$DefaultKeySet.foreach(MapLike.scala:174)
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
	at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
	at scala.collection.SetLike$class.map(SetLike.scala:92)
	at scala.collection.AbstractSet.map(Set.scala:47)
	at es.upm.fi.dia.oeg.morph.base.querytranslator.MorphBaseQueryTranslator.translate(MorphBaseQueryTranslator.scala:1464)
	at es.upm.fi.dia.oeg.morph.base.querytranslator.MorphBaseQueryTranslator.translate(MorphBaseQueryTranslator.scala:1514)
	at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunner$$anonfun$1.apply(MorphBaseRunner.scala:218)
	at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunner$$anonfun$1.apply(MorphBaseRunner.scala:216)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
	at scala.collection.immutable.List.foreach(List.scala:392)
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
	at scala.collection.immutable.List.map(List.scala:296)
	at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunner.translateSPARQLQueriesIntoSQLQueries(MorphBaseRunner.scala:216)
	at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunner.run(MorphBaseRunner.scala:182)
	at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBRunner$.main(MorphRDBRunner.scala:82)
	at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBRunner.main(MorphRDBRunner.scala)

Case 2 (Q2.txt file): I tried to shrink the query in Q1 by removing the (rdf:type) from the query and this time I got this error:

[main] INFO es.upm.fi.dia.oeg.morph.base.DBUtility$ - Executing query:
SELECT  DISTINCT V_8490."var_1" AS "1",V_8490."mappingid_1" AS "mappingid_1"
FROM  ( SELECT V_23573."c0" AS "var_0",1336775847::integer AS "mappingid_0",V_23573."c1" AS "var_1",1998137093::integer AS "mappingid_1"
FROM (SELECT DISTINCT AA."c0" as c0, EA."c1" as c1 FROM  "src_Dean" as AA, "src_Specification" as BA, "src_Humanities" as CA, "src_Chair" as DA, "src_isStudentOf" as EA WHERE AA."c0" = BA."c0" AND BA."c0" = CA."c0" AND CA."c0" = DA."c0" AND DA."c0" = EA."c0" ) V_23573
WHERE V_23573."c1" IS NOT NULL

UNION
SELECT V_42602."c1" AS "var_0",1335061928::integer AS "mappingid_0",V_42602."c0" AS "var_1",1108706191::integer AS "mappingid_1"
FROM (SELECT DISTINCT AA."c0" as c0, EA."c1" as c1 FROM  "src_Dean" as AA, "src_Specification" as BA, "src_Humanities" as CA, "src_Chair" as DA, "src_isStudentOf" as EA WHERE AA."c0" = BA."c0" AND BA."c0" = CA."c0" AND CA."c0" = DA."c0" AND DA."c0" = EA."c0" ) V_42602
WHERE V_42602."c0" IS NOT NULL

 ) "V_8490"
 INNER JOIN  ( SELECT V_9514."var_1" AS "var_1",V_9146."var_3" AS "var_3",V_9514."var_2" AS "var_2",V_9514."mappingid_1" AS "mappingid_1",V_9146."mappingid_3" AS "mappingid_3",V_9514."mappingid_2" AS "mappingid_2"
FROM  ( SELECT V_65470."c0" AS "var_1",1107204185::integer AS "mappingid_1",V_65470."c1" AS "var_2",1523084197::integer AS "mappingid_2"
FROM (SELECT DISTINCT AA."c0" as c0, AA."c1" as c1 FROM  "src_hasOtherStaff" as AA, "src_BasketBallFan" as BA, "src_Director" as CA, "src_tenured" as DA, "src_isPartOf" as EA WHERE AA."c1" = DA."c1" AND DA."c1" = EA."c1" AND AA."c0" = BA."c0" AND BA."c0" = CA."c0" AND CA."c0" = DA."c0" AND DA."c0" = EA."c0" ) V_65470
WHERE V_65470."c1" IS NOT NULL

UNION
SELECT V_21485."c1" AS "var_1",747870628::integer AS "mappingid_1",V_21485."c0" AS "var_2",421191743::integer AS "mappingid_2"
FROM (SELECT DISTINCT AA."c0" as c0, AA."c1" as c1 FROM  "src_hasOtherStaff" as AA, "src_BasketBallFan" as BA, "src_Director" as CA, "src_tenured" as DA, "src_isPartOf" as EA WHERE AA."c1" = DA."c1" AND DA."c1" = EA."c1" AND AA."c0" = BA."c0" AND BA."c0" = CA."c0" AND CA."c0" = DA."c0" AND DA."c0" = EA."c0" ) V_21485
WHERE V_21485."c0" IS NOT NULL

 ) "V_9514"
 INNER JOIN  ( SELECT V_39148."c0" AS "var_2",1403716230::integer AS "mappingid_2",V_39148."c1" AS "var_3",1673916398::integer AS "mappingid_3"
FROM (SELECT DISTINCT AA."c0" as c0, AA."c1" as c1 FROM  "src_isPartOf" as AA, "src_BasketBallFan" as BA, "src_hasCollegeDiscipline" as CA WHERE AA."c1" = CA."c1" AND AA."c0" = BA."c0" AND BA."c0" = CA."c0" ) V_39148
WHERE V_39148."c1" IS NOT NULL
 ) "V_9146" ON ("V_9514"."var_2" = "V_9146"."var_2")
 ) "V_8672" ON ("V_8490"."var_1" = "V_8672"."var_1")

[main] ERROR es.upm.fi.dia.oeg.morph.base.DBUtility$ - Error while executing SQL Query: SELECT  DISTINCT V_8490."var_1" AS "1",V_8490."mappingid_1" AS "mappingid_1"
FROM  ( SELECT V_23573."c0" AS "var_0",1336775847::integer AS "mappingid_0",V_23573."c1" AS "var_1",1998137093::integer AS "mappingid_1"
FROM (SELECT DISTINCT AA."c0" as c0, EA."c1" as c1 FROM  "src_Dean" as AA, "src_Specification" as BA, "src_Humanities" as CA, "src_Chair" as DA, "src_isStudentOf" as EA WHERE AA."c0" = BA."c0" AND BA."c0" = CA."c0" AND CA."c0" = DA."c0" AND DA."c0" = EA."c0" ) V_23573
WHERE V_23573."c1" IS NOT NULL

UNION
SELECT V_42602."c1" AS "var_0",1335061928::integer AS "mappingid_0",V_42602."c0" AS "var_1",1108706191::integer AS "mappingid_1"
FROM (SELECT DISTINCT AA."c0" as c0, EA."c1" as c1 FROM  "src_Dean" as AA, "src_Specification" as BA, "src_Humanities" as CA, "src_Chair" as DA, "src_isStudentOf" as EA WHERE AA."c0" = BA."c0" AND BA."c0" = CA."c0" AND CA."c0" = DA."c0" AND DA."c0" = EA."c0" ) V_42602
WHERE V_42602."c0" IS NOT NULL

 ) "V_8490"
 INNER JOIN  ( SELECT V_9514."var_1" AS "var_1",V_9146."var_3" AS "var_3",V_9514."var_2" AS "var_2",V_9514."mappingid_1" AS "mappingid_1",V_9146."mappingid_3" AS "mappingid_3",V_9514."mappingid_2" AS "mappingid_2"
FROM  ( SELECT V_65470."c0" AS "var_1",1107204185::integer AS "mappingid_1",V_65470."c1" AS "var_2",1523084197::integer AS "mappingid_2"
FROM (SELECT DISTINCT AA."c0" as c0, AA."c1" as c1 FROM  "src_hasOtherStaff" as AA, "src_BasketBallFan" as BA, "src_Director" as CA, "src_tenured" as DA, "src_isPartOf" as EA WHERE AA."c1" = DA."c1" AND DA."c1" = EA."c1" AND AA."c0" = BA."c0" AND BA."c0" = CA."c0" AND CA."c0" = DA."c0" AND DA."c0" = EA."c0" ) V_65470
WHERE V_65470."c1" IS NOT NULL

UNION
SELECT V_21485."c1" AS "var_1",747870628::integer AS "mappingid_1",V_21485."c0" AS "var_2",421191743::integer AS "mappingid_2"
FROM (SELECT DISTINCT AA."c0" as c0, AA."c1" as c1 FROM  "src_hasOtherStaff" as AA, "src_BasketBallFan" as BA, "src_Director" as CA, "src_tenured" as DA, "src_isPartOf" as EA WHERE AA."c1" = DA."c1" AND DA."c1" = EA."c1" AND AA."c0" = BA."c0" AND BA."c0" = CA."c0" AND CA."c0" = DA."c0" AND DA."c0" = EA."c0" ) V_21485
WHERE V_21485."c0" IS NOT NULL

 ) "V_9514"
 INNER JOIN  ( SELECT V_39148."c0" AS "var_2",1403716230::integer AS "mappingid_2",V_39148."c1" AS "var_3",1673916398::integer AS "mappingid_3"
FROM (SELECT DISTINCT AA."c0" as c0, AA."c1" as c1 FROM  "src_isPartOf" as AA, "src_BasketBallFan" as BA, "src_hasCollegeDiscipline" as CA WHERE AA."c1" = CA."c1" AND AA."c0" = BA."c0" AND BA."c0" = CA."c0" ) V_39148
WHERE V_39148."c1" IS NOT NULL
 ) "V_9146" ON ("V_9514"."var_2" = "V_9146"."var_2")
 ) "V_8672" ON ("V_8490"."var_1" = "V_8672"."var_1")

org.postgresql.util.PSQLException: ERROR: missing FROM-clause entry for table "v_9514"
  Position: 986
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2468)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2211)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:309)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:446)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:370)
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:311)
	at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:297)
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:274)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:269)
	at es.upm.fi.dia.oeg.morph.base.DBUtility$.execute(DBUtility.scala:76)
	at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBDataSourceReader.execute(MorphRDBDataSourceReader.scala:19)
	at es.upm.fi.dia.oeg.morph.base.querytranslator.engine.QueryResultTranslator$$anonfun$translateResult$1.apply(QueryResultTranslator.scala:28)
	at es.upm.fi.dia.oeg.morph.base.querytranslator.engine.QueryResultTranslator$$anonfun$translateResult$1.apply(QueryResultTranslator.scala:23)
	at scala.collection.immutable.Map$Map1.foreach(Map.scala:116)
	at es.upm.fi.dia.oeg.morph.base.querytranslator.engine.QueryResultTranslator.translateResult(QueryResultTranslator.scala:23)
	at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunner.run(MorphBaseRunner.scala:188)
	at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBRunner$.main(MorphRDBRunner.scala:82)
	at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBRunner.main(MorphRDBRunner.scala)
[main] ERROR es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBRunner$ - Exception occured: ERROR: missing FROM-clause entry for table "v_9514"
  Position: 986
Exception in thread "main" org.postgresql.util.PSQLException: ERROR: missing FROM-clause entry for table "v_9514"
  Position: 986
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2468)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2211)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:309)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:446)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:370)
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:311)
	at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:297)
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:274)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:269)
	at es.upm.fi.dia.oeg.morph.base.DBUtility$.execute(DBUtility.scala:76)
	at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBDataSourceReader.execute(MorphRDBDataSourceReader.scala:19)
	at es.upm.fi.dia.oeg.morph.base.querytranslator.engine.QueryResultTranslator$$anonfun$translateResult$1.apply(QueryResultTranslator.scala:28)
	at es.upm.fi.dia.oeg.morph.base.querytranslator.engine.QueryResultTranslator$$anonfun$translateResult$1.apply(QueryResultTranslator.scala:23)
	at scala.collection.immutable.Map$Map1.foreach(Map.scala:116)
	at es.upm.fi.dia.oeg.morph.base.querytranslator.engine.QueryResultTranslator.translateResult(QueryResultTranslator.scala:23)
	at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunner.run(MorphBaseRunner.scala:188)
	at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBRunner$.main(MorphRDBRunner.scala:82)
	at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBRunner.main(MorphRDBRunner.scala)

Could you please help to figure out what's the problem?

@dachafra dachafra added the bug label Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants