10. Create New Mapping
- Select the “Mappings” for the “Dataset Options” from my “Workspace”. This opens the “Mappings” pane in which you can create a new mapping, upload a mapping on an XSL and manage the existing mappings.
- By selecting “Create new mapping” the “New Mapping” pane appears. Give a Name to the box “Mapping Name”, Select the schema you which you want to transform your metadata click “submit”
- after clicking the button “submit”, the mapping with the specified name the mapping editor appears
Exercise 1 - Create new mappings
- Create a new mapping to the CARARE shema with the following title:
- your Name_Surname_Mapping
11. Mapping Editor
11.1 Input Schema Area
- The structure that corresponds to a user's specific import is visualized in the mapping interface as an interactive tree that appears on the left hand side of the editor. The tree represents the snapshot of the XML schema that is used as input for the mapping process. The user is able to navigate and access element statistics and also to search the tree by using the text field on the top.Elements in green color show that they have unique values.
11.2 Mapping Area
- Mapping area visualized in the middle part of the screen as a tree structure of embedded boxes, representing the internal structure of the complex element. The user is able to interact with this structure by clicking to collapse and expand every embedded box that represents an element, along with all relevant information (attributes, annotations) defined in the XML schema document.
11.3 Navigation Area
- On the right hand side, buttons correspond to high-level elements of the target schema (if not visible click on button on the top right of the ingestion platform) and are used to access their corresponding sub-element
11.3.1 Navigation Area - Bookmarks
Note that mandatory elements area appearing when the user starts the Xpath mapping.
11.3.2 Mapping Editor Notation
As we can observe on the top of each element in the mapping area – the schema prefix and the element name are shown – (eg. edm: ProvidedCHO) there are some indicators e.g , , , these indicators are described in the following table.
If you leave the cursor above the mapping the following shortcuts to the input tree and xpaths values appear.
- By clicking on the question mark (?) appearing the documentation about the mapping.
Exercise 2- Navigation
- Navigate through the three different areas:
- On the input schema area browse through the metadata and using the search button highlight the metadata field of title
- On the mapping area browse through the target metadata schema by using the appropriate buttons (+, -,@)
- Use the four tabs on the navigation area in order to navigate through fields, exam bookmarked fields, find mandatory elements that are unmapped and search for elements
12.1 MAPPINGS - Xpath Mapping
To perform an actual (one to one) mapping between the input and the target schema, a user has to simply drag a source element (x-path) from the input tree and dropping it to the desired element (with the area named unmapped) of the mapping area. The source elements will be underlined after mapped to the target schema.
Exercise 3 - Xpaths Mappings
Using the navigation tab create the following X paths Mappings:
|Source Element||Bookmark||Target Element|
|tns:PhotoUri||Image Uri (Appellation id)||car:appellation/car:id|
|tns:PhotoUri||Image Uri (edm:object)||car:digitalResource/car:object|
|ths:PhotoUri||Image Uri (edm:isShownAt)||car:digitalResource/car:isShownAt|
12.1.1 Mappings - Enumerated Mapping
- By double click on an element that takes values from an enumerated list
Exercise 4- Enumerated Mappings
Using the navigation tab create the following Enumerated mappings:
|EDM type (format, type)||car:heritageAssetIdentification/car:generalType||IMAGE|
|Europeana rights||car:rights/car:europenRights||The Public Domain Mark (PDM)|
12.1.2 Mapping - Constant Mapping
- By double clicking on the unmapped area you can define a constant value mapping. You can type a constant value in the provided text field. The value appears in the mapping area and in the resulting XML files. This type of mapping is useful for text that is intended to appear in all transformed items.
Exercise 5 - Constant Mappings
|Source Element||Target Element||Constant Value|
12.1.3 Mappings - Concatenate Mapping
- By clicking on the icon you can perform a concatenate mapping i.e to combine more than one mappings for producing a new mapping.
Exercise 6 - Concatenate Mapping
The target field of the navigation Car:recordInformation/car:source should take its value as a concatenate mapping between the source element: tns: Organization and the static text “Image Video and Multimedia Systems Laboratory”
12.1.4 MAPPINGS - FUNCTIONAL MAPPINGS
- By clicking on the button you can perform a functional mapping i.e to modify the value from an input xpath by applying a string manipulation function to it.
- Substring - You set the start and the end index.
- Substring after - You set the substring of the original string after which the value is taken.
- Substring before - You set the substring of the original string before which the value is taken
- Substring between - You set the substrings of the original string after and before which the value is taken.
- Replace string - You set a string to be replaced with the replacement
- Trim – Trims spaces
- Replace with regex - Replace all occurrences matching the regular expression (first argument) with the second argument (string)
- Split - You set the delimiter for tokenization and the start index of the original string
- Tokenize content and generate an element per content - You set the delimiter for tokenization
- Custom function – You can set a custom XSLT function
Examples are given below
Exercise 7 - Functional Mapping
Create a functional mapping from the source element: tns:Identifier to the Bookmark/Target Element: identifier/car:recordInformation/car:id such that the following transformations take place (use the substring after function):
|Source Element Value||Target Element Value|
12.1.5 Mapping - Conditional Mapping
- By clicking on the button
you can perform a conditional mapping i.e. to transform the value from an input xpath by using conditions. On the left the drop down menu with the type of condition appears that can be AND or OR. A condition is set using one of the following functions.
- Is equal to – sets a condition that is satisfied when the given xpath is equal to the given value.
- Is not equal to – sets a condition that is satisfied when the given xpath is not equal to the given value.
- Exists – sets a condition that is satisfied if the given xpath exists. It is important to note at this point that the fact the xpath of an element exists in the input tree does not mean that it exists for all the data in the imported collection. (In other words the input tree shown on the left aggregates all the possible xpaths found in the input data).
- Does not exist – sets a condition that is satisfied if the given xpath does not exist. It is important to note at this point that the fact the xpath of an element exists in the input tree does not mean that it exists for all the data in the imported collection. (In other words the input tree shown on the left aggregates all the possible xpaths found in the input data).
- Contains – sets a condition that is satisfied if the given xpath contains the given value.
- Does not contain – sets a condition that is satisfied if the given xpath does not contain the given value.
- Starts with – sets a condition that is satisfied if the given xpath starts with the given value.
- Does not start with – sets a condition that is satisfied if the given xpath does not start with the given value.
- Ends with – sets a condition that is satisfied if the given xpath ends with the given value.
- Does not end with – sets a condition that is satisfied if the given xpath does not end with the given value.
- If the value of xpath tns:Description contains the word “picture” and the Value of the xpath ths: Photographer is equal to the word "Petros Katsaros" then car:Description is the concatenation between the tns:Description and the Sring "by Petros Katsaros"
Exercise 8 - Conditional Mapping
Using the source elements tns:Title and tns:Photographer create the following conditional mapping for the Link name (Bookmark) / car:name target field:
- If the value of tns:Title contains the word “Parthenon” and the tns:Photographer value is Petros Katsaros then the car:name is the concatenation between tns:Title and the String “by Petros Katsaros”
- Otherwise the car:name is the same as tns:Title
12.1.6 Mappings - Structural Mapping
- Structural mappings are a special category of mapping. As you may have noticed in the complex types of the target schema illustrated in the mapping area text structural appears instead of unmapped. At this area you can map complex elements of your input metadata.
- Let’s assume you have a complex element named “B” in your metadata – having “C” as a child – and B appears 3 times in only one record. Also assume complex element “BTarget” – having “CTarget” as a child – in the target schema. If you make a structural mapping of B (by dragging it and dropping it) to “BTarget” and then you map “C” to “CTarget” 3 “BTarget” complex elements will appear in the output XML having “CTarget” as child and having the values of “C”.
Exercise 9 - Structural mapping
Create the following structural mapping:
12.1.7 Mapping - Value Mappings
- By clicking on the icon you can perform a value mapping i.e. to map specific values of your input metadata to specific values that you set.
Exercise 10- Value Mappings
Create the following Xpath mapping
|Source Element||Target Element|
Based on the previous create the following value mappings
|Target Element||Initial Value||New Value|
|car:heritageAssetType||Ancient Greece||Archaic Period, Ancient Greece|
|The Parthenon||The Parthenon, Monument|
14. Preview Items
After having performed a mapping you can preview the input files, the XSL created so far, the output files, the Europeana preview and a report of the unmapped elements or mistakes by clicking on the button on the top of the mapping tool.
- Select the previews you like in each tab, click on Remember “selected views” Click on an item
In the below figure the output preview with an error highlighted
- Click on the red line. More information about the error is shown in the ‘”Report pane”.
The following figure shows the Europeana preview that is very useful since it simulates the view of your items on the Europeana portal. Note that by clicking on the button next to the item title on the top you can switch the preview to other items.
Exercise 11 - Preview Items
For the mapping you have created click on the Preview button
- On the item views for the first column set: imported Item, item
- On the item views for the second column set: Mapped Item, Europeana
- Then click to one of the items (e.g. Parthenon) and check the initial item, its transformation to the EDM schema and how this item is displayed by the Europeana portal
- Check the mapped item for possible errors. In case of an error detect it and make the necessary changes based on the previous exercises
Exercise 12 - Preview Items
In case that the mapped item created in the previews step contained no errors then:
- Deliberately create an error by removing a mandatory value
- For once again check the mapped item for possible errors. Alternatively check in the navigation bar for mandatory elements that are unmapped
- Restore the mapping to its previous form
14. TRANSFORM ITEMS
- After having performed a mapping from “Dataset options” select transform. The “Transform pane appears that allow the user to select the mapping to be used for transformation.
- After that, the transformation icon appears next to the dataset and the derived dataset appears under the transformation
Exercise 13 - Transform Items
Transform the elements in your initianl dataset (Euphoto - Extended.zip) based on the mapping you have created.
The previous step creates the transformation to CARARE. If there no errors in them then you can proceed with the publication by clicking on Publish to MORE.