Archive for June, 2005

Python/Redland Powered RDF Validator

Posted in PHP, Python, RDF, Redland RDF Application Framework, Semantic Web on June 2nd, 2005 at 20:02:24

After some thinking this morning, I converted the current PHP-based crschmidt.net templating system to a Cheetah Python template. This means that some more of my tools can move to being Python powered, rather than PHP powered.

“So what?”

Currently, the interface to Redland that I have available in PHP is significantly less good than Python. It’s coded by yours truly, and it’s basically only designed for my use cases, so every time I want to use something new, I have to go and code it, or use a closer-to-native C-style interface translated into PHP. Neither of those are particularly enjoyable.

Python is a much more comfortable language for me to use. It is more intuitive for me. It feels more natural, not to mention the fact that I keep forgetting semicolons in my PHP code. It has an awesome binding for Redland, which is one of the things that I’ve been working with most over the past while.

In the past, all my scripts had been either 1. PHP or 2. Python with no site theming. Hopefully the new Cheetah template will help make me create some more tools in Python, which is the language I feel most comfortable in.

With that in mind, I’ve created a new crschmidt.net web service: an RDF Validator. A number of times, I have found that the official RDF validator will puke, but won’t give much of a reason why. This tool uses Redland, which has a tendancy to return what I consider better error messages on worse RDF. It’s designed as a one-off example of the new templating system, and should not be considered indicitive of most of the expected output of such scripts. Just a first attempt at getting myself into more code.

In-Feed Feedback

Posted in Semantic Web, Social on June 1st, 2005 at 23:38:23

I’m playing second fiddle to Danny again right now, implementing his Reader Provided Blog Enhancements as a wordpress plugin. Currently I’m posting to a local MySQL table, from which I can pull the relevant information and create different views later.

This is a great example of some code that would be nice to do with XmlHttpRequest: rather than having the post go to a redirect (which is only going to work if the user has referrers on right now, otherwise it just brings to a single page that says it was completed), it could all be done in the client, and the user would never have to leave.

However, there’s a couple problems with this.

1. RSS Aggregators are not web browsers, and depending on the level of the implementation they are using for displaying HTML content, they may not support Javascript at all or not completely. I’m hoping that HTTP POST will actually do something useful for most of them, but even that is a guess.
2. Online aggregators such as LiveJournal oftentimes strip out Javascript to prevent malicious cookiestealing (and for good reason).

So, unfortunately, javascript is out.

Couple changes that will be happening in the meantime while I work on this: RSS feeds will be limited in size to 1 or 2 posts, so that you don’t get change-flooded every time I turn the plugin on or off to test something, and you may see the review boxes appear or disappear.

Anyway, nothing much to see yet, but I will be doing RDF export of annotations provided, so the data isn’t going to be lost, and I will be working to clean up the code and make it “just work” with a WordPress plugin, hopefully. They are surprisingly easy to write. I didn’t realize how simple some of the stuff was. Keep your eyes on the prize!

Oh, and Danny? Your RDF in that post is broken. Missing rdf:RDF, and one of your close tags is missing a /. Thought I’d let you know 😉