[OSM-dev] API 0.5 is on the way

michael J michael_j at email.de
Sat Sep 15 19:07:03 BST 2007


Hi Martijn,

Martijn van Oosterhout wrote:
>> 1) Relation definition which allows any unordered 'member', 'tag'
>> combination, that contains at least one 'member' as child node:
>>
>> <!ELEMENT relation (tag*, member, (member | tag)*)>
> 
> Frederik kicked me for this: he suggests that a relation needs either
> a member or a tag but not both.

Uups. The documentation is vague on this point too. We should update it 
with the final resolution.

A relation without a member?? That is probably hard to retrieve back 
from the database.

I'd like to understand the use case behind.


According to the DTD Relations may point to Relations:

<!ELEMENT relation ((tag|member)+)>
<!ATTLIST relation id        CDATA #REQUIRED>

<!ELEMENT member EMPTY>
<!ATTLIST member type (way|node|relation) #REQUIRED>
<!ATTLIST member ref  CDATA  #REQUIRED>

This might lead to "Circular referenced Relations". A set of relations 
pointing to each other and that have no references to a way or a node.



Independently from the issue above I have below an example, how the DTD
could be extended to cover the complete structure of the payload too.
It also help defining the "Advanced Object Access Methods".

However, if used it has the draw back that we would need to introduce 
another child element node below the OSM root node. As it would require 
code changes, I am interested to hear if such code changes  are useful 
enough to get into the code basis.

Michael

<!ELEMENT osm (create|retrieve|update|delete)>

<!ELEMENT create   (node|relation|way)>
<!ELEMENT retrieve (bound?,(node|relation|way)*)>
<!ELEMENT update   ((node|relation|way)*)>
<!ELEMENT delete   (node|relation|way)>

<!ELEMENT osm (
   create_node
| create_way
| create_relation

| retrieve_node
| retrieve_way
| retrieve_relation
| retrieve_bounding_box

| update_node
| update_way
| update_relation

| delete_node
| delete_way
| delete_relation)>

<!ELEMENT create_node              node>
<!ELEMENT create_way               way>
<!ELEMENT create_relation          relation>

<!ELEMENT retrieve_node            node>
<!ELEMENT retrieve_way             way>
<!ELEMENT retrieve_relation        relation>
<!ELEMENT retrieve_bounding_box    (bound,(node|relation|way)*)>

<!ELEMENT update_node              node>
<!ELEMENT update_way               way>
<!ELEMENT update_relation          relation>

<!ELEMENT delete_node              node>
<!ELEMENT delete_way               way>
<!ELEMENT delete_relation          relation>

+ Rest from 0.5 DTD





More information about the dev mailing list