Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source updates, usage tagging #110

Merged
merged 36 commits into from
May 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
07d7827
first pass at adding all flags to src jsons
stepps00 May 18, 2018
e16baf6
makefile run
stepps00 May 18, 2018
4c5f0cb
deprecated sources, add logic to docs.py
stepps00 May 18, 2018
fa5de9e
updated three sources, links, docs.py update
stepps00 May 18, 2018
a82fbcc
more docs.py logic, makefile run to update src via links
stepps00 May 19, 2018
bd28f55
formatting to add new line in README
stepps00 May 19, 2018
b62b225
src:via description to readme
stepps00 May 19, 2018
c3d0476
update template
stepps00 May 19, 2018
293e1cf
src:via work, json formatting
stepps00 May 21, 2018
f57f9fd
docs.py logic for writing src:via and deprecated date
stepps00 May 21, 2018
087f17b
README updates
stepps00 May 21, 2018
4a3c3e3
property prefix links to prop repo
stepps00 May 21, 2018
9c3ff4f
more usage tags for geometry
stepps00 May 21, 2018
6d623e6
makefile run
stepps00 May 21, 2018
f2f003f
update usage tags, logic in docs py
stepps00 May 21, 2018
db8e294
quotemark
stepps00 May 21, 2018
f65864f
makefile run
stepps00 May 21, 2018
6119686
update template file
stepps00 May 21, 2018
d58d008
another makefile run
stepps00 May 21, 2018
22c6a2b
QS updates, make all
stepps00 May 21, 2018
476f005
formatting in readme
stepps00 May 21, 2018
3de1238
deprecated two sources
stepps00 May 22, 2018
332210a
make file run
stepps00 May 22, 2018
22ee8c9
deprecated localwiki source file
stepps00 May 22, 2018
bf53b42
mapzen-derived, docs.py logic
stepps00 May 22, 2018
878ce4e
comments in docs.py, swap derived w associated
stepps00 May 22, 2018
e411ad8
meso json updates for all src:via:
stepps00 May 22, 2018
9241624
update mapzen.json
stepps00 May 22, 2018
a228c1e
make all run
stepps00 May 22, 2018
2c47feb
wapo link update, make all
stepps00 May 22, 2018
dca8d82
update frgov
stepps00 May 22, 2018
ebda4f2
yerbashapes description update and src:via property
stepps00 May 22, 2018
12630c5
make all, updated meso and mapzen, template, and readme
stepps00 May 22, 2018
3439603
write links in markdown in docs.py
stepps00 May 23, 2018
2193eda
statoids words
stepps00 May 23, 2018
83045cb
make all run
stepps00 May 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ While a source .json file in the `whosonfirst-sources` repository does not requi

* `"license_text":` A one to two sentence description of what the license allows (_string, optional property_).

* `"src:via"`: A list of sources used by a source. A list of key/value pairs that includes the source context, source name, link to the source website, and a note about the source (_list, optional property_). See the [template file](source_template.json) for an example.

* `"usage_concordance":` Represents whether or not this source is used for concordance values (_integer, required property_). `1` value indicates use, `0` value indicates no use, `-1` value indicates unsure of use.

* `"usage_property":` Represents whether or not this source is used for property values (_integer, required property_). `1` value indicates use, `0` value indicates no use, `-1` value indicates unsure of use.
Expand All @@ -40,6 +42,12 @@ While a source .json file in the `whosonfirst-sources` repository does not requi

* `"description":` A one to two sentence description of the source (_string, optional property_).

* `"mz:is_current":` Represents whether of not a source is currently in use (_integer, optional property_). `0` signifies "not current".

* `"mz:associated":` Represents a source associated with works at Mapzen (_integer, optional property_). `1` signifies "Mapzen associated".

* `"edtf:deprecated":` Indicates the date when a source was determined to be invalid, was never a "going concern" (_string, optional property_). _Format: YYYY-MM-DD (though these dates can be encoded with any valid EDTF syntax)_.

## See also

* https://github.com/whosonfirst
Expand Down
31 changes: 30 additions & 1 deletion bin/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

docs.write("_This file was generated by the `bin/docs.py` script on %s_\n\n" % ymd)

docs.write("_All sources listed below are currently used to populate Who's On First records or will be added to Who's On First records in the near future._")

for n in names:

id = lookup[n]
Expand All @@ -52,6 +54,15 @@
if details.get('description'):
docs.write("_%s_ \n\n" % (details['description']))

#call out mz associated sources (wof, transitland, etc)
if details.get('mz_associated'):
docs.write("_This is a Mapzen associated source._ \n\n")

#call out deprecated sources and their deprecated date
if details.get('edtf:deprecated'):
if not details['edtf:deprecated'] == 'uuuu':
docs.write("* %s %s.\n" % ('This source was deprecated on', details['edtf:deprecated']))

for k in ('id', 'name', 'prefix'):

if details[k] == '':
Expand All @@ -70,13 +81,31 @@
if details.get('remarks'):
docs.write("* %s: _%s_\n" % ('remarks', details['remarks']))

#link to the license page for each source if page is available
if details.get('license') and details.get('license').startswith("http"):
docs.write("* %s: _%s_\n" % ('license', details['license']))
else:
docs.write("* %s: `%s`\n" % ('license', details['license']))

#list out all "via" sources with links to each source's source...
if details.get('src:via'):
docs.write("\n This source includes `CC-BY compatible` data from the following organizations:\n")
for via in details['src:via']:
if not via['source_link'] == "":
if via['source_note']:
docs.write(" \t* **%s**: [%s](%s) - %s\n" % (via["context"],via["source_name"],via["source_link"],via["source_note"]))
else:
docs.write(" \t* **%s**: [%s](%s)\n" % (via["context"],via["source_name"],via["source_link"]))

else:
if via['source_note']:
docs.write(" \t* **%s**: %s - %s\n" % (via["context"],via["source_name"],via["source_note"]))
else:
docs.write(" \t* **%s**: %s\n" % (via["context"],via["source_name"]))

usage = []


#catch any usage flag and append it as markdown to a usage: prop, if found
if details.get('usage_concordance'):
if details['usage_concordance'] == 1:
usage.append("`concordance`")
Expand Down
1 change: 1 addition & 0 deletions data/sources-spec-20180518.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/sources-spec-20180521.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/sources-spec-20180522.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/sources-spec-latest.json

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions source_template.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id":-1,
"id": -1,
"fullname": "",
"name": "",
"prefix": "",
Expand All @@ -8,8 +8,17 @@
"license": "",
"license_type": "",
"license_text": "",
"usage_concordance":-1,
"usage_property":-1,
"usage_geometry":-1,
"src:via": [{
"context": "Canada",
"source_link": "http://statcan.gc.ca/",
"source_name": "Statistics Canada",
"source_note": "Canadian open data portal."
}],
"mz:associated":-1
"mz:is_current": -1,
"edtf:deprecated": "YYY-MM-DD",
"usage_concordance": -1,
"usage_property": -1,
"usage_geometry": -1,
"description": ""
}
Loading