<!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>SPARQL Endpoints as Front-end for Multimedia Processing Algorithms</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ruben Verborgh</string-name>
          <email>ruben.verborgh@ugent.be</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Davy Van Deursen</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jos De Roo</string-name>
          <email>jos.deroo@agfa.be</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Erik Mannens</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Rik Van de Walle</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>ACA Moutstraat 100</institution>
          ,
          <addr-line>B-9000 Ghent</addr-line>
          ,
          <country country="BE">Belgium</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Agfa Healthcare</institution>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Ghent University</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>Multimedia processing algorithms in various domains often communicate with di erent proprietary protocols and representation formats, lacking a rigorous description. Furthermore, their capabilities and requirements are usually described by an informal textual description. While su cient for manual and batch execution, these descriptions lack the expressiveness to enable automated invocation. The discovery of relevant algorithms and automated information exchange between them is virtually impossible. This paper presents a mechanism for accessing algorithms as SPARQL endpoints, which provides a formal protocol and representation format. Additionally, we describe algorithms using OWL-S, enabling automated discovery and information exchange. As a result, these algorithms can be applied autonomously in varying contexts. We illustrate our approach by a use case in which algorithms are employed automatically to solve a complex multimedia annotation problem.</p>
      </abstract>
      <kwd-group>
        <kwd>multimedia processing</kwd>
        <kwd>N3Logic</kwd>
        <kwd>OWL-S</kwd>
        <kwd>Semantic Web</kwd>
        <kwd>SPARQL</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>In the last decade, the world has witnessed an unprecedented growth of
multimedia data production and consumption. In this context, metadata, which are
generally de ned as `data about data', play a crucial role. Metadata enable the
effective organization, access, and interpretation of multimedia content. Therefore,
they play an increasingly important role in bringing order to the growing amount
of available multimedia content. However, the lack of availability of many kinds
of metadata forms the main obstacle in many multimedia applications. For
professionals, metadata generation adds to the production cost because annotating
requires tedious manual work. Amateur producers do not possess the necessary
skills to provide metadata formally. Clearly, we need automated tools to assist
with this cumbersome task.
While automated feature extraction algorithms exist, they are prone to errors
and lack an intelligent view on the object under annotation. Currently, people
select the appropriate algorithms and parameters for a speci c problem and
initiate the process. As a result, manual intervention is required when a proposed
solution does not meet the requirements. This approach lacks actual
cooperation between di erent algorithms, which are unaware of their own abilities and
limitations.</p>
      <p>Suppose we have a series of photographs that need to be provided with a
textual description automatically. We dispose of the following multimedia
processing algorithm implementations:
{ description generation: creates a description based on image elements;
{ face detection: detects face regions in an image;
{ face recognition: recognizes a face in a region;
{ text recognition: translates bitmap text into a string.</p>
      <p>The above list encompasses all required algorithms to handle the task: we should
detect faces, recognize them, translate text, and nally generate a description
based on the found faces and text. While humans can nd and execute the
necessary steps for this task, an automated platform cannot, because:
(1) it does not know how to select algorithms;
(2) it cannot combine these algorithms into a solution plan;
(3) each algorithm has an informally speci ed format for input and output.</p>
      <p>Clearly, the rst problem arises because the algorithms lack a formal
description of their capabilities and requirements. A textual explanation of what the
algorithm performs, is insu cient to decide automatically whether it ts a
certain purpose. Problems 1 and 2 are closely related, since the creation of a plan
also involves a formal description of the desired solution. Based on this
description and that of the processing algorithms, an automated planner can devise a
solution plan.</p>
      <p>The third problem occurs because algorithms usually have a proprietary
interaction scheme. More speci cally, di erent algorithms use di erent ways to
specify input and output parameters. Further, these algorithms implement
different (standardized or proprietary) multimedia content description schemes to
provide their results. This makes it impossible to interact with these algorithms
automatically. In addition, the required parameters and the e ect of these
parameters are often described informally.</p>
      <p>In this paper, we address these shortcomings and aim to enable automated
algorithm discovery and execution. We propose RDF as input and output
representation format. We describe how to transform multimedia processing algorithms
into SPARQL endpoints to formalize their interaction. Therefore, we introduce a
query prototype suitable for algorithm invocations. We describe algorithm
capabilities and requirements using OWL-S, adding support for SPARQL groundings.
We zoom in on the expression of various relations between input and output,
introducing N3 expressions into OWL-S. Finally, we discuss how to create concrete
algorithm implementations as SPARQL endpoints, providing a number of
implementation details. These contributions pave the way for complex multimedia
processing scenarios.
2
2.1</p>
    </sec>
    <sec id="sec-2">
      <title>Algorithm Interaction</title>
      <sec id="sec-2-1">
        <title>Representation format</title>
        <p>The tasks performed by processing algorithms span a very wide range, so
nding a comprehensive interaction model poses a challenge. Input and output
parameters must be precisely speci ed, at the same time leaving room for new,
previously unused parameters. The algorithm interaction should be:
{ interoperable: enabling communication with various components,
regardless of low-level details such as operating system and programming language;
{ exible: handling a variety of inputs and outputs;
{ formal: able to communicate in a formal way with well-de ned semantics
so machines are able to interpret the information.</p>
        <p>
          The Resource Description Framework (RDF, [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]) is a data format tting the
above requirements well. More speci cally, RDF provides a means to represent
knowledge in a formal, machine-understandable way [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]. Further, vocabularies
and ontologies can be expressed with RDF Schema [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] and the Web Ontology
Language (OWL, [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ]), which are both built on top of RDF. We can de ne or
reuse ontologies for the input and output vocabulary of a speci c algorithm.
For instance, formalized versions of multimedia content description standards
(e.g., COMM representing a formal way to express MPEG-7 [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]) constitute one
possibility. Integrated semantics facilitate the automated interpretation and
exchangeability of results, countering the issues with proprietary formats.
2.2
        </p>
      </sec>
      <sec id="sec-2-2">
        <title>Communication protocol</title>
        <p>An algorithm communication protocol should meet these design requirements:
{ exible: able to specify variations on input and outputs;
{ distributed: provide access to algorithms located on di erent machines;
{ transparent: exhibit identical behavior, regardless of varying properties
such as physical location and technological di erences.</p>
        <p>
          The above requirements hint at a Service-Oriented Architecture (SOA, [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ]).
Therefore, we consider algorithms as Web services. A classic Web service
communication protocol choice is the Simple Object Access Protocol (SOAP, [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]).
However, this protocol is rather verbose and does not account for su cient
exibility: input and output parameters are passed in a rigid structure that does
not allow variations. Given the use of RDF and the de nition of algorithms
as information-generating entities, our approach is to implement algorithms as
SPARQL endpoints.
The SPARQL Protocol and RDF Query Language [
          <xref ref-type="bibr" rid="ref20 ref7">7, 20</xref>
          ] is used to retrieve
information from semantic data sources, traditionally static databases of RDF
content. However, an algorithm is essentially a data source, which does not
necessarily o er prede ned information, but rather creates new information in a
demand-driven way. By using SPARQL as Web service communication protocol,
we obtain the following features:
{ Web services can be invoked using formally de ned input and output
parameters;
{ the input and output is represented directly in RDF;
{ Web services wrapping multimedia algorithms can be seamlessly integrated
with other endpoints in the Semantic Web.
        </p>
        <p>There are clear advantages over using SPARQL endpoints instead of passing
RDF literals through classic technologies such as SOAP:
{ the overhead and verbosity of SOAP is absent;
{ the endpoint can check the presence of necessary parameters, as it is able
to parse and understand RDF. RDF literals, on the other hand, would be
treated as plain text and syntactic or semantic errors would go unnoticed.
Additionally, the cost of maintaining an endpoint is outweighed by the possibility
to do post-processing of the returned results directly in SPARQL:
{ selection of relevant output values;
{ structuring the output values to t the application format.</p>
        <p>In the next subsections, we present a number of querying techniques for
ondemand data sources such as multimedia processing algorithms.
Classic SPARQL queries The concept behind SPARQL is similar to that
of other query languages: to retrieve a speci c view on a larger data collection.
The query mechanism validates the data against the constraints in the WHERE
clause, conditioning the output. This aligns with the way we think about the
underlying RDF database: the WHERE clause is a lter that retains all triples
matching the speci ed template. A rst approach to query algorithms would be
the exact same way we query data sources.</p>
        <p>Suppose we have an algorithm mixing two colors. We begin by de ning formal
characteristics for the input and output parameters:
{ Input: a number of Color entities with a hasColorName property;
{ Output: a Color that has a hasColorName property, and a isMixOf
property with the list of input colors as value.</p>
        <p>If we want to ask the result of mixing red and yellow, we could invoke the
algorithm using the query in Listing 1. Note that we can choose SELECT queries (to
retrieve individual values) or CONSTRUCT queries (to retrieve an entire RDF graph).
PREFIX c: &lt;http://example.org/ontologies/Colors#&gt;
CONSTRUCT { ?color c:hasColorCode ?colorCode. }
WHERE {
c:Red a c:Color;</p>
        <p>c:hasColorCode "#FF0000".
c:Yellow a c:Color;</p>
        <p>c:hasColorCode "#FFFF00".
?color a c:Color;
c:hasColorCode ?colorCode;
c:isMixOf (c:Red c:Yellow).
}</p>
        <sec id="sec-2-2-1">
          <title>Listing 1. Color mixer invocation with classic SPARQL</title>
          <p>As opposed to querying data sources, invoking an algorithm is not as such
about ltering, but about retrieving the outputs of a process on the inputs.
Although it would be possible to build an algorithm this way, there are several
drawbacks to this approach:
{ missing indication that the query is an algorithm invocation;
{ unclear distinction between input and output in the WHERE clause;
{ conceptual mismatch by forcing the inputs into output conditions.
Clearly, we need a more advanced query which makes the invocation explicit,
while strictly adhering to the SPARQL standard.</p>
          <p>SPARQL queries with explicit invocation We consider the algorithm as
a virtual data source and refer to each invocation by a dedicated Request
entity. The input and output parameters of the invocation are are values of
the sr:input and sr:output properties. The inputs are generally threated as
known values; the outputs are usually unbound variables. Inside the SPARQL
query, we can refer to this entity and its associated properties. This enables us
to invoke an algorithm while keeping all the bene ts of a SPARQL query and
its declarativeness.</p>
          <p>The query in Listing 2 shows how this technique overcomes previous
weaknesses, clearly indicating the invocation, its parameters, and their direction.1</p>
          <p>The algorithm maintains an entity corresponding to the Request in the
WHERE clause, containing the same information as the entity in the query. The
algorithm executes its task on the entity input values; its computed output gets
bound to the entity output values. The resulting graph containing the Request
entity is subsequently queried in its entirety. We highlight the fact that this
Request entity is purely virtual: it is only accessible during the execution of
the query and remains invisible to other clients accessing the endpoint at the
same instant.
1 The ontology can be found at http://ninsuna.elis.ugent.be/ontologies/
arseco/sparqlrequest#
PREFIX c: &lt;http://example.org/ontologies/Colors#&gt;
PREFIX sr:</p>
          <p>&lt;http://ninsuna.elis.ugent.be/ontologies/arseco/sparqlrequest#&gt;
CONSTRUCT { :mixedColor c:hasColorCode ?colorCode. }
WHERE {
[a sr:Request;
sr:method "MixColor";
sr:input [a c:Color;
c:hasColorCode "#FF0000"],
[a c:Color;
c:hasColorCode "#FFFF00"];
sr:output [a c:Color;</p>
          <p>c:hasColorCode ?colorCode]]
}</p>
        </sec>
        <sec id="sec-2-2-2">
          <title>Listing 2. Algorithm invocation with a Request entity</title>
        </sec>
      </sec>
      <sec id="sec-2-3">
        <title>SPARQL queries with named parameters To generalize the query pro</title>
        <p>totype to a broader class of algorithms, it is necessary to provide parameter
identi cation for input and output. This is done by setting the value of the
input and output to a ParameterBinding entity, instead of solely the actual
value. An example is applying a mask to an image (Listing 3).</p>
        <p>For simplicity, the query can be abbreviated by removing parts of the WHERE
clause that are known in advance. A request will always have type Request, and
a parameter will always be of type ParameterBinding, so these statements can
be omitted. The method name is mostly unnecessary, because algorithms usually
have a single task that is consequently identi ed the moment they receives a
query. However, if a query is viewed out of its usual context, these items clarify
its intended meaning.</p>
        <p>
          SPARQL queries with complex parameters In case the input or
output parameters are complex, it is possible to specify either of them as
Notation3 (N3, [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]) strings, which are serialized representations of RDF graphs. They
may be required when the structure of the output RDF graph is unknown in
advance, making it impossible to reserve su cient variables for retrieval.
Furthermore, complex graphs { such as those containing rei ed statements { are
also better represented by N3 strings. The N3 speci cation has been extended
with this functionality by means of the log namespace.
        </p>
        <p>The query in Listing 4, segmenting an image, illustrates complex output. We
do not know beforehand how deeply the segments and thus the result graph will
be nested. Since SPARQL does not provide facilities to capture all descending
nodes, we SELECT an N3 string to store the result, which must be parsed
afterwards to obtain the corresponding RDF graph. For the sake of example, we also
supply the input parameter as an N3 string. N3 strings also o er the freedom
to return more expressive values. Consider an algorithm that recognizes words
PREFIX sr:</p>
        <p>&lt;http://ninsuna.elis.ugent.be/ontologies/arseco/sparqlrequest#&gt;
CONSTRUCT { &lt;source.jpg&gt; :hasMaskedImage ?maskedImage }
WHERE {
[a sr:Request;
sr:method "ApplyMask";
sr:input [a sr:ParameterBinding;
sr:bindsParameter "source";
sr:boundTo &lt;source.jpg&gt;],
[a sr:ParameterBinding;
sr:bindsParameter "mask";
sr:boundTo &lt;mask.jpg&gt;];
sr:output [a sr:ParameterBinding;
sr:bindsParameter "masked";
sr:boundTo ?maskedImage]]
}</p>
        <sec id="sec-2-3-1">
          <title>Listing 3. Algorithm invocation with named parameters</title>
          <p>in an audio fragment. In the strict case, the return value is ill-de ned when
uncertainty between two alternatives arises. RDF enables us to express this
uncertainty semantically as shown in Listing 5, where is stated that a certain audio
fragment contains the word \summer" or the word \sombre".
2.3</p>
        </sec>
      </sec>
      <sec id="sec-2-4">
        <title>Algorithm conversion</title>
        <p>Having de ned a formal model for invocations, we now direct our attention
to a conversion method from algorithm to SPARQL endpoint. When designing
an algorithm, an author arrives at a point where the output format must be
decided. Often, a proprietary format is created, accompanied by an informal
description. In this case, it would be convenient to choose RDF as underlying
data model since this gives access to an existing formal model, compliant with
other information in the Semantic Web. Should the author proceed with another
model { proprietary or standardized { then an adapter needs to be written to
convert the input and output into RDF.</p>
        <p>As such, algorithms communicate entirely using RDF. A SPARQL query
engine, surrounding the program, processes the virtual Request entity, turning
the algorithm into a SPARQL endpoint. This process is visualized in Fig. 1. The
RDF inputs are extracted from the query (1) and passed to the algorithm (2),
which generates RDF output (3). Input and output form the completed Request
entity (4). The query is executed on this entity (5), yielding the nal result. The
latter implies that SPARQL is not only used to simply pass input and output
parameters, but can also be used to apply formalized restrictions on input and
output parameters and the nal result.
PREFIX sr:</p>
        <p>&lt;http://ninsuna.elis.ugent.be/ontologies/arseco/sparqlrequest#&gt;
PREFIX log: &lt;http://www.w3.org/2000/10/swap/log#&gt;
SELECT ?segmentsN3
WHERE {
[a sr:Request;
sr:method "SegmentImage";
sr:input [a log:Formula;</p>
        <p>log:n3String "&lt;image.jpg&gt; a :Image."];
sr:output [a log:Formula;</p>
        <p>log:n3String ?segmentsN3]]
}</p>
        <sec id="sec-2-4-1">
          <title>Listing 4. Algorithm invocation with complex parameters</title>
          <p>@prefix e: &lt;http://eulersharp.sourceforge.net/2003/03swap/log-rules#&gt;.
({&lt;speech.wav#t=5.38,5.71&gt; :contains "summer".}
{&lt;speech.wav#t=5.38,5.71&gt; :contains "sombre".}) e:disjunction [a e:T].</p>
        </sec>
        <sec id="sec-2-4-2">
          <title>Listing 5. Expressing uncertainty in algorithm output</title>
          <p>3
3.1</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Capability and Requirements Description</title>
      <sec id="sec-3-1">
        <title>Description method</title>
        <p>
          Since SPARQL endpoints are in fact Web services, we can describe them as such.
A common RDF-compliant speci cation for semantic Web service descriptions
is OWL-S [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ], which consists of a three-part paradigm:
{ service pro le: a limited description of the service's capabilities and
requirements;
{ service model: service usage modalities and a more in-depth description
of its capabilities and requirements, suitable for service composition;
{ service grounding: technical details regarding communication with the
service.
        </p>
        <p>
          Other possibilities for service descriptions include WSMO [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ]. We chose OWL-S
because its de nition of the process model is more mature [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ], but the concepts
are transferable to WSMO. In the next subsections, we elucidate these di erent
parts through an example algorithm that recognizes a face in an image region:
{ input: a region which depicts a face;
{ output: the recognized face and the depicted person.
        </p>
        <p>This informal description leaves room for interpretation and should be
formalized. If the algorithm author already formalized the input and output
parameter model in RDF, we can copy this into the service description. However, it will
query</p>
        <p>5.
result
1.
4.</p>
        <p>request
input
output
2.
3.</p>
        <p>
          algorithm
often be more convenient to create the formal service description rst, deciding
which RDF classes to use for input and output, and then use this description
to implement the actual RDF parameters of the algorithm. This corresponds to
the design by contract methodology in software engineering [
          <xref ref-type="bibr" rid="ref18">18</xref>
          ].
3.2
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>Service pro le</title>
        <p>The pro le part is primarily meant for human reading or rendering purposes.
Therefore, it contains some basic information (useful for human interpretation),
reused from our model that we will de ne later on (Listing 6).
3.3</p>
      </sec>
      <sec id="sec-3-3">
        <title>Service model</title>
        <p>The model can be described as a process, containing detailed information about
all parameters. We will start with a basic description (Listing 7), extending it
as inadequacies come to light.</p>
        <p>Although this pro le seems correct on the surface, it does not convey all
intended semantics for a reliable description of a face recognition activity.
Consider an algorithm that, regardless of the input it receives, always returns the
exact same prede ned person in the PersonOutput parameter. This algorithm
does not recognize faces, yet it fully complies with the description of the example
above. Also, there is no guarantee whatsoever that the region in RegionInput
@prefix Process: &lt;http://www.daml.org/services/owl-s/1.1/Process.owl#&gt;.
:FaceRecognitionProcess a Process:AtomicProcess;</p>
        <p>Process:hasInput :RegionInput;
Process:hasOutput :FaceOutput;</p>
        <p>Process:hasOutput :PersonOutput.
:RegionInput a Process:Input;</p>
        <p>Process:parameterType "http://example.org/Images#Region".
:FaceOutput a Process:Output;</p>
        <p>Process:parameterType "http://example.org/Faces#Face".
:PersonOutput a Process:Output;</p>
        <p>Process:parameterType "http://example.org/Persons#Person".</p>
        <sec id="sec-3-3-1">
          <title>Listing 7. Basic algorithm process description</title>
          <p>actually contains a face; it could depict anything or nothing at all. This means
that even an actual face detection algorithm could fail to return a correct result.
To obtain a process description that ts the algorithm, we need to correct the
following problems:
{ the input is not guaranteed to contain a face</p>
          <p>
            ) the input constraints must be speci ed rigorously;
{ the face in the input is not necessarily that of the person in the output
) we require a semantic relation between input and output parameters.
We can capture these semantics by using preconditions and postconditions.
Preconditions OWL-S supports the use of preconditions to enforce input
constraints that go beyond RDF types. These conditions are typically expressed in
languages such as KIF [
            <xref ref-type="bibr" rid="ref9">9</xref>
            ] or SWRL [
            <xref ref-type="bibr" rid="ref12">12</xref>
            ]. We have opted to use N3 expressions,
which are very powerful due to the possibility of more sophisticated built-in
functions [
            <xref ref-type="bibr" rid="ref3">3</xref>
            ] and the existence of advanced reasoners such as Euler [
            <xref ref-type="bibr" rid="ref8">8</xref>
            ].
          </p>
          <p>Therefore, we needed to extend the Expression ontology to include support
for N3 expressions and conditions, resulting in the N3Expression ontology.2 Our
example description is supplemented with preconditions in Listing 8.</p>
          <p>Input and output parameters are referred to by parameter variables whose
name is the last segment of the parameter URI, lowercasing the rst letter. As
a result, the parameter variable ?regionInput refers to the parameter named
http://example.org/FaceDetection#RegionInput. In case of ambiguity, the
description document can provide parameter name aliases. This technique is
similar to that of SWRL variables in OWL-S. However, a rigorous mechanism that
links parameters to variable names should be created. This is left as future work.</p>
          <p>Also note the introduction of custom variables (face) in the precondition.
They are ordinary variables that remain bound in the postconditions, where they
can be used together with input and output variables.
2 http://ninsuna.elis.ugent.be/ontologies/arseco/n3expression#</p>
          <p>Listing 8. Algorithm process description preconditions
@prefix Process: &lt;http://www.daml.org/services/owl-s/1.1/Process.owl#&gt;.
@prefix Expression:</p>
          <p>&lt;http://www.daml.org/services/owl-s/1.1/generic/Expression.owl#&gt;.
@prefix N3Expression:</p>
          <p>&lt;http://ninsuna.elis.ugent.be/ontologies/arseco/n3expression#&gt;.
:FaceRecognitionProcess Process:hasResult :FaceRecognitionResult.
:FaceRecognitionResult a Process:Result;</p>
          <p>Process:hasEffect :FaceRecognitionEffect.
:FaceRecognitionEffect a N3Expression:N3-Expression;</p>
          <p>Expression:expressionBody
"?regionInput &lt;http://example.org/Images#regionDepicts&gt; ?faceOutput.
?faceOutput &lt;http://example.org/Faces#isFaceOf&gt; ?personOutput.".</p>
        </sec>
        <sec id="sec-3-3-2">
          <title>Listing 9. Algorithm process description postconditions</title>
          <p>Postconditions In a similar fashion, relations between input and output
parameters can be expressed in the N3 format. OWL-S terminology de nes
postconditions as e ects of a service result. It is possible to specify multiple results
that account for di erent cases, such as normal and erroneous execution. For
simplicity, we will limit the face recognition example to a single result and
effect. In Listing 9, we express that the region of the input contains the face of
the person in the output.
3.4</p>
        </sec>
      </sec>
      <sec id="sec-3-4">
        <title>Service grounding</title>
        <p>The remaining part of the algorithm description details its SPARQL endpoint
properties. To access a SPARQL endpoint, we need at least the following details:
{ the URL of the endpoint;
{ the SPARQL versions supported;
{ the supported query forms (e.g., CONSTRUCT, SELECT, ASK, or DESCRIBE).
service-description</p>
        <p>owl-s-sparql
SparqlService</p>
        <p>Service</p>
        <p>Service
Endpoint</p>
        <p>SparqlServiceGrounding</p>
        <p>ServiceGrounding</p>
        <p>WsdlGrounding</p>
        <p>
          Unfortunately, OWL-S only provides built-in support for Web Services
Description Language (WSDL, [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]) service groundings. At the moment of writing,
a draft by the W3C SPARQL Working Group on endpoint descriptions exists,
but it is not linked to the OWL-S ontologies [
          <xref ref-type="bibr" rid="ref23 ref24">23, 24</xref>
          ].
        </p>
        <p>An interesting approach is to create a service grounding, compatible with
OWL-S, linked to the SPARQL endpoint description. Our owl-s-sparql
ontology3 o ers this functionality by uniting the de nitions of service grounding
and SPARQL endpoint. Common grounding properties are provided by OWL-S.
SPARQL endpoint speci c properties are imported from the service
description ontology of the W3C draft. Properties that are currently missing, such as
supported SPARQL versions and query forms, are described in owl-s-sparql.
As depicted in Fig. 2, SparqlServiceGrounding is both a ServiceGrounding
(OWL-S) and an Endpoint (service description). A SparqlService is a Service
that has at least one SparqlServiceGrounding. Listing 10 shows a possible
grounding for the face detection algorithm.
3.5</p>
      </sec>
      <sec id="sec-3-5">
        <title>Service</title>
        <p>Finally, the three service parts need to be stitched together in an OWL-S service
construct (Listing 11). The user can choose to complement this description with
properties that facilitate human interpretation, such as textual descriptions.
3 http://ninsuna.elis.ugent.be/ontologies/arseco/owlssparql#</p>
        <sec id="sec-3-5-1">
          <title>Listing 11. Algorithm service description</title>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4 Implementation</title>
      <p>While algorithms can be developed independently, it is convenient to have a
software library to abstract common tasks. Two approaches are possible:
{ the wrapper approach, in which the algorithm is a standalone program,
invoked by a con gurable wrapper;
{ the toolkit approach, in which the algorithm directly uses the library for
tasks such as RDF parsing and SPARQL querying.</p>
      <p>The advantages of the former are that the algorithm does not need to be
altered, at the cost of customizing the wrapper su ciently. More importantly,
creating a con guration mechanism that accounts for all possible algorithm
interaction schemes is impossible, which is of course the main reason why we
introduced SPARQL endpoints. The toolkit approach requires adaptations to the
algorithm, improving performance but depending on the existance of an
interface between the employed programming language and the toolkit. In general,
the wrapper approach { where possible { proves best for existing algorithms
and the toolkit approach for algorithms in development, eliminating the need to
provide an intermediary communication format.</p>
      <p>
        We implemented toolkits in C++ and C#/.Net, as well as a standalone
command line version, to enable interaction with a great variety of programming
languages. As an example, we transformed two multimedia processing algorithms
into SPARQL endpoints: a face detection and a face recognition algorithm. The
face detection algorithm was built from scratch and is based on an
implementation of the Viola-Jones face detection algorithm [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ]. Hence, in this case, we used
the toolkit approach to enable SPARQL communication. For the face recognition
algorithm, we used an existing implementation developed by Verstockt et al. [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ],
which recognizes a face in a well-delineated region. Therefore, we applied the
wrapper approach for the face recognition algorithm in order to make the
algorithm accessible through SPARQL. Note that the face recognition algorithm
adheres to the example description of Section 3. Also note that both algorithms
can be deployed for the use case lined out in the introduction of this paper.
      </p>
      <p>Example output for the face detection and recognition algorithms is shown
in Listing 12 and Listing 13 respectively. Invoking the face detection algorithm
results in one found region depicting a face. The latter is used as input for the
face recognition algorithm, which subsequently results in the recognition of the
@prefix sr:</p>
      <p>&lt;http://ninsuna.elis.ugent.be/ontologies/arseco/sparqlrequest#&gt;.
@prefix img: &lt;http://example.org/Images#&gt;.
@prefix face: &lt;http://example.org/Faces#&gt;.
_:regionInput sr:bindsParameter "regionInput";</p>
      <p>sr:boundTo &lt;pict.jpg#xywh=45,121,51,51&gt;.
&lt;pict.jpg#xywh=45,121,51,51&gt; img:regionDepicts [a face:Face&gt;].</p>
      <p>Listing 12. Face detection algorithm example output
@prefix sr:</p>
      <p>&lt;http://ninsuna.elis.ugent.be/ontologies/arseco/sparqlrequest#&gt;.
@prefix dbpedia: &lt;http://dbpedia.org/resource/&gt;.
@prefix face: &lt;http://example.org/Faces#&gt;.
_:faceOutput sr:bindsParameter "faceOutput";</p>
      <p>sr:boundTo [face:isFaceOf dbpedia:Johnny_Depp].
_:personOutput sr:bindsParameter "personOutput";
sr:boundTo dbpedia:Johnny_Depp.</p>
      <p>Listing 13. Face recognition example output
face of the actor Johnny Depp. As one can see, multimedia processing algorithms
are not only accessed in a transparent and formalized way, they can also contain
pointers to other information available in the Semantic Web. This way, software
agents using these kind of endpoints can transparently query both static linked
open data sets and multimedia processing algorithms.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusions and Future Work</title>
      <p>The use of RDF as input and output representation format for algorithms
adds expressiveness with well-de ned semantics. By approaching algorithms as
SPARQL endpoints, we have a standardized protocol to access them, combined
with a exible query language to demand speci c information. This way, we can
employ algorithms transparently, regardless of low-level system properties.
Algorithm queries consist of classic SPARQL, yet indicating the fact that they are
invocations. OWL-S enables us to describe the capabilities and requirements of
algorithms rigorously, N3 expressions therein can relate input and output
parameters in various ways. An additional ontology lets us describe the SPARQL
grounding in OWL-S. We illustrated our approach with two example algorithms.</p>
      <p>An interesting direction for future research, is the composition of a plan to
solve complex solutions using algorithms. We also require a framework which
executes the plan and maintains state between invocations. Additionally, we must
elaborate some details such as variable identi cation in OWL-S descriptions.</p>
      <p>
        It is important that we will apply our approach to several larger multimedia
use cases. As outlined in the introduction, information-generating tasks such as
metadata annotation prove interesting. Applications such as multimedia
adaptation could bene t from service-based algorithms, as suggested in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Eventually,
we could extend the approach to general problem solving.
      </p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>The research activities as described in this paper were funded by Ghent
University, the Interdisciplinary Institute for Broadband Technology (IBBT), the
Institute for the Promotion of Innovation by Science and Technology in
Flanders (IWT), the Fund for Scienti c Research Flanders (FWO-Flanders), and the
European Union.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Arndt</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Troncy</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Staab</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hardman</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vacura</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          : COMM:
          <article-title>Designing a Well-Founded Multimedia Ontology for the Web</article-title>
          .
          <source>In: 6th International Semantic Web Conference (ISWC</source>
          <year>2007</year>
          ). Busan,
          <string-name>
            <surname>Korea</surname>
          </string-name>
          (November
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Berners-Lee</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Connolly</surname>
            ,
            <given-names>D.:</given-names>
          </string-name>
          <article-title>Notation3 (N3): A readable RDF syntax</article-title>
          .
          <source>W3C Recommendation (Jan</source>
          <year>2009</year>
          ), http://www.w3.org/TeamSubmission/n3/
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Berners-Lee</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Connolly</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kagal</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Scharf</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hendler</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>N3Logic: A logical framework for the World Wide Web</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          <volume>8</volume>
          (
          <issue>3</issue>
          ),
          <volume>249</volume>
          {
          <fpage>269</fpage>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Berners-Lee</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hendler</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lassila</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          :
          <article-title>The Semantic Web</article-title>
          .
          <source>Scienti c American</source>
          <volume>284</volume>
          (
          <issue>5</issue>
          ),
          <volume>34</volume>
          (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Brickley</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Guha</surname>
            ,
            <given-names>R.V.</given-names>
          </string-name>
          :
          <source>RDF vocabulary description language 1</source>
          .0:
          <string-name>
            <given-names>RDF</given-names>
            <surname>Schema. W3C Recommendation</surname>
          </string-name>
          (
          <year>Feb 2004</year>
          ), http://www.w3.org/TR/2004/RECrdf-schema-
          <volume>20040210</volume>
          /
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Christensen</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Curbera</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Greg</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weerawarana</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Web Services Description Language (WSDL) 1.1</article-title>
          .
          <string-name>
            <given-names>W3C</given-names>
            <surname>Member Submission</surname>
          </string-name>
          (
          <year>Mar 2001</year>
          ), http://www.w3.org/TR/wsdl
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Clark</surname>
            ,
            <given-names>K.G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Feigenbaum</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Torres</surname>
          </string-name>
          , E.:
          <article-title>SPARQL protocol for RDF</article-title>
          .
          <source>W3C Recommendation (Jan</source>
          <year>2008</year>
          ), http://www.w3.org/TR/rdf-sparql-protocol/
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>De Roo</surname>
          </string-name>
          , J.:
          <article-title>Euler proof mechanism</article-title>
          , http://eulersharp.sourceforge.net/
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Generereth</surname>
            ,
            <given-names>M.R.</given-names>
          </string-name>
          :
          <article-title>Knowledge Interchange Format</article-title>
          . Draft Proposed American National Standard, http://logic.stanford.edu/kif/dpans.html
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Geyter</surname>
            ,
            <given-names>M.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Soetens</surname>
            ,
            <given-names>P.:</given-names>
          </string-name>
          <article-title>A planning approach to media adaptation within the Semantic Web</article-title>
          .
          <source>In: Distributed Multimedia Systems</source>
          . pp.
          <volume>129</volume>
          {
          <issue>134</issue>
          (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Gudgin</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hadley</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mendelsohn</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Moreau</surname>
            ,
            <given-names>J.J.</given-names>
          </string-name>
          :
          <source>SOAP version 1</source>
          .
          <article-title>2 part 1: Messaging framework (second edition)</article-title>
          .
          <source>W3C Recommendation (Apr</source>
          <year>2007</year>
          ), http://www.w3.org/TR/2007/REC-soap12
          <string-name>
            <surname>-</surname>
          </string-name>
          part1-20070427/
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patel-Schneider</surname>
            ,
            <given-names>P.F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Boley</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tabet</surname>
            ,
            <given-names>S.:</given-names>
          </string-name>
          <article-title>SWRL: A Semantic Web Rule Language combining OWL and RuleML</article-title>
          . W3C Member Submission (May
          <year>2004</year>
          ), http://www.w3.org/Submission/SWRL/
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Klyne</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Carrol</surname>
            ,
            <given-names>J.J.: Resource</given-names>
          </string-name>
          <string-name>
            <surname>Description</surname>
          </string-name>
          <article-title>Framework (RDF): Concepts and abstract syntax</article-title>
          .
          <source>W3C Recommendation (Feb</source>
          <year>2004</year>
          ), http://www.w3.org/ TR/2004/REC-rdf-concepts-
          <volume>20040210</volume>
          /
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Lara</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Roman</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Polleres</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fensel</surname>
            ,
            <given-names>D.:</given-names>
          </string-name>
          <article-title>A conceptual comparison of WSMO and OWL-S. In: ECOWS 2004</article-title>
          .
          <article-title>LNCS</article-title>
          , vol.
          <volume>3250</volume>
          , pp.
          <volume>254</volume>
          {
          <fpage>269</fpage>
          . Springer (
          <year>2004</year>
          ), http://dx.doi.org/10.1007/978-3-
          <fpage>540</fpage>
          -30209-4_
          <fpage>19</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Lausen</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Polleres</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Roman</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Web Service Modeling Ontology (WSMO), howpublished = W3C Member Submission</article-title>
          , note = http://www.w3.org/ Submission/WSMO/, day = 3, month = jun,
          <source>year = 2005</source>
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Martin</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Burstein</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hobbs</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lassila</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          :
          <article-title>OWL-S: Semantic markup for web services</article-title>
          .
          <source>W3C Member Submission (Nov</source>
          <year>2004</year>
          ), http://www.w3.org/ Submission/OWL-S/
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>McGuinness</surname>
            ,
            <given-names>D.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>van Harmelen</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>OWL Web Ontology Language overview</article-title>
          .
          <source>W3C Recommendation (Feb</source>
          <year>2004</year>
          ), http://www.w3.org/TR/2004/REC-owlfeatures-
          <volume>20040210</volume>
          /
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18. Meyer, B.:
          <article-title>Applying "Design by Contract"</article-title>
          .
          <source>IEEE Computer</source>
          <volume>25</volume>
          (
          <issue>10</issue>
          ),
          <volume>40</volume>
          {
          <fpage>51</fpage>
          (
          <year>1992</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Perrey</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lycett</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <string-name>
            <surname>Service-Oriented Architecture</surname>
          </string-name>
          .
          <source>IEEE/IPSJ International Symposium on Applications and the Internet</source>
          Workshops p.
          <volume>116</volume>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>Prud'hommeaux</surname>
          </string-name>
          , E.,
          <string-name>
            <surname>Seaborne</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>SPARQL query language for RDF</article-title>
          .
          <source>W3C Recommendation (Jan</source>
          <year>2008</year>
          ), http://www.w3.org/TR/rdf-sparql-query/
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <surname>Verstockt</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Van Leuven</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , Van de Walle, R.,
          <string-name>
            <surname>Dermaut</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Torelle</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gevaert</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          :
          <article-title>Actor recognition for interactive querying and automatic annotation in digital video</article-title>
          .
          <source>In: IASTED International conference on Internet and Multimedia Systems and Applications</source>
          , 13th, Proceedings. pp.
          <volume>149</volume>
          {
          <fpage>155</fpage>
          . ACTA Press, Honolulu,
          <string-name>
            <surname>HI</surname>
          </string-name>
          , USA (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <surname>Viola</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jones</surname>
            ,
            <given-names>M.J.:</given-names>
          </string-name>
          <article-title>Robust real-time face detection</article-title>
          .
          <source>International Journal of Computer Vision</source>
          <volume>57</volume>
          (
          <issue>2</issue>
          ),
          <volume>137</volume>
          {154 (May
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <surname>Williams</surname>
            ,
            <given-names>T.G.</given-names>
          </string-name>
          :
          <article-title>SPARQL 1.1 service description</article-title>
          .
          <source>SPARQL Working Draft (Oct</source>
          <year>2009</year>
          ), http://www.w3.org/TR/2009/WD-sparql11
          <string-name>
            <surname>-</surname>
          </string-name>
          service-description-
          <volume>20091022</volume>
          /
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>Williams</surname>
            ,
            <given-names>T.G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mikhailov</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>SPARQL service description</article-title>
          . SPARQL Working Group (
          <year>2009</year>
          ), http://www.w3.org/2009/sparql/wiki/Feature:ServiceDescriptions
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>