Translation example

To clarify how the translation happens, an example is provided. Below is an image of the full process. This shows all the steps of a translation. Steps three and four are simply the reverse of two and one, respectively, so complete descriptions of them are omitted. In this example, MARC is being used for the interoperable core; it is not the final target of the translation. We're using MARC for the interoperable core while we develop the system.

Full process

Step one

To translate records, they must first be converted from their native format to our intermediate form. To allow for the most extensible translation system, the syntactic and semantic operations must be separated and the intermediate form is the instrument of that separation.

Step one

The intermediate form was designed to be simple and straight-forward. Each record contains one or more fields. Each field must have a name and a namespace and can have a value and any number of subfields. Values are objects unto themselves, and have several properties, including scheme, language and encoding.

Here is an abbreviated example of a GEM record. Here is the same record, in the intermediate form. Notice the "scheme" child of the "format" element in the original record is for its sibling, "contenttype". Another record format might put the scheme information in an attribute of the "contenttype" or "format" element, or as a child of the "contenttype" element. This is a trivial example of the sort of variance that necessitates the intermediate form. If the intermediate form weren't there, then a translation would be required for each variant form, even though they shared identical semantics. Regardless of where the scheme information is in the original record, after being parsed into the intermediate form it would have to be a property of the value associated with the "contenttype" field. To wit:


    text/HTML

Namespaces will be omitted from further examples.


Step two

Here's an example of a mapping of the Dublin Core title element, which is a component of GEM, to MARC.

(map  (source-element "title") (core-element "245" "a")
      (addField parent ("i1" "0"))
      (addField parent ("i2" "0"))
      (addField parent ("h" "[electronic resource]")))
Step two

For this simple mapping, the system would start by finding a "title" element in the input record. For each such element, the system would create a "245" field in the core record, with an "a" subfield. The value of the "title" element would be copied to the "a" subfield. After this, the system would look at the rest of the mapping. In this case there are three addField instructions. The second element of the addField instruction is for specifying where the fields will be added. If nothing is provided, the fields are added as children of the last field of the core-element indicator. In this case, since "parent" is specified, the fields will be added as children of "a"s parent, "245". The first element of each list is the name of the field to be added, the second element is the value for that field. So, if the input record contained, in intermediate form

English Grammar 101

The output record would contain this:


  English Grammar 101
  0
  0
  [electronic resource]
  

If there were two elements in the input record, there would be two 245 fields in the output record. This is the result of the first translation of GEM in the intermediate form to our interoperable core, also in intermediate form. </p> <p> <strong>Step three</strong> would translate from the interoperable core to the final target schema, in intermediate form. <strong>Step four</strong> would turn the intermediate form of the record into the desired syntax. </p> </div> </div> </div> </div> </div> </div> <div class="cont-page extra-info"> <div class="purposestmt iparsys parsys"><div class="section"><div class="new"></div> </div><div class="iparys_inherited"><div class="purposestmt iparsys parsys"><div class="customjavascript section"> <style> #main-content div.extra-info { background: none; } </style></div> </div> </div> </div> </div> </div> </div> <div class="footer iparsys parsys"><div class="section"><div class="new"></div> </div><div class="iparys_inherited"><div class="footer iparsys parsys"><div class="footer section"> <!-- Footer container --> <footer class="page-footer"> <!-- footer content --> <div class="cont-page"> <div class="par parsys"><div class="parsyscolumncontrol section"> <div class="parsys_column cq-colctrl-lt6"> <div class="parsys_column cq-colctrl-lt6-c0"> <div class="col0 parsys"><div class="text parbase section"> <p><img src="/content/dam/oclc/design-images/home-page/footer-logo.png" alt="OCLC logo" class="img-nobrdr"/></p> </div> </div> </div> <div class="parsys_column cq-colctrl-lt6-c1"> <div class="col1 parsys"><div class="text parbase section"> <div style="padding: 10px 0 0 0;"> <div class="social-intro"> <p><b>Follow OCLC<br /> Research:</b></p> </div> <div class="twitter-accounts" style="float: left; margin: 0 8px 0 0;"> <a href="https://twitter.com/oclc/lists/oclc-research" title="Follow OCLC Research on Twitter"><img class="img-nobrdr" src="/content/dam/common/images/social-icons/footer/footer-twitter.png" alt="Twitter"/></a> </div> <div class="other-accounts" style="float: left;"> <a href="https://www.facebook.com/OCLCResearch/" title="Like OCLC Research on Facebook"><img class="img-nobrdr" src="/content/dam/common/images/social-icons/footer/footer-facebook.png" alt="Facebook" style="margin: 0 5px 0 0;"/></a> <a href="https://www.youtube.com/user/oclcresearch" title="Watch OCLC Research videos on YouTube"><img class="img-nobrdr" src="/content/dam/common/images/social-icons/footer/footer-youtube.png" alt="YouTube" style="margin: 0 5px 0 0;"/></a> <a href="https://www.oclc.org/research/publications/blogs.html" title="Read the OCLC Research blogs"><img class="img-nobrdr" src="/content/dam/common/images/social-icons/footer/footer-blog.png" alt="Next blog" style="margin: 0 5px 0 0;"/></a> </div> </div> <div style="clear: both;">   </div> </div> <div class="text parbase section"> <div class="copyright"> <p><a href="https://policies.oclc.org/en/copyright.html" title="Read the OCLC copyright policy">© 2021 OCLC</a></p> <p><a href="https://policies.oclc.org/en/copyright/trademarks.html" title="View the OCLC and Affiliate Trademarks and Service Marks PDF">Domestic and international trademarks and/or service marks of OCLC, Inc. and its affiliates</a></p> <p>This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies. <a href="https://policies.oclc.org/en/privacy/cookie-statement.html">See OCLC's cookie notice to learn more.</a></p> <ul> <li><a href="https://policies.oclc.org/en/privacy/privacy-statement.html">Privacy statement</a></li> <li><a href="https://policies.oclc.org/en/accessibility.html">Accessibility statement</a></li> <li><a href="https://policies.oclc.org/en/security/iso-27001.html">ISO 27001 Certificate</a></li> </ul> </div> </div> </div> </div> </div></div> </div> <div style="clear: both"></div> </div> <div class="connect-bar mod"> <div class="cont-page"> <!-- ComputerWorld logo should only appear on US/EN site --> </div> </div> <!-- Copyright --> <div class="cont-page copyright"> <div class="text parbase"> </div> </div> </footer> <script> (function ($) { $(function() { yepnope({ test: ($(".event-listing-show").length), yep: ['/etc/designs/oclc/js/event-functions-v0.2.js'] }); }); })(jQuery); </script> </div> </div> </div> </div> <script src="/etc/designs/oclc/syntaxhighlighter/shCore.js" type="text/javascript"></script> <script src="/etc/designs/oclc/syntaxhighlighter/shAutoloader.js" type="text/javascript"></script> <script> SyntaxHighlighter.autoloader('java /etc/designs/oclc/syntaxhighlighter/shBrushJava.js', 'js jscript javascript /etc/designs/oclc/syntaxhighlighter/shBrushJScript.js', 'plain text /etc/designs/oclc/syntaxhighlighter/shBrushPlain.js', 'bash /etc/designs/oclc/syntaxhighlighter/shBrushBash.js', 'csharp /etc/designs/oclc/syntaxhighlighter/shBrushCSharp.js', 'css /etc/designs/oclc/syntaxhighlighter/shBrushCss.js', 'groovy /etc/designs/oclc/syntaxhighlighter/shBrushGroovy.js', 'perl pl /etc/designs/oclc/syntaxhighlighter/shBrushPerl.js', 'php /etc/designs/oclc/syntaxhighlighter/shBrushPhp.js', 'python py /etc/designs/oclc/syntaxhighlighter/shBrushPython.js', 'ruby /etc/designs/oclc/syntaxhighlighter/shBrushRuby.js', 'sql /etc/designs/oclc/syntaxhighlighter/shBrushSql.js', 'xml /etc/designs/oclc/syntaxhighlighter/shBrushXml.js'); SyntaxHighlighter.all(); </script> </body> </html>