Semantic Conventions for OpenStreetMap™ 2023

Mappings from common file formats to RDF, and other considerations

Abstract

This document contains reference examples of types files with their schemas known to be used for exchanging data with developers of tools around the ecosystem of OpenStreetMap with potential conventions to their counterpart with one or more encodings of Semantic Web standards. However, it is assumed that the average target audience will not read standards (or, if they do, not need more than superficial knowledge), but are still interested in a simpler approach to make tooling interoperable.

OpenStreetMap™ is a trademark of the OpenStreetMap Foundation, and is used with their permission. This project is not endorsed by or affiliated with the OpenStreetMap Foundation. (More about OSMF Trademark Policy)

Introduction

The OpenStreetMap ecosystem has several ways to exchange data, including machine-readable documentation and validation. Instead of explaining each kind of format, the intent here is to be a very superficial, example-oriented, quick reference between each format. Readers interested in more details are recommended to look for the [[[#references]]]. However, the idea here is to be a quick start for developers who just want to get things working, while also having a general overview good enough to consistently encode so many file formats that without such superficiality, never would be possible.

Terminology

Related specifications

At this moment, this section is mostly a list to make respecs show references at the bottom of the page. Some may be removed, and others added.

Namespaces

For more information about this section, see RDF Vocabularies and Namespace IRIs in [[[rdf11-concepts]]].

While this section already uses RFC2119 keywords, the actual suggestions are an early draft and open to testing and discussion.

Namespaces dedicated to OpenStreetMap use

Is RECOMMENDED to use the following conventions for namespace IRIs.

      

Common namespaces

The examples in this document may omit the prefixes. The list below provides their equivalence.

      

Data Primitives

Node

      
      
      

Way

      
      
      

Relation

      
      

    

Tag

Please see examples above where XML encoding has <tag k="" v="" /> and RDF/Turtle uses osmt: prefix.

Data change

This section contains examples able to make changes on data or explain past changes from [[[#data-primitives]]].

Changeset

      

History

Tag metadata

Wiki Infobox Tag

How to encode Wiki infoboxes for tags in RDF/Turtle?

      
      


      

    

Presets

See https://wiki.openstreetmap.org/wiki/Preset.

name-suggestion-index also releases their data as Presets? Humm. See https://github.com/osmlab/name-suggestion-index/tree/main/dist/presets.

iD style presets

JOSM style presets

Opinions are welcome.
What about https://wiki.openstreetmap.org/wiki/Name_Suggestion_Index ?
      
      
      
      

OsmAnd style presets

name-suggestion-index

Opinions are welcome.

nsi.json

      

replacements.json

      
      

warnings.json

      

Semantic elements

Point

Linear features

Areas

Relational

Wiki-as-base

Point

Linear features

Areas

Relational

Quality Assurance

The idea of Quality Assurance is for files not already covered by more specific topics, but still dedicated to checking for potential errors.

JSOM data validator (mapcss)


      

    

SHACL

See [[[shacl]]].

Data Primitives SHACL

This section documents how to use SHACL to validate [[[#data-primitives]]] if encoded like the [[[#data-primitives-ontology]]]. It's simple, allows readers to have an overview on how to use SHACL to check for errors with rules most people would already agree with.
But this use might be not necessary if the input data is known to be working (e.g. either database or validations of file formats would detect syntax errors).


    

Inference

The inference may be moved out of this document.

Wiki explanation about maxspeed



      
    

Data Primitives Ontology


  

This is required for specifications that contain normative material.