query-03b71681a9ea6dd4e32c5f59408563ff

rq turtle/ttl

lonelyitems clone tool no longer functions, and no one can seem to get a hold of Bene even as it appears there is no public repository for the tools' code, so I have been trying to build a clone myself using Quarry. The query I suspected might work is as follows: Lonely itemsBene's select wb_terms.term_full_entity_id, secondtable.ips_site_page from wb_terms inner join (select * from wb_items_per_site where ips_item_id in (select ips_item_id from wb_items_per_site group by ips_item_id having count()=1) and ips_site_id = 'bnwiki') as secondtable on wb_terms.term_entity_id=secondtable.ips_item_id limit 50 06:05, 6 February 2018 (UTC)) talk (Mahir256where 'bnwiki' could be any other wiki and the limit need not be 50 items, but the query always seems to hang. Is there a better way of writing a query to do what lonelyitems did? 06:52, 6 February 2018 (UTC)) talk (Mahir256: Okay, I have created an account there and am awaiting approval of my membership request so that I can connect properly. MisterSynergy@ 06:44, 6 February 2018 (UTC)) talk (MisterSynergy — or create your own tools. —nano /data/project/bene/public_html/lonelyitems/index.php, on Windows e.g. by using PuTTY) and do login.tools.wmflabs.org (I recommend to use the same user name as here) and set it up properly (you need to register public keys, and so on). There is “Getting started” documentation available at wikitech-wiki, and if something does not work as expected they help in the IRC channels. Once this is done, you can connect to the Toolforge console (wikitech-wikiAssuming you don’t have an account: create one at 06:36, 6 February 2018 (UTC)) talk (Mahir256: No, as I have not needed to use it since whatever Wikimedia code I needed to look at was on the appropriate GitHub mirror. Where on Toolforge can I find Bene's code? MisterSynergy@ 06:26, 6 February 2018 (UTC)) talk (MisterSynergyDo you have a Wikitech/Toolforge account? The code of bene's tools is actually readable for all users (as all tool sources on Toolforge are by default). — and it does return results. The portion of the code where the error occurs is here (reposted for clarity): here: So I am running the query being built MisterSynergy @┘────────────────────────────────────────────────────────────────────────────────────────────────────┌ $repo = mysqli_connect_wiki( 'wikidatawiki' ); $sql = createSQL( $repo, $wiki, $offset, $limit ); $url = htmlspecialchars( getUrl( $repo, $wiki ) ); $wikihtml = htmlspecialchars( $wiki ); if( $result = $repo->query( $sql ) ) { // spit out the result; omitted for clarity } else { echo '

Sorry, there was an error performing your request.

Technical details: ' . $repo->error . '

'; } 05:45, 8 February 2018 (UTC)) talk (Mahir256At one point in the past, the query could run for a long time but would still output results at the end. Now it terminates immediately, without any warning, irrespective of the parameters passed to construct the query itself. Do you or someone else familiar with connecting to (clone) databases know what the problem may be? 06:21, 8 February 2018 (UTC)) talk (MisterSynergy). I can’t tell whether the old ones still work, but this might be an issue here. —wikitech:Help:Toolforge/DatabaseHowever, some weeks ago (November?) they have changed the aliases of the database hosts (see history of function is basically a black box.mysqli_connect_wiki() needs to have restrictive permissions (which it has by default), since it contains tool-specific database credentials. So I don’t fully understand how this tool connects to the database, the ~/replica.my.cnf are access-restricted for whatever reason, so we cannot look into them. Typically only /data/project/bene/config.phpNo clear idea. Some files such as , with my own PDO database connector instead of Bene's approach. You can read all relevant code, except for the database credentials. tools.wmflabs.org/mstools/lonelyitems-clone/: I managed to get a (temporary) clone of this tool running at Mahir256@ However, after I saw the results I am pretty sure that the same can be achieved with the Query Service:

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX schema: <http://schema.org/>
SELECT ?item ?name ?sitelink WHERE {
  ?sitelink schema:about ?item; schema:isPartOf <https://bn.wikipedia.org/>; schema:name ?name .
  ?item wikibase:sitelinks 1 .
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v3("?name"):::projected v1("?sitelink"):::projected c6(["1^^xsd:integer"]):::literal c3([https://bn.wikipedia.org/]):::iri v1 --"schema:about"--> v2 v1 --"schema:isPartOf"--> c3 v1 --"schema:name"--> v3 v2 --"wikibase:sitelinks"--> c6