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

absolute URL interpreted as relative URL when there's a @prefix equal to @base #17

Open
VladimirAlexiev opened this issue Nov 2, 2022 · 0 comments

Comments

@VladimirAlexiev
Copy link
Owner

VladimirAlexiev commented Nov 2, 2022

@base         <https://ontotext.com/knowledge-graph/>.
@prefix OTKG: <https://ontotext.com/knowledge-graph/>.

<researchProject/(acronym)> a s:ResearchProject;
  s:sameAs         <(wikidata)>.

This is rendered as the CURIE OTKG:(wikidata), i.e. the field (wikidata) is interpreted as a URL relative to @base.

This makes sense for templated URLs like <researchProject/(acronym)> because the start it not a URL scheme like http:.
But for a URL that consists of a field alone, it's reasonable to assume that will be an absolute URL.

It's the RDF parser that decides that (wikidata) is a relative URL. How to fool it into not using @base?

  • I could fake it as https://(wikidata) but that's ugly as hell: how could I know that's the right URL scheme?
  • If I fake it as /(wikidata), that would use the host from @base, and <https://ontotext.com/(wikidata)> is even worse.

I think it's the safest to EXCLUDE the @prefix that is equal to @base.

(The reason I used it is because GraphDB remembers prefixes as namespaces, but does not remember base.
So OTKG: is used to shorten URLs when displaying resources.)

TODO: document in rdfpuml page

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

1 participant