Categories
RDF

A RDF extension in PHP

Danny Ayers points to an RDFWeb discussion entry about providing help with porting the Raptor RDF engine to Windows. Or with getting RDF support built into PHP.

Guys, PHP is open source. You don’t have to get the PHP folks to buy into including it as part of the distribution. What you need to do is provide the stripped down PHP code to handle the RDF parsing, and get this included in something such as PEAR or PECL.

Think “open source” rather than “who knows the insiders”.

Categories
RDF

New for me

Recovered from the Wayback Machine.

You all probably know about this already, but version 0.8 of RAP or RDF API for PHP was released in June. Among other things, such as an integrated RDF server, RAP provides support for the RDQL (a query language for RDF), now a W3C submission–which you’ve probably also heard about.

One advantage of taking a hiatus away from a technology is that when you come back, all the things you wished for are now a reality. Of course, the disadvantage is that you’re saying things like, “Hey, cool! Look at this!” and everyone has seen it before.

I guess it’s just me, myself, and I in this little journey of rediscovery. That’s okay – at least the audience will agree with me. For the most part.

Categories
RDF

Mining passive social networks

Recovered from the Wayback Machine.

Marc Canter pointed to an upcoming conference, the 1st Workshop on Friend of a Friend, Social Networking, and the Semantic Web (also mentioned at RDFWeb and Danny Ayers). I wasn’t sure about a conference focusing primarily on Friend of a Friend, but looking through the Call for Papers topic list, the conference goes beyond the concept of friend of a friend, if we think of this as primarily focusing on people describing their current, active associations. It also has the potential to go beyond, I think, the current understanding of social networks.

Though social networks have past the hot, new meme phase, we’re still trying to figure out everyday uses for these beasties. Or I should say, I’m trying to find practical and unique uses for social networks. If they continue on as they are, they’re really nothing more than a combination of popularity contest, dating service, job search, mini-blog, and Usenet.

However, the thought of associations defined online in a format that can be mined using standard technologies has a great deal of appeal–and not just within the context of making associations for jobs or professional advancement. If we look at FOAF as a way of enabling open source social networks, and then extend the definition of social networks to include passive associations rather than, or in addition to, active associations–then we have something really unique, and rather exciting.

For instance, I’ve been trying for the last year to find out what happened to others who graduated in 1986 with computer science degrees from Central Washington University. The Alumni directory of CWU isn’t particularly useful because it mainly lists information about people who actively post some new events about themselves, and most of us don’t. I also don’t have access to classmates’ addresses (the Alumni association is wary of giving these out); even if I did, I would hesistate to send them notes because I wouldn’t be sure if these people would want the contact with their old classmates.

If I modify my FOAF file to include information about me attending Central Washingtion University and getting a degree in Computer Science in 1986, this is a node, albeit a passive one, in an existing social network comprised of people who I went to school with. Now if this information were specifically searchable, someone else wanting to connect up with fellow classmates would find my information, including my email address, and they could send me an email, saying hi.

How is this different than the means I have today to connect up with others of my old class? It differs in two important ways:

First of all, the information is publicly available and searchable on the Net. Not only that, but it’s also constrained to specific assertions: I have a degree in computer science; this degree is from Central Washington University; I received this degree in 1986. Someone searching on just these assertions would find my data, rather than get 10,000 records back with a lot of accidental associations based on random scraping of pages in Google.

Secondly, and most importantly, by putting this information into my FOAF file I am acknowledging that I am a part of this particular social network, with an implication that I would welcome associations from other members of this same network. It is a passive node in the network, true; but with FOAF/RDF/OWL and data mining, these passive associations can be converted to active ones in the future.

Orkut leaves me lukewarm and Friendster leaves me cold. Even the Semantic Web doesn’t do much more than elicit a relatively unenthusiastic “yeah, smart shit” out of me. But give me this functionality in the future and I’ll dance from dawn to dusk.

Hopefully Workshops such as this one in Ireland (oh, I’d love to go), will help make this functionality a reality.

Categories
Burningbird RDF

Cleaning House

Yesterday and today I’ve been cleaning out my server, including my weblog installation. I also brought Practical RDF back online, as a new WordPress weblog. I borrowed heavily from the Burningbird redesign for this new weblog; basically copying Deep Thoughts with the addition of the book cover and the muted background.

I used an old trick to try to eliminate seams when the pattern repeats with the new background image. However, if you scroll up and down, very fast, the words, “Paul is dead” show up. Very strange.

One reason for the code cleanup is that I’m documenting all the changes I’ve made to my WP installation for the new group of boys and girls coming over to the Force. I’m also providing a zipped file of the code and if anyone is interested, they can grab it and modify the code or use as is. To help me in what is becoming a fairly major documentation project, I used a PHP document generator to generate source documentation of both the unmodified and modified WP files I’m using. Mine, of course, are in the package labeled “modified_wordpress”.

Among the changes I’ve made:

1. Blog Switcher for multiple WP weblogs. I also modified the CSS for each weblog installation, using a delicate violet for the Burningbird WP administration files, and a pale blue for RDF weblog’s admin files – to help differentiate when I go back and forth in a frenzy of posting.

2. Self-policing comments. When a comment is made, the code checks the database to see the status for comments for the specific post and its creation date. If the post is wide open to comments and over 20 days old, the comment program changes the status for that particular post to ‘moderated’ and then sends an email about the comment to me, to approve or not. With this, you need never have any form of automated application to close comments or moderate them after a certain time has passed.

You can try this yourself at Practical RDF with one of the older posts if you’re curious.

3. Spam flood protection. You can only post so many comment in a specific time period.

4. Static page generation. I statically generate my RDF/RSS and Atom feeds now when a post is published or edited. I also have a form that I’ve dropped into WordPress administration that allows me to create a static version of any of the pages.

4. The new linklog, b-link,Pithy Bar addition.

5. The older Category and Recent Comment lists in the sidebar. Yes, there are other plug-ins for these, but not at the time I wrote them. Besides, I like my Recent Comments implementation.

6. The category icon listing in the title bar for each posting.

7. Full page preview. I also removed the in-page preview from the existing WP edit page, as it was causing some performance problems when I created larger posts.

8. Per-post moderation. Being able to set moderation on a post-by-post basis – this has been a lifesaver. Comment spam problems are a thing of the past, now.

9. A new post status called ‘insert’, for those times when I want to create a page, but not have it show up in the regular lists of posts. There’s an associated file that will display these posts.

10. The full text option to display the full text of a post that has been split into sections through the use of the WP newpage tag. The code changes also prevent comments from showing on any page but the last page of a split page document.

Some other odds and ends, such as functions to return comment type, and so on.

Aside from the excitement of all this coding stuff, we’ve been hit with several major storms, one right after another. I was at the right place at the right time yesterday to see a storm unlike any I’d ever seen before. I’ll write more on this later in the week once I get this coding stuff out of the way. It was…something. Unfortunately, I didn’t have my camera with me, but luckily others captured some photos of the event.

Last night I stayed up all night: sitting, thinking, and just watching the lightning. At one point there was so much lightning that it created a strobe effect bright enough to light the surroundings–like a drug-induced midday.

However, my time was not all storm and code: I also watched a couple of movies, including Lost in Translation and Big Fish. Reviews on these later.

PS

Someone should do Andrew Orlowski a kindness and ask him which is the sadder: the person who writes to a weblog, or the person who writes about the person who writes to a weblog.

Categories
Semantics

Emotive

In my last post, Scott mentioned being able to change the stylesheet based on the mood of the writing–derived from the occurrence of trigger words such as ‘anger’, or perhaps mention of certain names.

The problem with a keyword-based solution is that without knowing the context, you really can’t determine how a word is being used. For instance, I could have a funny post that uses anger a lot, and it could be blazing red by the time I’m done, but there’s no real anger involved.

In addition, we’ve learned from Google how keywords can work, sometimes, and not, other times.

I believe no better tool exists for setting the context of a writing than the human brain. Of course we’ve found that many other factors can come into play even when the context is defined. This is the reason that smileys–those spawn of the devil– are so popular: to add hints so that a person can tell if something is supposed to be a joke or not. As we get to know each other, we’re better able to differentiate the mood of our writing based on past experience, known triggers, or word use. Even with this exposure, we still fall into little traps of misunderstandings.

In preparation for other work I’m doing, such as Poetry Finder, I’ve started working with WordPress’ key-value meta tags with each post, in this case to set a ‘tone’ of the individual writing. I’ve begun with a small set of tones and appropriate stylesheets; a set which I’ll add to over time. I’ve managed to get five tones so far, but only annotated ten postings.

If you use Emotive from the front page, category, or archive, you’ll get my favorite of the emotive sub-stylesheets. However, if you access an individual page, you can see the stylesheet based on the tone I set in the writing. If a tone isn’t set for the posting, again you’ll see the default.

Why do something like this? Well, it’s fun. More than that, though, I want to see how far I can ‘blur’ the lines between traditional front end technologies, such as (X)HTML, CSS, and JavaScript; and traditional backend tech such as PHP and MySQL.

The latency you see with the stylesheet being applied with each page is due to the fact that there is some overhead on the server when serving up the stylesheet. In addition, changing from page to page doesn’t allow caching. That’s the downside of this type of server-based processing in stylesheets – if the stylesheet changes from page to page. A better approach could be to use Javascript on the client to make the changes, triggered by a value set by the PHP application.

But it’s an interesting exercise.

(I’ll cover the technology used a little later in another writing.)