MapStory / mapstory

MapStory is the free atlas of change that everyone can edit
http://mapstory.org
GNU General Public License v3.0
54 stars 41 forks source link

Sanitize attribute titles in Create Layer wizard so users can have spaces and special characters #369

Closed jonpmarino closed 7 years ago

jonpmarino commented 7 years ago

This is a spike. Further research is needed before features can be defined.

When using the Create StoryLayer tool, users can define Attributes for the features they will add to that StoryLayer. If they have spaces or special characters in their Attribute title, errors will result. See #367 for more information. Ideally we would sanitize the user entered information so that user's can have attribute titles with spaces and special characters.

For example, pretend I am trying to start a StoryLayer about the history of beer. I'm not a trained database modeler but maybe I worked in the beer industry for many years and know the start dates of hundreds of breweries around the United States. I may want to start a StoryLayer with attributes such as: Brewery Name, Founder's Name, and Brewery Type. the apostrophe in Founder's Name will cause an error, as well as all these spaces.

rob-metalinkage commented 7 years ago

As part of this, can we add documentation that makes it explicit how names in the input data (which may be allowed to have spaces etc) relate to names exposed in services - e.g. WMS and WFS getFeatureInfo, where the XML data mode doesnt allow such names,

The decision to expose data using OGC (and other standards based APIs) makes this a key architectural concern - will every service API expose using the same (minimal common supported) rules or will there be a translation for each platform and serialisation supported - in which case documentation needs to be attached to each piece of data IMHO.

One way of doing this is to publish a lookup table (using SKOS semantics standard I suggest) giving the attribute name as used for each platform. I suspect we may need to do this for the trivial case, as we will not be able to reverse engineer the original attribute name from the simplified normalised version, and i thinnk thats important metadata. (Its metadata I'd like to exploit to link places to the wider Web of Data, and ultimately use that to drive links back to Mapstory assets. IMHO A key lesson of wikipedia is citabilility is important, as are citations.)

rob-metalinkage commented 7 years ago

PS - happy to take this on as part of a second phase of gazetteer (and metadata) engineering - for now i recommend aiming for a simple minimal name and in the attributes model storing the original name for future reference.