<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to SynonymDefSyntax</title><link>https://sourceforge.net/p/commondatamodel/wiki/SynonymDefSyntax/</link><description>Recent changes to SynonymDefSyntax</description><atom:link href="https://sourceforge.net/p/commondatamodel/wiki/SynonymDefSyntax/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 02 Sep 2015 08:16:24 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/commondatamodel/wiki/SynonymDefSyntax/feed" rel="self" type="application/rss+xml"/><item><title>SynonymDefSyntax modified by Anonymous</title><link>https://sourceforge.net/p/commondatamodel/wiki/SynonymDefSyntax/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;The &lt;strong&gt;synonym document is relative to a particular view&lt;/strong&gt;. Synonyms have a meaning only when using a the dictionary mechanism. It will permit to associate for each plug-in a specific keyword to another one. &lt;/p&gt;
&lt;h1 id="the-need-of-synonyms"&gt;The need of synonyms&lt;/h1&gt;
&lt;p&gt;The need of synonyms appears when an application can use several plug-ins. It will ask for data using keywords from its defined view. &lt;/p&gt;
&lt;p&gt;Mainly, there's two way of defining keywords of a view: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;in worst cases, according a particular data format &lt;/li&gt;
&lt;li&gt;or according a concept file relative to a specific experiment &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The fact, is that there is absolutely &lt;strong&gt;no guarantee that all plug-ins use same keywords&lt;/strong&gt; or directly refers to a concept file (which should be the good way of doing). So keywords used by the application can be unidentified in the mapping of a specific plug-in. Even if the physical measure exist under an another form in the mapping file. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;This is where synonyms interpose&lt;/strong&gt;. &lt;/p&gt;
&lt;h1 id="what-for"&gt;What for&lt;/h1&gt;
&lt;p&gt;Synonyms are loaded at the same time as the view. Its main purpose is to link two keywords. Once linked and when called both of them will return the same data. &lt;/p&gt;
&lt;p&gt;The synonym of a keyword is plug-in dependent. It means that the specified synonym will be used only when the associated plug-in is working. &lt;/p&gt;
&lt;p&gt;All synonyms corresponding to a view are stored in the same XML file. When specified that particular is searched in the same folder as the view. &lt;/p&gt;
&lt;h1 id="use-case"&gt;Use case&lt;/h1&gt;
&lt;p&gt;Let's imagine an application that only displays images, it uses the following view: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE data-def SYSTEM "../dtd/view_file.dtd"&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;data-def&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"IMAGE_VIEWER"&lt;/span&gt; &lt;span class="na"&gt;synonym=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; 
    &lt;span class="nt"&gt;&amp;lt;group&lt;/span&gt; &lt;span class="na"&gt;key=&lt;/span&gt;&lt;span class="s"&gt;"data"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; 
        &lt;span class="nt"&gt;&amp;lt;item&lt;/span&gt; &lt;span class="na"&gt;key=&lt;/span&gt;&lt;span class="s"&gt;"images"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;item&lt;/span&gt; &lt;span class="na"&gt;key=&lt;/span&gt;&lt;span class="s"&gt;"x_position"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt; 
        &lt;span class="nt"&gt;&amp;lt;item&lt;/span&gt; &lt;span class="na"&gt;key=&lt;/span&gt;&lt;span class="s"&gt;"y_position"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt; 
    &lt;span class="nt"&gt;&amp;lt;/group&amp;gt;&lt;/span&gt; 
    &lt;span class="nt"&gt;&amp;lt;group&lt;/span&gt; &lt;span class="na"&gt;key=&lt;/span&gt;&lt;span class="s"&gt;"info"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; 
        &lt;span class="nt"&gt;&amp;lt;item&lt;/span&gt; &lt;span class="na"&gt;key=&lt;/span&gt;&lt;span class="s"&gt;"comments"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt; 
    &lt;span class="nt"&gt;&amp;lt;/group&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;/data-def&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;and two plug-ins are available, they have defined the following mapping: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;plug-in A: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE map-def SYSTEM "../../dtd/mapping_file.dtd"&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;map-def&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"plug_in_A"&lt;/span&gt; &lt;span class="na"&gt;version=&lt;/span&gt;&lt;span class="s"&gt;"1.0.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
...
  &lt;span class="nt"&gt;&amp;lt;item&lt;/span&gt; &lt;span class="na"&gt;key=&lt;/span&gt;&lt;span class="s"&gt;"images"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;path&amp;gt;&lt;/span&gt;/entry1/data/my_images&lt;span class="nt"&gt;&amp;lt;/path&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/item&amp;gt;&lt;/span&gt;
...
&lt;span class="nt"&gt;&amp;lt;/map-def&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;plug-in B &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE map-def SYSTEM "../../dtd/mapping_file.dtd"&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;map-def&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"plug_in_B"&lt;/span&gt; &lt;span class="na"&gt;version=&lt;/span&gt;&lt;span class="s"&gt;"1.0.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
...
  &lt;span class="nt"&gt;&amp;lt;item&lt;/span&gt; &lt;span class="na"&gt;key=&lt;/span&gt;&lt;span class="s"&gt;"image_stack"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;path&amp;gt;&lt;/span&gt;/image*/data&lt;span class="nt"&gt;&amp;lt;/path&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;call&amp;gt;&lt;/span&gt;DataItemStacker&lt;span class="nt"&gt;&amp;lt;/call&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/item&amp;gt;&lt;/span&gt;
...
&lt;span class="nt"&gt;&amp;lt;/map-def&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The application will use &lt;strong&gt;the keyword &lt;em&gt;images&lt;/em&gt; according its view&lt;/strong&gt;. In the displayed view file above, no synonym file is mentioned. Therefore, in the case of the &lt;em&gt;plug-in A&lt;/em&gt;, the CDMA will answer an item, whereas &lt;strong&gt;the &lt;em&gt;plug-in B&lt;/em&gt; won't find the item&lt;/strong&gt;. &lt;/p&gt;
&lt;p&gt;Now in the view, &lt;strong&gt;we define the synonym file name&lt;/strong&gt; as the following: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&amp;lt;data-def name="IMAGE_VIEWER" synonym="my_synonym_file.xml"&amp;gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;In the same folder &lt;strong&gt;we create the synonym file&lt;/strong&gt; so called "my_synonym_file.xml", as following: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="cp"&gt;&amp;lt;?xml version="1.0" encoding="UTF8"?&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;!DOCTYPE synonym-def SYSTEM "../dtd/synonyms_file.dtd"&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;synonym-def&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;plugin&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"plug_in_B"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;synonym&lt;/span&gt; &lt;span class="na"&gt;key=&lt;/span&gt;&lt;span class="s"&gt;"images"&lt;/span&gt; &lt;span class="na"&gt;mapping=&lt;/span&gt;&lt;span class="s"&gt;"image_stack"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;/plugin&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/synonym-def&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Therefore, the application will still ask for data with both plug-ins the same way. But the in the case of the &lt;em&gt;plug-in B&lt;/em&gt; &lt;strong&gt;the keyword &lt;em&gt;images&lt;/em&gt; will be translated into &lt;em&gt;image_stack&lt;/em&gt;&lt;/strong&gt;. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Wed, 02 Sep 2015 08:16:24 -0000</pubDate><guid>https://sourceforge.net7897d2ef2f395defa26927038cb99ddfdbd48a0e</guid></item></channel></rss>