Using Taxonomy XML with RDF

Resource Description Framework : RDF (and the Drupal RDF module) allows us to make arbitrary statements of fact about Drupal resources.
In this case, we need to be able to say that a given taxonomy term is equivalent to (sameAs) a term defined in a public dataset. Here's how we can set this up.

Install and setup

Soon, we will be able to tell the system things like :

Our taxonomy term Paris represents the same concept as the one used by Freebase or Wordnet to represent the locality of Paris, France, and not the one in Texas or the one in rehab.
This will take the form of RDF statements like:
<http://example.com/taxonomy/term/4045> <http://www.w3.org/2002/07/owl#sameAs> <http://rdf.freebase.com/ns/en.paris> .
<http://example.com/taxonomy/term/4045> <http://www.w3.org/2002/07/owl#sameAs> <http://id.loc.gov/authorities/sh2008116535> .
<http://example.com/taxonomy/term/4045> <http://www.w3.org/2002/07/owl#sameAs> <http://dbpedia.org/resource/Paris> .
<http://example.com/taxonomy/term/4045> <http://www.w3.org/2002/07/owl#sameAs> <http://d.opencalais.com/er/geo/city/ralg-geo1/797c999a-d455-520d-e5cf-04ca7fb255c1> .
<http://example.com/taxonomy/term/4045> <http://www.w3.org/2002/07/owl#sameAs> <http://en.wikipedia.org/wiki/Paris> .   
in nice RDF/XML:
<rdf:RDF 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
  xmlns:owl="http://www.w3.org/2002/07/owl#" >
  <rdf:Description rdf:about="http://example.com/taxonomy/term/4045">
    <owl:sameAs rdf:resource="http://rdf.freebase.com/ns/en.paris" />
    <owl:sameAs rdf:resource="http://id.loc.gov/authorities/sh2008116535" />
    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Paris" />
    <owl:sameAs rdf:resource="http://en.wikipedia.org/wiki/Paris" />
    <owl:sameAs rdf:resource="http://d.opencalais.com/er/geo/city/ralg-geo1/797c999a-d455-520d-e5cf-04ca7fb255c1" />
  </rdf:Description>
</rdf:RDF>
Or, in Turtle:
@prefix owl: <http://www.w3.org/2002/07/owl#> .
<http://example.com/taxonomy/term/4045>
  owl:sameAs 
    <http://rdf.freebase.com/ns/en.paris> ,
    <http://id.loc.gov/authorities/sh2008116535> ,
    <http://dbpedia.org/resource/Paris> ,
    <http://en.wikipedia.org/wiki/Paris> ,
    <http://d.opencalais.com/er/geo/city/ralg-geo1/797c999a-d455-520d-e5cf-04ca7fb255c1> .    
... You don't need all these! Only one will do, but I'm listing a handful for comparison to illustrate the variety.

What a mess?

Looks like a load of pointless code, but the point is that NOW we can talk with those other data sources and they will tell us the synonyms, translations, descriptions of that item and its relation with other things - like a list of districts within or the province it's inside. Great for building up real taxonomies that are accurate, official, and edited without typing.
Once imported, you are free to re-edit or delete any of those values to suit yourself.

By using URIs as Globally Unique IDentifiers, those lookup services are also telling us where we can go to find more. And more.

And this is all done for you, now that the API code is in place. The RDF module will make a note of this data in your Repository, and look it up again next time it needs to know anything. Those long URLs are totally hidden from view unless you want to expose them.

Done.

The install steps have enabled this feature in the background. You won't see much on the surface, but the next vocab you import will be sitting on a framework of semantic data. This data can be inspected directly from the RDF data UI.