Benutzer:Kolossos/Labs
Zur Navigation springen
Zur Suche springen
- MYSQL GHEL
mysql --defaults-file="${HOME}"/replica.my.cnf -h dewiki.labsdb p50380g50921__ghel_p
- Wikidata ID
SELECT * FROM dewiki_p.page_props where pp_propname="wikibase_item";
- Tunneln
ssh -L 4711:labsdb1004.eqiad.wmnet:5432 kolossos@tools-login-eqiad.wmflabs.org
- psql;
psql -h labsdb1004.eqiad.wmnet -U osm -d gis
Wikidata
[Bearbeiten | Quelltext bearbeiten]http://wdq.wmflabs.org/api?q=claim%5B31%5D&props=31 -Instanzen
- Array of classes
Create table wp_coords_red0wd as
select *,
(select array_agg(CAST(nullif(instance, '') AS integer)) from instances as b where a."T_wikidata"=b.article) as classes
from wp_coords_red0 a
- Array of superclasses (one level more)
create table wp_coords_red0wd4 as
select *,
(select (a.classes || array_agg(superclass)) from superclass as c where c.class = ANY (a.classes)) as superclasses
from wp_coords_red0wd3 a
- Filter one class (Lighthouse)
select "Titel",instance,superclasses from wp_coords_red0wd4
where superclasses @> ARRAY[39715]
limit 100 offset 1000