SmartDataAnalytics / Sparqlify

Sparql -> SQL Rewriter enabling virtual RDB -> RDF mappings
http://aksw.org/Projects/Sparqlify
123 stars 13 forks source link

explode numerical values #68

Open KonradHoeffner opened 7 years ago

KonradHoeffner commented 7 years ago

A typed literal with xsd:positiveInteger throws an exception, see below, on integer list strings like "128;207". I suggest an explode option where above string is transformed into two triples with values 128 and 207, respectively.

java.lang.NumberFormatException: For input string: "128;207"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:580)
    at java.lang.Integer.parseInt(Integer.java:615)
    at org.apache.jena.riot.process.normalize.NormalizeValue.lambda$static$3(NormalizeValue.java:131)
    at org.apache.jena.riot.process.normalize.CanonicalizeLiteral.apply(CanonicalizeLiteral.java:63)
    at org.aksw.sparqlify.core.sparql.ItemProcessorSparqlify.process(ItemProcessorSparqlify.java:141)
Aklakan commented 7 years ago

One common powerful approach to this is to use SQL's unnest function - which generates multiple rows from a multi-valued cell. This requires finalizing the integration of the H2 embedded database.

KonradHoeffner commented 7 years ago

Would it work for CSV also?