echo extract exif, convert to N3 RDF, write out to disk. # Revision 1.1 (C) Dave Pawson 2007 # # Sources. # Python @@FIXME # Java http://sourceforge.net/projects/jpegrdf # Exiftool http://www.sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html if [ $# -lt 1 ] then echo "Usage exifRDF input.jpg [options]" echo "-d, add title and description " echo "-g, add geographical information" exit 2 fi if [ -f $1 ] then echo Processing $1 else echo $1 not found, quitting exit 2 fi #Extract the exif data, short form rm -f tmp.tmp exiftool -a -u -g1 -s -t $1 >tmp.tmp if [ $? -ne 0 ] then echo Error reported by exiftool, quitting exit 2 fi filename=$1 basename=${filename%.jpg} opfilename=$basename.n3 # create then show the thumbnail exiftool -b -ThumbnailImage $filename >thumb.jpg #echo calling exifRDF.py with $opfilename and $2 python /files/exif/exifRDF.py -i tmp.tmp -o $opfilename $2 $3 if [ $? -ne 0 ] then echo Error reported by exifRDF.py, quitting exit 2 fi echo Written $opfilename exit 0 cwm --n3 tmp.n3 --rdf >tmp.rdf if [ $? -ne 0 ] then echo Error reported by cwm, quitting exit 2 fi cd=/apps/jpegrdf CP=$cd/jpegrdf.jar:$cd:$cd/commons-logging-1.1.jar:$cd/icu4j_3_8_d01.jar:$cd/iri.jar:$cd/jena.jar:$cd/xercesImpl.jar:$cd/xerces.jar java -cp $CP com.nwalsh.jpegrdf.JpegRDF -rdf tmp.rdf $1 #rm tmp.rdf tmp.tmp tmp.n3