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

Add a command line argument to specify the base uri #349

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stevorobs3
Copy link

Closes #67

src/csv2rdf/csvw.clj Outdated Show resolved Hide resolved
@RickMoynihan
Copy link
Member

ok I can't quite see what this PR actually does, do you have an example of it having an effect? I think also when we're agreed on what it should do (see below) some tests would be good.

I think the main problem is that it probably wasn't very clear what #67 was asking for, as there are several contexts where base-uri might come in to play. Also I don't think this was fully appreciated when I wrote the issue (Feb 16 2022) as csvw has some highly confusing specified behaviour when it comes to base URI's:

https://github.com/Swirrl/csvw-issues/blob/main/issues/002-template-evaluation.md
w3c/csvw#888

Essentially the TLDR; of the above is that there are two base URI's, one used for the JSON-LD metadata document, and the other (the csv file url used for the expansion of uri templates in that same JSON-LD document).

I think this is wildly counter intuitive, and essentially all but one person in the working group seemed to think so too; yet there was a meeting and they decided for undocumented reasons to specify against the consensus (sensible?) option.

So I think what is most useful here is for -b to override the base-uri that is used for both URI template expansion and expanding relative URI terms in the JSON-LD metadata document, in our annotated mode.

The purpose is to support relative URI's better. The problem is that the CSVW files when "re-based" onto a different URI will yield different RDF to what the files without -b will. Which means you can't really publish those files; but I think that's fine, a common use case for csv2rdf is to convert csv files into triples, and to not publish the CSV or csvw-metadata file... i.e. the -b flag is really to support extra flexibility as a transformation tool.

I can imagine the possibility that there might be multiple base-uri flags e.g. --table-base-uri --jsonld-base-uri, which would allow you to set these two contexts independently, but I can't think of many situations where you'd want them to differ, so would prefer to set them both simultaneously for now.

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

Successfully merging this pull request may close these issues.

Provide a command line option for overriding the base-uri
2 participants