oeg-upm / morph-rdb

Virtual Knowledge Graph Creation from RDB with R2RML
https://morph.oeg.fi.upm.es/tool/morph-rdb
Other
41 stars 38 forks source link

Cannot run any example #39

Closed gcoskun closed 4 years ago

gcoskun commented 5 years ago

I followed the steps from the readme and imported the maven project into eclipse. I ran mvn clean and packages in the main folder. I moved the jar from the target folder to the examples folder. Then I tried to run the example with the CSV file. This is my output.

/DEV/github/morph-rdb/morph-examples/examples-csv$ ./example1-query01-csv.sh [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVProperties - reading configuration file : examples-csv/example1-query01-csv.morph.properties [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunnerFactory - MorphBaseRunnerFactory running morph-rdb 3.9.12 ... [main] INFO es.upm.fi.dia.oeg.morph.r2rml.model.R2RMLMappingDocument$ - Parsing mapping document examples-csv/example1-mapping-csv.ttl [main] WARN es.upm.fi.dia.oeg.morph.r2rml.model.R2RMLMappingDocument$ - Error occured while building metadata. [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunnerFactory - Setting output to examples-csv/example1-query01-result-csv.xml Exception in thread "main" java.lang.NoSuchMethodError: org.apache.jena.rdf.model.Model.setNsPrefixes(Ljava/util/Map;)Lorg/apache/jena/rdf/model/Model; at es.upm.fi.dia.oeg.morph.base.materializer.MorphBaseMaterializer.setModelPrefixMap(MorphBaseMaterializer.scala:40) at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunnerFactory.buildMaterializer(MorphBaseRunnerFactory.scala:320) at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunnerFactory.createRunner(MorphBaseRunnerFactory.scala:105) at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunnerFactory.createRunner(MorphBaseRunnerFactory.scala:46) at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunnerFactory.createRunner(MorphCSVRunnerFactory.scala:47) at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunner$.apply(MorphCSVRunner.scala:35) at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunner$.apply(MorphCSVRunner.scala:42) at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunner$.main(MorphCSVRunner.scala:60) at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunner.main(MorphCSVRunner.scala)

What am I doing wrong?

fpriyatna commented 5 years ago

hi, thanks for trying morph.

Can you check the Jena version in your POM files and make sure that it is at least 3.7.0 ?

Regards Freddy

gcoskun commented 5 years ago

Hi,

thanks for the response. I realized that the folder morph-rdb/morph-examples/dependency/ contains old jars. I replaced them with the new jena libraries. So the previous error is gone. But I get the following error now:

:~/DEV/github/morph-rdb/morph-examples/examples-csv$ sh example1-query01-csv.sh [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVProperties - reading configuration file : examples-csv/example1-query01-csv.morph.properties [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVProperties - CSV field separator = None [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunnerFactory - MorphBaseRunnerFactory running morph-rdb 3.9.14 ... [main] INFO es.upm.fi.dia.oeg.morph.r2rml.model.R2RMLMappingDocument$ - Parsing mapping document examples-csv/example1-mapping-csv.ttl [main] WARN es.upm.fi.dia.oeg.morph.r2rml.model.R2RMLMappingDocument$ - Error occured while building metadata. [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunnerFactory - Setting output to examples-csv/example1-query01-result-csv.xml [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunnerFactory - reading query file: examples-csv/example1-query01.rq [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBUtility$ - Loading CSV file ... [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBUtility$ - Loading CSV file: examples-csv/Sport.csv [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBUtility$ - createTableString = CREATE TABLE "SPORT" AS SELECT FROM CSVREAD('examples-csv/Sport.csv'); [main] ERROR es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBUtility$ - Error while dropping the table: SPORT : Table "SPORT" not found; SQL statement: DROP TABLE "SPORT" [42102-191] [main] ERROR es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBUtility$ - Error while creating the table: SPORT : IO Exception: "IOException reading examples-csv/Sport.csv"; SQL statement: CREATE TABLE "SPORT" AS SELECT FROM CSVREAD('examples-csv/Sport.csv'); [90028-191] [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBUtility$ - Loading CSV file ... [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBUtility$ - Loading CSV file: examples-csv/Student.csv [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBUtility$ - createTableString = CREATE TABLE "STUDENT" AS SELECT FROM CSVREAD('examples-csv/Student.csv'); [main] ERROR es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBUtility$ - Error while dropping the table: STUDENT : Table "STUDENT" not found; SQL statement: DROP TABLE "STUDENT" [42102-191] [main] ERROR es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBUtility$ - Error while creating the table: STUDENT : IO Exception: "IOException reading examples-csv/Student.csv"; SQL statement: CREATE TABLE "STUDENT" AS SELECT FROM CSVREAD('examples-csv/Student.csv'); [90028-191] [main] INFO es.upm.fi.dia.oeg.morph.rdb.querytranslator.MorphRDBQueryTranslator - this.mapInferredTypes = ?a -> Set(TriplesMapPerson) [main] INFO es.upm.fi.dia.oeg.morph.rdb.querytranslator.MorphRDBQueryTranslator - Query translation time = 83 ms. [main] INFO es.upm.fi.dia.oeg.morph.base.DBUtility$ - Executing query ... [main] INFO es.upm.fi.dia.oeg.morph.base.DBUtility$ - Executing query: SELECT 1847431070 AS "mappingid_a","T2"."ID" AS "a","T2"."WEBPAGE" AS "w",951988316 AS "mappingid_e",647973805 AS "mappingid_w","T2"."EMAIL" AS "e" FROM STUDENT T2

[main] ERROR es.upm.fi.dia.oeg.morph.base.DBUtility$ - Error while executing SQL Query: SELECT 1847431070 AS "mappingid_a","T2"."ID" AS "a","T2"."WEBPAGE" AS "w",951988316 AS "mappingid_e",647973805 AS "mappingid_w","T2"."EMAIL" AS "e" FROM STUDENT T2

org.h2.jdbc.JdbcSQLException: Table "STUDENT" not found; SQL statement: SELECT 1847431070 AS "mappingid_a","T2"."ID" AS "a","T2"."WEBPAGE" AS "w",951988316 AS "mappingid_e",647973805 AS "mappingid_w","T2"."EMAIL" AS "e" FROM STUDENT T2 [42102-191] at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) at org.h2.message.DbException.get(DbException.java:179) at org.h2.message.DbException.get(DbException.java:155) at org.h2.command.Parser.readTableOrView(Parser.java:5349) at org.h2.command.Parser.readTableFilter(Parser.java:1245) at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1884) at org.h2.command.Parser.parseSelectSimple(Parser.java:2032) at org.h2.command.Parser.parseSelectSub(Parser.java:1878) at org.h2.command.Parser.parseSelectUnion(Parser.java:1699) at org.h2.command.Parser.parseSelect(Parser.java:1687) at org.h2.command.Parser.parsePrepared(Parser.java:443) at org.h2.command.Parser.parse(Parser.java:315) at org.h2.command.Parser.parse(Parser.java:287) at org.h2.command.Parser.prepareCommand(Parser.java:252) at org.h2.engine.Session.prepareLocal(Session.java:560) at org.h2.engine.Session.prepareCommand(Session.java:501) at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1188) at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:170) at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:158) 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:25) at es.upm.fi.dia.oeg.morph.base.querytranslator.engine.QueryResultTranslator$$anonfun$translateResult$1.apply(QueryResultTranslator.scala:21) at scala.collection.immutable.Map$Map1.foreach(Map.scala:116) at es.upm.fi.dia.oeg.morph.base.querytranslator.engine.QueryResultTranslator.translateResult(QueryResultTranslator.scala:21) at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunner.run(MorphBaseRunner.scala:186) at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunner$.main(MorphCSVRunner.scala:61) at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunner.main(MorphCSVRunner.scala) [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunner - Running time = 89 ms. [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunner - errorCode = -1 [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunner - status = Table "STUDENT" not found; SQL statement: SELECT 1847431070 AS "mappingid_a","T2"."ID" AS "a","T2"."WEBPAGE" AS "w",951988316 AS "mappingid_e",647973805 AS "mappingid_w","T2"."EMAIL" AS "e" FROM STUDENT T2 [42102-191] [main] INFO es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphCSVRunner - **DONE****

gcoskun commented 5 years ago

I just noticed that the CSV files STUDENT.csv and SPORT.csv are capital case and the examples scripts are expecting Student.csv and Sport.csv. I renamed both files and now it works. I would propose to change the filenames in the github repo as well.

fpriyatna commented 5 years ago

Sure, thanks for the suggestions.

dachafra commented 4 years ago

Mapping sources and files are both in uppercase, and the scripts are tested and run. I close the issue