{"id":805,"date":"2007-04-24T21:40:35","date_gmt":"2007-04-25T01:40:35","guid":{"rendered":"http:\/\/fgiasson.com\/blog\/index.php\/2007\/04\/24\/converting-your-wordpress-and-mediawiki-data-into-rdf-on-the-fly\/"},"modified":"2007-04-24T21:40:35","modified_gmt":"2007-04-25T01:40:35","slug":"converting-your-wordpress-and-mediawiki-data-into-rdf-on-the-fly","status":"publish","type":"post","link":"https:\/\/fgiasson.com\/blog\/index.php\/2007\/04\/24\/converting-your-wordpress-and-mediawiki-data-into-rdf-on-the-fly\/","title":{"rendered":"Converting your WordPress and Mediawiki data into RDF on-the-fly"},"content":{"rendered":"<p>Semantic Web (RDF) data won&#8217;t come from initiatives such as <a href=\"http:\/\/livejournal.com\">LiveJournal.com<\/a> and <a href=\"http:\/\/tribe.net\">Tribe.net<\/a> with the exportation of their user profiles into RDF using the <a href=\"http:\/\/foaf-project.org\">FOAF ontology<\/a>; at least not at first. These initiatives are marginal considering the current state of the Web: billion of web pages where most of them are archived into relational database and generated, on-the-fly, in HTML.<\/p>\n<p>Semantic Web (RDF) data will come from the conversation of relational databases of widely used web software such as <a href=\"http:\/\/wordpress.org\">WordPress<\/a>, <a href=\"http:\/\/mediawiki.org\">Mediawiki<\/a> and <a href=\"http:\/\/phpbb.com\">phpBB<\/a>, into RDF using some ontologies. Some methods can be used:<\/p>\n<ul class=\"unIndentedList\">\n<li> Developing specialized scripts to perform the mapping between the database schema and its RDF representation (this is how the <a href=\"http:\/\/sioc-project.org\/wordpress\">WordPress exportation plugin<\/a> into <a href=\"http:\/\/sioc-project.org\">SIOC<\/a> is currently working). But this method is time consuming for their development of the scripts are hard to maintain.<\/li>\n<li> Developing <a href=\"https:\/\/fgiasson.com\/blog\/upload\/rdfviews\/mbz-rdf-view.sql\">RDF Views<\/a>. <a href=\"https:\/\/fgiasson.com\/blog\/index.php\/2007\/04\/17\/musicbrainz-relation-database-mapped-in-rdf-using-the-music-ontology\/\">This is how we currently convert the Musicbrainz.org relational database into RDF using the Music Ontology<\/a>.<\/li>\n<\/ul>\n<p>This blog post will show you how we can do the same with your WordPress blog and your Mediawiki wiki using <a href=\"https:\/\/fgiasson.com\/blog\/upload\/rdfviews\/mbz-rdf-view.sql\">Virtuoso RDF Views<\/a>.<\/p>\n<p>This is quite powerful: by using these views any WordPress or Mediawiki instance could be queried using SPARQL. Other views could easily be created for phpBB (currently on the way), and virtually any relational database accessible from the Web.<\/p>\n<p>Since developing these views is quick and simple, it makes them certainly one of the best tools to convert current relational data sources into RDF.<\/p>\n<h3>WordPress and Mediawiki RDF Views<\/h3>\n<p><a href=\"http:\/\/myopenlink.net\/weblog\/imitko\/index.vspx\"><br \/>\nMitko Iliev<\/a> developed these two RDF Views that are using the WordPress and Mediawiki database schemes and convert them into RDF using a RDF View. I added some comments in the code but as you can notice, they are quite simple and intuitive to understand (if you have some knowledge in SPARQL.<\/p>\n<ul class=\"unIndentedList\">\n<li><a href=\"https:\/\/fgiasson.com\/blog\/upload\/mw_rdf.sql\"> RDF View for MediaWiki<\/a><\/li>\n<li><a href=\"https:\/\/fgiasson.com\/blog\/upload\/wp_rdf.sql\"> RDF View for WordPress<\/a><\/li>\n<\/ul>\n<h3>Installing these RDF Views<\/h3>\n<p>You have 3 possibilities to install these RDF Views.<\/p>\n<ol>\n<li>If you have the <a href=\"http:\/\/www.openlinksw.com\/virtuoso\/\">commercial version of Virtuoso<\/a> you only have to connect the MySQL remote database with Virtuoso via Conductor. That way you will see MySQL databases as if they would be local into Virtuoso.<\/li>\n<li> If you have the <a href=\"http:\/\/virtuoso.openlinksw.com\/wiki\/main\/Main\/OdsVOS\">open-source version of Virtuoso<\/a> you have two choices:\n<ol>\n<li>You make a SQL dump of the MySQL database and import it into Virtuoso.<\/li>\n<li>You install the upgraded version of WordPress or Mediawiki developed by OpenLink Software. These upgraded versions of WordPress and Mediawiki use Virtuoso as dbms instead of MySQL.  These two versions should be making available to the public by OpenLink soon.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>The idea here is to give access to the relational data to Virtuoso by using one of these three methods. After that, it is just a matter of sending SPARQL queries against the RDF View.<\/p>\n<h3>Querying a MediaWiki instance using SPARQL<\/h3>\n<p><a href=\"http:\/\/demo.openlinksw.com\/mediawiki\/\"><br \/>\nI will use that MediaWiki instance<\/a> to show you a couple of examples. This is a modified version of MediaWiki 1.7 that uses Virtuoso instead of MySQL as dbms. Then we installed the RDF View I talked about above. From that point, we can query this Mediawiki wiki instance using SPARQL. Remember that it is always running in a relational database, but thanks to the RDF View, we can view its data in RDF too!<\/p>\n<ul class=\"unIndentedList\">\n<li> Listing all triples from the RDF view: <a href=\"http:\/\/demo.openlinksw.com\/DAV\/home\/demo\/wordpress-rdf-view\/all-triples.isparql\">See results<\/a><\/li>\n<li> Listing the names of the Wikis hosted on this server: <a href=\"http:\/\/demo.openlinksw.com\/DAV\/home\/demo\/wordpress-rdf-view\/all-wiki-names.isparql\">See results<\/a><\/li>\n<li> Listing the wiki pages of the &#8220;DemoWiki&#8221; wiki instance: <a href=\"http:\/\/demo.openlinksw.com\/DAV\/home\/demo\/wordpress-rdf-view\/all-wiki-pages.isparql\">See results<\/a><\/li>\n<li> Listing the wiki pages created by the &#8220;demo&#8221; user: <a href=\"http:\/\/demo.openlinksw.com\/DAV\/home\/demo\/wordpress-rdf-view\/all-pages-demo-user.isparql\">See results<\/a><\/li>\n<\/ul>\n<h3>Etc.<\/h3>\n<p>We can endlessly continue like that. What I would suggest you to do is to click on the results you get in these web pages, and to click on the &#8220;explore&#8221; link. That way, you will jump from node to node and find interesting stuff.<\/p>\n<h3>Conclusion<\/h3>\n<p>I believe that it is the best way to push people to adopt the semantic web, and all its concepts, as The way to describes things on the Web. Once we will get all that useful data from existing sources (musicbrainz, US census data, geonames, name it) and that people will start to release services using all this data in a useful way, then people will start to generate their content for the semantic web. This is why we should continue in that direction. Many people are already working to convert existing sources of data (relational database, web APIs, etc.) into RDF: the <a href=\"http:\/\/simile.mit.edu\/mail\/SummarizeList?listId=14\">linked-open-data community<\/a>, <a href=\"http:\/\/www.zitgist.com\">Zitgist<\/a>, <a href=\"http:\/\/www.openlinksw.com\">OpenLink<\/a>, and probably many others. I would guess (in fact I am sure) that in one year we would have several billion of triples ready to be searched and browsed by Web users.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Semantic Web (RDF) data won&#8217;t come from initiatives such as LiveJournal.com and Tribe.net with the exportation of their user profiles into RDF using the FOAF ontology; at least not at first. These initiatives are marginal considering the current state of the Web: billion of web pages where most of them are archived into relational database [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[84],"tags":[],"class_list":["post-805","post","type-post","status-publish","format-standard","hentry","category-semantic-web"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/805","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=805"}],"version-history":[{"count":0,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/805\/revisions"}],"wp:attachment":[{"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=805"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=805"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}