Search code examples
c#semanticsrdfxmp

Which to use, XMP or RDF?


What's the difference between RDF and XMP?

From what I can tell, XMP is derived from RDF... so what does it offer that RDF doesn't?

My particular situation is this: I've got some images which need tagging with details of how an experiment was performed, and what sort of data analysis has been performed on the images. A colleague of mine is pushing for XMP, but he's thinking of the images as photos - they're not really, they're just bits of data.

From what I've seen (mainly by opening images in notepad++) the XMP data looks very similar to RDF - even so far as using RDF in the tag names (e.g. <rdf:Seq>).

I'd like this data to be usable by other people who use similar instruments for similar experiments, so creating a mini standard (schema?) seems like the way to go.

Apologies for the lack of fundemental understanding - I'm a Doctor, not a programmer! If it makes any difference, the language of choice will be C#.

Edit for more information: First off, thanks for the excellent replies - thinking of XMP as a vocabulary for RDF makes things a lot clearer.

The sort of data I'll be storing wont be avaliable in any of the pre-defined sets. It'll detail experimental set ups, locations and results. I think using RDF is the way to go.

An example of the sort of thing (stored in XML as it is currently) would be :

<Experiment name="test2" loc="lab" timestamp="65420233400">
  <Instrument name="a1" rev="1.0"/>
  <Calibration>
    <date>13-02-10</date>
    <type>complete</type>
  </Calibration>
</Experiment>

Off the top of my head, I guess I'm going to be storing this in RDF as follows:

  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:zotty="http://www.zotty.com/rdf/">

    <zotty:experiment>
      <rdf:Bag> 
        <zotty:name>test2</zotty:name>
        <zotty:loc>lab</zotty:loc>
        <zotty:timestamp>65420233400</zotty:timestamp>
        <zotty:instrument>
          <rdf:Bag>
            <zotty:name>a1</zotty:name>
            <zotty:rev>1.0</zotty:rev>      
            <zotty:calibration>
              <rdf:bag>
                <zotty:date>13-02-10</zotty:date>
                <zotty:type>complete</zotty:type>
              </rdf:bag>
            </zotty:calibration>
          </rdf:Bag>
        </zotty:instrument>  
      <rdf:Bag>
    </zotty:experiment>
  </rdf:RDF>

Thanks for the advice :)


Solution

  • If you need full flexibility use plain RDF. You mentioned you need a flexible data model then the best option is to use directly RDF and wherever it's possible to reuse existing vocabularies in RDF. If you comment a bit on the domain I could advice a bit more on ontology reusability.

    If any of the XMP templates fit in your data layer then use those.