A couple days ago, I discussed how all RDF data is limited to triples. The question that remains is how to represent the spreadsheet of budget data as triples. In particular, we want to start with just the proposed budget amount for a single account line.
We assume we have an RDF file that defines the account numbers and gives each of them a description. This data has an "accounts:" prefix with an example account number of accounts:10-101-1100-51020-00-11-00000. To move the discussion forward, let's assume we have a vocabulary for budgets that defines a predicate like "budget:proposed" that assigns a proposed amount to an account item. Then an RDF triple for this might be like this:
Subject: accounts:10-101-1100-51020-00-11-00000
Predicate: budget:proposed
Object: "1343151.98"
A budget goes through multiple versions and then is adopted and then implemented. The next year, the new budget goes through several versions. Over the years, a lot of amounts will be assigned to each account number. When the various RDF files from multiple versions are used by an application, all the triples are effectively merged. They can't all have the same subject and predicate with different amounts. How would we know which amount was for which version? To fix this, we need to use either a different subject or a different predicate for each version.
We still want the amount to be related to the particular accounts:10-101-1100-51020-00-11-00000 URI, but we can relate it through an intermediate piece of data. We can think of the intermediate data as the instance of the account line in the version of the data. For example, suppose we have a separate RDF file for each version and include the date in the name like this:
http://www.orcsd.org/data/2011/proposed-budget-20110117.rdf
Let's use "p20110117:" as the prefix for this URL. Then we can use the same tag names with this URL for the proposed account item like p20110117:10-101-1100-51020-00-11-00000. We use this instead of the accounts: prefixed item in the triple:
Subject: p20110117:10-101-1100-51020-00-11-00000
Predicate: budget:proposed
Object: "1343151.98"
This triple says this proposed budget account line item has $1,343,151.98. (Actually the dollars needs to be explicit somewhere.) This triple captures the time-sensitive aspect of the proposed amount, but while we know that the identical tag names in "accounts:" and "p20110117:" mean the same account, it has to be explicit in RDF. So, with this approach we need to add another triple per account item like this:
Subject: p20110117:10-101-1100-51020-00-11-00000
Predicate: budget:forAccount
Object: accounts:10-101-1100-51020-00-11-00000
This triple says this proposed line item is for the pre-defined account with the same name in another RDF file. Again, we assume we have some budget vocabulary that defines the budget:forAccount predicate for this purpose. This seems to work OK.
Another alternative is to change the predicate for each version. Instead of using a generic budget:proposed predicate, we could define a new predicate specific to each proposed version. It would probably make sense to define the version-specific predicate in the same RDF file as the amounts. Maybe something like this:
Subject: p20110117:proposed20110117
Predicate: rdfs:subPropertyOf
Object: budget:proposed
The "rdfs:" prefix is for the RDF Schema specification. This triple just says the new predicate is a specialization of the generic budget:proposed predicate. With this 1 RDF triple per version, we can now have just 1 triple per account line:
Subject: accounts:10-101-1100-51020-00-11-00000
Predicate: p20110117:proposed20110117
Object: "1343151.98"
Frankly, I don't know which of these alternatives is better. The next step is to make up some sample RDF files for a couple versions and try to use it. That should help answer which is better.
No comments:
Post a Comment