SPARQLMotion - XML Syntax

Version 0.1.0, June 01, 2010

Authors:
Holger Knublauch <holger@topquadrant.com>

Abstract

This document introduces an XML serialization for displaying and editing SPARQLMotion scripts.

Status of This Document

THIS SYNTAX HAS BEEN DEPRECATED AS OF TopBraid 3.6.2. Please embed SM into SWP instead.

Version 0.1.0 - Draft for 1.0 release together with TopBraid Suite 3.4

This document is part of the SPARQLMotion Specification.


Table of Contents

 

1 Introduction

SPARQLMotion is an RDF-based language for representing executable data processing pipelines. SPARQLMotion scripts are represented by RDF resources that are linked together using properties such as sm:next. Resources that are linked together this way form SPARQLMotion scripts. Since those scripts may generally form graph structures, a graphical notation with nodes and edges is a suitable visualization for SPARQLMotion.

However, in many cases, the graphical notation is an overkill that makes editing and understanding SM scripts more complex than it needs to be. Many people prefer to write scripts in a textual notation instead. The SPARQLMotion XML Syntax addresses this need.

The XML Syntax is only available for a sub-set of the overall SPARQLMotion language, called Linear SPARQLMotion (described in the following section).

 

2 Linear SPARQLMotion

While SPARQLMotion scripts may contain graph structures, in which every node can have multiple incoming and outgoing edges, Linear SPARQLMotion is a sub-set of those scripts that only follow a single execution thread, without branching. In particular, the following conditions must be met:

Furthermore, all nodes should be blank nodes because the URIs will not be preserved by the XML Syntax anyway. Finally, like all SPARQLMotion scripts, linear SM scripts must be acyclic.

 

3 SPARQLMotion XML Syntax

A SPARQLMotion script must be surrounded by an element <sparqlmotion>. Starting with the first element (that has no incoming sm:next links), all modules are represented by XML elements that have the qname of the module type as their tag name. The arguments are represented by XML attributes. Here is a simple example:

    <sparqlmotion>
    
        <sml:ImportRDFFromWorkspace sml:url="http://example.org/test" />
        
        <sml:ApplyTopSPIN />
        
        <!-- Send back a greeting --> 
        <sml:ReturnText sml:text="Hello, World!" />
    
    </sparqlmotion>

The script above represents three modules, with two sm:next relationships between them, from top to bottom. XML comments above a node are stored using rdfs:label at the commented module.

The SPARQLMotion XML Syntax has been intentionally aligned with the UISPIN XML Syntax, creating a single consistent way of representing scripts and user interface elements. It is also possible to embed UISPIN directly into modules of type sml:ReturnUISPINDocument and sml:CreateUISPINDocument under the sml:view element. SPARQL expressions and queries are represented in the same way as in UISPIN, and please have a look at the UISPIN documentation for examples.

Child scripts (such as the body of loops) are represented as child elements, with the property name as a separate element. For example:

    <sml:IterateOverSelect sml:selectQuery="{#
        SELECT ?change
        WHERE {
            ?change a teamwork:Change .
        } }">
        <sm:body>

            <smf:invoke sp:arg1="{= ?changeFunction }" sp:arg2="{= ?change }"/>

        </sm:body>
    </sml:IterateOverSelect>