logantracyo
Programmer
Hi! I'm actually trying to represent the NY State Learning Standards, but rather than trying to explain *those* to you in order to ask how to structure them, it seems more efficient to use the varying geopolitical divisions of Earth as an analogy that is more likely to be familiar to you:
In particular, I would like to avoid the kind of "force-fit" re-categorization that is usual -- for example, here in the US, 48 States are made up of Counties . . . but Louisiana is made up instead of Parishes, and Alaska uses Boroughs. Similiarly, most States have Townships as geographical divisions, which are similar to Police Jury Wards in Louisiana, and which the six New England states call Towns (a term that refers to a population center in the other States).
This structure is similiar to that of England, where we borrowed it -- but other countries are divided into Provinces, Regions, etc. (all of which is, again, quite similar to the disparate structure I'm really modelling!)
In an RDBMS, this is usually handled generically based on the divisions familiar to the DB designer, by force-fitting those Parishes and Boroughs into a Counties table, the Towns and Wards into Townships, and so on.
With XML, it's *possible* to treat them non-generically, to have the US States made up of either Counties, Parishes, or Boroughs -- but does it make sense to do so? Here's an example:
Old RDBMS "force-fit" method, in XML:
New non-generic method:
The second example just seems to capture "reality" so much better than the first one. But am I overlooking real-world consequences to doing it this way?
And what about DTD's or schemas? Obviously, this makes for more complexity there -- would providing namespaces for the different structures be a good way to deal with that?
Naturally, I'd appreciate any help you can provide -- even (or particularly?) just telling me "what this approach is called", suggesting some terminology I can use to search effectively; I've tried "variable schema" and "variable data structure" to no avail.
Thanks!
In particular, I would like to avoid the kind of "force-fit" re-categorization that is usual -- for example, here in the US, 48 States are made up of Counties . . . but Louisiana is made up instead of Parishes, and Alaska uses Boroughs. Similiarly, most States have Townships as geographical divisions, which are similar to Police Jury Wards in Louisiana, and which the six New England states call Towns (a term that refers to a population center in the other States).
This structure is similiar to that of England, where we borrowed it -- but other countries are divided into Provinces, Regions, etc. (all of which is, again, quite similar to the disparate structure I'm really modelling!)
In an RDBMS, this is usually handled generically based on the divisions familiar to the DB designer, by force-fitting those Parishes and Boroughs into a Counties table, the Towns and Wards into Townships, and so on.
With XML, it's *possible* to treat them non-generically, to have the US States made up of either Counties, Parishes, or Boroughs -- but does it make sense to do so? Here's an example:
Old RDBMS "force-fit" method, in XML:
Code:
<state name="New York">
<county name="Monroe">
<township name="Town of Gates" />
<township name="Town of Webster" />
</county>
</state>
<state name="Louisiana">
<county name="Orleans Parish">
<township name="Police Jury Ward 1" />
<township name="Police Jury Ward 2" />
</county>
</state>
New non-generic method:
Code:
<state name="New York">
<county name="Monroe">
<town name="Gates" />
<town name="Webster" />
</county>
</state>
<state name="Louisiana">
<parish name="Orleans">
<police-jury-ward name="1" />
<police-jury-ward name="2" />
</parish>
</state>
The second example just seems to capture "reality" so much better than the first one. But am I overlooking real-world consequences to doing it this way?
And what about DTD's or schemas? Obviously, this makes for more complexity there -- would providing namespaces for the different structures be a good way to deal with that?
Naturally, I'd appreciate any help you can provide -- even (or particularly?) just telling me "what this approach is called", suggesting some terminology I can use to search effectively; I've tried "variable schema" and "variable data structure" to no avail.
Thanks!