Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When an image file is uploaded via the GUI, the process is something along these lines:

  • upload the image

See also Where are Images stored in VIVO?

A note from Jim Blake to Eliza Chan

Excerpted from an email conversation between Jim Blake and Eliza Chan, dated 2010-10-18 10:15

Eliza;

Perhaps "intractable" is not the right word, but it's close.

When an image file is uploaded via the GUI, the process is something along these lines:

  • upload the image file, and store in a temporary location.
  • ask the user for a cropping square to be used in producing the thumbnail.
  • create a URI for the image file surrogate object, and a URI for the image file bytestream object.
  • create a URI for the thumbnail surrogate object, and a URI for the thumbnail bytestream object.
  • hand the image file bytestream URI and the temporary file to the File Storage system, which will create a permanent storage.
  • generate a 115 by 115 JPEG thumbnail image from the main image and the cropping square.
  • hand the thumbnail image stream and the thumbnail bytestream URI to the File Storage system, which will create a permanent storage.
  • create a thumbnail bytestream object in the model.
  • create a thumbnail surrogate object in the model, storing the filename of the thumbnail, the mime type of the thumbnail, and the URI of the thumbnail bytestream.
  • create a main image bytestream object in the model.
  • create a main image surrogate object in the model, storing the filename of the main image, the mime type of the main image, and the URI of the main image bytestream.
  • link the main image surrogate object to the person object.

...

For an individual on my test installation (in N3, if I remember how to write it)

INDIVIDUAL

Panel
No Format

  <http://vivo.mydomain.edu/individual/n1451>
      http://vitro.mannlib.cornell.edu/ns/vitro/public#mainImage 	
              http://vivo.mydomain.edu/individual/n1674.
 

IMAGE FILE SURROGATE

Panel
No Format

  <http://vivo.mydomain.edu/individual/n1674>
      http://vitro.mannlib.cornell.edu/ns/vitro/public#thumbnailImage
              http://vivo.mydomain.edu/individual/n5863; 
      http://vitro.mannlib.cornell.edu/ns/vitro/public#downloadLocation
              http://vivo.mydomain.edu/individual/n3156;
      http://vitro.mannlib.cornell.edu/ns/vitro/public#mimeType
              "image/jpeg";
      http://vitro.mannlib.cornell.edu/ns/vitro/public#filename
              "lily1.jpg";
      http://vitro.mannlib.cornell.edu/ns/vitro/0.7#modTime
              "2010-10-18T09:51:58";
      http://www.w3.org/1999/02/22-rdf-syntax-ns#type
              http://vitro.mannlib.cornell.edu/ns/vitro/public#File;
      http://www.w3.org/1999/02/22-rdf-syntax-ns#type
              http://www.w3.org/2002/07/owl#Thing.
 

IMAGE FILE BYTESTREAM

Panel
No Format

  <http://vivo.mydomain.edu/individual/n3156>
      http://vitro.mannlib.cornell.edu/ns/vitro/0.7#modTime
              "2010-10-18T09:51:57";
      http://www.w3.org/1999/02/22-rdf-syntax-ns#type
              http://vitro.mannlib.cornell.edu/ns/vitro/public#FileByteStream;
      http://www.w3.org/1999/02/22-rdf-syntax-ns#type
              http://www.w3.org/2002/07/owl#Thing.
 

THUMBNAIL SURROGATE

Panel
No Format

  <http://vivo.mydomain.edu/individual/n5863>
      http://vitro.mannlib.cornell.edu/ns/vitro/public#downloadLocation
              http://vivo.mydomain.edu/individual/n5889;
      http://vitro.mannlib.cornell.edu/ns/vitro/public#mimeType
              "image/jpeg";
      http://vitro.mannlib.cornell.edu/ns/vitro/public#filename
              "thumbnail_lily1.jpg";
      http://vitro.mannlib.cornell.edu/ns/vitro/0.7#modTime
              "2010-10-18T09:52:12";
      http://www.w3.org/1999/02/22-rdf-syntax-ns#type
              http://vitro.mannlib.cornell.edu/ns/vitro/public#File;
      http://www.w3.org/1999/02/22-rdf-syntax-ns#type
              http://www.w3.org/2002/07/owl#Thing.
 

THUMBNAIL BYTESTREAM

Panel
No Format

  <http://vivo.mydomain.edu/individual/n5889>
      http://vitro.mannlib.cornell.edu/ns/vitro/0.7#modTime
              "2010-10-18T09:52:12";
      http://www.w3.org/1999/02/22-rdf-syntax-ns#type
              http://vitro.mannlib.cornell.edu/ns/vitro/public#FileByteStream;
      http://www.w3.org/1999/02/22-rdf-syntax-ns#type
              http://www.w3.org/2002/07/owl#Thing;
 

...

1. Create RDF for images and add to the VIVO site, e.g.

Panel
No Format
 

<rdf:Description rdf:about="http://localhost:8080/vivo/individual/cwid-gwa2001">
<j.2:mainImage rdf:resource="http://localhost:8080/vivo/individual/mainImage-gwa2001"/>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
<rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
<rdf:type rdf:resource="http://vivoweb.org/ontology/core#FacultyMember"/>
<rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
</rdf:Description>

...

Panel

<rdf:Description rdf:about="http://localhost:8080/vivo/individual/n12291199549391">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
<j.5:modTime xml:lang="en">2010-11-04T10:44:04</j.5:modTime>
<rdf:type rdf:resource="http://vitro.mannlib.cornell.edu/ns/vitro/public#FileByteStream"/>
</rdf:Description>

No Format
 

2. Copy images to the following folders:

...

This redirection means that the image shown in your browser has a name that you will recognize, with an appropriate file type. If you choose "Save Image" in your browser, the default filename will be suitable for the image.

However, this redirection implies additional overhead. Pages local to VIVO calculated the alias URL and used it as the "src" property on the image, avoiding the redirection. But because the "alias URL" was not present in the RDF, it was not available to external applications, which resulted in excessive load times for pages that displayed dozens of images.

In VIVO release 1.2 we added the "directDownloadUrl" property to FileByteStream objects. This property contains the "alias URL", is created when the image is ingested, and is used both by VIVO and by external applications when displaying images.

"Save Image" in your browser, the default filename will be suitable for the image.

However, this redirection implies additional overhead. Pages local to VIVO calculated the alias URL and used it as the "src" property on the image, avoiding the redirection. But because the "alias URL" was not present in the RDF, it was not available to external applications, which resulted in excessive load times for pages that displayed dozens of images.

The directDownloadUrl" property of FileByteStream objects contains the "alias URL", is created when the image is ingested, and is used both by VIVO and by external applications when displaying imagesVIVO releases from 1.2 through 1.4.1 contained code that would analyze the data model at startup, creating this property in the RDF if it was not present. Starting with release 1.5, that code has been removed, and ingested RDF for image files must contain the "directDownloadUrl" property in addition to those described above.

Accordingly, the FileByteStream examples shown above must now look like this instead:

IMAGE FILE BYTESTREAM

Panel
No Format

  <http://vivo.mydomain.edu/individual/n3156>
      http://vitro.mannlib.cornell.edu/ns/vitro/0.7#modTime
              "2010-10-18T09:51:57";
      http://www.w3.org/1999/02/22-rdf-syntax-ns#type
              http://vitro.mannlib.cornell.edu/ns/vitro/public#FileByteStream;
      http://www.w3.org/1999/02/22-rdf-syntax-ns#type
              http://www.w3.org/2002/07/owl#Thing.
      http://vitro.mannlib.cornell.edu/ns/vitro/public#directDownloadUrl
              "/file/n3156/lily1.jpg"
 

THUMBNAIL BYTESTREAM

Panel
No Format

  <http://vivo.mydomain.edu/individual/n5889>
      http://vitro.mannlib.cornell.edu/ns/vitro/0.7#modTime
              "2010-10-18T09:52:12";
      http://www.w3.org/1999/02/22-rdf-syntax-ns#type
              http://vitro.mannlib.cornell.edu/ns/vitro/public#FileByteStream;
      http://www.w3.org/1999/02/22-rdf-syntax-ns#type
              http://www.w3.org/2002/07/owl#Thing;
      http://vitro.mannlib.cornell.edu/ns/vitro/public#directDownloadUrl
              "/file/n5889/thumbnail_lily1.jpg"