Current Release

This documentation covers the current version of Fedora. Looking for another version? See all documentation.

This document will walk you through getting the code, building the webapp, and exercising the REST API. 

Prerequisites

Fedora requires Java 21 and Maven 3 (only for building the project). Check that you have them installed before proceeding:

$ java -version
openjdk 21.0.8 2025-07-15
OpenJDK Runtime Environment Homebrew (build 21.0.8)
OpenJDK 64-Bit Server VM Homebrew (build 21.0.8, mixed mode, sharing) 

$ mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/opt/apache-maven-3.6.3
Java version: 21.0.8, vendor: Homebrew, runtime: /opt/homebrew/Cellar/openjdk@21/21.0.8/libexec/openjdk.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "15.7.3", arch: "aarch64", family: "mac"

Building Fedora

You can download pre-compiled binaries and run Fedora in an existing Tomcat or Jetty instance, or build Fedora from source (it's not difficult or time consuming).

Clone the latest code from Github:

$ git clone https://github.com/fcrepo/fcrepo.git
Cloning into 'fcrepo'...
remote: Counting objects: 40152, done.
remote: Compressing objects: 100% (12759/12759), done.
Receiving objects:  14% (5622/40152), 3.68 MiB | 912 KiB/s  
[...]
 
$ cd fcrepo

And build the project (the first time you build Fedora may take some time and bandwidth to download all the development dependencies):

Running mvn -Pfast-build clean install builds Fedora quickly by skipping all tests. Run mvn clean install if you want to run the tests.


$ mvn -Pfast-build clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Fedora Commons :: Parent POM                                       [pom]
[INFO] Fedora Commons                                                     [pom]
[INFO] Fedora Repository Common Module                                 [bundle]
[INFO] Fedora Repository Configurations Module                         [bundle]
[INFO] Fedora Repository Kernel API                                    [bundle]
[INFO] Fedora Repository Persistence API Module                        [bundle]
[INFO] Fedora Repository Persistence Common Module                     [bundle]
[INFO] Fedora Repository Kernel Implementation                         [bundle]
[INFO] Fedora Repository Search API                                    [bundle]
[INFO] Fedora Repository OCFL Persistence Impl                         [bundle]
[INFO] Fedora Repository Search Impl                                   [bundle]
[INFO] Fedora Repository HTTP Commons Module                           [bundle]
[INFO] Fedora Event Serialization                                      [bundle]
[INFO] Fedora Repository JMS Module                                    [bundle]
[INFO] Fedora Repository Authorization Commons Module                  [bundle]
[INFO] Fedora Repository HTTP API Module                               [bundle]
[INFO] Fedora Repository WebAC Authorization Module                    [bundle]
[INFO] Fedora Repository Deployable Web Application                       [war]
[INFO] Fedora Repository LDP integration tests Module                     [jar]
[INFO] Fedora Repository RDF integration tests Module                     [jar]
[INFO]
[INFO] ----------------------< org.fcrepo:fcrepo-parent >----------------------
[INFO] Building Fedora Commons :: Parent POM 6.0.0-SNAPSHOT              [1/20]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[....]

Running the Fedora webapp

The webapp can be run from a bundled instance of jetty. The application will listen on port 8080 by default.
If you would like to run the webapp on a different port, you can add the "jetty.port" option in your maven command (e.g. mvn -Dfcrepo.dynamic.test.port=8181 jetty:run)

$ cd fcrepo-webapp
$ mvn jetty:run
[...]
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 2 seconds.

There's a nice, friendly HTML interface waiting for you at  http://localhost:8080/rest/  (the default username and password is fedoraAdmin)

REST API Examples

The REST API documentation provides a full listing of the features and functions of the REST API. Here are some examples to get you started:

$ curl "http://localhost:8080/rest/" -ufedoraAdmin:fedoraAdmin
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/>
        fedora:created                 "2026-01-27T15:13:47.924341Z"^^<http://www.w3.org/2001/XMLSchema#dateTime>;
        fedora:lastModified            "2026-01-27T15:13:47.924341Z"^^<http://www.w3.org/2001/XMLSchema#dateTime>;
        rdf:type                       ldp:BasicContainer;
        rdf:type                       ldp:Resource;
        rdf:type                       fedora:Resource;
        rdf:type                       fedora:RepositoryRoot;
        rdf:type                       ldp:RDFSource;
        rdf:type                       ldp:Container;
        rdf:type                       fedora:Container;
        ldp:contains                   <http://localhost:8080/rest/b1b6661e-abcb-4b73-ad92-1c888db5ede8>;
        fedora:hasTransactionProvider  <http://localhost:8080/rest/fcr:tx> .

The REST API supports a variety of RDF serialization formats, including:

$ curl http://localhost:8080/rest/ -H "Accept: application/rdf+xml" -ufedoraAdmin:fedoraAdmin
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:fedora="http://fedora.info/definitions/v4/repository#"
    xmlns:ldp="http://www.w3.org/ns/ldp#" > 
  <rdf:Description rdf:about="http://localhost:8080/rest/">
    <rdf:type rdf:resource="http://www.w3.org/ns/ldp#Container"/>
    <rdf:type rdf:resource="http://fedora.info/definitions/v4/repository#Container"/>
    <fedora:hasTransactionProvider rdf:resource="http://localhost:8080/rest/fcr:tx"/>
    <fedora:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2026-01-27T15:13:47.924341Z</fedora:created>
    <rdf:type rdf:resource="http://fedora.info/definitions/v4/repository#Resource"/>
    <ldp:contains rdf:resource="http://localhost:8080/rest/b1b6661e-abcb-4b73-ad92-1c888db5ede8"/>
    <rdf:type rdf:resource="http://www.w3.org/ns/ldp#Resource"/>
    <fedora:lastModified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2026-01-27T15:13:47.924341Z</fedora:lastModified>
    <rdf:type rdf:resource="http://www.w3.org/ns/ldp#RDFSource"/>
    <rdf:type rdf:resource="http://www.w3.org/ns/ldp#BasicContainer"/>
    <rdf:type rdf:resource="http://fedora.info/definitions/v4/repository#RepositoryRoot"/>
  </rdf:Description>
</rdf:RDF>

or

$ curl http://localhost:8080/rest/ -H "Accept: application/n-triples" -ufedoraAdmin:fedoraAdmin
<http://localhost:8080/rest/> <http://fedora.info/definitions/v4/repository#created> "2026-01-27T15:13:47.924341Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
<http://localhost:8080/rest/> <http://fedora.info/definitions/v4/repository#lastModified> "2026-01-27T15:13:47.924341Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
<http://localhost:8080/rest/> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/ldp#BasicContainer> .
<http://localhost:8080/rest/> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/ldp#Resource> .
<http://localhost:8080/rest/> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://fedora.info/definitions/v4/repository#Resource> .
<http://localhost:8080/rest/> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://fedora.info/definitions/v4/repository#RepositoryRoot> .
<http://localhost:8080/rest/> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/ldp#RDFSource> .
<http://localhost:8080/rest/> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/ldp#Container> .
<http://localhost:8080/rest/> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://fedora.info/definitions/v4/repository#Container> .
<http://localhost:8080/rest/> <http://www.w3.org/ns/ldp#contains> <http://localhost:8080/rest/b1b6661e-abcb-4b73-ad92-1c888db5ede8> .
<http://localhost:8080/rest/> <http://fedora.info/definitions/v4/repository#hasTransactionProvider> <http://localhost:8080/rest/fcr:tx> .

Create a new object

$ curl http://localhost:8080/rest/ -X POST -v -ufedoraAdmin:fedoraAdmin
* Host localhost:8080 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8080...
* Connected to localhost (::1) port 8080
* Server auth using Basic with user 'fedoraAdmin'
> POST /rest/ HTTP/1.1
> Host: localhost:8080
> Authorization: Basic ZmVkb3JhQWRtaW46ZmVkb3JhQWRtaW4=
> User-Agent: curl/8.7.1
> Accept: */*
> 
* Request completely sent off
< HTTP/1.1 201 Created
< Server: Jetty(12.0.23)
< Date: Tue, 10 Feb 2026 18:46:09 GMT
< Set-Cookie: JSESSIONID=node0cdnc4sr1fc1nwcs8ugpa0cgs3.node0; Path=/
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Mon, 09-Feb-2026 18:46:09 GMT; SameSite=lax
< ETag: W/"CF8599030A6F81D2D5B8D84D9ED4B288"
< X-State-Token: A767E30089197FB4132C4DD3DFB8BA88
< Last-Modified: Tue, 10 Feb 2026 18:46:09 GMT
< Link: <http://localhost:8080/rest/e3267c81-256a-46c7-ae16-e1f316791368>; rel="timegate"
< Link: <http://localhost:8080/rest/e3267c81-256a-46c7-ae16-e1f316791368>; rel="original"
< Link: <http://localhost:8080/rest/e3267c81-256a-46c7-ae16-e1f316791368/fcr:versions>; rel="timemap"
< Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"
< Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
< Link: <http://fedora.info/definitions/v4/repository#Resource>; rel="type"
< Link: <http://mementoweb.org/ns#OriginalResource>; rel="type"
< Link: <http://mementoweb.org/ns#TimeGate>; rel="type"
< Link: <http://www.w3.org/ns/ldp#RDFSource>; rel="type"
< Link: <http://www.w3.org/ns/ldp#Container>; rel="type"
< Link: <http://fedora.info/definitions/v4/repository#Container>; rel="type"
< Link: <http://localhost:8080/rest/e3267c81-256a-46c7-ae16-e1f316791368/fcr:acl>; rel="acl"
< Location: http://localhost:8080/rest/e3267c81-256a-46c7-ae16-e1f316791368
< Content-Type: text/plain
< Content-Length: 63
< 
* Connection #0 to host localhost left intact
http://localhost:8080/rest/e3267c81-256a-46c7-ae16-e1f316791368
 
$ curl http://localhost:8080/rest/e3267c81-256a-46c7-ae16-e1f316791368 -ufedoraAdmin:fedoraAdmin
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/e3267c81-256a-46c7-ae16-e1f316791368>
        fedora:created         "2026-02-10T18:46:09.334476Z"^^<http://www.w3.org/2001/XMLSchema#dateTime>;
        fedora:lastModified    "2026-02-10T18:46:09.334476Z"^^<http://www.w3.org/2001/XMLSchema#dateTime>;
        fedora:createdBy       "fedoraAdmin";
        fedora:lastModifiedBy  "fedoraAdmin";
        rdf:type               ldp:BasicContainer;
        rdf:type               ldp:Resource;
        rdf:type               fedora:Resource;
        rdf:type               ldp:RDFSource;
        rdf:type               ldp:Container;
        rdf:type               fedora:Container;
        fedora:hasParent       <http://localhost:8080/rest/> .

Delete an object

$ curl -X DELETE http://localhost:8080/rest/e3267c81-256a-46c7-ae16-e1f316791368 -ufedoraAdmin:fedoraAdmin


  • No labels