Thread:Semantic-mediawiki.org:Community portal/Recursively defining properties on SMW

I'm using SMW to create a course made out of several pages and would like to add something along the lines of a progress counter. Each wiki page has a property indicating which course it belongs to and a property indicating the preceding page.

With this idea, I thought it might actually be possible to recursively define the page number of each particular page belonging to a particular course. This is probably the fastest way to define page numbers without having to manually write in the page number for each page. The latter would definitely bring about a lot of work if I were to insert a page in say, between the first and second page.

However, the question is then, how do I implement this with SMW?

I was guessing I could define a page number variable which will then be SET in the template itself.

Would the set function actually work in this case (assuming this recursive method even works)? Or is there a more elegant method to accomplish the said task?