Versions Compared

Key

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

...

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 without including a 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

Jira
serverDuraSpace JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverIdc815ca92-fd23-34c2-8fe3-956808caf8c5
keyFCREPO-2376
).

Defining a custom CND file

Warning

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

...

{
    "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:

...

titleCND File

...

.

...