NOTE: @base
provides a prefix for relative IRIs using <...>
. So in the example below, <Entity>
expands to <http://my-url.com/ontologies/0.1/entity#Entity>
.
Where did you get this idea from? This is not the case. @base
is not prefixing whatever is in between the <
and >
. @base
defines the base IRI over which relative IRIs are resolved. Resolving relative IRIs is more complicated than concatenating two strings.
First, a base IRI is necessarily stripped off of its trailing #
and any fragment identifier. So, if you write:
@base <http://my-url.com/ontologies/0.1/entity#> .
<> a owl:Ontology .
you mean:
<http://my-url.com/ontologies/0.1/entity> a owl:Ontology .
you would have to add a #
explicitly to have it in the IRI:
@base <http://my-url.com/ontologies/0.1/entity#> .
<#> a owl:Ontology .
means:
<http://my-url.com/ontologies/0.1/entity#> a owl:Ontology .
If you want to add a non empty fragment identifier, you need the #
as well:
@base <http://my-url.com/ontologies/0.1/entity#> .
<#Entity> a owl:Ontology .
means:
<http://my-url.com/ontologies/0.1/entity#Entity> a owl:Ontology .
Second, if you use a non empty string between the <
and >
, and it is not a fragment identifier, then the IRI is constructed by getting rid of the local part of the base, which is whatever appear after the last /
of the path of the IRI. E.g.,
@base <http://my-url.com/ontologies/0.1/entity#> .
<Entity> a owl:Ontology .
means:
<http://my-url.com/ontologies/0.1/Entity> a owl:Ontology .
Another example:
@base <http://my-url.com/something/?uri=http://example.com/anything> .
<Entity> a owl:Ontology .
means:
<http://my-url.com/something/Entity> a owl:Ontology .
This is not, properly speaking, a direct answer to your question(s) but should suffice to allow you to take the right decision.