VladimirAlexiev / rdf2rml

RDF by Example: rdfpuml for True RDF Diagrams, rdf2rml for R2RML Generation
39 stars 5 forks source link

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

Open VladimirAlexiev opened 1 year ago

VladimirAlexiev commented 1 year ago
@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 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