On 7/29/2013 10:38, ChilliPeppers wrote:
Hi All,
By default the order of nodes in a tree is alphabetical. Is there any
way to control this?
For example, is there any way in the swa:ClassTreeGadget to specify
the order for nodes in a tree for an SWA application?
Yes you can control this (and other things) via a custom
swa:TreeDataProvider. The ClassTreeGadget takes an argument
arg:classTreeDataProvider. You can clone one of the existing
TreeDataProviders and change its arg:treeChildrenTemplate so that instead of
SELECT ?node ?label ?leaf ?icon ?movable
WHERE {
?node rdfs:subClassOf ?parent .
FILTER ((isIRI(?node) && (?node != owl:Nothing)) && (?node !=
owl:NamedIndividual)) .
FILTER ((!bound(?filterFunction)) || spif:invoke(?filterFunction,
?node)) .
BIND (NOT EXISTS {
?child rdfs:subClassOf ?node .
} AS ?leaf) .
BIND (ui:label(?node) AS ?label) .
BIND ("swa-icon-class" AS ?icon) .
BIND ((!swa:isReadOnlyTriple(?node, rdfs:subClassOf, ?parent)) AS
?movable) .
}
ORDER BY (?label)
it would use
SELECT ?node ?label ?leaf ?icon ?movable
WHERE {
?node rdfs:subClassOf ?parent .
FILTER ((isIRI(?node) && (?node != owl:Nothing)) && (?node !=
owl:NamedIndividual)) .
FILTER ((!bound(?filterFunction)) || spif:invoke(?filterFunction,
?node)) .
BIND (NOT EXISTS {
?child rdfs:subClassOf ?node .
} AS ?leaf) .
BIND (ui:label(?node) AS ?label) .
BIND ("swa-icon-class" AS ?icon) .
BIND ((!swa:isReadOnlyTriple(?node, rdfs:subClassOf, ?parent)) AS
?movable) .
BIND (spl:object(?node, my:sortOrder) AS ?sortOrder) .
}
ORDER BY (?sortOrder)
In the end, the whole tree is based on SELECT queries and you can inject
your own SELECT query through the data providers.
HTH
Holger
I had thought of putting a "sortOrder" annotation property on my
classes that the TreeGadget could use to order the nodes, but can't
figure out how to apply it.
Thanks
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise
Vocabulary Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages 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
Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary
Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages 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 Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.