If sidewalks are mapped as separate ways like here, then other pedestrian features should be connected to sidewalks.
If sidewalks are mapped as tags on the roads themselves, then the pedestrian features should be connected to the road.
If you have any other questions, feel free to ask. 👍