From a Wikipedia page to the corresponding DBpedia page in one click

And a similar link for Freebase.

The following two links won't do much if you click them now, but if you drag them to your bookmarks toolbar, clicking the first one there while viewing a Wikipedia page will take you to the corresponding DBpedia page, and clicking the second while viewing the Freebase page for a particular topic will take you to the page full of RDF for that topic.

wp -> dbpedia

freebase rdf

They're both scriptlets, or little bits of Javascript code embedded in links. Each reads the URL of the currently displayed page, does a bit of string manipulation on it, and sends your browser to the resulting URL. I've had the DBpedia one for a while, but I recently found that DBpedia URLs escape parentheses when Wikipedia URLs don't, so I fixed the scriptlet to account for this. While I was at it, I created the Freebase one, which is much simpler.

If anyone's interested, I also have scriptlets to go to a site's home page, an "up" button (cd ..), and a backlink button that searches Google for webpages linking to the currently displayed one.

4 Comments

Your Freebase script doesn't look like it's using the proper namespace. There's no guarantee that there will be a key in the /en namespace and, if there is, it may only be loosely related to the name of the Wikipedia article. You should reference the /wikipedia/en namespace and make sure the key is properly quoted.

See my WTF (Wikipedia-to-Freebase) Chrome extension or Zak Dweil's Greasemonkey script for a way to do this.
https://chrome.google.com/extensions/detail/hgmjdmegeidmljpoilgmfeifmiepnbkn


> it may only be loosely related to the name of the Wikipedia article

The idea was to go from the Freebase article to the Freebase page, not from the Wikipedia article to the Freebase page. I was just taking advantage of the commonality I found in URIs when I clicked the RDF links at the bottom of Freebase pages.


This is very useful for creating SPARQL queries. I created a site s3space.com several months ago where users can learn, create and share the SPARQL queries.

This conversion tool will help many to create more SPARQL queries easily.

Thanks for awesome tool.

Regards,
Amit
http://www.s3space.com


Thanks Amit, s3space.com looks pretty cool.