Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SparqlStore.php |
— | — | @@ -28,6 +28,8 @@ |
29 | 29 | } |
30 | 30 | |
31 | 31 | public function changeTitle( Title $oldtitle, Title $newtitle, $pageid, $redirid = 0 ) { |
| 32 | + parent::changeTitle( $oldtitle, $newtitle, $pageid, $redirid ); |
| 33 | + |
32 | 34 | $oldWikiPage = SMWDIWikiPage::newFromTitle( $oldtitle ); |
33 | 35 | $newWikiPage = SMWDIWikiPage::newFromTitle( $newtitle ); |
34 | 36 | $oldExpResource = SMWExporter::getDataItemExpElement( $oldWikiPage ); |
— | — | @@ -36,16 +38,17 @@ |
37 | 39 | $newUri = SMWTurtleSerializer::getTurtleNameForExpElement( $newExpResource ); |
38 | 40 | |
39 | 41 | $sparqlDatabase = smwfGetSparqlDatabase(); |
40 | | - $sparqlDatabase->insertDelete( "$newUri ?p ?o", "$oldUri ?p ?o" ); /// FIXME this moves properties that are not correct, reparse this page |
| 42 | + //$sparqlDatabase->insertDelete( "$newUri ?p ?o", "$oldUri ?p ?o" ); // this moves properties that are not correct, reparse this page |
41 | 43 | $sparqlDatabase->insertDelete( "?s ?p $newUri", "?s ?p $oldUri" ); |
42 | 44 | if ( $oldtitle->getNamespace() == SMW_NS_PROPERTY ) { |
43 | 45 | $sparqlDatabase->insertDelete( "?s $newUri ?o", "?s $oldUri ?o" ); |
44 | 46 | } |
45 | | - |
| 47 | + $newUpdate = new SMWUpdateJob( $newtitle ); |
| 48 | + $newUpdate->run(); |
46 | 49 | if ( $redirid != 0 ) { // update/create redirect page data |
47 | | - /// FIXME reparse this page |
| 50 | + $oldUpdate = new SMWUpdateJob( $oldtitle ); |
| 51 | + $oldUpdate->run(); |
48 | 52 | } |
49 | | - parent::changeTitle( $oldtitle, $newtitle, $pageid, $redirid ); |
50 | 53 | } |
51 | 54 | |
52 | 55 | public function doDataUpdate( SMWSemanticData $data ) { |
— | — | @@ -120,8 +123,12 @@ |
121 | 124 | $resourceUri = SMWTurtleSerializer::getTurtleNameForExpElement( $expNsResource ); |
122 | 125 | $rediUri = SMWTurtleSerializer::getTurtleNameForExpElement( SMWExporter::getSpecialPropertyResource( '_REDI' ) ); |
123 | 126 | $skeyUri = SMWTurtleSerializer::getTurtleNameForExpElement( SMWExporter::getSpecialPropertyResource( '_SKEY' ) ); |
124 | | - $sparqlResult = smwfGetSparqlDatabase()->select( '*', "$resourceUri $skeyUri ?s OPTIONAL { $resourceUri $skeyUri ?s }", array( 'LIMIT' => 1 ) ); |
125 | 127 | |
| 128 | + $sparqlResult = smwfGetSparqlDatabase()->select( '*', |
| 129 | + "$resourceUri $skeyUri ?s OPTIONAL { $resourceUri $skeyUri ?s }", |
| 130 | + array( 'LIMIT' => 1 ), |
| 131 | + array( $expNsResource->getNamespaceId() => $expNsResource->getNamespace() ) ); |
| 132 | + |
126 | 133 | $firstRow = $sparqlResult->current(); |
127 | 134 | if ( $firstRow === false ) { |
128 | 135 | $exists = false; |