I have an iterateOverSelect where I'm querying for the children of the
selectedResource.
I'm going to be creating a new composite:index for each child and
have calculated my ?startCompositeIndex to be one less than that of
the selectedResource.
SELECT ?child ?selectedResource ?srIndex ?startCompositeIndex
WHERE {
?child skos:broader ?selectedResource .
?selectedResource composite:index ?srIndex .
LET (?startCompositeIndex := (smf:cast(?srIndex, xsd:float) -
1)) .
}
I want to iterate over the above results and insert a new
composite:index for each ?child (I've previously deleted the child's
index).
I want the first child's index to be the same as the parent's and then
increment by 1 for each child
thereafter. (I will be deleting the parent node later and "promoting"
the children)
INSERT INTO <http://tb-session>
{
?child composite:index ?newCompositeIndex .
}
WHERE
{
?child skos:broader ?selectedResource
LET (?newCompositeIndex := (smf:cast(?startCompositeIndex, xsd:float)
+ 1)) .
}
After the insert, I reset my ?startCompositeIndex to the ?
newCompositeIndex and I want
to "repeat the loop".
SELECT ?startCompositeIndex
WHERE {
LET (?startCompositeIndex := smf:cast(?newCompositeIndex,
xsd:float)) .
}.
The composite:index is being set correctly for the
first child but never increments ... all children have the same
composite:index.
The above is only 3 modules (IterateOverSelect, Update, BindBySelect)
with the body including the last 2 ... correct?
I'm definitely missing something and hoping you can point out my
error.
Barb
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TopBraid Composer Users" group.
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-composer-users?hl=en
-~----------~----~----~----~------~----~------~--~---