Template talk:SMWDefaultMarkup

From Wikispooks
Jump to navigation Jump to search


The idea of this template, is to provide a one-size-fits-all chance to add markup to pages. This is in fact a rather questionable undertaking, since more markup means more computing needed to process it - so embedding intelligence in the semantic templates which are supposed to process the markup is probably a better bet.

Need for caution

This template is potentially problematic to the stability and predicability of SMW. In particular, statements of the form "If this page doesn't have property X, then give it property X" will put create problems by putting SMW into an infinite loop which it cannot spot - first adding property X and then removing it again - slowing down the processing of the SMW jobs queue and putting the semantic data involved into non-deterministic states.


Currently, it tags each page with the {{FULLPAGENAME}} variable, so easy to get from a template, but seems to be inaccessible from a semantic query. This is not actually used as yet, due to changes in how I decided to use the SMW data. Why then persist with this template? I think it is a useful adjunct to the existing options for inserting semantic data in pages. Some statements are not problematic (if X and Y exist, then add Z) and may simplify coding of semantic templates in future. Robin (talk) 09:00, 2 January 2014 (GMT)

I can see and understand the issues as set out but have no useful suggestions to make - yet. I'm happy for you to just press on with the whole SMW properties and templating work as you see fit because, from progress in the short period to date, it clearly has the potential to transform this site into something unique. If I have any concerns, I won't be slow to voice them; but as of right now - none. --Peter P (talk) 14:35, 2 January 2014 (GMT)

Why display properties?

These feel like a bit of a hack, quite expensive to create and cluttering up the property space somewhat, but prefixing them all "display_" they are easily ignored. Semantic MW is intended to be machine readable rather than human readable. However, I don't (yet) think they're too fancy since they are fairly simple to code (they are normal templates). Overall I feel they are are effective at circumventing lack of flexibility in SMW's post-processing. If there is a way to do without them, it would be worth knowing. For now, I'm happy as long as I don't find myself having to create endless amounts of them - which might be a sign of shortcomings in the underlying data model. Robin (talk) 11:30, 4 January 2014 (GMT)

I have noticed a marked increase in server CPU load recently. Server RAM is also pushing available limits much of the time. An obvious symptom, confirmed from server logs, is that I have also experienced server-forced connection resets several times. Whilst SMW is more server RAM/CPU demanding than plain old MW, I think this has mostly been connected to the intensive development work since most template edits result in the jobs queue being incremented by the number of uses of the template!! - I believe. I too am slightly bothered by potential loops in the SMW template processing. Example: I put the 'Description' in a standard page (The Power of Unreason this morning using 'SMWData' (I wanted it to show in the SMWDocs section of Conspiracy Theory which it now does OK. I then added 'SMWDocs' to The Power of Unreason and got a blank space where the table and header should have been so I removed it. Special:Properties again has multiple entries for most properties - we're up to 6 last I looked - though thankfully no more of the black gobbledegook ones. My guess is that this a circular processing issue but I haven't spent time trying to track it down. I think it probably best to let things settle down a bit before defining more properties and more Semantic templates. In any event, I have several permissions feelers out concerning use of book and web site extracts and hope to be concentrating on more solid content shortly. I'm particularly keen to get lots of stuff up on the genesis of WWI - it being the centenary of its outbreak in July and our esteemed PM being determined to use it for more Imperial pomp and circumstance and other bloody nonsense of that kind. --Peter P (talk) 13:24, 4 January 2014 (GMT)

flakiness explanation/thinking

I didn't notice exactly when the problems began, but some or all of the SMW template errors appear to be down to this template. Somewhat confusingly, this did appear to work as intended for a while. Or am I mistaken? I do remember thinking that the job queue could be depended upon to delay good code from showing perfect code showing perfect results. These templates now seem to be fairly reliably not working.

Does SMW warn somewhere not make the assignment of semantic properties conditional on other semantic properties? After a couple of days thrashing the semantic job queue, the difficult is pretty clear to me, hence the instruction to add this template after all other semantic markup is set. If the page model (as I originally thought) does in fact just visit the pages once and then finish the SMW assignment then the display properties won't work (assuming the semantic properties are set at the end of the page read rather than being done dynamically).

I wonder whether the SMW version upgrade is what changed this behaviour? If so, it ought to be explained somewhere - well, actually, the procedure would be worth documenting in any case. But I can't believe I'm the first person to have come up with display properties... unless there is a well documented alternative way to achieve the same end - which is actually quite possible, since I don't read documentation particularly well.

As far as a wishlish, I guess ideal behaviour of SMW would be to have a choice on whether properties could notice earlier properties of the page, with the default behavior being "yes", but having a PHP variable or script directive to change it and force either way. I wonder whether this has been suggested to the SMW guys... Robin (talk) 16:59, 11 February 2014 (GMT)

I think it would be best for you to put these queries to the SMW list yourself Robin. Yaron Koren is pretty prompt at answering solid techie issues. I'm not too bothered by the page lists update issue - yet - but I guess we do need to understand exactly what's happening. I'm more concerned about the actual data errors manifested when doing a refreshData. Also, I find myself spending an inordinate amount of time trying to understand what's going on when WP pages including display templates are imported but do not work properly - linked images are a case in point. It's one thing to try to maintain compatibility but quite another when doing so crowds out work on actual content. I'm reverting to separately importing any images I need to use - for now anyway. --Peter P (talk) 19:06, 11 February 2014 (GMT)