From: Joseph S. <acr...@io...> - 2003-02-24 23:46:45
|
private void addItemsRef(Element channel, List is) { if(is!=null && is.size()>0) { Element items=channel.addElement("items"); Element seq=items.addElement("rdf", "Seq"); Iterator iter=is.iterator(); while(iter.hasNext()) { Item item=(Item)iter.next(); // addItem(seq, item, "resource"); Element li = seq.addElement("li"); li.setAttribute("rdf", "resource", item.getLink()); } } } that now follows the rdf:Seq->li syntax described by O'Reilly's page http://www.oreillynet.com/pub/a/network/2000/08/25/magazine/rss_tut.html?page=3 Joe -- ---------------------------------------------------------------------- Joseph Shelby mailto:acr...@io... 45533 Stablemates Ct. http://www.io.com/~acroyear Sterling, VA 20164 (703) 404-0314 | 247-7868 Software Engineer, ISX Corporation, Arlington, VA "The people of England will permit anything...except cruelty to horses and a rise in the price of beer." -- Return of the Musketteers (1989) ---------------------------------------------------------------------- |
From: Joseph O. <jo...@en...> - 2003-02-25 06:54:06
|
Joe, the only issue with applying this patch is that I'm not sure what it's solving. You're adding the item to the sequence, and the *main* difference I see is that you're using the item LINK instead of the item ABOUT data... and those should be the same reference. Am I missing something? On Mon, 24 Feb 2003, Joseph Shelby wrote: > private void addItemsRef(Element channel, List is) { > if(is!=null && is.size()>0) { > Element items=channel.addElement("items"); > Element seq=items.addElement("rdf", "Seq"); > Iterator iter=is.iterator(); > while(iter.hasNext()) { > Item item=(Item)iter.next(); > // addItem(seq, item, "resource"); > Element li = seq.addElement("li"); > li.setAttribute("rdf", "resource", item.getLink()); > } > } > } > > that now follows the rdf:Seq->li syntax described by O'Reilly's > page > > http://www.oreillynet.com/pub/a/network/2000/08/25/magazine/rss_tut.html?page=3 > > Joe > --------------------------------------------------------- Joseph B. Ottinger jo...@en... http://enigmastation.com IT Consultant |
From: Danny A. <dan...@vi...> - 2003-02-25 10:14:19
|
> Joe, the only issue with applying this patch is that I'm not sure what > it's solving. You're adding the item to the sequence, and the *main* > difference I see is that you're using the item LINK instead of the item > ABOUT data... and those should be the same reference. Am I missing > something? The resource in the seq should the the same as the 'about', see : http://web.resource.org/rss/1.0/spec#s5.3.5 According to the spec : "{item_uri} should be identical to the value of the <link> sub-element of the <item> element, if possible.". So although in most circumstances the 'about' will be the same as the <link>, this isn't necessarily always the case (this was discussed a while ago on rss-dev). (Personally I'd prefer that the specs made the <link> element optional, so that self-contained items like many on blog posts were covered better, the thing being described being the 'about' resource, without reference to any external URL). Cheers, DAnny. |
From: Joseph O. <jo...@en...> - 2003-02-25 11:42:18
|
Ahh, I see. I'll put the change in in a few hours or so. On Tue, 25 Feb 2003, Danny Ayers wrote: > > > Joe, the only issue with applying this patch is that I'm not sure what > > it's solving. You're adding the item to the sequence, and the *main* > > difference I see is that you're using the item LINK instead of the item > > ABOUT data... and those should be the same reference. Am I missing > > something? > > The resource in the seq should the the same as the 'about', see : > http://web.resource.org/rss/1.0/spec#s5.3.5 > > According to the spec : "{item_uri} should be identical to the value of the > <link> sub-element of the <item> element, if possible.". So > although in most circumstances the 'about' will be the same as the <link>, > this isn't necessarily always the case (this was discussed a while ago on > rss-dev). > > (Personally I'd prefer that the specs made the <link> element optional, so > that self-contained items like many on blog posts were covered better, the > thing being described being the 'about' resource, without reference to any > external URL). > > Cheers, > DAnny. > > > --------------------------------------------------------- Joseph B. Ottinger jo...@en... http://enigmastation.com IT Consultant |
From: Joseph O. <jo...@en...> - 2003-02-25 11:48:47
|
Argh, belay that: I won't put any change in. The writer builds the sequence using the 'about' - and the item is stored with <link>, as the spec shows. Here's the relevant code to build handle the items (while building the channel): if(items!=null && items.size()>0) { addItemsRef(channel, items); Iterator iter=items.iterator(); while(iter.hasNext()) { Item item=(Item)iter.next(); Element itemElt=addItem(root, item, "about"); addElement(itemElt, "title", item.getTitle(), true); addElement(itemElt, "link", item.getLink(), true); addElement(itemElt, "description", item.getDescription(), true); addDublinCore(itemElt, item); } } And here's the code for addItem() and addItemsRef(): protected Element addItem(Element root, Item item, String resource) { Element itemElt=null; if(item!=null) { itemElt=root.addElement("item"); addNSAttribute(itemElt, "rdf", resource, item.getAbout(), false); } return itemElt; } private void addItemsRef(Element channel, List is) { if(is!=null && is.size()>0) { Element items=channel.addElement("items"); Element seq=items.addElement("rdf", "Seq"); Iterator iter=is.iterator(); while(iter.hasNext()) { Item item=(Item)iter.next(); addItem(seq, item, "resource"); } } } Now, the only remaining question is: "Should the <item> have its rdf:about value matching the sequence's rdf:resource?" Right now, it does. I'm not sure if the spec mandates it. On Tue, 25 Feb 2003, Joseph Ottinger wrote: > Ahh, I see. I'll put the change in in a few hours or so. > > On Tue, 25 Feb 2003, Danny Ayers wrote: > > > > > > Joe, the only issue with applying this patch is that I'm not sure what > > > it's solving. You're adding the item to the sequence, and the *main* > > > difference I see is that you're using the item LINK instead of the item > > > ABOUT data... and those should be the same reference. Am I missing > > > something? > > > > The resource in the seq should the the same as the 'about', see : > > http://web.resource.org/rss/1.0/spec#s5.3.5 > > > > According to the spec : "{item_uri} should be identical to the value of the > > <link> sub-element of the <item> element, if possible.". So > > although in most circumstances the 'about' will be the same as the <link>, > > this isn't necessarily always the case (this was discussed a while ago on > > rss-dev). > > > > (Personally I'd prefer that the specs made the <link> element optional, so > > that self-contained items like many on blog posts were covered better, the > > thing being described being the 'about' resource, without reference to any > > external URL). > > > > Cheers, > > DAnny. > > > > > > > > --------------------------------------------------------- > Joseph B. Ottinger jo...@en... > http://enigmastation.com IT Consultant > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Rsslibj-developer mailing list > Rss...@li... > https://lists.sourceforge.net/lists/listinfo/rsslibj-developer > --------------------------------------------------------- Joseph B. Ottinger jo...@en... http://enigmastation.com IT Consultant |
From: Danny A. <dan...@vi...> - 2003-02-25 12:53:48
|
> Now, the only remaining question is: "Should the <item> have its rdf:about > value matching the sequence's rdf:resource?" Right now, it does. I'm not > sure if the spec mandates it. It does: 5.3.5 <items> An RDF table of contents, associating the document's items [5.5] with this particular RSS channel. Each item's rdf:resource {item_uri} must be the same as the associated item element's rdf:about {item_uri}. An RDF Seq (sequence) is used to contain all the items rather than an RDF Bag to denote item order for rendering and reconstruction. Note that items appearing in the document but not as members of the channel level items sequence are likely to be discarded by RDF parsers. Syntax: <items><rdf:Seq><rdf:li resource="{item_uri}" /> ... </rdf:Seq></items> Requirement: Required http://web.resource.org/rss/1.0/spec#s5.3.5 |
From: Joseph O. <jo...@en...> - 2003-02-25 13:19:30
|
Beauty! Then the code as it stands right now is correct. On Tue, 25 Feb 2003, Danny Ayers wrote: > > > Now, the only remaining question is: "Should the <item> have its rdf:about > > value matching the sequence's rdf:resource?" Right now, it does. I'm not > > sure if the spec mandates it. > > It does: > > 5.3.5 <items> > An RDF table of contents, associating the document's items [5.5] with this > particular RSS channel. Each item's rdf:resource {item_uri} must be the same > as the associated item element's rdf:about {item_uri}. > > An RDF Seq (sequence) is used to contain all the items rather than an RDF > Bag to denote item order for rendering and reconstruction. > > Note that items appearing in the document but not as members of the channel > level items sequence are likely to be discarded by RDF parsers. > > Syntax: <items><rdf:Seq><rdf:li resource="{item_uri}" /> ... > </rdf:Seq></items> > Requirement: Required > > http://web.resource.org/rss/1.0/spec#s5.3.5 > --------------------------------------------------------- Joseph B. Ottinger jo...@en... http://enigmastation.com IT Consultant |
From: Joseph S. <acr...@io...> - 2003-02-25 12:57:16
|
On Tue, 25 Feb 2003, Joseph Ottinger wrote: actually, 2 things are fixed: what i was getting was <item/> what i should get is <li rdf:resource="uri"/> getAbout() seems to be empty. even when i used it first with the li tag, i got <li rdf:resource=""/> or <li/> (when EXML nicely ignored an attribute with a null value). again, if the about property isn't set by something, its empty and that's causing problems. My reading of the O'Reilly article is that the uri needs to be the same as the one in the Item tag, so why not use getLink in both?. The reason is that in RDF, the order of elements technically doesn't matter, unless the elements are wrapped in an rdf:Seq container. Even if RSS 1.0 were to specify that that the Item tags are in the right order, to be RDF compliant (which I need to work with existing RDF tools here @ my company), the Seq is all that matters in the order of things. Joe > Joe, the only issue with applying this patch is that I'm not sure what > it's solving. You're adding the item to the sequence, and the *main* > difference I see is that you're using the item LINK instead of the item > ABOUT data... and those should be the same reference. Am I missing > something? > > On Mon, 24 Feb 2003, Joseph Shelby wrote: > > > private void addItemsRef(Element channel, List is) { > > if(is!=null && is.size()>0) { > > Element items=channel.addElement("items"); > > Element seq=items.addElement("rdf", "Seq"); > > Iterator iter=is.iterator(); > > while(iter.hasNext()) { > > Item item=(Item)iter.next(); > > // addItem(seq, item, "resource"); > > Element li = seq.addElement("li"); > > li.setAttribute("rdf", "resource", item.getLink()); > > } > > } > > } > > > > that now follows the rdf:Seq->li syntax described by O'Reilly's > > page > > > > http://www.oreillynet.com/pub/a/network/2000/08/25/magazine/rss_tut.html?page=3 > > > > Joe > > > > --------------------------------------------------------- > Joseph B. Ottinger jo...@en... > http://enigmastation.com IT Consultant > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Rsslibj-developer mailing list > Rss...@li... > https://lists.sourceforge.net/lists/listinfo/rsslibj-developer > -- ------------------------------------------------------------------- Joseph Shelby mailto:acr...@io... http://www.celticdistrict.com/ http://www.io.com/~acroyear ------------------------------------------------------------------- |
From: Joseph O. <jo...@en...> - 2003-02-25 13:21:02
|
Argh, the problem lives on. I'll examine it more closely. Joe, can you show me some code that duplicates the issue? I'm hoping to have a new release today and I'd like it to be correct. On Tue, 25 Feb 2003, Joseph Shelby wrote: > On Tue, 25 Feb 2003, Joseph Ottinger wrote: > > actually, 2 things are fixed: > what i was getting was <item/> > what i should get is <li rdf:resource="uri"/> > > getAbout() seems to be empty. even when i used it first with the > li tag, i got <li rdf:resource=""/> or <li/> (when EXML nicely ignored > an attribute with a null value). > > again, if the about property isn't set by something, its empty and that's > causing problems. My reading of the O'Reilly article is that the uri needs > to be the same as the one in the Item tag, so why not use getLink in both?. > > The reason is that in RDF, the order of elements technically doesn't matter, > unless the elements are wrapped in an rdf:Seq container. Even if RSS 1.0 > were to specify that that the Item tags are in the right order, to be RDF > compliant (which I need to work with existing RDF tools here @ my company), > the Seq is all that matters in the order of things. > > Joe > > > Joe, the only issue with applying this patch is that I'm not sure what > > it's solving. You're adding the item to the sequence, and the *main* > > difference I see is that you're using the item LINK instead of the item > > ABOUT data... and those should be the same reference. Am I missing > > something? > > > > On Mon, 24 Feb 2003, Joseph Shelby wrote: > > > > > private void addItemsRef(Element channel, List is) { > > > if(is!=null && is.size()>0) { > > > Element items=channel.addElement("items"); > > > Element seq=items.addElement("rdf", "Seq"); > > > Iterator iter=is.iterator(); > > > while(iter.hasNext()) { > > > Item item=(Item)iter.next(); > > > // addItem(seq, item, "resource"); > > > Element li = seq.addElement("li"); > > > li.setAttribute("rdf", "resource", item.getLink()); > > > } > > > } > > > } > > > > > > that now follows the rdf:Seq->li syntax described by O'Reilly's > > > page > > > > > > http://www.oreillynet.com/pub/a/network/2000/08/25/magazine/rss_tut.html?page=3 > > > > > > Joe > > > > > > > --------------------------------------------------------- > > Joseph B. Ottinger jo...@en... > > http://enigmastation.com IT Consultant > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Rsslibj-developer mailing list > > Rss...@li... > > https://lists.sourceforge.net/lists/listinfo/rsslibj-developer > > > > --------------------------------------------------------- Joseph B. Ottinger jo...@en... http://enigmastation.com IT Consultant |