I finally managed to solve the problem.
I had to add the following code under the Article doEdit part:

if (version_compare(SMW_VERSION, '1.2', '>=' ) ||
          substr($smw_version, 0, 3) == '1.2') { // temporary hack
          if ( smwfIsSemanticsProcessed($t->getNamespace()) ) {
                $options = new ParserOptions();
                $revision = Revision::newFromTitle( $t );
                If ( $revision === NULL ) continue;
                $wgParser->parse($revision->getText(), $t, $options, true, 
true, 
$revision->getID());
                SMWFactbox::storeData(true);
          }
}

Actually the inserted page is parsed again to safe the information in 
the database. I don't understand why this is not automatically done in 
the doEdit, but it now works.

This is a solution for SMW 1.2

-Andreas


Michael Dale wrote:
> perhaps your "run_jobs" setting is not set? .. does it show up after you 
> run maintaince/runjobs? if semantic properties are in templates perhaps 
> its a run_jobs issue? otherwise does runnning refreshSemantics from SMW 
> maintaince folder update it? if refreshSemantics does not update ... 
> something is very wrong.. maybe try updating semantic wiki?
> 
> or you could debug you could trace all the executed sql statements 
> confirm the semantic table is being updated. If the factbox displays it 
> then its likely getting updated.. so its hard to say what could be wrong 
> in that case.
> 
> --michael
> 
> Andreas Wombacher wrote:
>> Hi,
>>
>> thanks for the response. Unfortunately this is not working for me.
>>
>> What is really strange is that the semantic annotation is depicted in 
>> the fact box, but when querying the annotation the page does not show up.
>>
>> Any other suggestion?
>>
>> Thanks in advance.
>>
>> best regards
>> Andreas
>>
>> Michael Dale wrote:
>>> I had to edit function edit Updates in Article.php added:
>>>
>>> $dbw = wfGetDB( DB_MASTER );
>>> $dbw->begin();  # Update the links tables
>>>        $u = new LinksUpdate( $this->mTitle, $editInfo->output );
>>>        $u->doUpdate();
>>>
>>> $dbw->commit();
>>>
>>> to commit semantic and category updates made with api based 
>>> Article->doEdit() calls
>>>
>>> peace,
>>> --michael
>>>
>>>
>>> Andreas Wombacher wrote:
>>>> Hio,
>>>>
>>>> I wrote a little extension which creates new wiki pages and uses the 
>>>> doEdit method of Article class to add the content. In previous 
>>>> versions of SMW this was sufficient to get the data in the semantic 
>>>> data collection. This is now not the case anymore.
>>>> Any help is appreciated.
>>>>
>>>> I am using
>>>> MediaWiki      1.13.0
>>>> PHP     5.2.4 (apache2handler)
>>>> MySQL     5.1.23-rc-community
>>>> Semantic MediaWiki (Version 1.2.1)
>>>> Semantic mediawiki is using the store2.
>>>>
>>>> best regards
>>>> Andreas
>>>>
>>>> ------------------------------------------------------------------------- 
>>>>
>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's 
>>>> challenge
>>>> Build the coolest Linux based applications with Moblin SDK & win 
>>>> great prizes
>>>> Grand prize is a trip for two to an Open Source event anywhere in 
>>>> the world
>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> _______________________________________________
>>>> Semediawiki-devel mailing list
>>>> Semediawiki-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
>>>>   
>>>
> 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to