<!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>NNexus Glasses A Drop-in Showcase for Wikification</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Deyan Ginev</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Computer Science, Jacobs University Bremen</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper describes a general drop-in approach for showcasing web services and web user interfaces, provided they are accessible through or realized via JavaScript and CSS. The author utilizes the Greasemonkey extension for Firefox to invade the client with user scripts, which load the desired new functionality, as if looking at the web through an enhanced pair of glasses. Such demos have so far typically required access and modifications to the production server of the target website. The approach is particularly valuable for mock-integration with closed, proprietary platforms and/or sites serving content under restrictive copyright licenses. A potential use case is to aid an “elevator pitch” to a company interested in MKM technologies, by supplementing it with a drop-in demo on their live system. To exemplify, the paper presents a case study of using the recent rewrite of the NNexus auto-linker for mathematical concepts to invade the closed web platforms of Zentrallblat Math and DLMF with wikification links.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Upon the creation of a new software suite, both in a research or industry setting,
come the challenges of marketing and adoption (or sales). It is common for
applications related to Mathematical Knowledge Management (MKM) to require
sophisticated software components (e.g. a variety of databases, web servers,
programming language environments and library dependencies), as well as a steep
learning curve to becoming an expert with the deployment and maintenance of
such systems. While user interfaces are commonly light-weight, in comparison
to backend code, they are just as commonly bundled together with said code.</p>
      <p>A very helpful exception to that rule are web user interfaces, which
communicate with their respective backends through HTTP, using e.g. the RESTful or
SOAP paradigms, achieving a loose coupling between the components. A modern
example of realizing loose coupling is using JavaScript to perform asynchronous
requests to the backend, following the AJAX paradigm [Gar05]. Ideally, this
class of interfaces allows a simple mechanism for inclusion, via adding a small
number of JavaScript “script” tags to the host website requesting the interface.</p>
      <p>However, while the high convenience of embedding such interfaces is a strong
point to promote adoption, it is not directly translatable in marketing the
interface. The chief problem is that most potential adopters are themselves large
and elaborate software platforms, running on mission-critical live servers, where
the risk of downtime and lack of stability outweighs the promise of adding
experimental features. This paper addresses how to invade such platforms with
“drop-in showcases” of web interfaces and/or web services, backed by a
successful case study of demonstrating the NNexus [Gin13b; Gin13a] system on the
Zentrallblat Math [Kar13] and DLMF [Nat13] platforms.
1.1</p>
      <sec id="sec-1-1">
        <title>NNexus</title>
        <p>As a minimal introduction, NNexus [GKX09] is an auto-linking (or
“wikification”) application for the PlanetMath.org [Pla13] online mathematics
encyclopedia. NNexus automates three problems related to the automatic wikification
of mathematical concepts. First, it crawls mathematical web resources,
currently PlanetMath.org, Wolfram MathWorld [Wei13], Wikipedia.org [Wik13] and
DLMF [Nat13], and automatically assembles an index of mathematical terms
defined within. At the time of writing, the NNexus index contains over 50,000
concepts, each a unique triple of natural language phrase, the definition’s URL and
a mathematical category (e.g. MSC [Msc] class). The second task is on-demand
“concept discovery”, whereby a longest-token matching algorithm mines for
previously indexed concepts inside a newly requested HTML source, followed by
a disambiguation algorithm that performs clustering and similarity analyses in
order to return a relevant subset of the discovered concepts. Finally, the third
task is one of annotation, e.g. embedding the discovered concepts as HTML links
(with optional RDFa), or providing a stand-off JSON annotation.</p>
        <p>As part of a comprehensive modernization effort, the NNexus 2.0 release
[Gin13a] underwent a full rewrite and redesign, as a production-ready,
standalone application. It is free, open source software, hosted on Github. In that
context, it was time to address both testing and showcasing on the main
potential adopter web sites – and while the author has direct access to deploy on
PlanetMath.org, that is not the case for any other site. Named NNexus Glasses
[Gin13b], the showcase was realized via creating a minimal user script, executed
by Firefox’s Greasemonkey [Gre] extension.
1.2</p>
      </sec>
      <sec id="sec-1-2">
        <title>Greasemonkey and User scripts</title>
        <p>User scripts are an internet phenomenon. Their most popular archive,
UserScript.org [Use] contains over 100,000 contributed scripts. From micro snippets
to elaborate frameworks, all written in JavaScript, they are a great way to use the
web programming paradigm in order to create, what can be seen as,
domainspecific web page plug-ins. All widespread browsers have native add-ons that
enable the inclusion of user scripts. The author used Firefox’s Greasemonkey,
while also available are Tampermonkey [Jan13] for Chrome, IE7Pro [Inn13] for
Internet Explorer, GreaseKit [KAT13] for Safari and other Webkit browsers. As
good guidelines for writing browser-independent JavaScript code now exist, it is
possible to write interoperable user scripts and execute them from one’s browser
of choice, with possibly minimal modifications.</p>
        <p>The main advantage over browser plug-ins, is that the JavaScript nature of
user scripts positions them on the same level as the web page, rather than on
the level of the browser’s menu and native code. Indeed some of the common
uses of user scripts is to extend or modify existing interfaces of web games, social
networking and video streaming sites, to name a few. One can imagine MKM
use cases for user scripts as well – e.g. modifying a page with including MathJaX
[Mat] to render its MathML on a legacy browser, or restyling its math content
using the STIX fonts [STI]. For our purpose, the result was a user script to invoke
the NNexus web service and style the returned results on any web address of
our choosing.
2</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>NNexus Glasses</title>
      <p>NNexus Glasses [Gin13b] is a tiny user script. Fifty lines of JavaScript white-list
the domains on which to enable the script; on page load, connect to the NNexus
showcase server [Gin13c], hosted at Jacobs University; and finally style the
results. What is even more impressive is the 3-click installation (load, confirm,
enable), once Greasemonkey is activated.
2.1</p>
      <sec id="sec-2-1">
        <title>Installation</title>
        <sec id="sec-2-1-1">
          <title>1. Install and enable Greasemonkey [Gre] in Firefox</title>
          <p>2. Click on the link to the NNexus Glasses user script [Gin13b]1.
3. Confirm installation, enable script.
4. Done! 2
To enjoy a demo, navigate to a page in the supported list of domains, notably
pages on Zentralblatt Math and DLMF.
2.2</p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>Demonstration</title>
        <p>To reiterate, if one was to market a product such as NNexus in a situation where
there were just a few minutes to convince an executive of its value, using a user
script could achieve an operational demo on their live system in a matter of a
couple of minutes.</p>
        <p>We present two such showcases of NNexus, invading the web sites of
Zentralblatt Math, from Fig. 1 to Fig. 2, and the Digital Library of Mathematical
Functions (DLMF), from Fig. 3 to Fig. 4. These screenshots were created with
the author’s local machine, without the knowledge or assistance of the two
organizations, as the effect was achieved by simply enabling the NNexus Glasses
user script and refreshing the web page.
1 In case Firefox is not the default browser, “click” is a shorthand for “open in Firefox”
here.
2 One should always double-check both Greasemonkey and NNexus Glasses are
enabled.
2.3</p>
      </sec>
      <sec id="sec-2-3">
        <title>A Primer on Linking</title>
        <p>In Fig. 2 and Fig. 4, one can notice an array of additional links superimposed on
top of the original Fig. 1 and Fig. 3. Each link points to one or more definitions
of the mathematical concept identified by NNexus. The NNexus web service has
two flavors of links it can embed in HTML pages – classic single links (shown in
light brown) and “multi-links” (shown in orange). It distinguishes between the
two via HTML class attributes, which applications can style and adapt to their
needs. In this showcase, the CSS styling is specified within the NNexus Glasses
user script.
2.4</p>
      </sec>
      <sec id="sec-2-4">
        <title>Multi-links</title>
        <p>An interesting annotation case is the embedding and presentation of concepts
that have multiple definitions – a situation that we encounter when the same
concept is defined in several domains (e.g. both PlanetMath.org and DLMF).
Our current solution for presenting such “multi-links” to the user is to show
a differently styled HTML anchor, with a simple onclick event that expands it
into a number of concrete links. To make serving several links visually appealing,
NNexus uses the icon image of the domain in which a concept is defined as an
anchor for each specific link. An example of a multi-link can be seen in
Listing 1.1. It is worth mentioning that this interface is very openly experimental,
as the author is still collecting user feedback – multi-links have become
available only with the current reimplementation of NNexus, and they are a young
feature that is still in development. The solution presented in this paper is an
early approximation, which so far seems sufficiently acceptable for the drop-in
showcases.</p>
        <sec id="sec-2-4-1">
          <title>Listing 1.1. A NNexus Multi-link</title>
          <p>&lt;a c l a s s=" nnexus_concepts " href=" j a v a s c r i p t : v o i d ( 0 ) "
onclick=" t h i s . n e x t S i b l i n g . s t y l e . d i s p l a y =’ i n l i n e ’ "&gt;
B e s s e l f u n c t i o n s
&lt;/a&gt;
&lt;sup s t y l e=" d i s p l a y : ␣ none ; "&gt;
&lt;a c l a s s=" nnexus_concept "</p>
          <p>href=" h t t p : / / dlmf . n i s t . gov / 1 0 . 1 "&gt;
&lt;img src=" h t t p : / / dlmf . n i s t . gov / s t y l e /DLMF−16. png "
a l t=" Dlmf "&gt;
&lt;/a&gt;
&lt;a c l a s s=" nnexus_concept "</p>
          <p>href=" h t t p : / / planetmath . o r g / b e s s e l s e q u a t i o n "&gt;
&lt;img src=" h t t p : / / planetmath . o r g / fab −f a v i c o n . i c o "
a l t=" Planetmath "&gt;
&lt;/a&gt;
&lt;/sup&gt;
This paper presented a purely client-side approach for creating “drop-in
showcases” on potentially proprietary, live web systems, for the purposes of pitching
a demo of a web service or web user interface. The method is applicable for
any application which is accessible through, or implemented in, JavaScript and
CSS, as it leverages the power of user scripts and potentially the AJAX [Gar05]
communication paradigm.</p>
          <p>The presented use case invades two live systems with wikification, or
autolinking, of mathematical concepts, realized via a user script communicating with
a NNexus web service. An experimental interface for presenting and interacting
with NNexus “multi-links” is also described.</p>
          <p>While NNexus Glasses is considered a complete solution to the showcasing
problem, interesting future work remains to be done for the NNexus user
interface. There are plans to make the degree of linking customizable by the user –
once the algorithm has “concept relevance” quantified in terms of probabilities,
one can adjust a cut-off threshold for displaying or hiding a concept link. This is
useful, as expert users would be interested in only the most relevant links, while
novices could benefit from having as many links as possible in order to easily
jump to supporting definitions.
[STI]</p>
          <p>National Institute of Standards and Technology (NIST), ed. Digital
Library of Mathematical Functions. May 12, 2013.
url: http://dlmf.nist.gov.</p>
          <p>STI Pub Consortium. STIX Fonts Version 1.1.
url: http://www.stixfonts.org (visited on [visited on 05/12/2013]).
Wikimedia Foundation, Inc., ed. Wikipedia.org. the free encyclopedia.
May 12, 2013.
url: http://wikipedia.org.</p>
        </sec>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [Gar05]
          <article-title>Jesse James Garrett</article-title>
          .
          <article-title>Ajax: A new approach to web applications</article-title>
          .
          <source>Tech. rep. Adaptive Path, Feb. 18</source>
          ,
          <year>2005</year>
          . url: http://adaptivepath.com/publications/essays/archives/ 000385.php.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [Gin13a] Deyan Ginev, ed.
          <source>NNexus 2</source>
          .0.
          <article-title>Auto-linking for mathematical concepts for PlanetMath.org, Wikipedia, and beyond</article-title>
          .
          <source>May 12</source>
          ,
          <year>2013</year>
          . url: https://github.com/dginev/nnexus.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [Gin13b] Deyan Ginev, ed.
          <source>NNexus Glasses</source>
          .
          <article-title>Greasemonkey user script for a NNexus showcase</article-title>
          .
          <source>May 12</source>
          ,
          <year>2013</year>
          . url: https://github.com/dginev/nnexus/raw/master/util/ nnexus_glasses.user.js.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [Gin13c] Deyan Ginev, ed.
          <source>NNexus Showcase Server. May 12</source>
          ,
          <year>2013</year>
          . url: http://nnexus.mathweb.org.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [GKX09]
          <article-title>James Gardner, Aaron Krowne, and Li Xiong. “NNexus: an automatic linker for collaborative web-based corpora”</article-title>
          .
          <source>In: Proceedings of the 12th International Conference on Extending Database Technology: Advances in Database Technology. EDBT '09</source>
          .
          <string-name>
            <surname>Saint</surname>
            <given-names>Petersburg</given-names>
          </string-name>
          ,
          <source>Russia: ACM</source>
          ,
          <year>2009</year>
          , pp.
          <fpage>1152</fpage>
          -
          <lpage>1155</lpage>
          . isbn:
          <fpage>978</fpage>
          -1-
          <fpage>60558</fpage>
          -422-5. doi: http://doi.acm.
          <source>org/10</source>
          .1145/1516360.1516501. url: http://doi.acm.
          <source>org/10</source>
          .1145/1516360.1516501.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <source>[Gre] Greasemonkey Project. May 12</source>
          ,
          <year>2013</year>
          . url: http://greasespot.net/.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [Kar13] FIZ Karlsruhe, ed.
          <source>Zentralblatt MATH. May 12</source>
          ,
          <year>2013</year>
          . url: http://zentralblatt-math.org/zmath/.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [Mat] MathJax: Beautiful Math in all Browsers. url: http://mathjax.com (visited
          <source>on [visited on 05/12</source>
          /2013]).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <source>[Msc] Mathematics Subject Classification MSC2010</source>
          .
          <year>2010</year>
          . url: http://msc2010.org (visited
          <source>on [visited on 11/16</source>
          /2011]).
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [Pla13] Ltd. PlanetMath.org, ed. PlanetMath.org.
          <article-title>math for the people, by the people</article-title>
          .
          <source>May 12</source>
          ,
          <year>2013</year>
          . url: http://planetmath.org.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [Use] UserScripts.org.
          <source>May 12</source>
          ,
          <year>2013</year>
          . url: http://userscripts.org/.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [Wei13] Eric W. Weisstein, ed.
          <source>Wolfram MathWorld</source>
          .
          <article-title>the web's most extensive mathematics resource</article-title>
          .
          <source>Wolfram Research. May 12</source>
          ,
          <year>2013</year>
          . url: http://wikipedia.org.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [Inn13] Innoshock, ed.
          <source>IE7Pro Project. May 12</source>
          ,
          <year>2013</year>
          . url: http://ie7pro.com/.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [Jan13] Jan Biniok, ed.
          <source>Tampermonkey Project. May 12</source>
          ,
          <year>2013</year>
          . url: http://tampermonkey.net/.
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [KAT13] KATO Kazuyoshi, ed. GreaseKit.
          <article-title>User Scripting for all WebKit applications</article-title>
          .
          <source>May</source>
          <volume>12</volume>
          ,
          <year>2013</year>
          . url: http://8-p.info/greasekit/.
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>[Wik13]</mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>