Warning |
---|
These training archives may be out of date, but have been retained and kept available for the community's benefit in reviewing previous sessions. Current training documentation can be found here: Training |
Learning Outcomes
- Deploying Fedora
- Explore core and external features
- Gain insight into content modeling
- Set up a federation over a local filesystem
- Set up JMS message consumer
- Set up external triplestore
- (PCDM)
Prerequisites
Either
- Vagrant setup:
- Download and install Vagrant: http://www.vagrantup.com/downloads.html
- Download the Fedora 4 VM: https://github.com/fcrepo4-labs/fcrepo4-vagrant
- Note that you can either clone the repository to your desktop or just download the ZIP [2] and unzip it
- Using a Command Line Interface, navigate to the VM folder from step 3 and run the command: vagrant up
- Note that this step will take a while as the VM downloads and installs a virtual environment
- Or, Standalone apps setup:
- Java7 installed
- WAR file(s) downloaded
- Configuration files downloaded
- Tomcat installed (optional)
Downloads
War files
Required
Optional
- fcrepo-message-consumer-webapp-4.1.1.war (optional, only needed if deploying to Tomcat)
- fcrepo-webapp-4.1.1.war (optional, only needed if deploying to Tomcat)
Triplestore
- Download and unpack Jena Fuseki (ZIP or TAR) prior to the training
Deploying Fedora4
In OSX or Windows you can simply double-click the fcrepo-webapp-4.1.0-auth.war file to launch the Fedora 4 console. Then click Start and wait for the application to load in your browser.
You can also run the application from the command line using the following command:
Code Block |
---|
java -jar fcrepo-webapp-4.1.0-jetty-console.war --headless |
Note: The location where Fedora writes to disk can be specified with the following flag:
Code Block |
---|
java -Dfcrepo.home=/path/fedora/data -jar fcrepo-webapp-4.1.0-jetty-console.war --headless |
Using Admin Features
Transactions (docs)
Versioning (docs)
Create a version with a label
Code Block |
---|
curl -XPOST http://localhost:8080/rest/item/fcr:versions/my-label |
Import/Export (docs)
Content Modeling
External Triplestore
...
Start Fuseki
Code Block |
---|
./fuseki-server --update --mem /test |
- Verify running at –
http://localhost:3030
...
Start Fedora
Code Block |
---|
java -Dfcrepo.modeshape.configuration=file:/path/to/repository-federation.json -jar fcrepo-webapp-4.1.0-jetty-console.war --headless |
...
Start fcrepo-message-consumer
Code Block |
---|
java -jar fcrepo-message-consumer-webapp-4.1.0-jetty-console.war --headless --port 9090 |
Explore Features
Using Google Chrome PostMan app, execute the following requests (attached)
Expand |
---|
- curl -XPUT localhost:8080/fcrepo/rest/objects/
- curl -XGET localhost:8080/fcrepo/rest/objects/
curl -XPUT -H"Content-Type: text/turtle" --data-binary @body localhost:8080/fcrepo/rest/objects/raven/ Code Block |
---|
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX indexing: <http://fedora.info/definitions/v4/indexing#>
<> a indexing:Indexable ;
indexing:hasIndexingTransformation \"default\" ."
|
- curl -XGET localhost:8080/fcrepo/rest/objects/raven/
curl -XPUT -H"Content-Type: text/turtle" --data-binary @body localhost:8080/fcrepo/rest/objects/raven/files/ Code Block |
---|
| PREFIX ldp: <http://www.w3.org/ns/ldp#>
PREFIX pcdm: <http://pcdm.org/models#>
<> a ldp:DirectContainer;
ldp:membershipResource </fcrepo/rest/objects/raven/>;
ldp:hasMemberRelation pcdm:hasFiles ."
|
- curl -XGET localhost:8080/fcrepo/rest/objects/raven/files/
- curl -XGET -H"Prefer: return=representation; include=\"http://fedora.info/definitions/v4/repository#EmbedResources\"" localhost:8080/fcrepo/rest/objects/raven/files/
- curl -XGET -H"Prefer: return=representation; omit=\"http://fedora.info/definitions/v4/repository#ServerManaged\"" localhost:8080/fcrepo/rest/objects/raven/files/
- curl -XPUT -H"Content-Type: application/pdf" localhost:8080/fcrepo/rest/objects/raven/files/page0
curl -XPATCH -H"Content-Type: application/sparql-update" --data-binary @body localhost:8080/fcrepo/rest/objects/raven/files/page0/fcr:metadata Code Block |
---|
| PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX indexing: <http://fedora.info/definitions/v4/indexing#>
DELETE { }
INSERT {
<> indexing:hasIndexingTransformation \"default\";
rdf:type indexing:Indexable }
WHERE { }"
|
- curl -XPUT -H"Content-Type: application/pdf" localhost:8080/fcrepo/rest/objects/raven/files/page1
curl -XPATCH -H"Content-Type: application/sparql-update" --data-binary @body localhost:8080/fcrepo/rest/objects/raven/files/page1/fcr:metadata Code Block |
---|
| PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX indexing: <http://fedora.info/definitions/v4/indexing#>
DELETE { }
INSERT {
<> indexing:hasIndexingTransformation \"default\";
rdf:type indexing:Indexable }
WHERE { }"
|
curl -XPUT -H"Content-Type: text/turtle" --data-binary @body localhost:8080/fcrepo/rest/collections/ Code Block |
---|
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX indexing: <http://fedora.info/definitions/v4/indexing#>
<> a indexing:Indexable ;
indexing:hasIndexingTransformation \"default\" ."
|
curl -XGET -H"Content-Type: text/turtle" --data-binary @body localhost:8080/fcrepo/rest/collections/poe/ Code Block |
---|
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX indexing: <http://fedora.info/definitions/v4/indexing#>
<> a indexing:Indexable ;
indexing:hasIndexingTransformation \"default\" ."
|
- curl -XGET localhost:8080/fcrepo/rest/collections/poe/
curl -XPUT -H"Content-Type: text/turtle" --data-binary @body localhost:8080/fcrepo/rest/collections/poe/members/ Code Block |
---|
| PREFIX ldp: <http://www.w3.org/ns/ldp#>
PREFIX pcdm: <http://pcdm.org/models#>
PREFIX ore: <http://www.openarchives.org/ore/terms/>
<> a ldp:IndirectContainer;
ldp:membershipResource </fcrepo/rest/collections/poe/>;
ldp:hasMemberRelation pcdm:hasMember ;
ldp:insertedContentRelation ore:proxyFor ."
|
curl -XPUT -H"Content-Type: text/turtle" --data-binary @body localhost:8080/fcrepo/rest/collections/poe/members/member0 Code Block |
---|
| PREFIX ore: <http://www.openarchives.org/ore/terms/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX indexing: <http://fedora.info/definitions/v4/indexing#>
<> a ore:Proxy;
ore:proxyIn </fcrepo/rest/collections/poe/> ;
ore:proxyFor </fcrepo/rest/objects/raven/> ;
indexing:hasIndexingTransformation \"default\";
rdf:type indexing:Indexable ."
|
|
SPARQL Query
In Fuseki console (localhost:3030)
- Select "Control Panel"
- Select Dataset "/test"
- Select Output "Text"
- Select "Force the accept header text/plain regardless"
Query
No Format |
---|
prefix pcdm: <http://pcdm.org/models#>
select ?work
where {
<http://localhost:8080/fcrepo/rest/collections/poe> pcdm:hasMember ?work .
?work pcdm:hasFiles ?files .
}
group by ?work
having (count(?files) > 1) |
Using Admin Features
Transactions (docs)
Versioning (docs)
Create a version with a label
Code Block |
---|
curl -XPOST http://localhost:8080/rest/item/fcr:versions/my-label |
Import/Export (docs
...
)
Additional Resources