Loading ...
Sorry, an error occurred while loading the content.
 

New API methods: flickr.machinetags (experimental)

Expand Messages
  • Aaron Straup Cope
    Hi all, If you’re not already familiar with machine tags the easiest way to think of them is being like a plain old tag but with a special syntax that allows
    Message 1 of 6 , Nov 18, 2008
      Hi all,

      If you’re not already familiar with machine tags the easiest way to
      think of them is being like a plain old tag but with a special syntax
      that allows users to define additional structured data about that tag.

      If you'd like to know more, the best place to start is the official
      announcement we made about machine tags in the Flickr API group:

      http://www.flickr.com/groups/api/discuss/72157594497877875

      If you want to know even more, take a look at:

      http://code.flickr.com/blog/2008/07/18/wildcard-machine-tag-urls/
      http://code.flickr.com/blog/2008/08/28/machine-tags-lastfm-and-rocknroll/
      http://blech.vox.com/library/post/flickr-exif-machine-tags.html

      --

      Okay! Now that everyone is feeling warm and fuzzy about machine tags:

      We enabled (4) new experimental API methods for browsing the hierarchies
      of machine tags on the site.

      They are aggregate rollups of all the unique namespaces, predicates,
      values and pairs for public photos with machine tags.

      For example, lots of people have added "exif:" related machine tags to
      their photos but there hasn't been a way to know what kind of EXIF data
      has been added. exif:camera? exif:focus? exif:tunablaster?

      Those are the sorts of things these methods are designed to help you
      find. Sort of like wildcard URIs but for the API. Like this:

      --

      * flickr.machinetags.getNamespaces

      This returns a list of all the unique namespaces, optionally bracketed
      by a specific predicate. For example:

      <namespaces predicate="airport" page="1" total="2" perpage="500" pages="1">
      <namespace usage="1931" predicates="1">aero</namespace>
      <namespace usage="3" predicates="1">geo</namespace>
      </namespaces>

      http://www.flickr.com/services/api/flickr.machinetags.getPredicates.html

      * flickr.machinetags.getPredicates

      Like "getNamespaces", returns a list of all the unique namespaces,
      optionally bracketed by a specific namespace. For example:

      <predicates namespace="aero" page="1" total="17" perpage="500" pages="1">
      <predicate usage="1" namespaces="1">aiirport</predicate>
      <predicate usage="1" namespaces="1">aiport</predicate>
      <predicate usage="2568" namespaces="1">airline</predicate>
      <predicate usage="1" namespaces="1">airlines</predicate>
      <predicate usage="1" namespaces="1">airpor</predicate>
      <predicate usage="1" namespaces="1">airporrt</predicate>
      <predicate usage="1944" namespaces="1">airport</predicate>
      <predicate usage="10" namespaces="1">icao</predicate>
      <predicate usage="328" namespaces="1">ln</predicate>
      <predicate usage="1972" namespaces="1">man</predicate>
      <predicate usage="1926" namespaces="1">model</predicate>
      <predicate usage="517" namespaces="1">msn</predicate>
      <predicate usage="1" namespaces="1">seires</predicate>
      <predicate usage="1894" namespaces="1">series</predicate>
      <predicate usage="338" namespaces="1">special</predicate>
      <predicate usage="1908" namespaces="1">tail</predicate>
      <predicate usage="5" namespaces="1">type</predicate>
      </predicates>

      http://www.flickr.com/services/api/flickr.machinetags.getPredicates.html

      * flickr.machinetags.getValues

      At this point, the pattern should be pretty straightforward. All the
      unique values for a specific namespace/predicate pair. For example:

      <values namespace="aero" predicate="tail" page="1" total="1159"
      perpage="500" pages="3">
      <value usage="1">01-0041</value>
      <value usage="1">164993</value>
      <value usage="2">26000</value>
      <value usage="1">4k-az01</value>
      <value usage="1">4l-tgl</value>
      <value usage="1">4r-ade</value>
      <!-- and so on... -->
      </values>

      http://www.flickr.com/services/api/flickr.machinetags.getValues.html

      * flickr.machinetags.getPairs

      Finally, get pairs returns the list of unique namespace/predicate pairs
      optionally filtered by namespace or predicate.

      <-- please, not another blob of XML... -->

      http://www.flickr.com/services/api/flickr.machinetags.getPairs.html

      --

      A couple things to note:

      Certain namespace/predicate pairs have been special cased to return a
      single value. As of this writing they are:

      * geo:lat (and variations)

      * geo:lon (and variations)

      * file:name

      * file:path

      * (anything):md5

      If people have a particular reason for needing or wanting these please
      let us know. Otherwise the cost of storing all the variations and the
      dubious use of returning them made us decide to exclude them.

      Also, as of this writing some of the earliest machine tags may not have
      been indexed yet. Once the indexing is complete we'll do a proper blog
      post (on code.flickr.com) and probably add some machine tags specific
      documentation to the API section on the site.

      --

      Finally, until further notice please keep in mind that these methods are
      still considered experimental and write your code accordingly.

      Enjoy!
    • Paul Mison
      ... The obvious thing to build on top of these (long-desired) methods is some sort of graphical machine tag browser, a bit like the Mac OS X / iPod column view
      Message 2 of 6 , Nov 21, 2008
        2008/11/18 Aaron Straup Cope <aaron@...>:
        > Okay! Now that everyone is feeling warm and fuzzy about machine tags:
        >
        > We enabled (4) new experimental API methods for browsing the hierarchies
        > of machine tags on the site.

        The obvious thing to build on top of these (long-desired) methods is
        some sort of graphical machine tag browser, a bit like the Mac OS X /
        iPod column view browser. So I did.

        http://husk.org/code/machine-tag-browser.html

        This is entirely self-contained in one file (except for loading jQuery
        from Google and (cough) the pulser from Flickr). It uses JavaScript to
        get a full list of namespaces, giving you the option to drill down
        into predicates and the values available for that namespace/predicate
        pair.

        There are still a couple of issues (mainly to do with click handling)
        and there's also a list of features I want to add, but I think it's
        solid enough for me to mention it to the list.

        I've also added it to github, if anyone feels like contributing:
        http://github.com/blech/flimter/tree/master

        As Aaron said, "enjoy!"

        --
        Paul Mison
        http://husk.org/
      • David Wilkinson
        On Fri, Nov 21, 2008 at 11:14 AM, Paul Mison ... Thanks! That makes quite interesting browsing... Dave W.
        Message 3 of 6 , Nov 21, 2008
          On Fri, Nov 21, 2008 at 11:14 AM, Paul Mison <lists@...> wrote:

          > The obvious thing to build on top of these (long-desired) methods is
          > some sort of graphical machine tag browser, a bit like the Mac OS X /
          > iPod column view browser. So I did.

          Thanks! That makes quite interesting browsing...

          Dave W.
        • hesnut
          ... Yeah that s fun. Interesting what predicates jump out ... specifically those long a** ones. But the flickrite in me wants to click through to a search
          Message 4 of 6 , Nov 21, 2008
            --- In yws-flickr@yahoogroups.com, "David Wilkinson"
            <davidawilkinson@...> wrote:
            >
            > On Fri, Nov 21, 2008 at 11:14 AM, Paul Mison <lists@...>
            > wrote:
            >
            > > The obvious thing to build on top of these (long-desired) methods is
            > > some sort of graphical machine tag browser, a bit like the Mac OS X /
            > > iPod column view browser. So I did.
            >
            > Thanks! That makes quite interesting browsing...
            >
            > Dave W.
            >

            Yeah that's fun. Interesting what predicates "jump out"...
            specifically those long a** ones. But the flickrite in me wants to
            click through to a search for photos under the values. ;-)

            clickykbd
          • sigbjorn.finne
            Thanks, cool feature & a good new direction for the API :) I ve updated the Haskell API binding (version 0.3) to include support for these four methods,
            Message 5 of 6 , Nov 21, 2008
              Thanks, cool feature & a good new direction for the API :)

              I've updated the Haskell API binding (version 0.3) to
              include support for these four methods,

              http://hackage.haskell.org/cgi-bin/hackage-scripts/package/flickr
              http://www.forkio.com/flickr.html

              It includes an example app/snippet demonstrating how to use
              the new API for lookups/listing (examples/ShowTags.hs)

              thanks
              --sigbjorn

              --- In yws-flickr@yahoogroups.com, Aaron Straup Cope <aaron@...> wrote:
              >
              > Hi all,
              >
              > If you're not already familiar with machine tags the easiest way to
              > think of them is being like a plain old tag but with a special syntax
              > that allows users to define additional structured data about that tag.
              >
              ....
              >
              > Enjoy!
              >
            • Jef Poskanzer
              I m still waiting for you folks to finish off your *first* machine tags change and add full & automatic reflection between geo:lat/geo:long and
              Message 6 of 6 , Dec 15, 2008
                I'm still waiting for you folks to finish off your *first* machine
                tags change and add full & automatic reflection between
                geo:lat/geo:long and flickr.photos.geo.setLocation.
              Your message has been successfully submitted and would be delivered to recipients shortly.