Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 :)

like image 678
zotty Avatar asked Jan 13 '11 15:01

zotty


3 Answers

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.

like image 77
Manuel Salvadores Avatar answered Nov 18 '22 06:11

Manuel Salvadores


I'm not an expert in this but this is the way I understand it. RDF is a generic way to store pretty much any information that you want and define how you want to store it. XMP uses a subset of RDF and comes with a bunch of pre-built templates for data storage such as IPTC and Dublin Core. You can still store arbitrary data, too, but are encouraged to use the templates defined. In other words, don't redefine "image description" if its already somewhere else.

What I'd say to do is look at Dublin Core and IPTC and see if that works for you. If so, go down the XMP route. If everything's custom, RDF might be the better way.

like image 38
Chris Haas Avatar answered Nov 18 '22 07:11

Chris Haas


XMP is a metadata format developed and pushed by Adobe and basically provides a defined vocabulary for specifying the contents of a file. XMP itself resues other standard vocabularies - the Dublin Core Terms, for example, are extensively reused by XMP.

It really isn't a question of RDF vs XMP: most commonly, XMP IS serialised as RDF and if you look in Adobe's own spec, they talk about XMP in terms of an RDF serialisation. It's also important to note, that RDF is extensible ad libitum....and so msalvadores answer is a good one: if the XMP vocabulary lets you say what you want to say about the picture, use it and use it serialised in RDF - in that way, if there is additional stuff you need to say which is not in the XMP vocab, can extend it yourself or combine it with other vocabularies (serialised as RDF) that allow you to say what you want to say.

Hope this helps.

like image 3
Nico Adams Avatar answered Nov 18 '22 06:11

Nico Adams