You're describing a very small social network. If every person's immediate family and close social network is a "community", then "community" loses all meaning.
Do I care about the other people just in my apartment building? Not above a minimal base level of caring for anyone, apart from a few cute little kids. Do I know anyone else in the building? No, not really, not even the cute little kids. Would I help one of them in an emergency? Sure.
But we are a community in the sense that we have shared interests: that the elevators be kept running, that power be kept on, that the water supply be kept going, that the parking lot be plowed, that the garbage be collected. We may never have cause to work together in support of these shared interests, but the potential exists.
Other relations between members are possible as well. Students and faculty at a university, for instance. Or staff and patients at a hospital. Or a regional technology interest group. In these cases, membership in the communities is more tenuous, and is maintained by group participation, enrollment in the university, participation in a hospital treatment program, etc.
Virtual communities such as HN are almost entirely reliant on interaction for establishing membership.