SANSA-Stack / Archived-SANSA-Examples

Usage examples for the SANSA Stack
http://sansa-stack.net
Apache License 2.0
38 stars 13 forks source link

ParseException when trying to run Sparklify example #15

Closed nemanjavuk closed 7 years ago

nemanjavuk commented 7 years ago

I tried to run a net.sansa_stack.examples.spark.query.Sparqklify example class with my own file in nt format and it gives back the following stack trace:

`Exception in thread "main" org.apache.spark.sql.catalyst.parser.ParseException: mismatched input '-' expecting (line 1, pos 3)

== SQL == rdf-schema#subClassOf ---^^^

at org.apache.spark.sql.catalyst.parser.ParseException.withCommand(ParseDriver.scala:197)
at org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parse(ParseDriver.scala:99)
at org.apache.spark.sql.execution.SparkSqlParser.parse(SparkSqlParser.scala:46)
at org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parseTableIdentifier(ParseDriver.scala:48)
at org.apache.spark.sql.Dataset$$anonfun$createOrReplaceTempView$1.apply(Dataset.scala:2407)
at org.apache.spark.sql.Dataset$$anonfun$createOrReplaceTempView$1.apply(Dataset.scala:2405)
at org.apache.spark.sql.Dataset.org$apache$spark$sql$Dataset$$withPlan(Dataset.scala:2589)
at org.apache.spark.sql.Dataset.createOrReplaceTempView(Dataset.scala:2405)
at net.sansa_stack.query.spark.sparqlify.SparqlifyUtils3$$anonfun$1.apply(SparqlifyUtils3.scala:62)
at net.sansa_stack.query.spark.sparqlify.SparqlifyUtils3$$anonfun$1.apply(SparqlifyUtils3.scala:45)
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.HashMap$HashMap1.foreach(HashMap.scala:221)
at scala.collection.immutable.HashMap$HashTrieMap.foreach(HashMap.scala:428)
at scala.collection.immutable.HashMap$HashTrieMap.foreach(HashMap.scala:428)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
at scala.collection.AbstractTraversable.map(Traversable.scala:104)
at net.sansa_stack.query.spark.sparqlify.SparqlifyUtils3$.createSparqlSqlRewriter(SparqlifyUtils3.scala:45)
at net.sansa_stack.examples.spark.query.Sparklify$.main(Sparklify.scala:53)
at net.sansa_stack.examples.spark.query.Sparklify.main(Sparklify.scala)`
Aklakan commented 7 years ago

Hi, can you please provide a (relevant subset; apparently the subClassOf statements would be sufficient) example of your input data so that we can try to reproduce the isse? Are you sure that your N-TRIPLES file is error free? Also, did you use the release or develop version of sansa?

nemanjavuk commented 7 years ago

I tried with a larger example but even if you try with a file with only the following triple:

<http://example.org/#Spiderman> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://example.org/#Superhero> .

I get the same exception. I used the develop branch of SANSA-Examples. Thank you

Aklakan commented 7 years ago

I tested the triple with the current versions of the rdf and query layers in develop, and there this triple works. However, it is most likely related to an existing issue about deriving SQL table names for RDF partitions in the RDF layer: https://github.com/SANSA-Stack/SANSA-RDF/issues/19

Aklakan commented 7 years ago

I am closing this concrete issue (which is resolved) in favor of the more general issue SANSA-Stack/SANSA-RDF#19