<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Macros vs. scripting in VPOET ∗</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Mariano Rico</string-name>
          <email>mariano.rico@uam.es</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>David Camacho</string-name>
          <email>david.camacho@uam.es</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Óscar Corcho</string-name>
          <email>ocorcho@fi.upm.es</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Computer Science Department, Universidad Autónoma de Madrid</institution>
          ,
          <country country="ES">Spain</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Ontology Engineering Group, Departamento de Inteligencia Artificial, Universidad Politécnica de Madrid</institution>
          ,
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We present our experience on the provision and use of macros for the management of semantic data in semantically-enabled web applications. Macros can be considered as a lightweight version of scripting languages, mostly oriented to end users instead of to developers. We have enabled the use of macros in a wiki-based application named VPOET, oriented to web designers, and have confirmed through evaluations that macros satisfy a wide audience.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>1 Introduction
http://ishtar.ii.uam.es/fortunata/servlet/VPoetRequestServlet?
action=renderOutput&amp;
designID=FOAFOutputConditionalGraphics&amp;
provider=mra68&amp;
source=http:/www.w3.org/People/Berners-Lee/card&amp;
indvID=http://www.w3.org/People/Berners-Lee/card#i</p>
      <p>
        Unlike other templates systems based on scripting languages (shown in next
section), VPOET provides web designers with simple macros to embed in the template
source code. A 20 min. tutorial 4 is enough to start creating templates. The
experimental evaluation [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] shows that web designers, in a wide skills range, from amateur
to professionals, are satisfied with these macros. We argue that macros is a well known
concept for web designers, while the current systems are oriented to developers.
2
      </p>
      <p>Scripting Templates. A Comparative Use Case
This section describes briefly some representative semantic web applications that
handle templates to present semantic data, such as semantic wikis, semantic browsers,
and semantic portals. We have selected one representative application or
infrastructure from each group: Semantic Media Wiki, Fresnel (used by the Longwell browser),
and Rhizomer (used by the Rhizomik portal) respectively.</p>
      <p>Semantic Media Wiki allows users create templates employing an ad hoc syntax
with parsing functions 5. The left part of table 2 shows the source code of a template 6,
and the right part of the figure shows the renderization of semantic data by using this
template. The creator of a template must know the wiki syntax, basics of programming,
and basics of ontology components.</p>
      <p>
        Fresnel [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] is a template infrastructure for semantic data, used by a faceted
semantic web browser named Longwell. However, as table 3 (top) shows, the Fresnel syntax 7
requires skills in semantic web technologies that severely limit the number of designers
available.
      </p>
      <p>
        Rhizomer [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] is an infrastructure to browse and edit semantic data. The
presentation of RDF data is achieved by means of Extensible Stylesheet Language
Transformations (XSLT). As one can see in table 3 (middle), web designers require additional
skills in XSLT programming.
      </p>
      <p>Table 1 summarizes the features of these templates and the competencies required
to the creators of templates for the semantic applications considered. The current
state of the art is oriented to developers with competencies in both Semantic Web
Technologies and Web Client technologies. Therefore, it does not provide web designers
with authoring tools to create attractive an reusable templates for semantic data. There
must be a balance between expressiveness, to address RDF features (e.g. multi-valued
properties, or properties with no value) and complexity, in order to reduce the required
level of competencies.</p>
      <p>4See http://ishtar.ii.uam.es/fortunata/Wiki.jsp?page=VPOETTutorial
5A template source code and usage example can be found at http://en.wikipedia.
org/wiki/Template:Infobox_Settlement</p>
      <p>6Edit page http://semanticweb.org/wiki/Template:Person to see the template
source code between &lt;includeonly&gt; and &lt;/includeonly&gt;. Note: the code previous to
this block shows an usage example.</p>
      <p>7See http://www.w3.org/2005/04/fresnel-info/manual/
guage</p>
    </sec>
    <sec id="sec-2">
      <title>Allows</title>
      <sec id="sec-2-1">
        <title>Images</title>
      </sec>
      <sec id="sec-2-2">
        <title>Template reusing</title>
      </sec>
      <sec id="sec-2-3">
        <title>Conditional rendering Yes</title>
      </sec>
      <sec id="sec-2-4">
        <title>Dynamics (Web 2.0) No</title>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Oriented to</title>
      <p>No
No</p>
    </sec>
    <sec id="sec-4">
      <title>Competencies</title>
      <sec id="sec-4-1">
        <title>Sem. Web Techs.</title>
      </sec>
      <sec id="sec-4-2">
        <title>Web Client Techs.</title>
      </sec>
      <sec id="sec-4-3">
        <title>Other</title>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Pros</title>
    </sec>
    <sec id="sec-6">
      <title>Cons</title>
      <p>Low
Low</p>
      <sec id="sec-6-1">
        <title>Wiki syntax</title>
      </sec>
      <sec id="sec-6-2">
        <title>Medium</title>
        <p>quirements</p>
      </sec>
      <sec id="sec-6-3">
        <title>Error syntax Yes Yes</title>
        <p>No
No
CSS</p>
      </sec>
      <sec id="sec-6-4">
        <title>High</title>
      </sec>
      <sec id="sec-6-5">
        <title>High</title>
      </sec>
      <sec id="sec-6-6">
        <title>High</title>
      </sec>
      <sec id="sec-6-7">
        <title>Programming Lan- Wiki syntax, OWL, Fresnel XSLT,</title>
      </sec>
      <sec id="sec-6-8">
        <title>Programming, ont., CSS</title>
      </sec>
      <sec id="sec-6-9">
        <title>HTML/CSS</title>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>Rhizomik</title>
      <p>OWL/XML
Yes
Yes
Yes
Yes</p>
      <sec id="sec-7-1">
        <title>XSLT</title>
      </sec>
      <sec id="sec-7-2">
        <title>Very high</title>
      </sec>
      <sec id="sec-7-3">
        <title>Very high</title>
      </sec>
      <sec id="sec-7-4">
        <title>XSLT</title>
      </sec>
      <sec id="sec-7-5">
        <title>HTML, CSS,</title>
      </sec>
      <sec id="sec-7-6">
        <title>Javascript, macros Yes Yes</title>
        <p>Yes
Yes
Low</p>
      </sec>
      <sec id="sec-7-7">
        <title>Low-Very high</title>
        <p>re- Pure OWL</p>
      </sec>
      <sec id="sec-7-8">
        <title>Generic solu- Low require</title>
        <p>tion
ments
prone Too complex for Too complex for
a web designer a web designer
{| cellspacing="0" cellpadding="5" style="position:relative; margin: 0 0 0.5em 1em;
border-collapse: collapse; border: 1px solid #aaa; background: #fff; float: right;
clear: right; width: 20em"
! colspan="2" style="background: #86ba0c; color: white" |&lt;span style="font-size: 80%;
float: right; "&gt;{{#ask: [[{{FULLPAGENAME}}]]</p>
      </sec>
      <sec id="sec-7-9">
        <title>Average pro- Semantic Web Semantic Web Web designers grammers developers + developers + + Macros</title>
        <p>| format=vcard
| ?Name
| ?Affiliation=organization
| ?Email
| ?Foaf:phone=workphone
| ?Homepage
| searchlabel=vCard
}}&lt;/span&gt; [[Name::{{{Name|{{PAGENAME}}}}}]]
|{{#ifeq:{{{Picture|}}}|||{{Tablelongrow|Value=[[Image:{{{Picture</p>
        <p>}}}|150px|{{{Name|{{PAGENAME}}}}}]]|Color=white}}}}
|{{#ifeq:{{{Email|}}}|||{{Tablelongrow|Value={{Mailbox|{{{Email</p>
        <p>}}}}}|Color=#e4f8b6}}}}
|{{#ifeq:{{{Affiliation|}}}|||{{Tablerow|Label=Affiliation:|</p>
        <p>Value=[[member of::affiliation::{{{Affiliation}}}]]}}}}
|{{#ifeq:{{{Homepage|}}}|||{{Tablerow|Label=Homepage:|</p>
        <p>Value=[[homepage::http://{{{Homepage}}}|{{{Homepage label|
{{{Homepage}}}}}}]]}}}}
|{{#ifeq:{{{Phone|}}}|||{{Tablerow|Label=Phone:</p>
        <p>|Value=[[foaf:phone::{{{Phone}}}]]}}}}
|&lt;!-- *** Events *** --&gt;
{{Tablelongrow|Align=Left|Font size=80%|</p>
        <p>Value={{#ask:[[has PC member::{{PAGENAME}}]]
| format=list
| sort=start date | order=desc
| sep=,_
| intro=PC member of:_ }}|Color=#e4f8b6}}
|{{Tablelongrow|Align=Left|Font size=80%|</p>
        <p>Value={{#ask:[[has OC member::{{PAGENAME}}]]
| format=list
| sort=start date | order=desc
| sep=,_
| intro=OC member of:_ }}|Color=#e4f8b6}}
|{{#ifeq:{{{FOAF|}}}|||{{Tablerow|Label=See also:|
Value=[[see also::{{{FOAF}}}|FOAF]]}}|Color=white}}
|}[[Category:Person]]
dering an example.
:foafGroup rdf:type fresnel:Group ;
fresnel:stylesheetLink &lt;http://www.example.org/example.css&gt; ;
fresnel:containerStyle "background-color: white;"</p>
        <p>^^fresnel:stylingInstructions ;
:foafPersonFormat rdf:type fresnel:Format ;
fresnel:classFormatDomain foaf:Person ;
fresnel:resourceStyle "background-color: gray;"</p>
        <p>^^fresnel:stylingInstructions ;
fresnel:group :foafGroup .
:nameFormat rdf:type fresnel:Format ;
fresnel:propertyFormatDomain foaf:name ;
fresnel:propertyStyle "border-top: solid black;"</p>
        <p>^^fresnel:stylingInstructions ;
fresnel:labelStyle "font-weight: bold;"</p>
        <p>^^fresnel:stylingInstructions ;
fresnel:group :foafGroup .
:urlFormat rdf:type fresnel:Format ;
fresnel:propertyFormatDomain foaf:homepage ;
fresnel:propertyFormatDomain foaf:mbox ;
fresnel:value fresnel:externalLink ;
fresnel:propertyStyle "border-top: solid black;"</p>
        <p>^^fresnel:stylingInstructions ;
fresnel:labelStyle "font-weight: bold;"</p>
        <p>^^fresnel:stylingInstructions ;
fresnel:group :foafGroup .
:depictFormat rdf:type fresnel:Format ;
fresnel:propertyFormatDomain foaf:depiction ;
fresnel:label fresnel:none ;
fresnel:value fresnel:image ;
fresnel:propertyStyle "border-top: solid black;"</p>
        <p>^^fresnel:stylingInstructions ;
fresnel:group :foafGroup .
&lt;table border="0" cellpadding="0" cellspacing="0"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img src="OmemoBaseURL/attach/Mra68Graphics/xample_body_esi.gif"&gt;&lt;/td&gt;
&lt;td background="OmemoBaseURL/attach/Mra68Graphics/xample_body_upper_pat.gif"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="OmemoBaseURL/attach/Mra68Graphics/xample_body_esd.gif"&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td background="OmemoBaseURL/attach/Mra68Graphics/</p>
        <p>xample_body_left_patt.gif"&gt;&lt;/td&gt;
&lt;td&gt;
&lt;table border="0" cellpadding="0" cellspacing="0"&gt;
&lt;tr&gt;&lt;td colspan=2&gt;OmemoConditionalVizFor(title, mra68,</p>
        <p>SimpleFOAFOutput.title)OmemoConditionalVizFor(name, mra68,</p>
        <p>SimpleFOAFOutput.name)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=2&gt;OmemoConditionalVizFor(givenname, mra68,</p>
        <p>SimpleFOAFOutput.givenname)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=2&gt;OmemoConditionalVizFor(family_name, mra68,</p>
        <p>SimpleFOAFOutput.family_name)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=2&gt;OmemoConditionalVizFor(homepage, mra68,</p>
        <p>SimpleFOAFOutput.homepage)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=2&gt;OmemoConditionalVizFor(depiction, mra68,</p>
        <p>SimpleFOAFOutput.depiction)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=2&gt;OmemoConditionalVizFor(knows, mra68,</p>
        <p>SimpleFOAFOutput.knows)&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;td background="OmemoBaseURL/attach/Mra68Graphics/</p>
        <p>xample_body_right_patt.gif"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="17" style="font-size: 2px"&gt;&lt;img src="OmemoBaseURL/</p>
        <p>attach/Mra68Graphics/xample_body_eii.gif"&gt; &lt;/td&gt;
&lt;td background="OmemoBaseURL/attach/Mra68Graphics/</p>
        <p>xample_body_bottom_pat.gif"&gt;&lt;/td&gt;
&lt;td width="17" style="font-size: 2px"&gt;&lt;img src="OmemoBaseURL/</p>
        <p>attach/Mra68Graphics/xample_body_eid.gif"&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
(bottom).</p>
        <p>VPOET reduces the requirements needed to create templates, lowering the
adoption barrier for web designers. VPOET “speaks”the web designers language, i.e. client
side languages such as HTML, CSS and javascript, not requiring competencies in
semantic web technologies or additional programming languages. Web designers use
simple macros (see table 4) embedded in the source code, with the additional benefit of
being capable of detecting errors in the macros in “development time”(checks in
every modification of the template) and in “runtime”(checks in every template usage).
The information about the structural components of a given ontology component are
provided to web designers by OMEMO8, another application that generates
simplified versions of a given ontology, specifically oriented to web designers. By reading the
information provided by OMEMO, web designers can know the sub-components of a
given ontology component, requiring only basics of semantic web technologies such as
class, property, value or relation.</p>
        <p>Table 3 (bottom) shows an example of VPOET template source code (left part),
and the rendering of that code inside a Google Page by using VPOET templates
in a Google Gadget named GG-VPOET 9. In this example one can see the macro
OmemoConditionalVizFor, which renders a given property only if the property has
a value. The rendering is transfered to a specified template, which uses the macro
OmemoGetP to render the property value. As properties use to be multi-valuated, a
mechanism based in PPS (pre-condition, post-condition, and sep-arator) has been added to
the macro OmemoGetP. For example, let us assume a semantic data source with
individuals having the property FOAF:depiction with values {url1, url2,..., urlN }. If a web
designer wants to create a VPOET template, like the one shown in bottom of table 3,
which renders multiple values of this property with HTMLcode like this:
&lt;img src=”url1”&gt;&lt;BR&gt;
....
&lt;img src=”urlN ”&gt;
she can use the conditional rendering provided by OmemoConditionalVizFor typing:
OmemoConditionalVizFor(urlprop, mra68, SimpleFOAFOutput.depiction)
8See http://ishtar.ii.uam.es/fortunata/Wiki.jsp?page=OMEMO
9See http://ishtar.ii.uam.es/fortunata/Wiki.jsp?page=VPOETGoogleGadget
which renders the property by means of the template SimpleFOAFOutput.depiction
(created by designer mra68). The code of the template uses OmemoGetP in its 3
arguments flavor OmemoGetP(pre, post, sep) to code the template like this:
OmemoGetP(&lt;img src=”,”&gt;,&lt;BR&gt;)</p>
        <p>Another common requirement are “nested properties”, e.g. displaying only FOAF:name
for FOAF:knows objects. This can be achieved by means of the macro OmemoGetP in its 5
arguments flavor OmemoGetP(relation, propPref, pre, post, sep. A simple
(multivalues separated by &lt;BR&gt;) codification could be:
OmemoGetP(knows, name„,&lt;BR&gt;)</p>
        <p>But, if additionally you want to associate a link to the value, you have to use the
macro OmemoGetLink. The final template code would be like this:
&lt;A href =”OmemoGetLink(knows)”&gt;OmemoGetP(knows, name„,&lt;BR&gt;) &lt;/A&gt;
This macro is replaced in runtime by a link capable of displaying ontology components
of the type pointed by the relation knows, i.e. a FOAF:Person. In the current
implementation, clicking the link would “change to a new page”, but it can be modified to
place the client code in a new DOM object in the same page by using AJAX.
3</p>
        <p>Conclusions and further work
Our experience in VPOET shows that, in the context of templates creation, macros
provides web designers with a friendly environment, requiring lower competencies than
other equivalent frameworks such as Semantic Media Wiki, Rhizomer, or Fresnel. An
additional advantage of VPOET templates is that these templates can be used easily
by other developers skilled in any programming language due to the simplicity of the</p>
      </sec>
      <sec id="sec-7-10">
        <title>HTTP messages involved.</title>
        <p>
          An initial small set of macros were obtained from the analysis of the semantic
templates in Semantic Media Wiki. The experiments [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] carried out with fifteen real
users confirmed that a that small number of macros satisfied the needs of most web
designers. These users suggested, by filling detailed questionnaires, new macros or
additional parameters for the existing ones.
        </p>
        <p>Our current work is focused on providing web designers with new features such as
creation of containers to handle individuals sets in a more attractive way. The current
implementation lists individuals in a simple sequence. Probably, this will require new
macros or modifications to the existing ones.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Rico</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Camacho</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , Corcho, Ó.:
          <article-title>VPOET: Using a Distributed Collaborative Platform for Semantic Web Applications</article-title>
          .
          <source>In proc. IDC2008. SCI 162</source>
          , pp.
          <fpage>167</fpage>
          -
          <lpage>176</lpage>
          . Springer (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Rico</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Macías</surname>
            ,
            <given-names>J.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Camacho</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , Corcho, Ó.:
          <article-title>Enabling Web Designers to Handle Semantic Data in Web Applications</article-title>
          . Submitted to Journal of Web Semantics (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Pietriga</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bizer</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Karger</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          :
          <article-title>Fresnel: A Browser-Independent Presentation Vocabulary for RDF</article-title>
          .
          <source>In proc. ISWC. LNCS 4273</source>
          , pp.
          <fpage>158Ű</fpage>
          -
          <lpage>171</lpage>
          . Springer (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>García</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gil</surname>
          </string-name>
          , R.:
          <article-title>Improving Human-Semantic Web Interaction: The Rhizomer Experience</article-title>
          .
          <source>In proc. SWAP'06. CEUR-WS 201</source>
          , pp.
          <fpage>57</fpage>
          -
          <lpage>64</lpage>
          . (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>