Old Release

This documentation covers an old version of Fedora. Looking for another version? See all documentation.

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. 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 text-box.

System-Generated Prefixes

As noted above, as new namespaces are used for the first time, those namespaces will be bound permanently to particular prefixes.  Currently, if the first use of a particular namespace should occur in RDF that is POSTed or PUT to the repository, regardless of any specific prefix binding supplied in the submitted graph, Fedora will instead bind the new namespace to a system-generated namespace in the form "ns00x".  While this behavior is not incorrect, it is inconvenient, and not necessarily user friendly for human interaction with the repository.  In order to avoid this behavior, you can define a custom CND file which defines namespace prefixes.  Previously, it was possible to control the prefixes used by using SPARQL update or RDF with namespace prefixes, but this functionality does not currently work (see Unable to locate Jira server for this macro. It may be due to Application Link configuration. ).

Defining a custom CND file

The following steps should only be done when the repository is first set up, before any content has been added.

Namespace registry corruption can occur if new namespaces are defined in the CND for a repository that already has content that uses those namespaces with different associated prefixes.

In order to define a custom CND file, you must first customize the repository.json file. This is the configuration that is used with the -Dfcrepo.modeshape.configuration setting. In that file, the "node-types" block should be defined as: "node-types" : ["fedora-node-types.cnd", "file:/etc/fcrepo/namespaces.cnd"].

repository.json
{
    "name" : "fedora",
    "jndiName" : "",
    "workspaces" : { ... },
    "storage" : {
        "persistence": { ... },
        "binaryStorage" : { ... }
    },
    "security" : {
        "anonymous" : { ... },
        "providers" : [ ... ]
    },
    "node-types" : ["fedora-node-types.cnd", "file:/etc/fcrepo/namespaces.cnd"]
}

 

The namespaces.cnd file can be used to register namespaces like so:

CND File
<acl = 'http://www.w3.org/ns/auth/acl#'>
<cc = 'http://creativecommons.org/ns#'>
<dcterms = 'http://purl.org/dc/terms/'>
<exif = 'http://www.w3.org/2003/12/exif/ns#'>
<geo = 'http://www.w3.org/2003/01/geo/wgs84_pos#'>
<gn = 'http://www.geonames.org/ontology#'>
<iana = 'http://www.iana.org/assignments/relation/'>
<ore = 'http://www.openarchives.org/ore/terms/'>
<owl = 'http://www.w3.org/2002/07/owl#'>
<prov = 'http://www.w3.org/ns/prov#'>
<rel = 'http://id.loc.gov/vocabulary/relators/'>
<schema = 'http://schema.org/'>
<skos = 'http://www.w3.org/2004/02/skos/core#'>
  • No labels