Portal Diskussion:Astronomie/Index

aus Wikipedia, der freien Enzyklopädie
Letzter Kommentar: vor 11 Jahren von LeastCommonAncestor in Abschnitt Aktualisierung
Zur Navigation springen Zur Suche springen

Was ist eigentlich der Sinn dieses Artikels?? Die zugehörige Vorlage haben wir ja schon. Müsste da nicht ein LA hin?--James Bond 007 21:15, 30. Jan 2005 (CET)

Ich als Außenstehender denke, diese Seite sollte als Einstiegs- und Oberseite für die Liste erhalten bleiben. --SirJective 10:34, 14. Mai 2005 (CEST)

Verwendete Abfrage

[Quelltext bearbeiten]

Hab die Liste aus dem Dump vom 21. April 2005 aktualisiert. Die Kategorie:Kalender und ihre Unterkategorien wurden dabei ausgeschlossen. Die Datenbank enthält 3683 Astronomie-Artikel in 150 Kategorien. Siehe auch Benutzer:SirJective/Datenbank-Abfragen#Index_A&R.

Ich verwendete folgende SQL-Abfrage. --SirJective 10:34, 14. Mai 2005 (CEST)

-- Alle existierenden Kategorien
drop table if exists allcats;
create table allcats(
  cat_id int(8) unsigned not null,
  cat_title varchar(255) binary not null,
  primary key (cat_id),
  unique key (cat_title)
);
replace into allcats
select cur_id, cur_title
from cur
where cur_namespace = 14;

-- Alle Links von existierender Kategorie zu existierender Kategorie
drop table if exists catlinks;
create table catlinks(
  cat_child int(8) unsigned not null,
  cat_parent int(8) unsigned not null,
  key (cat_child),
  key (cat_parent)
);
insert into catlinks
select child.cat_id, parent.cat_id
from allcats as child, categorylinks, allcats as parent
where child.cat_id = cl_from
and parent.cat_title = cl_to;

-- ----

-- Erzeugt eine Tabelle aller Kategorien,
-- mit Platz fuer die Angabe ob es Astronomie-Kategorien sind.

drop table if exists cat_astro;
create table cat_astro(
  cat_id int(8) unsigned not null,
  cat_title varchar(255) binary not null,
  depth_astro tinyint(2) not null,
  primary key (cat_id),
  unique key (cat_title),
  key (depth_astro, cat_id)
);

insert into cat_astro
select cat_id, cat_title, 0
from allcats;

-- ----

-- Identifizierung der Astronomie-Kategorien

-- Kategorien, deren Unterkategorien bestimmt werden sollen, kriegen 1.
update cat_astro
set depth_astro = 1
where cat_title = 'Astronomie'
or cat_title = 'Raumfahrt';

-- Kategorien, deren Unterkategorien nicht bestimmt werden sollen, kriegen -1.
-- Diese Kategorien werden selbst aber beachtet.
update cat_astro
set depth_astro = -1
where 0
;

-- Kategorien, die nicht beachtet werden sollen, kriegen -2.
update cat_astro
set depth_astro = -2
where cat_title = 'Kalender'
;

update cat_astro as ch, catlinks, cat_astro as par
set ch.depth_astro = 2
where ch.depth_astro = 0
and ch.cat_id = cat_child
and cat_parent = par.cat_id
and par.depth_astro = 1;

update cat_astro as ch, catlinks, cat_astro as par
set ch.depth_astro = 3
where ch.depth_astro = 0
and ch.cat_id = cat_child
and cat_parent = par.cat_id
and par.depth_astro = 2;

update cat_astro as ch, catlinks, cat_astro as par
set ch.depth_astro = 4
where ch.depth_astro = 0
and ch.cat_id = cat_child
and cat_parent = par.cat_id
and par.depth_astro = 3;

update cat_astro as ch, catlinks, cat_astro as par
set ch.depth_astro = 5
where ch.depth_astro = 0
and ch.cat_id = cat_child
and cat_parent = par.cat_id
and par.depth_astro = 4;

update cat_astro as ch, catlinks, cat_astro as par
set ch.depth_astro = 6
where ch.depth_astro = 0
and ch.cat_id = cat_child
and cat_parent = par.cat_id
and par.depth_astro = 5;

update cat_astro as ch, catlinks, cat_astro as par
set ch.depth_astro = 7
where ch.depth_astro = 0
and ch.cat_id = cat_child
and cat_parent = par.cat_id
and par.depth_astro = 6;

update cat_astro as ch, catlinks, cat_astro as par
set ch.depth_astro = 8
where ch.depth_astro = 0
and ch.cat_id = cat_child
and cat_parent = par.cat_id
and par.depth_astro = 7;

update cat_astro as ch, catlinks, cat_astro as par
set ch.depth_astro = 9
where ch.depth_astro = 0
and ch.cat_id = cat_child
and cat_parent = par.cat_id
and par.depth_astro = 8;

update cat_astro as ch, catlinks, cat_astro as par
set ch.depth_astro = 10
where ch.depth_astro = 0
and ch.cat_id = cat_child
and cat_parent = par.cat_id
and par.depth_astro = 9;

update cat_astro as ch, catlinks, cat_astro as par
set ch.depth_astro = 11
where ch.depth_astro = 0
and ch.cat_id = cat_child
and cat_parent = par.cat_id
and par.depth_astro = 10;

update cat_astro as ch, catlinks, cat_astro as par
set ch.depth_astro = 12
where ch.depth_astro = 0
and ch.cat_id = cat_child
and cat_parent = par.cat_id
and par.depth_astro = 11;

delete from cat_astro
where depth_astro = 0 or depth_astro < -1;
OPTIMIZE TABLE cat_astro;

select count(*), ' Astronomie-Kategorien gefunden.'
from cat_astro;

-- ----

-- Tabelle der Artikel in Astronomie-Kategorien.
drop table if exists cat_astro_art;
create table cat_astro_art(
  key (p_id)
)
select distinct cur_id as p_id, cur_title as p_title, cl_sortkey as p_sortkey
from cat_astro, categorylinks use index (cl_to), cur
where cat_title = cl_to
and cl_from = cur_id
and cur_namespace = 0;

select count(*), ' Astronomie-Artikel gefunden.'
from cat_astro_art;

-- ----

-- Ausgabe der Ergebnisse. Bei Artikeln mit mehreren Sortierschluesseln
-- wird nur einer (mehr oder weniger zufaellig) ausgewaehlt.

select concat('*[[',p_title,'|', p_sortkey,']]')
from cat_astro_art
group by p_id
order by p_sortkey;

Achja: Der in einer der Abfragen verwendete Index categorylinks.cl_to gehört nicht zur Standardausstattung. Ich lege ihn beim Import der Tabelle an, indem ich den Kopf des Dumps editiere:

"INDEX cl_to (cl_to, cl_from),"

Prinzipiell kann man aber auch auf den Index verzichten und muss nur seine Erwähnung in der Abfrage entfernen. --SirJective 10:59, 14. Mai 2005 (CEST)

Die Artikel werden nach folgenden Kriterien ausgesucht und sortiert:

  • Betrachtet werden alle Artikel in den Unterkategorien von "Astronomie" und "Raumfahrt", wobei die Suche die Kategorien "Kalender", "Rakete_(militärisch)", "Portalseite_(Astronomie)", "Solarenergie", "Geomorphologie" ignoriert (Artikel in diesen Kategorien oder deren Unterkategorien werden nur betrachtet, wenn sie durch andere Unterkategorien erreichbar sind).
  • Es werden alle Weiterleitungsseiten auf irgendeinen dieser Artikel bestimmt.
  • Zu jedem Artikel werden alle vorhandenen Sortierschlüssel bestimmt, und für jeden Sortierschlüssel:
    • Der Artikel wird mit dem Sortierschlüssel aufgelistet, wenn
      • der Sortierschlüssel gleich "!" ist und er der einzige Sortierschlüssel ist, oder
      • der Sortierschlüssel ungleich "!" und nicht gleich dem Artikeltitel ist.
    • Der Artikel wird ohne den Sortierschlüssel aufgelistet, wenn
      • der Sortierschlüssel ungleich "!" ist und
      • der Sortierschlüssel gleich dem Artikeltitel ist.
  • Als "gleich dem Artikeltitel" wird ein Sortierschlüssel auch dann betrachtet, wenn er gleich "" oder " " ist. Nach diesen Regeln werden bestimmte Titel/Schlüssel-Kombinationen nicht aufgelistet, es wird aber hoffentlich jeder Artikel wenigstens einmal aufgelistet.
  • Artikel werden nach ihrem Sortierschlüssel sortiert, oder - bei Ausgabe ohne Schlüssel - nach ihrem Titel.
  • Nach demselben Schema werden kategorisierte Weiterleitungsseiten ausgegeben (davon gibt es nur eine Handvoll). Diese sind zusätzlich durch ein nachgestelltes "(k)" gekennzeichnet.
  • Jede Weiterleitungsseite wird alphabetisch in die Artikelliste einsortiert, und zusätzlich beim Weiterleitungsziel angegeben. Weiterleitungen sind durch die Textklasse "allpagesredirect" gekennzeichnet, die in der Standarnkonfiguration zur ein Kursivschreibung sorgt.

Die Daten für dieses Update stammen aus dem Dump vom 5. Februar 2006.

Mittels einer SQL-Abfrage erzeuge ich eine fast fertige Liste, die mit einem Java-Programm in das endgültige Format gebracht wird. --SirJective 00:18, 16. Feb 2006 (CET)

Aktualisierung

[Quelltext bearbeiten]

Ich habe die Unterseiten heute aktualisiert. Erfasst sind alle

--LeastCommonAncestor (Diskussion) 01:10, 10. Jan. 2013 (CET)Beantworten