On 22/11/2010 22:25, mo...@gmx.net wrote: > Hello everyone > > My goal is to automatically update the value of a specific property in an > article. > > A first idea was to use the SMWWriter-Extension (which needs the > PageObjectModel-Extension). The use of the smwwrite-action only led to an > error (Fatal error: Call to undefined method POMTemplate_SMWW::addParameter() > in C:SMWWriter.php on line 895).
This should not happen. Maybe Denny can comment on this. In general, SMWWriter ist the suggested way of addressing your problem. -- Markus > > My next idea was to simply receive the whole article, replace the part of the > affected variable and update the page with this new article contents. When I > try to receive the article data, I get kind of an unexpected content for me. > An example: I want to update the weight of a dog instance called “Tom”, i.e. > set the property HasWeightInKg from “20” to “25” I use the following > API-command to receive the article contents: > http://localhost/mediawiki/api.php?action=query&prop=revisions&titles=Tom&rvprop=content > . The content that is given back to me is (in XML-format): > ---------- > <?xml version="1.0"?> > <api> > <query> > <pages> > <page pageid="4322" ns="0" title="Tom"> > <revisions> > <rev xml:space="preserve">{{WeightTemplate > |Weight=20 > }} > This is a second simple test.</rev> > </revisions> > </page> > </pages> > </query> > </api> > ---------- > I was rather expecting the content to contain a string like > “[[HasWeightInKg:20]]”. I guess that updating the above content of the page > doesn’t have any effect on the actual semantic values of the page/instance, > does it? I am also missing other data, such as the category, to which the > page belongs (i.e. its class). Therefore, this also seems to be a dead end… > > => My question: Does someone know how to properly receive& update semantic > properties of a page by using the API? > > Kind regards, > Simon > > PS: I am also using the Jena TripleStore, where the properties also should be > updated. When I manually edit a page, this is done without problems. I am not > sure what I have to pay attention to when using the API... > > > > ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Semediawiki-devel mailing list Semediawiki-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-devel