Jump to content

Talk:Wikibase/Flow

About this board

How to create query services for wikibase?

10
Arnavutsezgin (talkcontribs)

Hi. First of all, I apologize for the disgusting English I will use. I did the Wikibase installation. My main goal is to collect data that will not be added to Wikidata. So this data will be in one main area. I have configured my Mediawiki wikibase plugin as both a client and a server. But my problem starts at this point. I want to use this data on my MediaWiki site. I know how to use #statements and as a template. That is not my problem. I want to build something like query services used for Wikidata. Because I will use the other on wiki by questioning my data.

I did a lot of research. But I have not learned anything clear in this regard. Should I make the data wiki server, the other wiki client? A wiki that uses the same database as the data server? How about this idea for you? If there is a method you know, please do not hesitate to say it. Server sizes are small but mine. Is there something I can not see https://www.wikidata.org/wiki/Wikidata:Tools/External_tools or https://www.wikidata.org/wiki/Wikidata:Data_access? I appreciate your help.

Arnavutsezgin (talkcontribs)
Arnavutsezgin (talkcontribs)
Jan Dittrich (WMDE) (talkcontribs)

@Jonas Kress (WMDE): Is that something you can help with – maybe just with referring @Incelemeelemani to the right person? The problem might also point out that our terminology and/or documentation needs to be iterated if the client/server question is unclear.

Jonas Kress (WMDE) (talkcontribs)
Arnavutsezgin (talkcontribs)

@Jonas Kress (WMDE), @Jan Dittrich (WMDE)... Am I telling the truth? I installed Wikibase on my own web site. I've added the data. I want to question the data on my site. Is it enough to install only WDQS for this? Unfortunately, I could not find any help on this issue. I found a few little bits of information. But it is inadequate. Could you suggest a non-docker solution to me? Do I have to install https://github.com/wikimedia/wikidata-query-rdf ? Thank you. Website address : sorumu.com

Arnavutsezgin (talkcontribs)
Arnavutsezgin (talkcontribs)

Hi, https://addshore.com/2017/12/wikibase-docker-images/ I installed as shown. But I could not find the database. There is no explanation in this regard. There is a lot of confusion about WDQS. She's very addicted to Wikidata. I want to use Wikidata as a dictionary. Thank you for reading.

Arnavutsezgin (talkcontribs)

Curiously, I expect a WDQS solution independent of wikidata. Thank you.

Juandev (talkcontribs)

So did you find the solution afterwards?

Reply to "How to create query services for wikibase?"

Use a wikibase from wikibase.cloud as repo of a wiki

1
Loman87 (talkcontribs)

Hello,

is this possible? How should the configuration look like? The client, in this case, would be my wiki with wikibase installed.

Thanks for any help!

Reply to "Use a wikibase from wikibase.cloud as repo of a wiki"

Extension:Wikibase and installation of the extension

4
Addshore (talkcontribs)

At some point in the past, this page, or something this page pointed to, actually told you how to install the Wikibase extension. It doesn't seem to any more.

I want to link to (or at least be able to copy) some documentation that says how to install the extension for development reasons, what LocalSettings lines are needed when installing the extension, does install.php need to be run?

As far as I can tell, that is no longer the case, and I can't easily find the documentation to point to for how to install the extension for a blog post that I am writing.

An example from another extension would be https://www.mediawiki.org/wiki/Extension:Cognate#Installation

Ping @Dan Shick (WMDE):

After some searching through older version of this page I found these install pages exist, but go far above this basic installation introduction https://www.mediawiki.org/wiki/Wikibase/Installation https://www.mediawiki.org/wiki/Wikibase/Installation/Advanced_configuration, and are not currently linked from the landing page.

Thoughts?

2600:1008:B02D:B116:2998:E105:74E5:49C7 (talkcontribs)

Go for it. Maybe put it on a different page though and link that page to here?

Addshore (talkcontribs)
Addshore (talkcontribs)

And on second thoughts, to align with the rest of mediawiki.org a little more, this page I have just created should probably just live at Extension:Wikibase, and have a banner at the top that also directs people to this wider Wikibase landing page.

Thoughts?

Reply to "Extension:Wikibase and installation of the extension"

Class 'DataValues\Deserializers\DataValueDeserializer' not found

2
Marx.FelipeForte (talkcontribs)

After attempting to update to MediaWiki 1.38, I also updated the Wikibase extension. Nevertheless, both the new and the old Wikibase are currently producing the same error, hinting at a problem with how Wikibase interacts with the new MediaWiki version 1.38.

Full error log:

[5fd0ce49dfdffcca08f1df96] /wiki/ProleWiki:Main_page   Error: Class 'DataValues\Deserializers\DataValueDeserializer' not found

Backtrace:
from /var/www/prole/extensions/Wikibase/client/WikibaseClient.ServiceWiring.php(264)
 #0 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(447): Wikimedia\Services\ServiceContainer->{closure}()
 #1 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(416): Wikimedia\Services\ServiceContainer->createService()
 #2 /var/www/prole/includes/MediaWikiServices.php(294): Wikimedia\Services\ServiceContainer->getService()
 #3 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(424): MediaWiki\MediaWikiServices->getService()
 #4 /var/www/prole/extensions/Wikibase/client/includes/WikibaseClient.php(361): Wikimedia\Services\ServiceContainer->get()
 #5 /var/www/prole/extensions/Wikibase/client/WikibaseClient.ServiceWiring.php(860): Wikibase\Client\WikibaseClient::getDataValueDeserializer()
 #6 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(447): Wikimedia\Services\ServiceContainer->{closure}()
 #7 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(416): Wikimedia\Services\ServiceContainer->createService()
 #8 /var/www/prole/includes/MediaWikiServices.php(294): Wikimedia\Services\ServiceContainer->getService()
 #9 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(424): MediaWiki\MediaWikiServices->getService()
 #10 /var/www/prole/extensions/Wikibase/client/includes/WikibaseClient.php(155): Wikimedia\Services\ServiceContainer->get()
 #11 /var/www/prole/extensions/Wikibase/client/WikibaseClient.ServiceWiring.php(1057): Wikibase\Client\WikibaseClient::getSingleEntitySourceServicesFactory()
 #12 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(447): Wikimedia\Services\ServiceContainer->{closure}()
 #13 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(416): Wikimedia\Services\ServiceContainer->createService()
 #14 /var/www/prole/includes/MediaWikiServices.php(294): Wikimedia\Services\ServiceContainer->getService()
 #15 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(424): MediaWiki\MediaWikiServices->getService()
 #16 /var/www/prole/extensions/Wikibase/client/includes/WikibaseClient.php(160): Wikimedia\Services\ServiceContainer->get()
 #17 /var/www/prole/extensions/Wikibase/client/WikibaseClient.ServiceWiring.php(956): Wikibase\Client\WikibaseClient::getWikibaseServices()
 #18 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(447): Wikimedia\Services\ServiceContainer->{closure}()
 #19 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(416): Wikimedia\Services\ServiceContainer->createService()
 #20 /var/www/prole/includes/MediaWikiServices.php(294): Wikimedia\Services\ServiceContainer->getService()
 #21 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(424): MediaWiki\MediaWikiServices->getService()
 #22 /var/www/prole/extensions/Wikibase/client/includes/WikibaseClient.php(222): Wikimedia\Services\ServiceContainer->get()
 #23 /var/www/prole/extensions/Wikibase/client/WikibaseClient.ServiceWiring.php(401): Wikibase\Client\WikibaseClient::getStore()
 #24 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(447): Wikimedia\Services\ServiceContainer->{closure}()
 #25 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(416): Wikimedia\Services\ServiceContainer->createService()
 #26 /var/www/prole/includes/MediaWikiServices.php(294): Wikimedia\Services\ServiceContainer->getService()
 #27 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(424): MediaWiki\MediaWikiServices->getService()
 #28 /var/www/prole/extensions/Wikibase/client/includes/WikibaseClient.php(170): Wikimedia\Services\ServiceContainer->get()
 #29 /var/www/prole/extensions/Wikibase/client/WikibaseClient.ServiceWiring.php(826): Wikibase\Client\WikibaseClient::getEntityLookup()
 #30 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(447): Wikimedia\Services\ServiceContainer->{closure}()
 #31 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(416): Wikimedia\Services\ServiceContainer->createService()
 #32 /var/www/prole/includes/MediaWikiServices.php(294): Wikimedia\Services\ServiceContainer->getService()
 #33 /var/www/prole/vendor/wikimedia/services/src/ServiceContainer.php(424): MediaWiki\MediaWikiServices->getService()
 #34 /var/www/prole/vendor/wikimedia/object-factory/src/ObjectFactory.php(211): Wikimedia\Services\ServiceContainer->get()
 #35 /var/www/prole/vendor/wikimedia/object-factory/src/ObjectFactory.php(152): Wikimedia\ObjectFactory\ObjectFactory::getObjectFromSpec()
 #36 /var/www/prole/includes/HookContainer/HookContainer.php(473): Wikimedia\ObjectFactory\ObjectFactory->createObject()
 #37 /var/www/prole/includes/HookContainer/HookContainer.php(156): MediaWiki\HookContainer\HookContainer->getHandlers()
 #38 /var/www/prole/includes/HookContainer/HookRunner.php(2858): MediaWiki\HookContainer\HookContainer->run()
 #39 /var/www/prole/includes/parser/Parser.php(635): MediaWiki\HookContainer\HookRunner->onParserClearState()
 #40 /var/www/prole/includes/parser/Parser.php(4833): Parser->clearState()
 #41 /var/www/prole/includes/parser/Parser.php(926): Parser->startParse()
 #42 /var/www/prole/includes/parser/Parser.php(4860): Parser->preprocess()
 #43 /var/www/prole/includes/cache/MessageCache.php(1257): Parser->transformMsg()
 #44 /var/www/prole/includes/language/Message.php(1474): MessageCache->transform()
 #45 /var/www/prole/includes/language/Message.php(1007): Message->transformText()
 #46 /var/www/prole/includes/language/Message.php(1071): Message->format()
 #47 /var/www/prole/includes/OutputPage.php(1041): Message->text()
 #48 /var/www/prole/includes/OutputPage.php(1090): OutputPage->setHTMLTitle()
 #49 /var/www/prole/includes/page/Article.php(464): OutputPage->setPageTitle()
 #50 /var/www/prole/includes/actions/ViewAction.php(80): Article->view()
 #51 /var/www/prole/includes/MediaWiki.php(543): ViewAction->show()
 #52 /var/www/prole/includes/MediaWiki.php(321): MediaWiki->performAction()
 #53 /var/www/prole/includes/MediaWiki.php(912): MediaWiki->performRequest()
 #54 /var/www/prole/includes/MediaWiki.php(563): MediaWiki->main()
 #55 /var/www/prole/index.php(53): MediaWiki->run()
 #56 /var/www/prole/index.php(46): wfIndexMain()
 #57 {main}
Marx.FelipeForte (talkcontribs)

Fix found: Copy "composer.json" from the Wikibase extension folder to the main folder as "composer.local.json", then run:

composer install --no-dev
MavropaliasG (talkcontribs)
Jdforrester (WMF) (talkcontribs)

These are provided in git by the development team: RELEASE-NOTES-1.37, RELEASE-NOTES-1.38, RELEASE-NOTES-1.39 etc. Is that sufficient for your needs? I don't think copying them onto the wiki would be a good idea, as they would diverge from reality pretty easily (as do the MediaWiki notes).

Which table does Wikibase query for getting the current statements on a Wikidata item?

3
Rdrg109 (talkcontribs)

I'm trying to understand how the internals of Wikibase work. Specifically, I want to know how Wikibase is able to show the current statements of a Wikidata item in the web browser of end users.

I decided to inspect the source code (link to the Wikibase repository in gerrit.wikimedia.org), but as I am not very familiar with PHP and the internals of Wikibase, I believed that I didn't find the relevant part that accomplishes what I am looking for.

I presume that Wikibase keeps track of the current statements in a table and whenever a new revision is added to the Mediawiki's the revision table, the table that stores Wikibase statements is modified accordingly. Then, when someone asks for the current statements of a Wikidata item, Wikibase returns the rows at the table that stores current Wikibase statements.

My question is: What is the workflow that is followed for Wikibase to return the current statements of a Wikidata item to users so that they see it in their web browsers?

Rdrg109 (talkcontribs)

I asked a similar question in Libera Chat's room #wikimedia-cloud and some user replied:

19:35 <rdrg109> I still have a question though: How does Wikibase is able to know the existing statements on a given Wikibase item? I presume Wikibase stores that information somewhere in a table in a database. Isn't that information stored in any of the tables named wb_* or wbt_*?
19:44 <rdrg109> ^ For the record, I opened a topic for this question in Talk:Wikibase: https://www.mediawiki.org/wiki/Topic:Y3u994hnsgkbgbz0
19:46 <+wm-bb> <<hidden username>> it’s stored in a table that’s not available on the replicas
19:46 <+wm-bb> <<hidden username>> see https://wikitech.wikimedia.org/wiki/Help:Toolforge/Database#Unavailable_tables, the `text` table is the one with all the page contents
Jdforrester (WMF) (talkcontribs)

The "workflow" is that it fetches the JSON of the Entity (not from the text table, but via external storage) and decodes it. You can call the wbgetclaims API to get the statements ('claims'), like this one for Q42/Douglas Adams, or if you really want you could fetch the raw entity JSON over the Wikibase API and decode it yourself, I suppose. Hope this helps!

Reply to "Which table does Wikibase query for getting the current statements on a Wikidata item?"
Kghbln (talkcontribs)
Kghbln (talkcontribs)
Dan Shick (WMDE) (talkcontribs)

Good suggestion! I'm adding this to my list of tasks for the next go-round with the docs (should be done by end of Aug.)

Kghbln (talkcontribs)

Thanks a bunch!

Standalone Wikibase not prefered any more?

2
Juandev (talkcontribs)

If I type in extension:wikibase I am linked here and yet the first link is Wikibase cloud. Does it mean, that standalone Wikibase instalation is not prefered any more?

Lectrician1 (talkcontribs)

Ya that's kind of weird. At least the Docker setup should be linked.

Reply to "Standalone Wikibase not prefered any more?"

Article is still linked to a deleted item

2
Till Kraemer (talkcontribs)

Hello, I have a weird issue on my wikibase repository where some old items are suddenly wikitext, so trying to edit them gives me errors like '"wikitext" content is not allowed on page Q18155 in slot "Main"'.

I'm too scared to alter the database by hand so I just wanted to delete these faulty items. However, the associated link to the item doesn't go away in the language versions, so I can't link to those articles in a new item, resulting in errors like "The link... is already used by Item Q18155.", even though that item has been already deleted.

Is there by any chance a script available that deattaches the link from an article to a deleted wikibase item? Thanks, cheers and all the best!

Till Kraemer (talkcontribs)

Redirecting the old item to the new item via Special:RedirectEntity and then deleting the old item seems to solve this issue. Cheers and all the best!

Using the main namespace for items

2
Till Kraemer (talkcontribs)

Hello, I'm running MediaWiki 1.40.0 and I would like to use the main namespace for items like on Wikidata. Can I just add something to LocalSettings.php of the repository or do I have to edit Wikibase.example.php? I'm currently using the default Wikibase.example.php and my LocalSettings.php looks like this.

Also, I'm still having issues with pre-1.37.0 items. They look like this (NSFW) while new items look like this (NSFW).

Any ideas on how to fix this are very much appreciated! Thanks, cheers and all the best!

Till Kraemer (talkcontribs)

I'm not sure if this is the best way to do it but this seems to work for me:


LocalSettings.php of the repo:


wfLoadExtension( 'WikibaseRepository', "$IP/extensions/Wikibase/extension-repo.json" );

$wgWBRepoSettings['siteLinkGroups'] = [ 'mywiki', 'pool', 'quote' ];

$wgWBRepoSettings['localClientDatabases'] = array(

    'de' => 'dewiki',

    'en' => 'enwiki',

    'ja' => 'jawiki',

);

$wgExtraNamespaces[120] = "Property";

$wgExtraNamespaces[121] = "Property_talk";

$entitySources = [

    'data' => [

        'entityNamespaces' => [ 'item' => 0, 'property' => 120 ],

        'repoDatabase' => 'datawiki',

        'baseUri' => 'https://data.mywiki.com/wiki/',

        'interwikiPrefix' => '',

        'rdfNodeNamespacePrefix' => '',

        'rdfPredicateNamespacePrefix' => 'wd',

        'type' => 'db'

    ],

];

$wgWBRepoSettings['entitySources'] = $entitySources;

$wgWBRepoSettings['localEntitySourceName'] = 'data';


LocalSettings.php of the clients:


wfLoadExtension( 'WikibaseClient', "$IP/extensions/Wikibase/extension-client.json" );

$wgWBClientSettings['repoUrl'] = 'https://data.mywiki.com';

$wgWBClientSettings['repoScriptPath'] = '';

$wgWBClientSettings['repoArticlePath'] = '/wiki/$1';

$entitySources = [

'datawiki' => [

'repoDatabase' => 'datawiki',

        'baseUri' => 'https://data.mywiki.com/wiki/',

        'entityNamespaces' => [

            'item' => 0,

            'property' => 120,

       ],

        'interwikiPrefix' => '',

        'rdfNodeNamespacePrefix' => '',

        'rdfPredicateNamespacePrefix' => 'wd',

    ],

];

$wgWBClientSettings['entitySources'] = $entitySources;

$wgWBClientSettings['itemAndPropertySourceName'] = 'datawiki';

$wgWBClientSettings['siteLinkGroups'] = [ 'mywiki' ];

$wgWBClientSettings['siteGlobalID'] = 'enwiki';

$wgWBClientSettings['otherProjectsLinks'] = [ 'poolwiki', 'quotewiki' ];


After the changes, I also ran cleanupTitles.php on the repo. Thanks and cheers!