Many Thanks Jeroen! Indeed, that solved it (continuing with more similar error though :P )
And well, the ::makePage was actually found on the deprecated list [1] I saw now ... always something :) // Samuel [1] http://semantic-mediawiki.org/doc/deprecated.html On 07/30/2011 02:29 AM, Jeroen De Dauw wrote: > Hey, > > I think the solution is as simple as calling getDataItem on your > SMWWikiPageValue before passing it along. I guess we might need to docs > somewhere on the DV/DI changes in SMW 1.6, because right now Markus and > I are probably the only people that have a good idea of what changed. > TodoListSize++; > > Cheers > > -- > Jeroen De Dauw > http://www.bn2vs.com > Don't panic. Don't be evil. > -- > > > On 30 July 2011 02:18, Samuel Lampa <samuel.lamp...@rilnet.com > <mailto:samuel.lamp...@rilnet.com>> wrote: > > Hi, > > I got a reported bug (per mail) with the initSMWWriter function in > the PageHandler class in RDFIO [1] (For complete code, see: [2]), > which seem to be due to some API changes in SMW, for which I'd need > some guidance. > > When trying to import the test data (from the "paste test data > link") on the Special:RDFImport page, one gets: > > Catchable fatal error: Argument 1 passed to > SMWSemanticData::__construct() must be an instance of SMWDIWikiPage, > instance of SMWWikiPageValue given, called in > /home/samuel/www/smw-trunk/__extensions/RDFIO/classes/__PageHandler.php > on line 171 and defined in > > /home/samuel/www/smw-trunk/__extensions/SemanticMediaWiki/__includes/SMW_SemanticData.php > on line 103 > > Below is the relevant code from PageHandler.php. (line 171 highlighted): > > > $page = SMWWikiPageValue::makePage( $this->m_wikititle, $this->m_ns ); > > $this->m_smwwriter = new SMWWriter( $page->getTitle() ); > if ( $delete ) { > // We are not adding anything, so create a "page" with "false" title > $this->m_smwwriter_add = new SMWSemanticData( > SMWWikiPageValue::makePage( false, $this->m_ns ) ); > $this->m_smwwriter_remove = new SMWSemanticData( $page ); > } else { > *$this->m_smwwriter_add = new SMWSemanticData( $page );* > // We are not removing anything, so create a "page" with "false" title > $this->m_smwwriter_remove = new SMWSemanticData( > SMWWikiPageValue::makePage( false, $this->m_ns ) ); > } > > > The problem is obviously that SMWWikiPageValue::makePage( false, > $this->m_ns ) returns an SMWWikiPageValue, while I need an > SMWDIWikiPage for creating the new SMWSemanticData:s. > > So, how can I go about creating new SMWDIWikiPage, when I have the > title and the namespace (like I have in the code above)? > > There is SMWDIWikiPage::newFromTitle($__title), but that does not > take the namespace (which I'll need to specify, not?), and there is > SMWDIWikiPage::__newFromSerialization($diType, $serialization) ... > but unfortunately don't have a clue how to get the correct $diType > and $serialization ... > > > Cheers, > // Samuel > > [1] http://localhost/smw-dev/__index.php/Extension:RDFIO > <http://localhost/smw-dev/index.php/Extension:RDFIO> > [2] > > http://svn.wikimedia.org/__svnroot/mediawiki/trunk/__extensions/RDFIO/classes/__PageHandler.php > > <http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/RDFIO/classes/PageHandler.php> > > -- > Samuel Lampa > ------------------------------__--------- > Bioinformatician @ Uppsala University > Blog: http://saml.rilspace.org > ------------------------------__--------- > > -- Samuel Lampa --------------------------------------- Bioinformatician @ Uppsala University Blog: http://saml.rilspace.org --------------------------------------- ------------------------------------------------------------------------------ Got Input? Slashdot Needs You. Take our quick survey online. Come on, we don't ask for help often. Plus, you'll get a chance to win $100 to spend on ThinkGeek. http://p.sf.net/sfu/slashdot-survey _______________________________________________ Semediawiki-devel mailing list Semediawiki-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-devel