Skip to content

Commit

Permalink
name-suggestion-index #4: added more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
fititnt committed Dec 7, 2022
1 parent e211e83 commit efd5c9b
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 3 deletions.
29 changes: 26 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ <h2>Presets</h2>

<p class="ednote" title="name-suggestion-index presets">
name-suggestion-index also releases their data as Presets? Humm. See
<a href="https://github.com/osmlab/name-suggestion-index/tree/main/dist/presets">https://github.com/osmlab/name-suggestion-index/tree/main/dist/presets</a>.
<a
href="https://github.com/osmlab/name-suggestion-index/tree/main/dist/presets">https://github.com/osmlab/name-suggestion-index/tree/main/dist/presets</a>.
</p>
<!--
- About unifying presets
Expand All @@ -358,7 +359,8 @@ <h3>iD style presets</h3>
</a>
</li>
<li>
<a href="https://raw.githubusercontent.com/osmlab/name-suggestion-index/main/dist/presets/nsi-id-presets.json">
<a
href="https://raw.githubusercontent.com/osmlab/name-suggestion-index/main/dist/presets/nsi-id-presets.json">
https://raw.githubusercontent.com/osmlab/name-suggestion-index/main/dist/presets/nsi-id-presets.json
</a>
</li>
Expand Down Expand Up @@ -396,6 +398,9 @@ <h3>JOSM style presets</h3>
<pre class="example" title="A NSI+JSOM Preset (canonical) reference, preset-nsi-josm" data-content-type="xml"
data-oninclude="escapeExample" data-include="reference/preset/preset-nsi-josm.xml">
</pre>
<pre class="example" title="A NSI+ID Preset (canonical) reference, preset-nsi-id" data-content-type="json"
data-oninclude="escapeExample" data-include="reference/preset/preset-nsi-id.json">
</pre>
</section>
<section>
<h3>OsmAnd style presets</h3>
Expand Down Expand Up @@ -452,7 +457,25 @@ <h2>name-suggestion-index</h2>
<h3>nsi.json</h3>
<pre class="example" title="nsi.json (reference)" data-content-type="json" data-oninclude=""
data-include="reference/name-suggestion-index/nsi.json">
</pre>
</pre>
</section>
<section>
<h3>replacements.json</h3>
<pre class="example" title="replacements.json (reference)" data-content-type="json" data-oninclude=""
data-include="reference/name-suggestion-index/replacements.json">
</pre>
<pre class="example" title="replacements.rq SPARQL" data-content-type="application/sparql-query" data-oninclude=""
data-include="proposal/name-suggestion-index/replacements.rq">
</pre>
</section>
<section>
<h3>warnings.json</h3>
<pre class="example" title="warnings.json (reference)" data-content-type="json" data-oninclude=""
data-include="reference/name-suggestion-index/warnings.json">
</pre>
<!--
Here good candidate for SHACL
-->
</section>
</section>

Expand Down
2 changes: 2 additions & 0 deletions proposal/name-suggestion-index/replacements.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Maybe SPARQL?
# see https://stackoverflow.com/questions/56665588/is-there-a-good-example-of-how-to-use-sparql-to-replace-a-substring-with-another
18 changes: 18 additions & 0 deletions reference/name-suggestion-index/replacements.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"_meta": {
"version": "6.0.20221205",
"generated": "2022-12-05T06:14:41.645Z",
"url": "https://raw.githubusercontent.com/osmlab/name-suggestion-index/main/dist/replacements.json",
"hash": "9250009717da869c05a5c2fa206f103f"
},
"replacements": {
"Q97365372": {
"note": "Proman - Wikidata redirect",
"wikidata": "Q24189171"
},
"Q18720442": {
"note": "But - Wikidata redirect",
"wikidata": "Q2877537"
}
}
}
22 changes: 22 additions & 0 deletions reference/name-suggestion-index/warnings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"_meta": {
"version": "6.0.20221205",
"generated": "2022-12-05T06:14:41.698Z",
"url": "https://raw.githubusercontent.com/osmlab/name-suggestion-index/main/dist/warnings.json",
"hash": "f626f07ad2dbbda8fb1d609ab8836aaf"
},
"warnings": [
{
"qid": "Q647092",
"msg": "Banca Intesa might possibly be replaced by Q1343118"
},
{
"qid": "Q113528897",
"msg": "⚠️ Entity for \"Matcha Cafe Maiko\" was deleted."
},
{
"qid": "Q110278626",
"msg": "Entity for \"Q110278626\" missing English label."
}
]
}
61 changes: 61 additions & 0 deletions reference/preset/preset-nsi-id.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"_meta": {
"version": "6.0.20221205",
"generated": "2022-12-05T06:14:46.202Z",
"url": "https://raw.githubusercontent.com/osmlab/name-suggestion-index/main/dist/presets/nsi-id-presets.json",
"hash": "8bed5489ff39ee4dbd38ce0955e70d9e"
},
"presets": {
"amenity/animal_boarding/dogtopia-03770a": {
"name": "Dogtopia",
"locationSet": {"include": ["ca", "us"]},
"icon": "maki-veterinary",
"geometry": ["point", "area"],
"matchScore": 2,
"imageURL": "https://graph.facebook.com/Dogtopia/picture?type=large",
"terms": ["dogtopia"],
"tags": {"amenity": "animal_boarding", "brand:wikidata": "Q112037444"},
"addTags": {
"amenity": "animal_boarding",
"animal_boarding": "dog",
"brand": "Dogtopia",
"brand:wikidata": "Q112037444",
"name": "Dogtopia"
}
},
"amenity/animal_boarding/petshotel-03770a": {
"name": "PetsHotel",
"locationSet": {"include": ["ca", "us"]},
"icon": "maki-veterinary",
"geometry": ["point", "area"],
"matchScore": 2,
"imageURL": "https://graph.facebook.com/PetSmart/picture?type=large",
"terms": ["petshotel"],
"tags": {"amenity": "animal_boarding", "brand:wikidata": "Q67141961"},
"addTags": {
"amenity": "animal_boarding",
"animal_boarding": "dog;cat",
"brand": "PetsHotel",
"brand:wikidata": "Q67141961",
"name": "PetsHotel"
}
},
"amenity/animal_boarding/petsuites-a2c409": {
"name": "PetSuites",
"locationSet": {"include": ["us"]},
"icon": "maki-veterinary",
"geometry": ["point", "area"],
"matchScore": 2,
"imageURL": "https://graph.facebook.com/petsuitesstayandplay/picture?type=large",
"terms": ["petsuites"],
"tags": {"amenity": "animal_boarding", "brand:wikidata": "Q112037454"},
"addTags": {
"amenity": "animal_boarding",
"animal_boarding": "dog;cat",
"brand": "PetSuites",
"brand:wikidata": "Q112037454",
"name": "PetSuites"
}
}
}
}
15 changes: 15 additions & 0 deletions reference/preset/preset-nsi-josm.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<presets xmlns="http://josm.openstreetmap.de/tagging-preset-1.0" author="Name Suggestion Index" shortdescription="Name Suggestion Index" description="Canonical common brand names for OpenStreetMap" link="https://github.com/github:osmlab/name-suggestion-index" version="6.0.20221205">
<!-- From https://raw.githubusercontent.com/osmlab/name-suggestion-index/main/dist/presets/nsi-josm-presets.xml -->
<!-- Trivia: compare with preset-nsi-id (have more information about applicable area -->
<group name="Name Suggestion Index">
<group name="brands">
<group name="amenity">
Expand All @@ -12,6 +13,20 @@
<key key="brand:wikidata" value="Q112037444" />
<key key="name" value="Dogtopia" />
</item>
<item name="PetsHotel" type="node,closedway,multipolygon">
<key key="amenity" value="animal_boarding" />
<key key="animal_boarding" value="dog;cat" />
<key key="brand" value="PetsHotel" />
<key key="brand:wikidata" value="Q67141961" />
<key key="name" value="PetsHotel" />
</item>
<item name="PetSuites" type="node,closedway,multipolygon">
<key key="amenity" value="animal_boarding" />
<key key="animal_boarding" value="dog;cat" />
<key key="brand" value="PetSuites" />
<key key="brand:wikidata" value="Q112037454" />
<key key="name" value="PetSuites" />
</item>
</group>
</group>
</group>
Expand Down

0 comments on commit efd5c9b

Please sign in to comment.