Closed mchaloupka closed 4 years ago
hi Milos, Thanks for trying morph.
Yes, queries from BSBM are supported. I will check with the files that you provided.
Regards Freddy
Thanks. By the way, for me it would be enough if you will give me enough information how to make it running for BSBM over MSSQL or MySQL. Ideally, if it would be possible even to run some SPARQL endpoint which can be accessed from BSBM test driver (I have not seen anywhere whether you support something like that or not).
Miloš
By the way, I have update the log.txt attachment, originally it was empty because I have redirected only standard output to the file, not the error output.
hi Miloš,
I have just uploaded a new release, please pull your repository, or use this jar: https://github.com/oeg-upm/morph-rdb/releases/download/v3.9.14/morph-rdb-dist-3.9.14.jar
Mapping document and query file can be found at: https://github.com/oeg-upm/morph-rdb/tree/master/morph-examples/examples-bsbm-mysql
Let me know if you still encounter problems.
Freddy
Hi @fpriyatna, I have tried it but with no luck. I have used dependencies from 3.9.0 - could that be an issue?
Not sure whether I am executing it correctly. In the root folder (F:\Morph) I have all files needed for the query (.rq, .properties, .ttl) and a batch file to execute it.
This is the batch file I use to execute the query:
cd dist
java -cp morph-rdb.jar;dependency/* es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBRunner "F:\Morph" example.properties
cd ..
Output of the run is as follows: log.txt
Do you have any idea what I am doing wrong? Thanks.
Hi, I think you are not including the dependency jars, bc you have to move the generated morph-rdb jar file to the examples folder. We updated the documentation last year, could you take a look and see if it is resolved?
Thanks!
Hi,
it is not resolved although in the newer version there is a different exception (previously there was a scala.MatchError
, now there is NoSuchElementException
.
Steps to reproduce:
It requires docker
and .NET Core SDK 3.1 or newer
installed.
dotnet fsi
and it opens you a console where you should execute the following queries:
#load "benchmark.fsx"
Benchmark.generateData 20
open Database
open Docker
createNetwork benchmarkNetwork
startDatabaseContainer Databases.MySql
;;
docker run --net=benchmark-net --rm -it --name morph ubuntu:latest
mkdir /morph
cd /morph
docker cp query.morph.properties morph:/morph/query.morph.properties
docker cp Query_01.rq morph:/morph/Query_01.rq
apt-get update
apt-get install wget
apt-get install unzip
apt-get install default-jre
wget https://github.com/oeg-upm/morph-rdb/releases/download/morph-RDB_v3.9.17/dependency.zip
unzip dependency.zip
wget https://github.com/oeg-upm/morph-rdb/releases/download/morph-RDB_v3.9.17/morph-rdb-dist-3.9.17.jar
ln -s morph-rdb-dist-3.9.17.jar morph-rdb.jar
wget https://raw.githubusercontent.com/mchaloupka/bsbm-r2rml/develop/src/main/dist/rdb2rdf/mapping.ttl
java -cp .:morph-rdb.jar:dependency/* es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBRunner . query.morph.properties
The last command should succeed, but it generates the following output itself:
log4j:WARN No appenders could be found for logger (es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBRunner$).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
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:1435)
at es.upm.fi.dia.oeg.morph.base.querytranslator.MorphBaseQueryTranslator$$anonfun$22.apply(MorphBaseQueryTranslator.scala:1433)
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:1433)
at es.upm.fi.dia.oeg.morph.base.querytranslator.MorphBaseQueryTranslator.translate(MorphBaseQueryTranslator.scala:1483)
at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunner$$anonfun$1.apply(MorphBaseRunner.scala:213)
at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunner$$anonfun$1.apply(MorphBaseRunner.scala:211)
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:211)
at es.upm.fi.dia.oeg.morph.base.engine.MorphBaseRunner.run(MorphBaseRunner.scala:181)
at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBRunner$.main(MorphRDBRunner.scala:78)
at es.upm.fi.dia.oeg.morph.r2rml.rdb.engine.MorphRDBRunner.main(MorphRDBRunner.scala)
I have verified (using Ontop), that the query should return a result so it is definitely not correct that the result.nt
output is empty and therefore it seems that the logged error is not just transient.
To shutdown the container with morph, you can just press Ctrl+D
. To shutdown the database, just use the following commands in the console where you had it created (still inside of the fsi
environment):
Docker.stopAndRemoveContainer databaseDockerName
removeNetwork benchmarkNetwork
;;
#quit;;
Thank you for your feedback. We've already the same issue and the reason is because the engine only searches in the rr:class
mapping properties when a query asks about a type (in your case ProductType). We are currently working on it for extending the search to find this kind of predicates in the POM.
If you want to run morph-rdb in the current state you can substitute the predicate using other such as bsbm:productType (instead of rdf:type) and the problem should be resolved. This change may only impact in the case you perform query rewriting techniques over the query, but if you are only performing a query-translation/execution from SPARQL-to-SQL shouldn't have any impact in the total performance.
After one month we don't receive any comment so it's assumed that issue is solved. Additionally, we try to reproduce the generation of the benchmark and we obtain errors in the output. Log added. issue clossed. log-benchmark.txt
Hi @dachafra ,
thanks for providing the log. I will look into it, it should be fixed in few days, I have created a ticket on my side to handle it and ensure that you can run it.
Is the issue with supporting only rr:class
already resolved? I have not found such issue in the list of either opened or closed, so I do not know what is the state of that.
Regards, Milos
The engine supports rr:class but it has an issue solving rdf:type predicates in common POMs (we will open an issue soon as it is currently under our ToDo list). I'll mention you on that issue. Thanks for the feedback.
Hi, do you support queries from BSBM? I have tried to execute a query and it failed.
See attached files to see what happens. In general I was not able to query anything where a join is involved. Extension of the files was changed (or added) to .txt so it can be uploaded to github.
example.properties.txt Query_01.txt bsbm.txt log.txt