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:belongstoproperties.- This test envokes a list of
wof:idvalues and the known values in that record'swof:belongstoproperty. This test should be run locally when updating and rebuilding hierarchies to verify that no values are being stripped out of thewof:belongstoproperty.
- This test envokes a list of
-
test_isparent.js: A routine test to verify
wof:parent_idproperties.- This test envokes a list of
wof:idvalues and the known values in that record'swof:parent_idproperty. This test should be run locally when updating records to verify that no records are incorrectly given a newwof:parent_idvalue.
- 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_preferredproperty.- 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_preferredproperty, 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:langproperty, as well as aname:[lang]_x_preferredproperty for thewof:langvalue.- This test checks for two separate things in a Who's On First record:
- Verifies that a
wof:langproperty exists and returns the value of that property. - Verifies that a record also has a
name:[lang]_x_preferredproperty, where[lang]is equal to the value of thewof:langproperty.
- 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_byandwof:supersededproperties, by doing the following:- Checks that a record's (record A)
wof:superseded_byvalue matches thewof:idof an existing record (record B). - If so, checks that record B's
wof:supersedesproperty value matches record A'swof:idvalue.
- 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:latitudeandwk:longitudevalues 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