[redland-dev] librdf_model_to_string only works for rdf+xml?
(repost)
Einar Poke
einarpeak at yahoo.com
Tue Jul 17 19:01:23 BST 2007
--- Dave Beckett <dave at dajobe.org> wrote:
>
> There is no standard mime type for RSS 1.0, but it works
> if you use the serializer name:
>
> str = librdf_model_to_string(model, uri, "rss-1.0", NULL, 0);
Thank you for your reply. I had also tried using the serializer name,
but the result was actually worst (the application was crashing inside
this function call).
Then I finally found out the problem was related to the libraries, not
my test code. I was using the Windows build
"redland-1.0.3-Win32-Dev.zip" available from here:
http://nzlinux.virtuozzo.co.nz/files/redland/1.0.3/
http://www.nzlinux.org.nz/blogs/2006/04/21/redland-windows-103-ready/
Now it finally worked after I tried using instead the Windows build
"redland-1.0.3-3-bin.zip" (and related libraries) I just found here:
http://82.149.170.66/kde-windows/win32libs/zip/single/
Hopefully this information will help others to avoid the same kind of
problem I had.
Now there's only one remaining problem: the resulting RSS does not
produce contents for the "items" tag! The obtained RSS for
"http://scripts.gamespy.com/rss/gamespy.all.2.0.xml" misses all the
relevant information, producing only this result:
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:content="http://web.resource.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:enc="http://purl.oclc.org/net/rss_2.0/enc#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rss091="http://purl.org/rss/1.0/modules/rss091#"
xmlns="http://purl.org/rss/1.0/">
<channel rdf:about="http://www.gamespy.com">
<title>GameSpy Complete</title>
<link>http://www.gamespy.com</link>
<description>GameSpy editors talk about video games, industry news,
and the multiplayer gaming community. GameSpy.com covers video games
for PC, Xbox 360, Wii, PS3, PS2, PSP and DS.</description>
<rss091:language>en-us</rss091:language>
<rss091:copyright>IGN Entertainment, Inc.</rss091:copyright>
<rss091:pubDate>Tue, 17 Jul 2007 10:14:22 PDT</rss091:pubDate>
<content:encoded><![CDATA[GameSpy editors talk about video games,
industry news, and the multiplayer gaming community. GameSpy.com covers
video games for PC, Xbox 360, Wii, PS3, PS2, PSP and
DS.]]></content:encoded>
<items>
<rdf:Seq>
</rdf:Seq>
</items>
</channel>
</rdf:RDF>
Fixing the repeated encoding above is easy enough, but how can I get
access to the contents of tag "items"? I even tried to access the
information directly in the model by calling
"librdf_model_get_contexts(model)" for instance, but this call returns
zero and produces the message "librdf warning - Model does not support
contexts", even when I tried explicitly declaring:
storage=librdf_new_storage(world, "memory", "test",
"hash-type='memory',new='yes',context='yes'")")
Is there anything I'm doing wrong? Please advise.
____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story.
Play Sims Stories at Yahoo! Games.
http://sims.yahoo.com/
____________________________________________________________________________________
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097
More information about the redland-dev
mailing list