Last modified: 2010-08-30 16:21:52 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T26856, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 24856 - getSMWPageIDandSort(Titleold) == getSMWPageIDandSort(TitleNew)
getSMWPageIDandSort(Titleold) == getSMWPageIDandSort(TitleNew)
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Markus Krötzsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-18 16:09 UTC by Karima Rafes
Modified: 2010-08-30 16:21 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Karima Rafes 2010-08-18 16:09:56 UTC
Hi

I tried to read the data  after to move a page so I use two times the function getSemanticData.

//save new page
		$newpage = SMWDataValueFactory::newTypeIDValue( '_wpg' );
		$newpage->setValues( $newtitle->getDBkey(), $newtitle->getNamespace(), $pageid );
		$semdata1 = $this->getSemanticData( $newpage );
		$this->_update($semdata1);

		// Save the old page
		$oldpage = SMWDataValueFactory::newTypeIDValue( '_wpg' );
		$oldpage->setValues( $oldtitle->getDBkey(), $oldtitle->getNamespace(), $redirid );
		$semdata2 = $this->getSemanticData( $oldpage );
		$this->_update( $semdata2); 

BUT $semdata1 and $semdata2 give same triples.

I think...the responsable is the function getSMWPageIDandSort. The old and new page has the same ID  of getSMWPageIDandSort so getSemanticData give the same data (same cache).

bye
karima
Comment 1 Karima Rafes 2010-08-18 19:04:39 UTC
Quick and dirty fix ...

$this->m_semdata = array(); //ADD

//save new page
        $newpage = SMWDataValueFactory::newTypeIDValue( '_wpg' );
        $newpage->setValues( $newtitle->getDBkey(), $newtitle->getNamespace(),
$pageid );
        $semdata1 = $this->getSemanticData( $newpage );
        $this->_update($semdata1);

$this->m_semdata = array(); //ADD

        // Save the old page
        $oldpage = SMWDataValueFactory::newTypeIDValue( '_wpg' );
        $oldpage->setValues( $oldtitle->getDBkey(), $oldtitle->getNamespace(),
$redirid );
        $semdata2 = $this->getSemanticData( $oldpage );
        $this->_update( $semdata2); 

bye
karima
Comment 2 Markus Krötzsch 2010-08-29 19:25:33 UTC
I do not yet understand what the problem is. What is "$this" in the above code?

I assume you are talking about changing the title of a page by moving it. When you do this, there will be a redirect from the old title to the new title. SMW follows redirects when querying for semantic data. This is a feature that helps to avoid information being lost when the title of a page changes.

But you can switch this behaviour off by using the configuration option smwgEqualitySupport (http://semantic-mediawiki.org/wiki/Help:Configuration#smwgQEqualitySupport). But the data that you get for a page that is a redirect is not very interesting anyway. It just says that it is a redirect to the new title.
Comment 3 Karima Rafes 2010-08-29 20:16:15 UTC
>The data that you get for a page that is a redirect is not very interesting
anyway... 

except recording the triplets in another database.

If the name/URI are different the triplets are different (only put owl:sameAs for the old URI and copy the triplets with the new uri).

>This is a feature that helps to avoid information being lost when the title of a page changes.

May be there is another tool with the exact replica of the data when I m in my class like the class Rapstore ?
Comment 4 Markus Krötzsch 2010-08-30 14:42:28 UTC
I still have significant problems understanding you, sorry. Could you provide a somewhat more verbose description of your problem? Here are some questions that you may want to address to clarify things:

* What are you trying to do?

* Is there some SMW function that does not work as documented?

* Is this problem visible to users of SMW? Can it be reproduced on sandbox.semantic-mediawiki.org?

* What is "$this" in your code snippet?

* You talk about "another database". How does this relate to your question? What is your database setup?

* You talk about "another tool" with "replica of the data". What data do you mean? What kind of tools are you talking about?

* What does RAPStore have to do with all this? Is your problem related to (RDF) storage bindings?
Comment 5 Karima Rafes 2010-08-30 16:21:52 UTC
* What does RAPStore 
OK... it's a class in your project.
http://semantic-mediawiki.org/doc/SMW__RAPStore2_8php-source.html

* What are you trying to do?
I'm developing a new connector for SMW with the triplestore 4store
http://www.mediawiki.org/wiki/Extension:LinkedWiki

* Is there some SMW function that does not work as documented?
I didn't find the documentation but I use the template SMW_RAPStore2.php.

* Is this problem visible to users of SMW? Can it be reproduced on
sandbox.semantic-mediawiki.org?
The lambda user doesn't see this problem.

* What is "$this" in your code snippet?
it's the class 
http://github.com/BorderCloud/LinkedWiki/blob/master/class/SMW_LinkedWikiStore.php
and this class extends SMWSQLStore2

* You talk about "another database". How does this relate to your question?
What is your database setup?
Like Rapstore I duplicate the triplets in another database to create an endpoint sparql.

* You talk about "another tool" with "replica of the data". What data do you
mean? What kind of tools are you talking about?
I need to record the triplets in a wiki page in real time. So I need to call an function of SMW to give me the triplets current for one page (in the turtle format without prefix).
My dream is a function like this :
getExportTurtle(Title $title) => string (format turtle without prefix)

I found a hack for the moment but it will be for the next version.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links