Here is the principle, every word of this post is a link. That’s what I believe the semantic web will be, everything interconnected, every piece of information linked. But as said in the title, it is a prototype, so the links actually are random links given by delicious and not related at all with the actual words themselves. So this is kind of a dummy semantic web blog post. But I am sure you get the idea.
Here is the ruby code I wrote to do this:
I am sure one can do this with wikipedia
require 'net/http'
require 'uri'
text = ARGV[0]
sentences = text.split('.')
linked_sentences = sentences.collect do |sentence|
propositions = sentence.split(',')
linked_propositions = propositions.collect do |proposition|
words = proposition.split(' ')
linked_words=words.collect do |word|
ref = Net::HTTP.get_response(URI.parse(
'http://del.icio.us/recent?random&min=10'))['location']
"<a href=\"#{ref}\">#{word}</a>"
end
linked_words.join(" ")
end
linked_propositions.join(", ")
end
puts linked_text = linked_sentences.join(". ")


February 20, 2007 at 9:12 pm
hmm, fascinating, though I know I would be overwhelmed by this pretty quickly