[OSM-dev] Datamodel relation/member constraints

Robert Vollmert rvollmert-lists at gmx.net
Sat May 31 08:15:51 BST 2008


On May 30, 2008, at 23:18, Thomas Wood wrote:

> On Fri, May 30, 2008 at 9:21 PM, Stefan de Konink  
> <skinkie at xs4all.nl> wrote:
>> So would it be allowed to do:
>>
>> type=node ref=1 role=from
>> type=node ref=2 role=at
>> type=node ref=1 role=at
>> type=node ref=3 role=to
>>
>> Or is the second 1 not allowed?
>>
> If by ref you mean node id, then yes, the second 1 is not allowed.
> The API used to throw an unhandled exception back at you (500) if you
> did it because of an index constraint on the database.
> This has recently been fixed to actually return a nice error and stop
> corrupting the database. (Although it may not have been deployed yet)

I'd hoped we only require the triple type/ref/role to occur at most  
once in a relation -- I'm sure there's some situations where one  
object logically fills two different roles in a relation.

Examples: Modelling a u-turn-restriction with from,at,to roles, in  
which case from and to might be the same object. Start and End nodes  
in circular routes.

Cheers
Robert





More information about the dev mailing list