Namespace Definition

A Namespace Definition is a document that owns a namespace. Because a namespace IRI ends in / or #, no document path can equal it exactly — so the namespace document lives at the namespace directory itself (its document IRI is the slashless form) and declares what it owns explicitly via sdg:declaresNamespace.

Identity rule

sdg:declaresNamespace must equal the document's own IRI plus a trailing / or #. The corpus audit enforces this.

Derived membership

Definition documents do not author a pointer back to their namespace. The Lexicon graph derives membership by longest-declared-namespace match over term IRIs — nested namespaces (such as sdgl: inside sdg:) resolve to the most specific declaration. sdg:namespace remains reserved for documents coining terms into a namespace they don't structurally live in.

Editor usage

Typing a prefix in the workspace editor queries the Lexicon for all terms whose lex:inNamespace is the declared namespace; Ctrl+Click on a bare prefix resolves through sdg:declaresNamespace to this document.

Coherence rules

Errordeclares-namespace

A Namespace Definition must declare the namespace it owns via sdg:declaresNamespace — the document's own IRI plus a trailing '/' or '#'. The corpus audit's identity check enforces the same invariant.

SELECT ?this ?message WHERE {
  FILTER NOT EXISTS { ?this sdg:declaresNamespace ?namespace }
  BIND("This Namespace Definition declares no namespace (sdg:declaresNamespace)." AS ?message)
}
Warningpreferred-prefix

A Namespace Definition should declare sdg:preferredPrefix — completion and CURIE rendering use it.

SELECT ?this ?message WHERE {
  FILTER NOT EXISTS { ?this sdg:preferredPrefix ?prefix }
  BIND("A Namespace Definition should declare sdg:preferredPrefix — completion and CURIE rendering use it." AS ?message)
}
Namespace Definition — Sparqdown Docs