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

Database source - mapping with column labels instead of column names #92

Closed
giorgialodi opened this issue Dec 13, 2020 · 3 comments
Closed
Labels

Comments

@giorgialodi
Copy link

Hi @bjdmeest I am using RML mapper also for transforming in RDF some data included in a mysql database.

I noticed that the mapper does not take column labels but column names. This causes some issues in the case of multilingual tables in multilingual databases. I would suggest using column labels instead (this is possible BTW by R2RML to the best of my knowledge), changing the code as follows

In RDBAccess.java, column names in the result set are retrieved with the getColumnName method of ResultSetMetaData. This does not allow, in the mappings, using "alias" column names that in the SQL queries are defined with as. This also causes issues when the result of a query would produce different columns with the same (unaliased) name.

Using the getColumnLabel method instead of getColumnName would allow using aliased column names and solve the issues reported above.

Currently I am using a local revised version of the mapper with this change but I believe it would be better to include it in the main repo here, if you all agree on the above proposal.

@bjdmeest
Copy link
Collaborator

Hi @giorgialodi, thanks for this! On first inspection, this does indeed look like the right way to go (I guess the R2RML spec was a bit unclear in this regard, only using the term 'column name' throughout the spec even though they also rely on column labels, eg https://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0002d).

We'll review this with the team (making sure we don't break anything existing/don't unintentionally diverge from the R2RML spec) and get back to you!

@thomas-delva
Copy link
Contributor

This recommended change was part of the latest release: v4.9.2!

Please let us know in the case you have further related issues

@DylanVanAssche DylanVanAssche added the enhancement New feature or request label Mar 18, 2021
@no-response
Copy link

no-response bot commented Apr 1, 2021

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@no-response no-response bot closed this as completed Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants