Logo Help Center

Automatically creating XMP file relations in Elvis 4

Automatically creating XMP file relations in Elvis 4

The Adobe CS products save information (and other metadata) on relations between files embedded in the XMP block of the file. When a file is imported or checked in, Elvis extracts this XMP information and saves it in the search index and creates automatic relations where possible. This opens up the possibility to search for related files when new files are imported.

XMP metadata

There are different areas (namespaces) in the XMP metadata block, the media management root namespace (xmpMM) contains all relevant information for creating relations. The namespace is filled with file pathʼs and unique identifiers - GUIDʼs - which uniquely identify a file, a related file or a referenced file. Detailed information on the XMP structure is available in Adobe XMP SDK documentation.

Base XMP ID fields

There are three significant XMP fields used as a base for creating relations. These fields are involved in creating all relation types (duplicate, related and references):

  • documentId - created once for new files, different renditions are expected to have different values for this field.
  • instanceId - changes with each save operation.
  • originalDocumentId - links a resource to its original source, for example, when you save a PSD document as a JPEG, then convert the JPEG to GIF format, the immediate source of the GIF is the JPEG, and the original source is the PSD. The value of originalDocumentId in both the JPEG and GIF files is the value of originalDocumentId from the original PSD file.

Related

Information from the "derived" block of XMP metadata is used by Elvis to create related relations. The current file can be derived from another file already available in Elvis or the current file can have one or more derivatives which are already in Elvis. The Elvis fields involved are:

  • derivedFromDocumentId
  • derivedFromInstanceId
  • derivedFromOriginalDocumentId

Elvis also uses the "history" block of the XMP metadata, which contains information about the history of the file, such as save actions or format changes. All actions in this area are sorted by date, the starting with the first action and ending with the last action on the file. Elvis indexes the history in the following fields:

  • xmpHistory - structured object containing all actions defined inside the history block
  • historyInstanceIds - list of all instanceIdʼs defined inside the history block 
    The instanceId of the current file can be listed in the history block of another file already available in Elvis. Itʼs also possible that the current file contains history instanceIds which can be linked to instanceIds of other files which are already in Elvis.

Note: We’re not matching on history instanceIds older than the second last “saved” or “created” action as this can lead to creating too many related relations between files which are not or only vaguely related.

References

The "manifest" block of the XMP metadata contains information about files placed on or linked to the current file, for example images placed in InDesign files are listed here. The Elvis fields involved are:

  • referencedInstanceIds
  • referencedDocumentIds
  • referencedFilenames - list of all filenames of placed files
  • xmpReferences - structured object containing all of the above, essentially a list of placed files where each file contains a referencedInstanceId, referencedDocumentId and a lastURL.

XMP extraction and processing

Elvis uses a utility called xmpcommand to extract XMP information from files. The location of xmpcommand is in the Elvis Server tools folder:

  • Windows: C:\ProgramFiles (x86)\Elvis Server\tools\windows\xmptoolkit\xmpcommand.exe
  • Mac OS X: /Applications/Elvis Server.app/Contents/Server/tools/macosx/xmptoolkit/xmpcommand

You can use the tool with the following command:

$ xmpcommand -scan get <file to scan>

Following are a few samples of XMP output to illustrate a few automatically created relations.

Sample related relation

<xmpMM:History>
    <rdf:Seq>
        <rdf:li rdf:parseType="Resource">
            <stEvt:action>created</stEvt:action>
            <stEvt:instanceID>xmp.iid:383F1918412A6811974E8D9C1281014F</stEvt:instanceID>
            <stEvt:when>2012-05-23T14:29:04+02:00</stEvt:when>
            <stEvt:softwareAgent>Adobe Photoshop CS5.1 Macintosh</stEvt:softwareAgent>
        </rdf:li>
    </rdf:Seq>
</xmpMM:History>
<xmpMM:OriginalDocumentID>xmp.did:383F1918412A6811974E8D9C1281014F</xmpMM:OriginalDocumentID>
<xmpMM:DocumentID>xmp.did:383F1918412A6811974E8D9C1281014F</xmpMM:DocumentID>
(*) <xmpMM:InstanceID>xmp.iid:383F1918412A6811974E8D9C1281014F</xmpMM:InstanceID>

Color correction.psd

<xmpMM:History>
    <rdf:Seq>
        <rdf:li rdf:parseType="Resource">
            <stEvt:action>created</stEvt:action>
(*)         <stEvt:instanceID>xmp.iid:383F1918412A6811974E8D9C1281014F</stEvt:instanceID>
            <stEvt:when>2012-05-23T14:29:04+02:00</stEvt:when>
            <stEvt:softwareAgent>Adobe Photoshop CS5.1 Macintosh</stEvt:softwareAgent>
        </rdf:li>
        <rdf:li rdf:parseType="Resource">
            <stEvt:action>saved</stEvt:action>
            <stEvt:instanceID>xmp.iid:393F1918412A6811974E8D9C1281014F</stEvt:instanceID>
            <stEvt:when>2012-05-23T14:29:38+02:00</stEvt:when>
            <stEvt:softwareAgent>Adobe Photoshop CS5.1 Macintosh</stEvt:softwareAgent>
            <stEvt:changed>/</stEvt:changed>
        </rdf:li>
        <rdf:li rdf:parseType="Resource">
            <stEvt:action>saved</stEvt:action>
            <stEvt:instanceID>xmp.iid:3A3F1918412A6811974E8D9C1281014F</stEvt:instanceID>
            <stEvt:when>2012-05-23T14:29:38+02:00</stEvt:when>
            <stEvt:softwareAgent>Adobe Photoshop CS5.1 Macintosh</stEvt:softwareAgent>
            <stEvt:changed>/</stEvt:changed>
        </rdf:li>
    </rdf:Seq>
</xmpMM:History>
<xmpMM:OriginalDocumentID>xmp.did:383F1918412A6811974E8D9C1281014F</xmpMM:OriginalDocumentID>
<xmpMM:DocumentID>xmp.did:383F1918412A6811974E8D9C1281014F</xmpMM:DocumentID>
(*) <xmpMM:InstanceID>xmp.iid:3A3F1918412A6811974E8D9C1281014F</xmpMM:InstanceID>

Save as jpg thumbnail.jpg

<xmpMM:History>
    <rdf:Seq>
        <rdf:li rdf:parseType="Resource">
            <stEvt:action>created</stEvt:action>
            <stEvt:instanceID>xmp.iid:383F1918412A6811974E8D9C1281014F</stEvt:instanceID>
            <stEvt:when>2012-05-23T14:29:04+02:00</stEvt:when>
            <stEvt:softwareAgent>Adobe Photoshop CS5.1 Macintosh</stEvt:softwareAgent>
        </rdf:li>
        <rdf:li rdf:parseType="Resource">
            <stEvt:action>saved</stEvt:action>
            <stEvt:instanceID>xmp.iid:393F1918412A6811974E8D9C1281014F</stEvt:instanceID>
            <stEvt:when>2012-05-23T14:29:38+02:00</stEvt:when>
            <stEvt:softwareAgent>Adobe Photoshop CS5.1 Macintosh</stEvt:softwareAgent>
            <stEvt:changed>/</stEvt:changed>
        </rdf:li>
        <rdf:li rdf:parseType="Resource">
            <stEvt:action>saved</stEvt:action>
(*)         <stEvt:instanceID>xmp.iid:3A3F1918412A6811974E8D9C1281014F</stEvt:instanceID>
            <stEvt:when>2012-05-23T14:29:38+02:00</stEvt:when>
            <stEvt:softwareAgent>Adobe Photoshop CS5.1 Macintosh</stEvt:softwareAgent>
            <stEvt:changed>/</stEvt:changed>
        </rdf:li>
        <rdf:li rdf:parseType="Resource">
            <stEvt:action>saved</stEvt:action>
            <stEvt:instanceID>xmp.iid:3B3F1918412A6811974E8D9C1281014F</stEvt:instanceID>
            <stEvt:when>2012-05-23T14:32:32+02:00</stEvt:when>
            <stEvt:softwareAgent>Adobe Photoshop CS5.1 Macintosh</stEvt:softwareAgent>
            <stEvt:changed>/</stEvt:changed>
        </rdf:li>
        <rdf:li rdf:parseType="Resource">
            <stEvt:action>converted</stEvt:action>
            <stEvt:parameters>from application/vnd.adobe.photoshop to image/jpeg</stEvt:parameters>
        </rdf:li>
        <rdf:li rdf:parseType="Resource">
            <stEvt:action>derived</stEvt:action>
            <stEvt:parameters>converted from application/vnd.adobe.photoshop to image/jpeg</stEvt:parameters>
        </rdf:li>
        <rdf:li rdf:parseType="Resource">
            <stEvt:action>saved</stEvt:action>
            <stEvt:instanceID>xmp.iid:3C3F1918412A6811974E8D9C1281014F</stEvt:instanceID>
            <stEvt:when>2012-05-23T14:32:32+02:00</stEvt:when>
            <stEvt:softwareAgent>Adobe Photoshop CS5.1 Macintosh</stEvt:softwareAgent>
            <stEvt:changed>/</stEvt:changed>
        </rdf:li>
    </rdf:Seq>
</xmpMM:History>
<xmpMM:OriginalDocumentID>xmp.did:383F1918412A6811974E8D9C1281014F</xmpMM:OriginalDocumentID>
<xmpMM:DocumentID>0</xmpMM:DocumentID>
<xmpMM:InstanceID>xmp.iid:3C3F1918412A6811974E8D9C1281014F</xmpMM:InstanceID>

Sample reference relation

<xmpMM:OriginalDocumentID>xmp.did:3D3F1918412A6811974E8D9C1281014F</xmpMM:OriginalDocumentID>
<xmpMM:DocumentID>xmp.did:3D3F1918412A6811974E8D9C1281014F</xmpMM:DocumentID>
(*) <xmpMM:InstanceID>xmp.iid:3D3F1918412A6811974E8D9C1281014F</xmpMM:InstanceID>

Photo 2.psd

<xmpMM:OriginalDocumentID>xmp.did:3E3F1918412A6811974E8D9C1281014F</xmpMM:OriginalDocumentID>
<xmpMM:DocumentID>xmp.did:3E3F1918412A6811974E8D9C1281014F</xmpMM:DocumentID>
(*) <xmpMM:InstanceID>xmp.iid:3E3F1918412A6811974E8D9C1281014F</xmpMM:InstanceID>

References.indd

<xmpMM:Manifest>
    <rdf:Bag>
        <rdf:li rdf:parseType="Resource">
            <stMfs:linkForm>ReferenceStream</stMfs:linkForm>
            <stMfs:reference rdf:parseType="Resource">
(*)             <stRef:instanceID>xmp.iid:3D3F1918412A6811974E8D9C1281014F</stRef:instanceID>
                <stRef:documentID>xmp.did:3D3F1918412A6811974E8D9C1281014F</stRef:documentID>
                <stRef:lastURL>file:///Volumes/Test/References/Photo%201.psd</stRef:lastURL>
            </stMfs:reference>
            <xmpMM:placedXResolution>72.00</xmpMM:placedXResolution>
            <xmpMM:placedYResolution>72.00</xmpMM:placedYResolution>
            <xmpMM:placedResolutionUnit>Inches</xmpMM:placedResolutionUnit>
        </rdf:li>
        <rdf:li rdf:parseType="Resource">
            <stMfs:linkForm>ReferenceStream</stMfs:linkForm>
            <stMfs:reference rdf:parseType="Resource">
(*)             <stRef:instanceID>xmp.iid:3E3F1918412A6811974E8D9C1281014F</stRef:instanceID>
                <stRef:documentID>xmp.did:3E3F1918412A6811974E8D9C1281014F</stRef:documentID>
                <stRef:lastURL>file:///Volumes/Test/References/Photo%201.psd</stRef:lastURL>
            </stMfs:reference>
            <xmpMM:placedXResolution>72.00</xmpMM:placedXResolution>
            <xmpMM:placedYResolution>72.00</xmpMM:placedYResolution>
            <xmpMM:placedResolutionUnit>Inches</xmpMM:placedResolutionUnit>
        </rdf:li>
    </rdf:Bag>
</xmpMM:Manifest>
...
<xmpMM:OriginalDocumentID>xmp.did:92F64887402A68118A6D95B2C4EFF12A</xmpMM:OriginalDocumentID>
<xmpMM:DocumentID>xmp.did:92F64887402A68118A6D95B2C4EFF12A</xmpMM:DocumentID>
<xmpMM:InstanceID>xmp.iid:96F64887402A68118A6D95B2C4EFF12A</xmpMM:InstanceID>
Was this article helpful?
0 out of 0 found this helpful / Created: / Updated:
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.