Skip to content

Instantly share code, notes, and snippets.

@escowles
Created May 25, 2017 17:36
Show Gist options
  • Select an option

  • Save escowles/4f8b5a94093cde8232c1e117f65f1a72 to your computer and use it in GitHub Desktop.

Select an option

Save escowles/4f8b5a94093cde8232c1e117f65f1a72 to your computer and use it in GitHub Desktop.
#!/bin/bash
JAR=$HOME/src/impexp/target/fcrepo-import-export-0.1.1-SNAPSHOT.jar
BASE=http://localhost:8080/rest/$RANDOM
SRC=$BASE/src
DST=$BASE/dst
# create a collection and some objects that link to it
curl -X PUT $SRC && echo
curl -X PUT -H "Content-Type: text/turtle" -d "<> a <http://pcdm.org/models#Collection> ." $SRC/col && echo
curl -X PUT -H "Content-Type: text/turtle" -d "<> a <http://pcdm.org/models#Object>; \
<http://pcdm.org/models#memberOf> <$SRC/col> ." $SRC/obj1 && echo
curl -X PUT -H "Content-Type: text/turtle" -d "<> a <http://pcdm.org/models#Object>; \
<http://pcdm.org/models#memberOf> <$SRC/col> ." $SRC/obj2 && echo
# export
rm -rf export.inbound
java -jar $JAR -m export -r $SRC/col -d export.inbound -i -p "http://pcdm.org/models#memberOf"
# import
java -jar $JAR -m import -r $DST -d export.inbound -M $SRC,$DST -p "http://pcdm.org/models#memberOf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment