mirror of
https://github.com/almet/notmyidea.git
synced 2025-04-28 19:42:37 +02:00
43 lines
No EOL
4.5 KiB
XML
43 lines
No EOL
4.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<feed xmlns="http://www.w3.org/2005/Atom"><title>Alexis' log</title><link href="http://blog.notmyidea.org" rel="alternate"></link><link href="http://blog.notmyidea.org/feeds/python.atom.xml" rel="self"></link><id>http://blog.notmyidea.org</id><updated>2011-08-19T00:00:00Z</updated><entry><title>Simple test page</title><link href="http://blog.notmyidea.org/simple-test-page.html" rel="alternate"></link><updated>2011-08-19T00:00:00Z</updated><author><name>Alexis Métaireau</name></author><id>tag:blog.notmyidea.org,2011-08-19:/simple-test-page.html/</id><summary type="html"><p>Simple test for ghp-import + post commit hook
|
|
Yeah ?</p>
|
|
</summary><category term="bleh"></category></entry><entry><title>Using dbpedia to get languages influences</title><link href="http://blog.notmyidea.org/using-dbpedia-to-get-languages-influences.html" rel="alternate"></link><updated>2011-08-16T00:00:00Z</updated><author><name>Alexis Métaireau</name></author><id>tag:blog.notmyidea.org,2011-08-16:/using-dbpedia-to-get-languages-influences.html/</id><summary type="html"><p>While browsing the Python's wikipedia page, I found information about the languages
|
|
influenced by python, and the languages that influenced python itself.</p>
|
|
<p>Well, that's kind of interesting to know which languages influenced others,
|
|
it could even be more interesting to have an overview of the connexion between
|
|
them, keeping python as the main focus.</p>
|
|
<p>This information is available on the wikipedia page, but not in a really
|
|
exploitable format. Hopefully, this information is provided into the
|
|
information box present on the majority of wikipedia pages. And… guess what?
|
|
there is project with the goal to scrap and index all this information in
|
|
a more queriable way, using the semantic web technologies.</p>
|
|
<p>Well, you may have guessed it, the project in question in dbpedia, and exposes
|
|
information in the form of RDF triples, which are way more easy to work with
|
|
than simple HTML.</p>
|
|
<p>For instance, let's take the page about python:
|
|
<a class="reference external" href="http://dbpedia.org/page/Python_%28programming_language%29">http://dbpedia.org/page/Python_%28programming_language%29</a></p>
|
|
<p>The interesting properties here are &quot;Influenced&quot; and &quot;InfluencedBy&quot;, which
|
|
allows us to get a list of languages. Unfortunately, they are not really using
|
|
all the power of the Semantic Web here, and the list is actually a string with
|
|
coma separated values in it.</p>
|
|
<p>Anyway, we can use a simple rule: All wikipedia pages of programming languages
|
|
are either named after the name of the language itself, or suffixed with &quot;(
|
|
programming language)&quot;, which is the case for python.</p>
|
|
<p>So I've built <a class="reference external" href="https://github.com/ametaireau/experiments/blob/master/influences/get_influences.py">a tiny script to extract the information from dbpedia</a> and transform them into a shiny graph using graphviz.</p>
|
|
<p>After a nice:</p>
|
|
<pre class="literal-block">
|
|
$ python get_influences.py python dot | dot -Tpng &gt; influences.png
|
|
</pre>
|
|
<p>The result is the following graph (<a class="reference external" href="http://files.lolnet.org/alexis/influences.png">see it directly here</a>)</p>
|
|
<img alt="http://files.lolnet.org/alexis/influences.png" src="http://files.lolnet.org/alexis/influences.png" style="width: 800px;" />
|
|
<p>While reading this diagram, keep in mind that it is a) not listing all the
|
|
languages and b) keeping a python perspective.</p>
|
|
<p>This means that you can trust the scheme by following the arrows from python to
|
|
something and from something to python, it is not trying to get the matching
|
|
between all the languages at the same time to keep stuff readable.</p>
|
|
<p>It would certainly be possible to have all the connections between all
|
|
languages (and the resulting script would be easier) to do so, but the resulting
|
|
graph would probably be way less readable.</p>
|
|
<p>You can find the script <a class="reference external" href="https://github.com/ametaireau/experiments">on my github account</a>. Feel free to adapt it for
|
|
whatever you want if you feel hackish.</p>
|
|
</summary><category term="dbpedia"></category><category term="sparql"></category><category term="python"></category></entry></feed> |