Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Namespaces

A Fedora repository includes a number of pre-defined namespace bindings (essentially, a mapping that connects a particular prefix to a URI, allowing for a more convenient and human-readable rendering of RDF).  Predefined namespaces include DC, FOAF, Fedora, and LDP, among others.  As additional namespaces are used in the course of depositing materials into the repository, each new namespace will automatically be bound to its own prefix the first time it is used.  Once a URI is bound to a particular namespace prefix, it cannot be changed, except through the use of a special tool for this purpose. A full list of the bound namespaces for a given Fedora repository at any given moment can be seen in the HTTP REST interface, as a list of pre-populated PREFIX bindings in the SPARQL update query textbox.

SPARQL-Update

To ensure that specific namespaces are used (i.e., treated as sacred) by Fedora 4 when doing a SPARQL update, ensure that the namespace prefix URI includes a terminating character. Otherwise system-generated JCR namespaces (e.g., ns001, ns002), and not the user-supplied namespaces, will get registered. Therefore, the following statement could lead to unexpected namespaces. F4 will register a system-generated namespace and you would not find "http://myurl.org" namespace in the system.

 

Code Block
titleProblematic Usage
linenumberstrue
PREFIX esc: <http://myurl.org>
INSERT {
<>
esc:package "ppp";
}
WHERE { }

...

Therefore, the URI prefix in line 1 should have a terminating character, e.g., a slash or a hash.  

Code Block
titleRecommended Usage
linenumberstrue
PREFIX esc: <http://myurl.org/>
. . .

...