Open MathiasVDA opened 8 months ago
Hi!
Do you maybe have a simple example we can use to debug this?
Here is an example. Run this query on your database:
create table sandbox.rml_test (
id serial4 NOT NULL,
label varchar(255) NULL,
this_is_the_problem float8 NULL
);
INSERT INTO sandbox.rml_test
("label")
VALUES('label1'),('label2'),('label3');
And use this rml file as input for the mapper
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
<https://data.infrabel.be/data/Source/AMDB/JDBC> a d2rq:Database;
d2rq:jdbcDSN "...";
d2rq:jdbcDriver "drivers/org.postgresql.Driver";
d2rq:username "...";
d2rq:password "..." .
<https://data.infrabel.be/mapping/rml_test_map>
a rr:TriplesMap;
rml:logicalSource [
rml:source <https://data.infrabel.be/data/Source/AMDB/JDBC>;
rr:sqlVersion rr:SQL2008;
rr:tableName "sandbox.rml_test"; ];
rr:subjectMap [
rr:template "https://data.infrabel.be/rml_test_{id}"; ];
rr:predicateObjectMap [
rr:predicate rdfs:label;
rr:objectMap [ rml:reference "label" ] ].
And run this command:
docker run --rm -v "%cd%":/data rmlio/rmlmapper-java -m path_to_mapping_file -o path_to_output_file -s turtle
We will have a look, thanks for the example!
Normally, it should handle the float8
thing as datatype according to https://github.com/RMLio/rmlmapper-java/blob/master/src/main/java/be/ugent/rml/access/RDBAccess.java#L286C1-L286C27 but we will have to investigate further what is going on.
It might be more related to the NULL value then to the data type. I haven't tested other dataypes with a NULL value
Hello
I have a postgresql database with a table that I'm trying to convert into triples using RML and RMLmapper. But I get the following exception:
I have studied that table and created a series of views that reduced the number of columns in the table until RMLMapper worked properly. I found out that when a column has datatype float8 and at least one value is NULL, then the above exception is thrown.
This the postgresql version of the database: PostgreSQL 12.14 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit