s9y 0.9 beta-1: atom feeds and categories/tags

Found a bug? Tell us!!
Post Reply
bpkri
Regular
Posts: 41
Joined: Tue Aug 09, 2005 2:31 pm

s9y 0.9 beta-1: atom feeds and categories/tags

Post by bpkri »

I use categories and the freetag plugin, and when I examined the ATOM 0.3 feed of my s9y 0.9-beta-1 installation closer I found, that tags get properly injected into the atom 0.3 feed as dc:subject tags, but categories don't get included.

I already changed this in my blog to correct this error, inserting:

Code: Select all

	foreach ($entry['categories'] AS $idx => $cat) { 
		$name = serendipity_utf8_encode(htmlspecialchars($cat['category_name'])); ?>
		<dc:subject><?php echo $name; ?></dc:subject>
<?php
	}
?>

into rss_functions.inc, right after where the tags get injected.

I also noticed that in the Atom 1.0 feed categories get inserted as category tags, however tags from the freetag plugin get injected as <dc:subject> tags. Don't really know if this is the correct way to go at this, but I am not firm enough in Atom, to tell. I don't actively use the Atom 1.0 feed yet, because Technorati still has its problems with it, as do many feed readers.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: s9y 0.9 beta-1: atom feeds and categories/tags

Post by garvinhicking »

Actually, the way of specifying categories within dc:subject is not really suggested, I don't think feed aggregators support this kind of generic hack?

That's why it's missing in the Atom 0.3 implementation of Serendipity and has only been introduced in 1.0 where official category tags were added.

It seems though that it's standard to indicate tags as dc:subject tags, as they are not categories but simple "subject" items and thus should be alright...

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
bpkri
Regular
Posts: 41
Joined: Tue Aug 09, 2005 2:31 pm

Post by bpkri »

Maybe, but one BIG feed reader supports it: Technorati and it is common practice to include categories as <dc:subject> items.
Usually feed aggregators/readers don't do much with categories at all, at least I haven't seen many who do.

Well I can live with it not becoming part of s9y, as I now know how to fix it for myself.

However the problem with the atom 1.0 feed, I think, should be adressed? Or do we want to distinguish between tags and categories in the future? I don't know if this makes much sense for feed readers, but as I said, I am not very firm with my atom-knowledge there.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

But since Atom 0.3 is already dead, I prefer to not enhance its support, but rely on Atom 1.0 instead...

IMHO yes, we should distinct categories frmo tags in 1.0! If there was no distinction, it wouldn't have two implementations for it :)

(But, same applies for me: I'm not very familiar with Atom nomenclature)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
bpkri
Regular
Posts: 41
Joined: Tue Aug 09, 2005 2:31 pm

Post by bpkri »

Heh, I wouldn't call Atom 0.3 dead, as long as feed readers and sites like Technorati still support it.

Atom 1.0 seems the way to go. Tags and categories seem to be different ways to achieve the same goal to me. I don't know if it is really necessary to distinguish those in the feeds.
All websites I examined so far talking about Atom 1.0 and the differences to Atom 0.3 or categories/tags talk about the category tag meaning that we can get rid of dc:subject for categories AND tags.
Maybe we should see what the folks over at Technorati think of this, too.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

bpkri wrote:Heh, I wouldn't call Atom 0.3 dead, as long as feed readers and sites like Technorati still support it.
The official IETF recommendation for Atom is the 1.0 format, so all previous versions (which always were in DRAFT state) are now obsoleted. That is why feed readers should think twice about implementing draft protocols, because they need to react to final implementations. So it's not like with RSS 0.91 and 2.0 which were official standard and need to be supported longer - Atom 0.3 never was a format, only an in-between state until the final implementation was ready.

Having said this, I do understand the need for supporting it, which is why s9y still supports Atom 0.3 - but I think we should stay close to the draft spec, which did not say that dc:subject should be used for categorizations.

Personally I do think that tags and categories are quite different. Categories always have a global scheme to rasterize your content; tags attributize your content with many leaf-tags and singular tag names.

Usually you have many tags for an article, but only one or two categories, which makes it easier to look up entries for categories when you only rougly know the topic, instead of tags were you should be able to quickly find what you are exactly looking for.

Of course this is all my humble, personal oppinion. *gg*

If you get any official or professional statements about this tag/category nomenclature, please let me know! It is easy and straightforward to change the implementation in s9y frmo dc:subject to category.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
bpkri
Regular
Posts: 41
Joined: Tue Aug 09, 2005 2:31 pm

Post by bpkri »

You sure are right, that - especially when viewed inside a blog, that's to say if you have the context - tags and categories are very different.
You may have categories, nested categories and tags to assign to an article. Categories are rather static. They don't change all the time.

Tags are more dynamic. They are made up with the posts - often there is also functions, which shows how tags are related to one another.

However, in a feed, outside the blog you do not have that kind of context. You are viewing articles away from the bigger blog context and thus are missing this kind of information.
You (usually) cannot say if categories are nested, and IMO it doesn't matter if the meta information is really a category or a tag. This kind of information only matter if you are inside a blog.
Post Reply