Yeah, this is rather advanced stuff. Let me see if I can walk you through some
ideas used in the yuml solution.
<ui:group>
<yuml:CollectSuperClasses arg:class="{= ?class }"/>
<yuml:CollectAssociations/>
<yuml:CollectAttributes/>
<yuml:ConcatClassesAndAttributes/>
<yuml:ConcatGeneralizations/>
<yuml:ConcatAssociations/>
<ui:group let:text="{#
SELECT ?text
WHERE {
GRAPH ui:tempGraph {
yuml:Subject yuml:text ?text .
} .
} }">
<img src="{=
fn:concat("http://yuml.me/diagram/dir:td/class/", ?text) }"/>
</ui:group>
</ui:group>
The surrounding ui:group doesn't do any output, just organizes the children
into order. The child elements yuml:... are executed from top to bottom, and
also don't create any XML output. They just update the ui:tempGraph. In this
particular case I need to prepare some helper structures to collect
superclasses and associations from multiple sources. Then, the code is building
a long string for the Http request. This is done using yuml:Concat, which has
the following prototype:
<ui:update ui:updateQuery="{!
DELETE {
GRAPH ui:tempGraph {
yuml:Subject yuml:text ?old .
}
}
INSERT {
GRAPH ui:tempGraph {
yuml:Subject yuml:text ?new .
}
}
WHERE {
GRAPH ui:tempGraph {
OPTIONAL {
yuml:Subject yuml:text ?old .
} .
} .
BIND (fn:concat(COALESCE(?old, ""), ?text) AS ?new) .
} }"/>
This basically replaces a given triple with the old value concatenated with a
new ?text. Since the order of execution in SWP is always top-down, this is like
programming in an imperative stateful language. The ui:tempGraph is discarded
after the function has finished, but it's global throughout the execution of
the SWP engine.
Not sure if this helps, but you have set yourself a rather challenging goal, so
I believe it may require a complex solution as well.
Holger
On Apr 5, 2011, at 1:43 AM, Peter Ward wrote:
> Or perhaps I should just learn the spr functions and build up what I need
> with the ui:commaSeperatedList and similar aggregators?
> I must admit, this is getting a bit esoteric.
>
> Peter
>
> --
> You received this message because you are subscribed to the Google
> Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
> TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> To post to this group, send email to
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/topbraid-users?hl=en
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en