8000 Ability to provide base IRI for parsing relative IRIs in input files · Issue #129 · eyereasoner/eye · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Ability to provide base IRI for parsing relative IRIs in input files #129

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

Open
tpluscode opened this issue Jan 26, 2025 · 5 comments
Open

Comments

@tpluscode
Copy link

When an input has no @base, the file's URL is used to parse relative references.

I would like to ask for a --base or --base-iri CLI option to set the base for parsing if the base directive is missing.

@josd
Copy link
Collaborator
josd commented Jan 27, 2025

For eye you can use

--wcache <uri> <file>           to tell that <uri> is cached as <file>

@tpluscode
Copy link
Author

Hm, that did not work.

I have a base.n3 file:

PREFIX ex: <http://example.org/>

<foobar> a ex:Foo .

{
  <http://localhost/foobar> a ex:Foo .
} => {
  <http://localhost/foobar> a ex:Bar .
} .

I expected that calling with --wcache http://localhost/ base.n3 would do the trick but it still parses the relative reference as file:// URL

> eye --nope --quiet --pass --wcache http://localhost/ base.n3 base.n3  
@prefix ex: <http://example.org/>.

<file:///absolute/path/foobar> a ex:Foo.

@tpluscode
Copy link
Author

I'm also unsure how this is going to work when there are multiple files like that. Consider foo.n3 and bar.n3

eye --nope --quiet --pass --wcache http://localhost/ foo.n3 foo.n3 --wcache http://localhost/ bar.n3 bar.n3  

The description of --wcache suggests that this is not valid usage and each usage should have a different value of <uri>?

@josd
Copy link
Collaborator
josd commented Jan 27, 2025

It works as follows:

$ eye --nope --quiet --pass --wcache http://localhost . http://localhost/base.n3
@prefix ex: <http://example.org/>.

<http://localhost/foobar> a ex:Foo.
<http://localhost/foobar> a ex:Bar.

and we use it all the time for multiple files, either by specifying a "directory", like the above . or by multiple --wcache options

@josd
Copy link
Collaborator
josd commented Jan 27, 2025

for examples see all test files in the subdirectories of https://github.com/eyereasoner/eye/tree/master/reasoning

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
0