- From: Vladimir Alexiev via GitHub <noreply@w3.org>
- Date: Wed, 15 Apr 2026 15:11:03 +0000
- To: public-shacl@w3.org
VladimirAlexiev has just created a new issue for https://github.com/w3c/data-shapes:
== allow declaring BASE in `sh:prefixes` ==
[prefix-declarations-for-sparql-queries](https://www.w3.org/TR/shacl/#x5.2.1-prefix-declarations-for-sparql-queries) is a crucial feature to make SPARQL shapes easier to write and maintain.
`sh:prefixes` (which usually points to an ontology) allows modular definition of prefixes.
But why not of BASE? That would bring the same benefits to queries that need to construct or compare instance URLs.
Example:
```ttl
@base <https://example.org/data/>.
@prefix ex: <https://example.org/ontology#>.
ex: a owl:Ontology
sh:declare
[sh:base "https://example.org/data/"^^xsd:anyURI], # NEW
[sh:prefix "ex"; sh:namespace "https://example.org/ontology#"].
ex:MyShape a sh:NodeShape ;
sh:sparql [a sh:SPARQLConstraint ;
sh:prefixes ex: ;
sh:select """
<can use or make relative URLs here>
""".
```
Rather than another blank node, a simpler syntactic variant is to express the base like this:
```ttl
ex: a owl:Ontology
sh:base "https://example.org/data/"^^xsd:anyURI]; # NEW
sh:declare
[sh:prefix "ex"; sh:namespace "https://example.org/ontology#"].
```
Please view or discuss this issue at https://github.com/w3c/data-shapes/issues/856 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 15 April 2026 15:11:04 UTC