From 2d44735e2e2ae4514c7e2b70f516c8f1bbc0df0e Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Thu, 10 Jan 2013 09:55:21 +0100 Subject: Create list of interesting relation types Currently "interesting" means just all relations types that occure more than 100 times. This list is generated on update. It is currently not used but will be needed for more detailed relation type statistics. --- sources/master/interesting_relation_types.sql | 29 +++++++++++++++++++++++++++ sources/master/update.sh | 1 + 2 files changed, 30 insertions(+) create mode 100644 sources/master/interesting_relation_types.sql (limited to 'sources/master') diff --git a/sources/master/interesting_relation_types.sql b/sources/master/interesting_relation_types.sql new file mode 100644 index 0000000..18aab2d --- /dev/null +++ b/sources/master/interesting_relation_types.sql @@ -0,0 +1,29 @@ +-- ============================================================================ +-- +-- Taginfo +-- +-- interesting_relation_types.sql +-- +-- ============================================================================ + +.bail ON + +ATTACH DATABASE '__DIR__/db/taginfo-db.db' AS db; + +-- ============================================================================ + +DROP TABLE IF EXISTS interesting_relation_types; +CREATE TABLE interesting_relation_types ( + rtype TEXT +); + +INSERT INTO interesting_relation_types (rtype) + SELECT value FROM db.tags WHERE key='type' AND count_relations > 100; + +ANALYZE interesting_relation_types; + +.output __DIR__/db/interesting_relation_types.lst + +SELECT rtype FROM interesting_relation_types ORDER BY rtype; + +-- ============================================================================ diff --git a/sources/master/update.sh b/sources/master/update.sh index e3f5413..99d16b0 100755 --- a/sources/master/update.sh +++ b/sources/master/update.sh @@ -30,6 +30,7 @@ rm -f $DATABASE sqlite3 $DATABASE