W3C home > Mailing lists > Public > xproc-dev@w3.org > April 2009

XProc and SMIL, Orchestrating Pipeline Steps

From: Philip Fennell <philip.fennell@gmail.com>
Date: Fri, 24 Apr 2009 14:49:45 +0100
Message-ID: <de7ce88b0904240649q29a790eej3ed92f25e251efd9@mail.gmail.com>
To: "xproc-dev@w3.org" <xproc-dev@w3.org>
As a result of the recent discussion around parallel step execution,
workflow orchestration and the like I had an idea about how you could
implement pipeline step timing and synchronization (orchestration)
without adding complexity to the existing XProc Recommendation. How
about using SMIL Timesheets <http://www.w3.org/TR/timesheets/>. For
those not familiar with them, they are a way to separate SMIL
Animation behaviours from the content they act upon.

Included below is an example, abridged so that you can just
concentrate upon the timing and synchronization parts, that instructs
a compliant XProc processor to execute the three terms:get steps in
parallel but only once the 'aggregate-terms' step has begun. Also note
that the three steps have a duration of 11 seconds so that there is,
in effect, a time-out on the requests. There are other possibilities
too for using time offsets and delays as well as repeats so that
pipelines can run steps periodically and trigger other steps upon
completion either straight away or some time later. You could even
programmatically dispatch events from outside the pipeline that would
trigger the active phases of steps.

I don't think it is as far-fetched as it looks but I'm sure there are
subtleties underneath that are just waiting to rise-up and bite!

I'm working on a blog post about this for O'Reilly but wanted to run
it past you people first to see what you thought before I go shooting
my mouth off about it.

Any feedback good or bad would be appreciated.


Regards

Philip Fennell



<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step
		xmlns:p="http://www.w3.org/ns/xproc"
		xmlns:smil="http://www.w3.org/ns/SMIL30"
		xmlns:terms="http://example.org/service/terms/"
		xmlns:xs="http://www.w3.org/2001/XMLSchema"
		name="TermAggregation">
	
	<smil:timesheet>
		<smil:par>
			<smil:item select="#service1" begin="aggregate-terms.begin" dur="11s"/>
			<smil:item select="#service2" begin="aggregate-terms.begin" dur="11s"/>
			<smil:item select="#service3" begin="aggregate-terms.begin" dur="11s"/>
		</smil:par>
	</smil:timesheet>
	
	<p:input port="source"/>
	<p:output port="result" sequence="true"/>
	
	<p:declare-step type="terms:get">
		<p:input port="source"/>
		<p:output port="result" sequence="true"/>
		
		<p:option name="href"/>
		
		<!-- Omitted for brevity's sake, but it would use p:http-request
			 to submit the text that you want terms to be extract from. -->
	</p:declare-step>
	
	<terms:get xml:id="service1" name="OpenCalais"
href="http://opencalais.com/..."/>
	<terms:get xml:id="service2" name="MetaCarta"
href="http://www.metacarta.com/..."/>
	<terms:get xml:id="service3" name="Yahoo"
href="http://search.yahooapis.com/..."/>
	
	<p:identity name="result-wrapper">
		<p:input port="source">
			<p:inline>
				<terms:group/>
			</p:inline>
		</p:input>
	</p:identity>
	
	<p:insert xml:id="aggregate-terms" match="/terms:group" position="last-child">
		<p:input port="source"/>
		
		<p:input port="insertion">
			<p:pipe step="OpenCalais" port="result"/>
			<p:pipe step="MetaCarta" port="result"/>
			<p:pipe step="Yahoo" port="result"/>
		</p:input>
	</p:insert>
	
</p:declare-step>
Received on Friday, 24 April 2009 13:50:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 24 April 2009 13:50:45 GMT