whosonfirst-tests
Testing known-knowns and properties in Who's On First records.
2017-05-12: This document should be considered a work-in-progress
Types of tests
Validating known-knowns in Who's On First
-
test_belongsto.js: A routine test to verify
wof:belongsto
properties.- This test envokes a list of
wof:id
values and the known values in that record'swof:belongsto
property. This test should be run locally when updating and rebuilding hierarchies to verify that no values are being stripped out of thewof:belongsto
property.
- This test envokes a list of
-
test_isparent.js: A routine test to verify
wof:parent_id
properties.- This test envokes a list of
wof:id
values and the known values in that record'swof:parent_id
property. This test should be run locally when updating records to verify that no records are incorrectly given a newwof:parent_id
value.
- This test envokes a list of
Testing Who's On First properties
-
test_lang_names.js: A test to ensure a record or set of records has a
name:eng_x_preferred
property.- This test can be used as a one-off to verify a record has a specified property. As it stands, this test checks for the
name:eng_x_preferred
property, but can be configured to check of other properties.
- This test can be used as a one-off to verify a record has a specified property. As it stands, this test checks for the
-
test_official_lang_names.js: A test to ensure a record or set of records has a
wof:lang
property, as well as aname:[lang]_x_preferred
property for thewof:lang
value.- This test checks for two separate things in a Who's On First record:
- Verifies that a
wof:lang
property exists and returns the value of that property. - Verifies that a record also has a
name:[lang]_x_preferred
property, where[lang]
is equal to the value of thewof:lang
property.
- Verifies that a
- This test checks for two separate things in a Who's On First record:
-
test_superseded_by.js: A test to validate records'
wof:superseded_by
andwof:superseded
properties, by doing the following:- Checks that a record's (record A)
wof:superseded_by
value matches thewof:id
of an existing record (record B). - If so, checks that record B's
wof:supersedes
property value matches record A'swof:id
value.
- Checks that a record's (record A)
-
wk_mismatch: (in folder) A test to validate records'
wk:*
properties, by doing the following:- Checks that a record's
wk:latitude
andwk:longitude
values fall within it's parent's geometry.
- Checks that a record's
See also
https://github.com/whosonfirst
https://github.com/whosonfirst/whosonfirst-json-schema
https://github.com/whosonfirst/py-mapzen-whosonfirst-validator
https://github.com/whosonfirst/whosonfirst-www-boundaryissues