nkons / r2rml-parser

R2RML Parser is an award-winning tool that can export relational database contents as RDF graphs, based on an R2RML mapping document.
Apache License 2.0
68 stars 21 forks source link

rr:parentTriplesMap result in error when rr:child is a literal #17

Closed ValeriaPequeno closed 8 years ago

ValeriaPequeno commented 8 years ago

Hi,

When I trie pick up a uri from another r2rml mapping give me a error:

I thing the problem is the rr:child in the rr:parentTripleMap is a string and the query to pick up the tuple in the database is not properly formed.

Example of my mapping:

map:Organization rr:logicalTable [ rr:sqlQuery """ SELECT OrgID AS ID, Homepage AS foaf_homepage, Name AS rdfs_label, Address AS vcard_ADR, Location AS vcard_ADR2, Postcode AS vcard_ADR3, Country AS vcard_ADR4 FROM organizations """ ];

rr:subjectMap [
    rr:template 'http://data.example.com/organization/{"ID"}';
    rr:class conf:Organization; 
];
rr:predicateObjectMap [
    rr:predicate rdfs:label;
    rr:objectMap [ rr:column 'rdfs_label'; ]
]; 
rr:predicateObjectMap [
    rr:predicate foaf:homepage;
    rr:objectMap [ rr:column 'foaf_homepage' ; ] 
];
rr:predicateObjectMap [
    rr:predicate vcard:ADR; 
    rr:objectMap [
        rr:parentTriplesMap map:PostalAddress; 
        rr:joinCondition [
            rr:child "\"vcard_ADR\"";
            rr:parent 'Address'; 
        ]
    ] 
].

when the R2RML-parser makes the query to the database, for example: SELECT Address AS ID, Location AS ID2, Postcode AS ID3, Country AS ID4, Country AS vcard_country, Address AS vcard_street, Location AS vcard_locality, Postcode AS vcard_pcode
FROM organizations
WHERE Address = 4676 Admirality Way

The query returns an error because there is not any ' ' in 4676 Admirality Way.

I hope this problem can be solved soon, Best regards, Valéria

nkons commented 8 years ago

Hi Valeria,

Indeed, it was a bug, thanks for noticing. I believe it is now fixed (commit 3c4cbf5). Please let me know how this goes.

In case you are not sure how to download and compile the code, see my comment on issue #16

ValeriaPequeno commented 8 years ago

Hi,

Thank you for your commit. However, when I put the new release to work, the following message appear:

This is R2RML Parser 0.7-alpha. Run with -h for help on options. Exception in thread "main" java.lang.NullPointerException at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1838) at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110) at java.lang.Double.parseDouble(Double.java:538) at gr.seab.r2rml.beans.Generator.createTriples(Generator.java:455) at gr.seab.r2rml.beans.Main.main(Main.java:104) R2RML Parser 0.7-alpha. Done.

The same mappings in before version, works well.

The log file is in attach.

status.txt

Best regards, Valeria

nkons commented 8 years ago

Hi Valeria, I believe commit 1b2e822 fixes this. Can you please verify?

ValeriaPequeno commented 8 years ago

Hi Nikolaos,

Unfortulatly the problem is not fix yet. I have done the sollowing steps:

1) synchronized my local github repository 2) refreshed my eclipse copy of r2rml-parser 3) run as maven build -> package 4) verified that the correct mapping is assigned in the property file. 5) run the generated application in the target folder. 6) The same error message appeared.

In attachment is my files. Thanks by your effort in help me. Best, Valéria

On Sat, Nov 21, 2015 at 9:44 AM, Nikolaos Konstantinou < notifications@github.com> wrote:

Hi Valeria, I believe commit 1b2e822 https://github.com/nkons/r2rml-parser/commit/1b2e82243aadc8f37fa91574468895a37c19e43f fixes this. Can you please verify?

— Reply to this email directly or view it on GitHub https://github.com/nkons/r2rml-parser/issues/17#issuecomment-158617300.

nkons commented 8 years ago

Strange... I don't get any exceptions in mine... Please send me again the status.log after you set

default.verbose=true

in r2rml.properties

Also, try maven build -> clean package

Thanks

ValeriaPequeno commented 8 years ago

Hi,

I did a maven clean and built the project again. After I changed the default.verbose=true. The error message was not resolved yet.

My files are in attachment. Thanks. Best, Valéria

On Mon, Nov 23, 2015 at 11:34 AM, Nikolaos Konstantinou < notifications@github.com> wrote:

Strange... I don't get any exceptions in mine... Please send me again the status.log after you setdefault.verbose=truein r2rml.propertiesThanks Also, try maven build -> clean package

Date: Mon, 23 Nov 2015 02:39:23 -0800 From: notifications@github.com To: r2rml-parser@noreply.github.com CC: nkons@live.com Subject: Re: [r2rml-parser] rr:parentTriplesMap result in error when rr:child is a literal (#17)

Hi Nikolaos,

Unfortulatly the problem is not fix yet. I have done the sollowing steps:

1) synchronized my local github repository

2) refreshed my eclipse copy of r2rml-parser

3) run as maven build -> package

4) verified that the correct mapping is assigned in the property file.

5) run the generated application in the target folder.

6) The same error message appeared.

In attachment is my files.

Thanks by your effort in help me.

Best,

Valéria

On Sat, Nov 21, 2015 at 9:44 AM, Nikolaos Konstantinou <

notifications@github.com> wrote:

Hi Valeria, I believe commit 1b2e822

< https://github.com/nkons/r2rml-parser/commit/1b2e82243aadc8f37fa91574468895a37c19e43f

fixes this. Can you please verify?

Reply to this email directly or view it on GitHub

<https://github.com/nkons/r2rml-parser/issues/17#issuecomment-158617300 .

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/nkons/r2rml-parser/issues/17#issuecomment-158910612.

nkons commented 8 years ago

I believe the latest commit (6a28b95) fixes this issue. It worked for me locally; with the following database and mapping file, r2rml-parser produced dump.rdf containing 146 triples.

iswc-postgres_dump.sql.txt

iswc-mapping_test.rdf.txt

dump.rdf.txt

ValeriaPequeno commented 8 years ago

I tested and I seems fine now. Thanks.