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

spec: docs: logicalSource: add required charter reference formulations #152

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

Conversation

DylanVanAssche
Copy link
Collaborator

@DylanVanAssche DylanVanAssche commented Jan 15, 2025

Charter requires CSV + JSONPath in Core, specs in IO registry for simplicity.

Related to kg-construct/rml-io#98

Broaded version of rml:RelativePathSource
Comment on lines +31 to +73
## Access descriptions

RML-Core requires the `rml:PathFile` access description to be supported by any implementation to access files with an absolute or relative path.
This access description allows accessing files with relative and absolute paths from:

- `rml:CurrentWorkingDirectory`: relative to the current working directory of the RML processor.
- `rml:MappingDirectory`: relative to the location of the RML mapping.
- A string Literal: a string describing an absolute path against which relative paths are resolved, similar to the Base URI in [RFC3986](https://www.rfc-editor.org/rfc/rfc3986).

If `rml:root` is not specified, it defaults to `rml:CurrentWorkingDirectory`.

| Property | Domain | Range |
| ----------- | ------------------------- | ------------------------------------------------------------------ |
| `rml:root` | `rml:FilePath` | `rml:CurrentWorkingDirectory`, `rml:MappingDirectory` or `Literal` |
| `rml:path` | `rml:FilePath` | `Literal` |

Example of accessing a CSV file relative to the current working directory.
The file's absolute path is `$CURRENT_WORKING_DIR/file.csv` where `$CURRENT_WORKING_DIR` is
the location of the RML mapping.

<pre class="ex-source">
&lt;#RelativePathCWD&gt; a rml:LogicalSource;
rml:source [ a rml:FilePath;
rml:root rml:CurrentWorkingDirectory;
rml:path "./file.csv";
];
.
</pre>

Example of accessing a JSON file relative to the path of the mapping.
The file's absolute path is `$MAPPING_DIR/file.json` where `$MAPPING_DIR` is
the location of the RML mapping.

<pre class="ex-source">
&lt;#RelativePathMapping&gt; a rml:LogicalSource;
rml:source [ a rml:FilePath;
rml:root rml:MappingDirectory;
rml:path "./file.json";
];
rml:referenceFormulation rml:JSONPath;
rml:iterator "$";
.
</pre>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced the access description should be in core.
I think it should stay in IO, since there is where we define access descriptions

Yes, it is used in core tests, but that is not a problem IMO. It is normal to have some core module that needs other modules before it can lead to something that works. And therefor it is also normal to include some of those dependencies to run tests.

In fact I would prefer for CSV and JSON to also be introduced in IO. I think it makes the specs more easy to follow. But since reference formulation is introduced in core I'm not as strongly opposed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was discussed like this during the physical meeting to also move the access description, without it, you cannot perform any test cases nor have a stand-alone RML mapping if you only support Core. Therefore, the simplest access description (next gen of rml:source "/path/to/file.csv") is moved here. You mention you don't see this an issue, but having something standalone is IMO the best. Requiring people to implement some features of a module to have Core even working is not great IMO.

AFAIK, RML-Core would be the original RML actually where these things were included...

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.

2 participants