diff options
author | Jochen Topf <jochen@topf.org> | 2013-01-10 09:55:21 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2013-01-10 09:55:21 +0100 |
commit | 2d44735e2e2ae4514c7e2b70f516c8f1bbc0df0e (patch) | |
tree | 2e5cfe405a5683960f56e843e1bd0c1cca8a7db2 /sources/master | |
parent | 3e12a769fd3c23532722409ab13d5d9ba251945b (diff) | |
download | taginfo-2d44735e2e2ae4514c7e2b70f516c8f1bbc0df0e.tar taginfo-2d44735e2e2ae4514c7e2b70f516c8f1bbc0df0e.tar.gz |
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.
Diffstat (limited to 'sources/master')
-rw-r--r-- | sources/master/interesting_relation_types.sql | 29 | ||||
-rwxr-xr-x | sources/master/update.sh | 1 |
2 files changed, 30 insertions, 0 deletions
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 <languages.sql perl -pe "s|__DIR__|$DIR|" master.sql | sqlite3 $DATABASE perl -pe "s|__DIR__|$DIR|" interesting_tags.sql | sqlite3 $DATABASE +perl -pe "s|__DIR__|$DIR|" interesting_relation_types.sql | sqlite3 $DATABASE echo "`$DATECMD` Done master." |