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

Ladies and gentlemen : Machine tags

Expand Messages
  • Aaron Straup Cope
    Hi, [Note : I work here] We are rolling out a new feature called machine tags that allows users to be more precise in how they tag, and how they search,
    Message 1 of 8 , Jan 24, 2007
      Hi,

      [Note : I work here]

      We are rolling out a new feature called "machine tags" that allows users to
      be more precise in how they tag, and how they search, their photos.

      Many of you may already be familiar with machine tags by another name
      (triple tags) or because you are already using them, informally, in your
      code (for example, "geo:long=123.456").

      "Machine tags" is the technical term for the extra hamsters we've added to
      the Flickr servers to formalize how these sorts of tags are treated. I've
      included a "Ceci n'est pas un FAQ" below with all the details.

      For the moment, machine tags are principally an API "thing". The photo pages
      have been updated to display tags a little differently but otherwise all the
      magic you can perform with machine tags happens here at the API layer. (This
      includes the special wildcard syntax for searching photos with machine
      tags.)

      Enjoy!

      ---

      # What are machine tags?

      Machine tags are tags that use a special syntax to define extra information
      about a tag.

      Machine tags have a namespace, a predicate and a value. The namespace
      defines a class or a facet that a tag belongs to ('geo', 'flickr', etc.) The
      predicate is name of the property for a namespace ('latitude', 'user', etc.)
      The value is, well, the value.

      Like tags, there are no rules for machine tags beyond the syntax to specify
      the parts of a machine tag. For example, you could tag a photo with :

      * flickr:user=straup

      * flora:tree=coniferous

      * medium:paint=oil

      * geo:cartier="plateau mont royal"

      * geo:neighbourhood=geo:cartier

      Flickr has already used machine tags, informally, on a couple of occasions :

      - When we launched Maps, we provided a way for people who had
      "geotagged" their photos to import their location data. This was
      done using the "geo:lat=..." and "geo:lon=..." tags.

      - When a user tags an event with an upcoming ID (for example :
      "upcoming:event=81334") we display a link back to the upcoming.org
      site. A similar example is the excellent "Flickr Upcoming Event"
      greasemonkey script :

      http://userscripts.org/scripts/show/5464

      Dan Catt wrote a very good piece about machine tags - he called them "triple
      tags" - last year :

      http://geobloggers.com/archives/2006/01/11/advanced-tagging-and-tripletags/

      ---

      # What is the spec for machine tags?

      Machine tags are divided in to three parts :

      1) A "namespace" :

      Namespaces MUST begin with any character between a - z; remaining
      characters MAY be a - z, 0 - 9 and underbars. Namespaces are
      case-insensitive.

      2) A "predicate" :

      Predicates MUST begin with any character between a - z; remaining
      characters MAY be a - z, 0 - 9 and underbars. Namespaces are
      case-insensitive.

      3) A "value" :

      Values MAY contain any characters that a "plain vanilla" tags
      use. Values may also contain spaces but, like regular tags, they
      need to wrapped in quotes.

      Namespace and predicates are separated by a colon : ":"

      Predicates and values are separated by an equals symbol : "="

      For example :

      * flickr:user=straup

      * geo:locality="san francisco"

      ---

      # Why can't I use non-ASCII characters for namespaces and predicates ?

      Simple steps, first.

      ---

      # Can I define another machine tag as the value of a machine tag?

      Sure, but it will not be processed as a machine tag itself.

      ---

      # How do I add machine tags?

      By adding tags! No, really.

      Machine tags are added *exactly* the same as any other tag whether it is
      done through the website or the API.

      When the Flickr supercomputer processes your tags, we take a moment to check
      whether it is a machine tag. If it is we leverage the powerful Do What I
      Mean engine to, well, do what you mean.

      ---

      # How do I query machine tags?

      Via the API!

      Specifically, using the "machinetags" parameter in the
      'flickr.photos.search' method. Like tags, you can specify multiple machine
      tags as a comma separated list.

      ---

      # Can I query the various part of a machine tag?

      Yes. Aside from passing in a fully formed machine tag, there is a special
      syntax for searching on specific properties :

      * Find photos using the 'dc' namespace :

      {"machine_tags" => "dc:"}

      * Find photos with a title in the 'dc' namespace :

      {"machine_tags" => "dc:title="}

      * Find photos titled "mr. camera" in the 'dc' namespace :

      {"machine_tags" => "dc:title=\"mr. camera\"}

      * Find photos whose value is "mr. camera" :

      {"machine_tags" => "*:*=\"mr. camera\""}

      * Find photos that have a title, in any namespace :

      {"machine_tags" => "*:title="}

      * Find photos that have a title, in any namespace, whose value is "mr.
      camera" :

      {"machine_tags" => "*:title=\"mr. camera\""}

      * Find photos, in the 'dc' namespace whose value is "mr. camera" :

      {"machine_tags" => "dc:*=\"mr. camera\""}

      ---

      # Is there a limit to the number of machine tags I can query?

      Yes. The limit depends on the tag mode (ALL or ANY) that you are querying
      with. "ALL" (AND) queries are limited to (16) machine tags. "ANY" (OR)
      queries are limited to (8).

      ---

      # Can I do range queries on machine tags?

      No. Not yet, anyway.

      It is a hard problem for reasons far too dull to get in to here. It's on the
      list.

      ---

      # Are machine tag namespaces reserved?

      No. Anyone can use a namespace for anything they want.

      If you are concerned about colliding namespaces you should consider adding
      an additional machine tag to define your namespace. For example :

      dc:subject=tags
      xmlns:dc=http://purl.org/dc/elements/1.1/

      Like tags, in general, we expect (hope?) that the community will develop its
      own standards by consensus over time.

      ---

      # What about all the machine tags that are already in the Flickr database?

      At the moment, they are still treated as plain old tags.

      We have plans to go back and re-import them as machine tags but for now,
      only new tags will be processed as machine tags.

      In the meantime, if you re-save a machine from the 'edit this tag' it will
      be re-imported as a machine tag.

      ---

      # Is the predicate *really* a predicate?

      You are in a dark cave. In the corner is a fire and a man making bunny
      shadows on the wall with his hands. Whether or not it's really a 'predicate'
      depends on how much time you spend on the semantic-web mailing list. ;-)

      It's close enough to being a predicate that it makes for a good short-hand.

      ---

      # Wait, aren't machine tags just RDF?

      No, machine tags are not RDF; they could play RDF on television, though.

      See also :

      http://weblog.scifihifi.com/2005/08/05/meta-tags-the-poor-mans-rdf

      ---

      # Huh, what is RDF ?

      RDF Describes Flickr. That's really all you need to know about RDF.

      --

      Aaron Straup Cope
      Hackr
    • Premasagar Rose
      Very nice. I think I ll just go for a long walk to get my head around the implications... Thank you, Flickr Hackrs Premasagar -- Portfolio .::.
      Message 2 of 8 , Jan 24, 2007
        Very nice. I think I'll just go for a long walk to get my head around the implications...
        Thank you, Flickr Hackrs

        Premasagar


        -- 
        Portfolio .::. http://premasagar.com






        On 24 Jan 2007, at 18:08, Aaron Straup Cope wrote:

        Hi,

        [Note : I work here]

        We are rolling out a new feature called "machine tags" that allows users to
        be more precise in how they tag, and how they search, their photos.

        Many of you may already be familiar with machine tags by another name
        (triple tags) or because you are already using them, informally, in your
        code (for example, "geo:long=123.456").

        "Machine tags" is the technical term for the extra hamsters we've added to
        the Flickr servers to formalize how these sorts of tags are treated. I've
        included a "Ceci n'est pas un FAQ" below with all the details.

        For the moment, machine tags are principally an API "thing". The photo pages
        have been updated to display tags a little differently but otherwise all the
        magic you can perform with machine tags happens here at the API layer. (This
        includes the special wildcard syntax for searching photos with machine
        tags.)

        Enjoy!

        ---

        # What are machine tags?

        Machine tags are tags that use a special syntax to define extra information
        about a tag.

        Machine tags have a namespace, a predicate and a value. The namespace
        defines a class or a facet that a tag belongs to ('geo', 'flickr', etc.) The
        predicate is name of the property for a namespace ('latitude', 'user', etc.)
        The value is, well, the value.

        Like tags, there are no rules for machine tags beyond the syntax to specify
        the parts of a machine tag. For example, you could tag a photo with :

        * flickr:user=straup

        * flora:tree=coniferous

        * medium:paint=oil

        * geo:cartier="plateau mont royal"

        * geo:neighbourhood=geo:cartier

        Flickr has already used machine tags, informally, on a couple of occasions :

        - When we launched Maps, we provided a way for people who had
        "geotagged" their photos to import their location data. This was
        done using the "geo:lat=..." and "geo:lon=..." tags.

        - When a user tags an event with an upcoming ID (for example :
        "upcoming:event=81334") we display a link back to the upcoming.org
        site. A similar example is the excellent "Flickr Upcoming Event"
        greasemonkey script :

        http://userscripts.org/scripts/show/5464

        Dan Catt wrote a very good piece about machine tags - he called them "triple
        tags" - last year :

        http://geobloggers.com/archives/2006/01/11/advanced-tagging-and-tripletags/

        ---

        # What is the spec for machine tags?

        Machine tags are divided in to three parts :

        1) A "namespace" :

        Namespaces MUST begin with any character between a - z; remaining
        characters MAY be a - z, 0 - 9 and underbars. Namespaces are
        case-insensitive.

        2) A "predicate" :

        Predicates MUST begin with any character between a - z; remaining
        characters MAY be a - z, 0 - 9 and underbars. Namespaces are
        case-insensitive.

        3) A "value" :

        Values MAY contain any characters that a "plain vanilla" tags
        use. Values may also contain spaces but, like regular tags, they
        need to wrapped in quotes.

        Namespace and predicates are separated by a colon : ":"

        Predicates and values are separated by an equals symbol : "="

        For example :

        * flickr:user=straup

        * geo:locality="san francisco"

        ---

        # Why can't I use non-ASCII characters for namespaces and predicates ?

        Simple steps, first.

        ---

        # Can I define another machine tag as the value of a machine tag?

        Sure, but it will not be processed as a machine tag itself.

        ---

        # How do I add machine tags?

        By adding tags! No, really.

        Machine tags are added *exactly* the same as any other tag whether it is
        done through the website or the API.

        When the Flickr supercomputer processes your tags, we take a moment to check
        whether it is a machine tag. If it is we leverage the powerful Do What I
        Mean engine to, well, do what you mean.

        ---

        # How do I query machine tags?

        Via the API!

        Specifically, using the "machinetags" parameter in the
        'flickr.photos.search' method. Like tags, you can specify multiple machine
        tags as a comma separated list.

        ---

        # Can I query the various part of a machine tag?

        Yes. Aside from passing in a fully formed machine tag, there is a special
        syntax for searching on specific properties :

        * Find photos using the 'dc' namespace :

        {"machine_tags" => "dc:"}

        * Find photos with a title in the 'dc' namespace :

        {"machine_tags" => "dc:title="}

        * Find photos titled "mr. camera" in the 'dc' namespace :

        {"machine_tags" => "dc:title=\"mr. camera\"}

        * Find photos whose value is "mr. camera" :

        {"machine_tags" => "*:*=\"mr. camera\""}

        * Find photos that have a title, in any namespace :

        {"machine_tags" => "*:title="}

        * Find photos that have a title, in any namespace, whose value is "mr.
        camera" :

        {"machine_tags" => "*:title=\"mr. camera\""}

        * Find photos, in the 'dc' namespace whose value is "mr. camera" :

        {"machine_tags" => "dc:*=\"mr. camera\""}

        ---

        # Is there a limit to the number of machine tags I can query?

        Yes. The limit depends on the tag mode (ALL or ANY) that you are querying
        with. "ALL" (AND) queries are limited to (16) machine tags. "ANY" (OR)
        queries are limited to (8).

        ---

        # Can I do range queries on machine tags?

        No. Not yet, anyway.

        It is a hard problem for reasons far too dull to get in to here. It's on the
        list.

        ---

        # Are machine tag namespaces reserved?

        No. Anyone can use a namespace for anything they want.

        If you are concerned about colliding namespaces you should consider adding
        an additional machine tag to define your namespace. For example :

        dc:subject=tags
        xmlns:dc=http://purl.org/dc/elements/1.1/

        Like tags, in general, we expect (hope?) that the community will develop its
        own standards by consensus over time.

        ---

        # What about all the machine tags that are already in the Flickr database?

        At the moment, they are still treated as plain old tags.

        We have plans to go back and re-import them as machine tags but for now,
        only new tags will be processed as machine tags.

        In the meantime, if you re-save a machine from the 'edit this tag' it will
        be re-imported as a machine tag.

        ---

        # Is the predicate *really* a predicate?

        You are in a dark cave. In the corner is a fire and a man making bunny
        shadows on the wall with his hands. Whether or not it's really a 'predicate'
        depends on how much time you spend on the semantic-web mailing list. ;-)

        It's close enough to being a predicate that it makes for a good short-hand.

        ---

        # Wait, aren't machine tags just RDF?

        No, machine tags are not RDF; they could play RDF on television, though.

        See also :

        http://weblog.scifihifi.com/2005/08/05/meta-tags-the-poor-mans-rdf

        ---

        # Huh, what is RDF ?

        RDF Describes Flickr. That's really all you need to know about RDF.

        --

        Aaron Straup Cope
        Hackr



      • dartar
        Excellent news! -Dario
        Message 3 of 8 , Jan 24, 2007
          Excellent news!

          -Dario
        • Dan Coulter
          Is anyone else interested in thinking about a standardized system for these tags? For me, the most interesting thing about these tags is that it ll help
          Message 4 of 8 , Jan 24, 2007
            Is anyone else interested in thinking about a standardized system for these tags?  For me, the most interesting thing about these tags is that it'll help describe the tags in other users photos so that searches can be more useful.  If you are interested, I've setup a group here:

            http://www.flickr.com/groups/mtags/

            On 1/24/07, dartar < dartar@...> wrote:
            Excellent news!

            -Dario




            Yahoo! Groups Links

            <*> To visit your group on the web, go to:
                http://groups.yahoo.com/group/yws-flickr/

            <*> Your email settings:
                Individual Email | Traditional

            <*> To change settings online go to:
                http://groups.yahoo.com/group/yws-flickr/join
                (Yahoo! ID required)

            <*> To change settings via email:
                mailto:yws-flickr-digest@yahoogroups.com
                mailto:yws-flickr-fullfeatured@yahoogroups.com

            <*> To unsubscribe from this group, send an email to:
                yws-flickr-unsubscribe@yahoogroups.com

            <*> Your use of Yahoo! Groups is subject to:
                http://docs.yahoo.com/info/terms/




            --
            Dan Coulter
            http://www.dancoulter.com/
            http://www.phpflickr.com/
            It is time - http://e-hobo.com/

            Hey, I got nothing to do today but smile
            -Simon and Garfunkel
          • mortimerp9
            Wow, this is great news, felicitation Flickr! I am already boiling with some idea to play with and might even have some time to implement them ;) I had a
            Message 5 of 8 , Jan 25, 2007
              Wow, this is great news, felicitation Flickr!

              I am already boiling with some idea to play with and might even have
              some time to implement them ;)

              I had a single question however:
              Will there be a way to get all the existing predicate for a domain, or
              all the unique values for a specific domain:predicate (if we know that
              it will return a simple enum and not a continuous range)

              Thank you,

              Pierre
            • Aaron Straup Cope
              Hi Pierre, Like ranges, it s on the list but there is not an ETA yet. Out of curiosity, what would you use such a feature for? Cheers, ... -- Aaron Straup Cope
              Message 6 of 8 , Jan 25, 2007
                Hi Pierre,

                Like ranges, it's on the list but there is not an ETA yet.

                Out of curiosity, what would you use such a feature for?

                Cheers,


                On 1/25/07 2:23 AM, "mortimerp9" <mortimer.pa@...> wrote:

                > Wow, this is great news, felicitation Flickr!
                >
                > I am already boiling with some idea to play with and might even have
                > some time to implement them ;)
                >
                > I had a single question however:
                > Will there be a way to get all the existing predicate for a domain, or
                > all the unique values for a specific domain:predicate (if we know that
                > it will return a simple enum and not a continuous range)
                >
                > Thank you,
                >
                > Pierre
                >

                --

                Aaron Straup Cope
                Hackr
              • Raymond Yee
                Just to add to the question -- I d love to have a whole set of query functionality, including being able to look up all domains in use. I know about geo but
                Message 7 of 8 , Jan 25, 2007
                  Just to add to the question -- I'd love to have a whole set of query
                  functionality, including being able to look up all domains in use. I
                  know about "geo" but what others are being used -- and with what
                  frequency?

                  For instance, we can pull up all the geo: machine tags by searching
                  for "geo:" with the API call. See
                  http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=744dbddf5c50c0176befdcae9d095a57&machine_tags=geo%3A&extras=machine_tags
                  or http://tinyurl.com/23ddd4 You will >500,000 photos under that domain.

                  I tried variants on "geo:" to try to pull up all machine tags ("*:",
                  "*", "*:*") but I couldn't find any that would get me all the machine
                  tags....

                  -Raymond

                  --- In yws-flickr@yahoogroups.com, "mortimerp9" <mortimer.pa@...> wrote:

                  >
                  > I had a single question however:
                  > Will there be a way to get all the existing predicate for a domain, or
                  > all the unique values for a specific domain:predicate (if we know that
                  > it will return a simple enum and not a continuous range)
                  >
                  >
                • Jeremy Quinn
                  ... Hi Guys, This is a great feature!! I especially appreciate the way the machine tags are neatly tucked away in photo pages. Sorry to ask for an enhancement
                  Message 8 of 8 , Jan 28, 2007
                    On 24 Jan 2007, at 18:08, Aaron Straup Cope wrote:

                    > We are rolling out a new feature called "machine tags" that allows
                    > users to
                    > be more precise in how they tag, and how they search, their photos.


                    Hi Guys,

                    This is a great feature!!

                    I especially appreciate the way the machine tags are neatly tucked
                    away in photo pages.

                    Sorry to ask for an enhancement first thing though ;)

                    Currently, machine tags are returned like this :

                    XML:
                    <tag id="84181-106507228-8572369" author="61417564@N00"
                    raw="story:title=Hello World" machine_tag="1">story:title=helloworld</
                    tag>

                    JSON:
                    {"id":"84181-106507228-8572369", "author":"61417564@N00",
                    "raw":"story:title=Hello World", "_content":"story:title=
                    helloworld", "machine_tag":1}

                    They would be much faster/easier to process (less string searching)
                    if at least the namespace prefix could be a separate attribute/
                    property, also ideally the predicate and value :

                    XML:
                    <tag id="84181-106507228-8572369" author="61417564@N00"
                    raw="story:title=Hello World" machine_tag="1" ns="story"
                    predicate="title" value="Hello World">story:title=helloworld</tag>.

                    JSON:
                    {"id":"84181-106507228-8572369", "author":"61417564@N00",
                    "raw":"story:title=Hello World", "_content":"story:title=helloworld",
                    "machine_tag":1, "ns":"story", "predicate":"title", "value":"Hello
                    World"}


                    Keep up the innovations ;)

                    best regards

                    Jeremy

                    PS. Searching for a list of users who have a specific machine tag on
                    any of their photos would be a related item on my wishlist :)
                  Your message has been successfully submitted and would be delivered to recipients shortly.