Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ValeriaPequeno opened this issue Nov 19, 2015 · 8 comments
Closed

Comments

@ValeriaPequeno
Copy link

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
Copy link
Owner

nkons commented Nov 19, 2015

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
Copy link
Author

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
Copy link
Owner

nkons commented Nov 21, 2015

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

@ValeriaPequeno
Copy link
Author

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 <
[email protected]> wrote:

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


Reply to this email directly or view it on GitHub
#17 (comment).

@nkons
Copy link
Owner

nkons commented Nov 23, 2015

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
Copy link
Author

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 <
[email protected]> 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: [email protected]
To: [email protected]
CC: [email protected]
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 <

[email protected]> wrote:

Hi Valeria, I believe commit 1b2e822

<
1b2e822

fixes this. Can you please verify?

Reply to this email directly or view it on GitHub

<#17 (comment)
.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#17 (comment).

@nkons
Copy link
Owner

nkons commented Nov 28, 2015

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
Copy link
Author

I tested and I seems fine now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants