Jump to navigation Jump to search

About this board

Ash Crow (talkcontribs)

Hello, I have installed an instance of Mediawiki with both the Wikibase client and repo. I can create an item with no problem and add a link to Wikipedia or Wikidata, but I cannot find what "language code" to indicate the local Wiki (say I have a page "Hello World" that should be linked to the "Q1" on my test wiki.)

Ladsgroup (talkcontribs)

Hey, it's because the sites table is not populated to have the links to the client. I personally run eval.php and run this code:

$sites = [];
$langCode = 'en';
$site = new MediaWikiSite();
$site->setGlobalId( 'clientwiki' );
$site->setGroup( 'wikipedia' );
$site->setLanguageCode( $langCode );
$site->addInterwikiId( $langCode );
$site->addNavigationId( $langCode );
$site->setPath( MediaWikiSite::PATH_PAGE, "$1" );
$site->setPath( MediaWikiSite::PATH_FILE, "$1" );           
$sites[] = $site;
$sitesTable = SiteSQLStore::newInstance();
$sitesTable->saveSites( $sites );
Reply to "Link local pages to items"

Source code for label and geospatial services

Bovlb (talkcontribs)

(I also asked here.) Can someone please point me at the source code for the label and geospatial services? Thanks!

Lydia Pintscher (WMDE) (talkcontribs)
Bovlb (talkcontribs)

Thanks for the link. That's a great starting point. I'm especially interested in the "magic" that goes beyond serving answers from datafiles: binding variables that weren't explicitly asked for; and doing geo-spatial calculations. I'll see if I can find that in the code.

In case you were interested in what I'm doing: I'm looking at the possibility of serving knowledge graph embeddings and their proximity calculations for Wikidata in a way that can be integrated into SPARQL queries.

Reply to "Source code for label and geospatial services" going https?

Summary by Thiemo Kreuz (WMDE)
Kghbln (talkcontribs)

I guess it will be great if the website moved to https.

Reply to " going https?"
Bttfvgo (talkcontribs)

I installed Wikibase which solved a lot of the problems on my MediaWiki site. Now, however, search suggest is no longer working. Results normally popped up as letters were typed into the search bar but now the only thing that pops up is a spinning wheel and nothing being found (it only shows the current typed text, italicized). Any help on getting Search working again is much appreciated! Thank you!

Thiemo Kreuz (WMDE) (talkcontribs)

If you turn your local wiki into a Wikibase repository, the search box in the upper right will be replaced with an entity search. There is currently no way to turn this of. You can hack the code and remove the line $out->addModules( 'wikibase.ui.entitysearch' ); in the file repo/Wikibase.hooks.php just to see if it works.

Bttfvgo (talkcontribs)

I have been playing around with various things but to no avail. Removing the line you listed removes the spinning wheel that searches for "items" rather than pages. I had made a sample item once and the search box showed that one with no problem. I have been playing with different variables in LocalSettings.php, such as $wgUseAjax, $wgEnableOpenSearchSuggest, $wgVectorUseSimpleSearch and $wgEnableMWSuggest and can get them to show, but only once (if you use them they don't appear at all after that) but they appear in a results list which appear atop the "other" results list. Going to the search page itself which bring up suggested results with no problem. Any ideas?

Thiemo Kreuz (WMDE) (talkcontribs)

I don't understand what you want to do. I assume you want the top-right search box to suggest both items (by their label) as well as page names in other namespaces. Such a feature does not exist.

Bttfvgo (talkcontribs)

That is indeed what I want. The search box on the Special:Search page does indeed search for suggested results when letters are typed (but doesn't search for entities). Is there a way to swap the primary search box (which got replaced with entity search) with the one used on the Special:Search page? Search suggest works there! Or is there any extension I can get? I know MediaWiki and Wikipedia both use CirrusSearch but I cannot complete installation because my current hosting plan doesn't offer Java and apparently you need Java to get Elasticsearch to work. Is there a workaround or possibly another extension, or can I just change the primary box with the one on Special:Search? Thanks again!

Bttfvgo (talkcontribs)

Is there perhaps something I can edit in the file /extensions/Wikibase/repo/resources/wikibase.ui.entitysearch.js? I've found two lines: Updates the suggestion list special item that triggers a full-text search. and Removes the native search box suggestion list. Can I edit anything on the page to change it back? I feel like I'm so close! Thanks!

Bttfvgo (talkcontribs)

I put it back but removing the lines

		function removeSuggestionContext( input ) {
			var context = $.data( input, 'suggestionsContext' );

			if ( context ) {
				// Native fetch() updates/re-sets the data attribute with the suggestion context.
				context.config.fetch = function() {};
				$.removeData( input, 'suggestionsContext' );

does indeed add search suggestion capabilities back the box. However, the "other" search list still appears under this one. I can try removing the lines below the aforementioned section of code, which look like they would add the spinner and entity search features. I really do hope there's a way! Suggested search is so, so nice.

Bttfvgo (talkcontribs)

Okay, so I removed the above, and all lines below it, up to // Default form submit action: Imitate full-text search. I went ahead and ran $php maintenance/update.php and everything seems to be working great again. I haven't ran into any inherent problems, and that "other" search box doesn't appear anymore. Only search suggestions, same as it always has. I hope there won't be any problems caused by doing that. Granted I won't be able to search for "items" anymore, but it's okay, I don't have any anyway. I merely added the feature for "future expansion". If you know of any possible problems that will come from having eliminated that code, please let me know!!

Txantimedia (talkcontribs)

The first time, I setup the client only. After reading some of the comments here, I setup both the repository and the client. In both cases, as soon as I enable Wikibase in Localsettings.php, the search function breaks. Normally, the search will return matches almost as soon as you start typing. Once Wikibase is enabled, I get the dreaded circling lines while typing. When I stop typing, I get a message "No match was found". Nothing every appears in the search box. If I click on the magnifying glass, I get results below. This behavior is repeatable.

My setup: FreeBSD 10.3, PHP 7.1.10, MediaWiki 1.29.1

I feel like I'm missing a step, but I've read and reread the docs.

@Bttfvgo, are you saying removing that function fixes the problem? It doesn't sound like it.

Bttfvgo (talkcontribs)

Sorry for the late reply. Removing those lines did indeed make it so that I could use regular search again. I've since reupdated so I'll have to do something different. Right now it searches for items only (search for any aliases listed for the item). If you go to Special:Search, however, the native search features still work great. I want native search. I want people to start to type and a long list of results pop up. When you only have a few items it defeats the purpose. I know Commons (which have their own Wikibase) have phenomenal search features that do indeed seem to incorporate everything. And that's what I want!

But at the time, Txantimedia, removing those lines removed the entity search feature of Wikibase, thus forcing the site to once again rely fully on its good ol' suggested search search box. There should be a way to have regular search at the top and item search at the bottom.

Bttfvgo (talkcontribs)

Just tried it and can confirm removing that code still removes entity search and re-enables native search. I would really like to use entity search but I only have a few items thus far. Therefore, I'd really like to be able to just use regular search. One day when I create an item for each page and can properly link my pages from each data item (it only lets me like to Wikipedia) I might re-enable entity search - I do like Commons and how they add pictures to the search! I want to be able to do all that also!

Yurik (talkcontribs)
This post was hidden by Lucas Werkmeister (WMDE) (history)
Reply to "Search no longer works properly"

Wikibase repository naming convention

CreativeC (talkcontribs)

Hi, I have a Gamepedia wiki and I would like to use Wikibase to store variables on a namespace (Properties:) and retrieve them in the main namespace. And I’d also a third tab between Article and Discussion. Is there a way to name items pages with its real name instead of Q173 or Qsomething ? Otherwise how do I link a page if the basepagename doesn’t match ?

Reply to "Wikibase repository naming convention"

Need a developer help

Summary by Thiemo Kreuz (WMDE)

Inactionable. mw:How to report a bug might help.

Nirmol360 (talkcontribs)

Hi, I need developed help to installing Wikibase on my site.

How can I uninstall Wikibase Repository and retain Client?

星耀晨曦 (talkcontribs)

When I comment require_once "$IP/extensions/Wikibase/repo/Wikibase.php";require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php"; and set $wgEnableWikibaseRepo to false. My wiki tell me: "Unable to connect to the database". How can I properly uninstall Wikibase Repository?

星耀晨曦 (talkcontribs)

Update problem description: I can access special page, however other pages show "Unable to connect to the database". If I disable Repository and Client at the same time, the page returns to normal.

Thiemo Kreuz (WMDE) (talkcontribs)

That starts making more sense. When there is no repo, the client can not connect anywhere. Why do you want such a setup? Note that even if we are working on such a feature (it's called "federation", documentation is in the "docs" folder), we are currently only supporting setups where the repo database is on the same machine as the client.

星耀晨曦 (talkcontribs)

I see installation guide wrote "Enable Wikibase Client only". I thought I can only enable Client.

Thiemo Kreuz (WMDE) (talkcontribs)

You can, but only if you have a second Wikibase repository wiki running on the same database. We hope to rewrite the installation instructions soon, and will try to do so during the upcoming hackathon.

Thiemo Kreuz (WMDE) (talkcontribs)

I tried this locally, and it works as expected. If your system is not able to connect to the database, the error can't be in the three lines you touched, as they don't even attempt to establish such a connection. Can you reproduce the error when all you do is reenabling/disabling these lines?

星耀晨曦 (talkcontribs)

If I reenable these lines, my wiki work well. Errors reappear when I disable these lines again.

Thiemo Kreuz (WMDE) (talkcontribs)

I have no idea then, sorry. Did you edited any of these .php files?

星耀晨曦 (talkcontribs)


Reply to "How can I uninstall Wikibase Repository and retain Client?"

How to create query services for wikibase?

İncelemeelemani (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 or I appreciate your help.

İncelemeelemani (talkcontribs)
İncelemeelemani (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)
İncelemeelemani (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 ? Thank you. Website address :

İncelemeelemani (talkcontribs)
İncelemeelemani (talkcontribs)

Hi, 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.

İncelemeelemani (talkcontribs)

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

Reply to "How to create query services for wikibase?" (talkcontribs)
  • Construct an ApiMain object with the arguments passed via the URL and call its execute() method to do the actual API stuff.
Thiemo Kreuz (WMDE) (talkcontribs)

I'm afraid this question is way to generic. I can see it's a quote from Manual:Api.php. But the relevant question is, what do you want to do? What do you have and what do you want to achieve? Maybe it helps if you start playing around with the d:Special:ApiSandbox?

Reply to "how to do this step"

API token... documentation error?

Summary by Thiemo Kreuz (WMDE)

Editing via API must be done via POST, and can not be done via JSONP.

Valerio Bozzolan (talkcontribs)

Going here I see the «token» param. But trying to use it, it throws an error:

"code": "mustpostparams"
"info": "The following parameter was found in the query string, but must be in the POST body: token."

How to use it? Thanks.

Valerio Bozzolan (talkcontribs)

Solved. Means POST method. Yes, I used POST method, but I was under same origin policy restrictions, and it does not work with JSONP. Abandoned.