Old Release

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

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Current »

Here is found details of the locations and purposes of the Fedora configuration files. For details on how to enable and configure these options, see this page.

fcrepo-webapp

Fedora RESTful HTTP API uses the open source Jersey RESTful Web Services framework that provides support for JAX-RS APIs and serves as a JAX-RS (JSR 311 & JSR 339) Reference Implementation. The jersey servlet dispatcher is configured in web.xml as follows:

web.xml
<servlet>
  <servlet-name>jersey-servlet</servlet-name>
  <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
  <init-param>
    <param-name>javax.ws.rs.Application</param-name>
    <param-value>org.fcrepo.http.commons.FedoraApplication</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
</servlet>

 

The following spring files exist in a directory as configured in web.xml, which contains a context-param element with param-name "contextConfigLocation".  The param-value points to a spring context configuration file "WEB-INF/classes/spring/repository.xml". This configuration file imports a settings file located in the same directory or the file specified by system property fcrepo.spring.configuration. Note that these files are in the source tree under fcrepo-webapp/src/main/resources/spring and copied to WEB-INF/classes upon build.

fcrepo-webapp/src/main/resources/spring

repository.xml

  • this imports all the settings from either the file specified in the system property fcrepo.spring.configuration or the provided configuration file fcrepo-config.xml
repo.xml
  <!-- Master context for fcrepo4. -->
  <import resource="${fcrepo.spring.configuration:classpath:/spring/fcrepo-config.xml}"/>

fcrepo-config.xml

This is where you configure your Fedora instance, including:

  • specify the repository.json file to be loaded as the repositoryConfiguration or use the fcrepo.modeshape.configuration system property.
  • bean for repository factory
  • bean implementation for InternalIdentifierConverter (identifier  translationChain),   StoragePolicyDecisionPointImpl, SessionFactory, and base-packages to auto scan into spring
  • bean implementation for eventing - observer, filter, event bus
  • specify the implementation for processing events
  • config for transactions
  • bean implementation for minting identifiers

It is recommended to use the provided fcrepo-config.xml as a starting point for your customization.

fcrepo/fcrepo-configs/src/main/resources/config

activemq.xml

  • config for message broker

jgroups-fcrepo-tcp.xml

  • Config for the Messaging Toolkit JGroups to transfer state between nodes in a Fedora Cluster.

fcrepo4/fcrepo-webapp/src/main/resources

logback.xml

Modeshape repository configuration

Fedora uses Modeshape, a JCR implementation. We distribute a handful of known-good configurations for Modeshape, although we anticipate configuration tuning for deployment environments will be common.

https://github.com/ModeShape/modeshape/blob/master/modeshape-jcr/src/main/resources/org/modeshape/jcr/repository-config-schema.json

Repository Config Options

These configuration files are copied to WEB-INF/classes from fcrepo-configs/src/main/resources upon build.

cacheSize

  • The cacheSize option may be set to specify the size of the Modeshape node cache.  The default value is 10,000, and increasing this value can improve performance, particularly for the Many Members performance issue.  See the example configuration files, such as file-simple/repository.json for an example.

/config/clustered-mysql/repository.json

  • Configuration for clustered repositories with a centralized MySQL object store.

/config/file-simple/repository.json

  • Configuration for file-based object store for testing, not recommended for production. 

/config/jdbc-mysql/repository.json 

  • Configuration for MySQL-based object store. 

/config/jdbc-postgresql/repository.json

  • Configuration for PostgreSQL-based object store.

/config/servlet-auth/repository.json

  • Configuration with servlet authentication enabled.

Fedora will store object properties to the configured backend datastore. These probably won't be very large, and should be stored on fast disk. The object properties are stored as binary JSON documents within the given cache store configuration.

Binary storage

fcrepo.binary.directory:target/binaries

Fedora stores binary content separately (to one of the above paths, depending on configuration). These files are stored hashed by the content SHA-1 hash. 


Parallel stream processing

fcrepo.streaming.parallel:false

If you are running Fedora on a multiprocessor machine you can level parallel processing across single requests by turning this option on.   Parallel processing of streams can boost the retrieval speeds of the RDF associated with objects with large numbers of inlinks (ie dependent objects with memberOf associations).  Enabling this option in conjunction with increasing with cacheSize parameter in your repository.json file can boost retrieval speeds significantly.

Skolemizing to Hash-URIs

fcrepo.bnode.hash-uri=<true|false>

With this property set to 'true', Fedora will skolemize incoming blank nodes to hash-URIs (with UUID fragments) on the base URI to which the request was addressed. By default this feature is turned off for backwards compatibility.


Allowing user updates to certain server managed triples 

You can relax certain restrictions on updating some server managed triples using the following setting:

fcrepo.properties.management=relaxed

For details please refer to the following article: How to allow user-updates to certain server managed triples.

Custom Namespace registry

This optional feature allows an administrator to provide a list of custom namespace prefixes that will override the default prefix registry. The custom namespaces are loaded on start-up via a YAML file.  The namespaces can be modified while Fedora is running.  Changes may take a few minutes to take effect.

Below is a sample YAML namespace configuration file, custom_namespaces.yml.  Notice the "awesome" prefix definition at the bottom of the list. We will use this in the following example. NB: the custom file will override all default namespace prefixes.  In other words, the custom file becomes the definitive registry.  Any namespaces that are not prefixed will be returned as full URIs in the response. 

premis:  http://www.loc.gov/premis/rdf/v1#
test:  info:fedora/test/
memento:  http://mementoweb.org/ns#
rdfs:  http://www.w3.org/2000/01/rdf-schema#
webac:  http://fedora.info/definitions/v4/webac#
acl:  http://www.w3.org/ns/auth/acl#
vcard:  http://www.w3.org/2006/vcard/ns#
xsi:  http://www.w3.org/2001/XMLSchema-instance
xmlns:  http://www.w3.org/2000/xmlns/
rdf:  http://www.w3.org/1999/02/22-rdf-syntax-ns#
fedora:  http://fedora.info/definitions/v4/repository#
xml:  http://www.w3.org/XML/1998/namespace
ebucore:  http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#
ldp:  http://www.w3.org/ns/ldp#
dcterms:  http://purl.org/dc/terms/
iana:  http://www.iana.org/assignments/relation/
xs:  http://www.w3.org/2001/XMLSchema
fedoraconfig:  http://fedora.info/definitions/v4/config#
foaf:  http://xmlns.com/foaf/0.1/
dc:  http://purl.org/dc/elements/1.1/
awesome: http://example.com/awesome/


Fedora can activate the file by using the -Dfcrepo.namespace.registry system parameter, either on the command line or by adding it to the list of other params that provide paths to other configuration files:

mvn jetty:run -Dfcrepo.namespace.registry=/my/fedora/path/custom_namespaces.yml

In order to demonstrate how this feature works,  try starting Fedora without  defining a custom namespace registry: 

mvn jetty:run

Once Fedora is running,  run the following curl command

echo "@prefix awesome: <http://example.com/awesome/> . <> awesome:stuff 'waffle' ." | curl -u fedoraAdmin:fedoraAdmin http://localhost:8080/rest/test  -X PUT -H "Content-Type: text/turtle" --data-binary "@-"

When you retrieve this resource,

curl -i -u fedoraAdmin:fedoraAdmin http://localhost:8080/rest/test

notice the new predicate is expressed as the full URI.

output
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix fedora:  <http://fedora.info/definitions/v4/repository#> .
@prefix ldp:  <http://www.w3.org/ns/ldp#> .

<http://localhost:8080/rest/test>
...
        <http://example.com/awesome/test>  "waffle" ;
...  

Also notice there are built in prefixes for common namespaces.  Now restart Fedora with the custom namespaces yml enabled: 

mvn jetty:run -Dfcrepo.namespace.registry=/my/fedora/path/custom_namespaces.yml

Retrieve the item and see how your custom namespace prefix is being used.

curl -ufedoraAdmin:fedoraAdmin  http://localhost:8080/rest/test
@prefix awesome:  <http://example.com/awesome/> .
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix fedora:  <http://fedora.info/definitions/v4/repository#> .
@prefix ldp:  <http://www.w3.org/ns/ldp#> .

<http://localhost:8080/rest/test>
...
        awesome:test           "waffle" ;
...


Suppose, you later decide that the "awesome" namespace was mislabelled. Instead you really wanted the namespace to be "justokay". Edit the file /my/fedora/path/custom_namespaces.yml to change "awesome" to "justokay", save the file and wait a few seconds, then check the namespace output again:

curl -ufedoraAdmin:fedoraAdmin  http://localhost:8080/rest/test

@prefix justokay:  <http://example.com/awesome/> .
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix fedora:  <http://fedora.info/definitions/v4/repository#> .
@prefix ldp:  <http://www.w3.org/ns/ldp#> .

<http://localhost:8080/rest/test>
...
		justokay:test          "waffle" ;
...
  • No labels