[13:15:03] raymond * r115668 /trunk/extensions/ (118 files in 117 dirs): Localisation updates from http://translatewiki.net. [15:30:59] howdy [15:32:34] hey [15:40:07] hi [15:40:19] Saruman: do you happen to know something about semantic mediawiki? :) [16:24:59] drobbins: i do [17:41:35] Saruman: cool [17:41:40] Saruman: mind if I ask you a few questions? [17:42:00] I am doing some stuff with semantic mediawiki at http://wiki.zenoss.org [17:42:13] click on "ZenPack Directory" and you'll see the semantic stuff. [17:42:47] I am trying to wrap my head around internal objects (vs. subobjects) [17:47:39] heh, then we are doing the same thing [18:04:14] internal objects as in the SIO extension? [18:10:31] yes [18:11:32] ok [18:11:43] I've used SIO before, but subobjects are new to me [18:11:49] I'm reading about it as we speak [18:13:07] re [18:16:21] what did I miss [18:17:52] hi [18:18:08] well, trying to figure all this stuff out [18:18:27] currenty trying to implement reviews. But I want to store reviews on user pages and then do an "ask" to display them on the zenpack page. [18:18:49] New patchset: Mwjames; "SRF jqPlot scatter plotting" [mediawiki/extensions/SemanticResultFormats] (master) - https://gerrit.wikimedia.org/r/20029 [18:22:04] so you want each review to be a set of properties, and retrieve those in a relevant place [18:23:51] yes [18:24:12] but properties on a subobject or internal object, since each review has a ZenPack(page), Rating(number), and Comment [18:24:23] and users should be able to review multiple ZenPacks. [18:24:28] right now I am not using SIO. [18:25:00] Core problem you face is that #ask returns a (set of) page(s), not simply sets of properties [18:25:29] wiki.zenoss.org/User:Daniel_Robbins [18:25:41] so if you #ask for reviews on ZenPack Foo, then the main result is a number of user pages [18:25:54] yes, and my properties are not being set as sub-objects/internal-objects at all. They are applied to the User page directly [18:26:00] extracting the right review from each user page may require some trickery [18:26:17] well for SIO, is each IO a page? I think it is. [18:26:23] yes it is [18:26:30] so maybe that is a way to go [18:26:39] so if you used SIO, every review would be a separate virtual page [18:26:44] that should work [18:26:51] that would be fine. [18:27:25] Subobjects are almost the same as SIO's, but I'm not totally clear on the last subtle differences [18:27:39] what gets confusing is all the templates all over the place. [18:27:46] it's easy to forget that they are just templates. [18:27:51] (at least for me) [18:28:09] once my brain wraps around all this, I am going to write some conceptual docs. [18:28:28] the SMW docs are very good for someone who sort of understands everything already :) [18:28:41] but better than most [18:30:54] I am starting to understand SIO [18:30:57] I should be able to get this working. [18:31:07] I have an example for you, interested? [18:31:17] sure [18:31:24] http://www.saruman.biz/janwiki/index.php/Test [18:31:39] in that wiki, I tried to create SIO's for tracks of an album [18:31:47] the TEst page queries for that album [18:31:57] only 1 page with SIOs created, though [18:33:09] hmmmm, the "records" test broke [18:33:34] I am thinking I need a new property of type Page called "Reviewer" [18:33:49] this will link the internal object page to the user page. [18:34:02] New patchset: Mwjames; "SRF jqPlot scatter chart" [mediawiki/extensions/SemanticResultFormats] (master) - https://gerrit.wikimedia.org/r/20029 [18:34:38] I can't follow that logic [18:34:52] a property of type Page essentially models a relation between two pages [18:35:10] yes, well the review needs to define who wrote the review. [18:35:18] I need to create a relation between the review and the reviewer [18:35:34] well the review is on the user page, right? [18:35:39] yes [18:35:46] but as a sub-object. [18:35:56] do I need a reviewer property or no? [18:35:59] so the first SIO for the review will be #1 [18:36:09] I don't think so [18:36:20] ok [18:36:38] question [18:36:57] what if I am going to have different types of SIOs on user pages? Will that create problems? [18:37:11] for example, reviews and then quotations (theoretical example) [18:37:33] in the recipe example, say I want to have ingredients and feedback. [18:37:35] should be no problem whatsoever [18:37:38] ok [18:37:41] and I can query for eacH? [18:38:15] you're going to do something like {{#set_internal:review|score=9|text=this is vewwy good}} [18:38:39] oh, add a prop for the ZenPack that's reviewed [18:38:46] yep [18:38:52] something like {{#set_internal:review|ZenPack=Foo|score=9|text=this is vewwy good}} [18:39:49] ok [18:39:56] and how might I query for all reviews then? [18:40:10] just looking into that [18:40:51] all reviews would simply be {{#ask: [[review::+]] }} [18:41:35] what about reviews for a particular ZenPack (to be displayed on that ZenPack's page) [18:42:08] {{#ask: [[review::+]] [[ZenPack={{FULLPAGENAME}]] }} ? [18:42:08] on the ZenPack page, the query would be something like {{#ask: [[review::+]] [[ZenPack::Foo]]}} [18:42:12] yep [18:42:15] cool [18:42:17] :) [18:42:19] will try it. [18:42:27] SMW usually is 8-D [18:42:31] and "review" needs to be a property of type page? [18:42:35] yes, SMW is nice. [18:42:57] New review: Mwjames; "The problem of the first draft data model has been resolved allowing to use the the first column con..." [mediawiki/extensions/SemanticResultFormats] (master); V: 1 C: 1; - https://gerrit.wikimedia.org/r/20029 [18:43:41] yah, and it's Property:review page defines the different subproperties [18:43:42] see http://www.saruman.biz/jan/Property:Album [18:44:24] each of the subproperties then also has it's own Property page, like Property:score [18:46:01] oh, question. [18:46:05] so construct the model for your reviews, define all subproperties, define the SIO property page, and then create reviews [18:46:13] for my query, what if I want to get the user who reviewed it? [18:46:30] well that'd be the page the review is located, right? [18:46:30] already did properties [18:46:34] yes [18:46:43] but on the zenpack page, I would want to display the user, along with their review. [18:46:55] user X gave it a 5, user Y gave it a 4, etc. [18:47:22] no prob [18:47:52] remember, {{#ask: [[review::+]] [[ZenPack={{FULLPAGENAME}]] }} returns all subobjects that actually concern the ZenPack [18:48:17] ok [18:48:20] so the #ask returns a set of (virtual) pages, and all you have to do is to add the subproperties you want in your printout [18:48:35] nicest to pipe these to a template which formats each review [18:48:53] so it will give me the user page too? [18:49:26] {{#ask: [[review::+]] [[ZenPack={{FULLPAGENAME}]] |?review=Reviewer|?score=Verdict|?text=Review}} [18:49:56] yah, because the SIO is basically of type Page, so it contains the link to the page where the SIO was set [18:51:47] good [18:54:00] Saruman: I don't get the "reviewer" stuff you have there. [18:54:12] I won't have a property called reviewer. Because I didn't define one or set it. [18:55:22] if you hint at ?review=Reviewer, that property is the SIO itself, called review, but I want to set the column name to Reviewer [18:56:29] ok [18:57:47] hrm, not working. [18:57:57] should it be ZenPack::{{FULLPAGENAME}} [18:58:02] even that is not working. [18:58:14] make it hardcoded ZenPack::Foo [18:58:34] magic words can be problematic [18:59:55] also, if you're to use SIO, you'll have to install it! [18:59:56] http://wiki.zenoss.org/Special:Version [19:00:15] oh excuse me [19:00:17] overlooked it [19:00:28] yes, installed [19:00:29] so [19:01:02] just asking for all reviews gives me links page to each page 'Daniel Robbins#1', etc. [19:01:15] see bottom of wiki.zenoss.org/Spamtest [19:01:57] that table is from my old query.... sorta works [19:05:04] ok, I have a working "all reviews" query on that page. [19:05:18] Just need to tweak it to see all reviews for a certain ZenPack [19:05:30] I've got it [19:05:36] allow me to edit SpamText [19:06:15] got it [19:06:18] reload it [19:06:23] it's there. [19:06:30] grrr wiki won't allow my edit [19:07:03] why not? [19:07:05] pasting a URL? [19:08:01] no, edit conflict [19:08:01] looks good [19:08:03] ah [19:08:03] save now workd [19:08:15] only tweak now is that ZenPacks are in the ZenPack: namespace :) [19:08:47] why? [19:09:15] they could be in the main namespace and have category ZenPack attached to them [19:09:26] SMW treats category as "class" [19:09:34] I am also using Category:ZenPack [19:09:46] the namespace choice was for a couple of reasons. [19:09:54] ok [19:10:13] first, everyone likes to add 'ZenPack' to the name of their ZenPack. it gets annoying. So now the URL is http://wiki.zenoss.org/ZenPack:OpenVZ [19:10:16] which is nicer. [19:10:40] second reason is that I can use CSS to style those pages differently if I want (and want to do this eventually) [19:10:42] if you pipe the #ask result to a template that prints a row in the table, then you can use ParserFunctions to remove ZenPack: from the resulting page name [19:11:23] making a mental note of that :) [19:11:25] I can recommend the VAriables extension [19:12:21] what does that do? [19:12:35] (reviews working btw, see http://wiki.zenoss.org/ZenPack:OpenVZ) [19:12:54] if in the template you use something like {{#vardefine:zenpackname|{{{2}}}}} and then perform parserfucntion wizardry on {{#var:zenpackname}} then you can eventually style your link [[{{{2}}}|{{#var:zenpackname}}]] [19:13:16] although you may also create a single spell without intermediate saving in a #var [19:13:33] ah ok [19:13:43] ok, so Variables isn't indispensible for your current needs [19:14:15] would I do that with __NOTITLE__ and then specify = {{#var:zenpackname}} = [19:14:30] a nice little optimization. [19:14:36] OK, gotta run. Thanks for your help, Saruman :) [19:14:36] what's __NOTITLE__? [19:14:39] np [19:14:45] New patchset: Mwjames; "SRF sparkline run/pass jshint compliance test" [mediawiki/extensions/SemanticResultFormats] (master) - https://gerrit.wikimedia.org/r/20471 [19:14:46] extension to drop the title of the page. [19:14:53] k! [19:15:01] you put it in wikitext, title goes away on page save. [19:15:07] bbl [19:16:44] New review: Mwjames; "nothing added just ensure jshint compliance, before SRF 1.8 release" [mediawiki/extensions/SemanticResultFormats] (master); V: 1 C: 2; - https://gerrit.wikimedia.org/r/20471 [19:16:45] Change merged: Mwjames; [mediawiki/extensions/SemanticResultFormats] (master) - https://gerrit.wikimedia.org/r/20471 [21:04:49] I am getting the wrong reviews :( [21:07:57] fixed :) [21:12:37] New patchset: Mwjames; "SRF jqPlot scatter chart" [mediawiki/extensions/SemanticResultFormats] (master) - https://gerrit.wikimedia.org/r/20029 [21:17:22] New patchset: Mwjames; "SRF jqPlot scatter chart" [mediawiki/extensions/SemanticResultFormats] (master) - https://gerrit.wikimedia.org/r/20029 [21:21:29] New patchset: Mwjames; "SRF jqPlot scatter chart" [mediawiki/extensions/SemanticResultFormats] (master) - https://gerrit.wikimedia.org/r/20029 [21:36:14] having a weird problem. [21:36:27] I am defining properties but I am not seeing them in the properties browser [21:37:10] maybe it's because I need to tweak LocalSettings.php to enable properties in my non-default namespace? [21:38:44] yep [21:40:35] enabled, doing data repair [22:30:02] New patchset: Mwjames; "SRF jqPlot scatter chart" [mediawiki/extensions/SemanticResultFormats] (master) - https://gerrit.wikimedia.org/r/20029 [23:11:03] ok, so I want to put a creation date on each review. Looks like each page only has a modification date property [23:13:53] New patchset: Mwjames; "SRF jqPlot scatter chart" [mediawiki/extensions/SemanticResultFormats] (master) - https://gerrit.wikimedia.org/r/20029 [23:20:55] wondering if I can use modification date [23:20:57] New review: Jeroen De Dauw; "Just in time to save me from the mad house :)" [mediawiki/extensions/SemanticResultFormats] (master); V: 1 C: 2; - https://gerrit.wikimedia.org/r/20029 [23:20:57] Change merged: Jeroen De Dauw; [mediawiki/extensions/SemanticResultFormats] (master) - https://gerrit.wikimedia.org/r/20029 [23:26:06] what I am thinking about is having the form insert a static "datetime.now()" when the review is added.