EXAMPLES OF SMALL TRANSFORMATIONS WITH D:SWARM

What can I do with d:swarm? To illustrate the current functional range of d:swarm we are going to describe and explain some exemplary transformations:

  • How to create the RDA element “Publication Statement” from the corresponding segment of MAB-Tags?
  • How to add the 10- or 13-digit ISBN by using the transformation functions of d:swarm?
  • How to add a stable http-uri for linkage of a particular resource?

For the purposes of illustration we created an example dataset “zoology” and preloaded it in our demo installation (http://demo.dswarm.org) in the first example project “Example1”. You will find a schematic summary of all mappings and transformations of the entire example project in our user documentation.

The first attribute of the target schema (bibo:Document) that we are going to examine is the RDA element “publication statement”. The value of this attribute has its source in the MAB-Tags 410 (Place of Publication), 412 (Publisher) and 425 (Year of Publication) of the above mentioned Example Data Set “zoologie “. Basically a mappping is established by linking an element of the source schema to an element of the target schema. To do so we activate the first required source attribute and the corresponding desired target element by point and click. If MAB records are processed, a special widget is used to facilitate the parametrization of the needed attribute paths.

The widget demands a name for the particular mapping and offers the button “add a key definition” to append additional source attributes. Further needed parameters are MAB tag and if necessary indicator. In the present mapping we use “rda:publicationStatement” as the name of the mapping and as source attributes the above mentioned MAB tags of Place, Publisher and Year. Closing the widget by clicking on “OK” transfers the mapping to the transformation logic widget.

The next step of the transformation logic is the definition of the delimiter that separates the constituent parts of the publication statement in the resulting target string: The transformation function “compose” is used to add a colophon at the value of the source attribute MAB tag “410”. The use of a space character as “delimiter” of the function “concat” concatenates the source attributes as desired to a single string.

The resulting target element “publication statement” has the value “Frankfurt am Main: Fischer-Taschenbuch-Verl. 1963”.

The second mapping that we are going to explain is the target attribute bibliographic ontology tag “isbn”. Since the source record contains only the 10-digit ISBN we are going to add the 13-digit version by using the transformation function “isbn”.

For this purpose we again establish a mapping with the required “key definitions” which are MAB tag “540” and indicator “a”. As name for the mapping we use “bibo:isbn (10)”. The supplement of the 13-digit version of the ISBN requires a second separate mapping of the same source path but this time we name the mapping “bibo:isbn (13)”. To avoid the concatenation of both mappings we select “New Mapping” in the mapping widget.

To make sure that only the digits of the isbn and not parts of the source string like “ISBN” or other additions are transformed to the target element of the first isbn mapping we are going to use the transformation function “isbn” with its parameter “clean”. The second isbn mapping needs the parameter “isbn13” to transform the 10-digit isbn to the 13-digit version.

After executing both transformations the target element bibo:isbn contains both types of ISBN.

The third and last element of the target schema that we are going to examine in our mapping example is “owl:sameAs”. The purpose of this element is the provisioning of an stable http-uri that links to the particular resource. From the source side of the transformation workflow we are going to use the value of the MAB tag “001” which is the BSZ pica production number of the example record. Concurrent to the two already described mappings we are establishing a new one with this key definition.

To turn the plane ID into a resolvable URI we use the transformation function “compose”. After adding the function to the transformation workflow we parametrize the prefix as “http://hub.culturegraph.org/about/BSZ-”  and the postfix as “/html”.

After running the transformation the value of the resulting target element “owl:sameAs” is:  http://hub.culturegraph.org/about/BSZ-033314047/html.

This is just a small example to illustrate basic functionalities of d:swarm. What do you want to transform with d:swarm? Please describe your use case on our public mailinglist. We will answer how to achieve this case with d:swarm.

Scroll to Top