cendres.net

Duong Tam Kien
Architecte de l'information
Sociologue

sparql and computationnal sociology - 1

22.05.2012

Yesterday saw my first steps in SPARQL. Not necessarly an very pleasant experience, it seems promising anyway. Don’t look at this post as a tutorial into SPARQL and the reality of semantic web but more as a journey log.

Then certainly in a vague moment of procrastination coupled with the spirit of maximalism, someone proposed to use wikipedia to produce a full automatically constructed graph of influence of philosophers among others. Quiet quickly, we went about dbpedia to skip the scrapping part. The aim of dbpedia is to provided a semantic version of wikipedia.

That is said, it provided a very handy API and way to query a “network of knowledge”

Here is the last SPARQL query we produced to get a minimal graph of relations between philosophers.

PREFIX dbo: <http://dbpedia.org/ontology/>

select distinct ?person ?influenced ?influencedBy
where { 
    ?person
        rdf:type dbo:Philosopher ;
        foaf:name ?nameperson .
    {
      OPTIONAL {
        ?person
          dbpedia-owl:influenced ?influenced .

        ?influenced rdf:type dbo:Philosopher .
      }
    }
    UNION
    {
      OPTIONAL {
        ?person
          dbpedia-owl:influencedBy ?influencedBy .

        ?influencedBy rdf:type dbo:Philosopher .
      }
    }
}

ORDER BY ?person

There is obviously some lacks due to wikipedia categorization eg. Sigmund Freud is certainly a major influence in history of philosophical thougths but does not appear because is not tagged as a philosopher.

first returns of experience

  • The dataset provided has some weird bugs or the query is wrong. For example, Jacques Lacan has a some influenced links on the web rendering but less when we do a direct query. (Don’t worry, I am not switching views about lacanian psychoanalysis, I just found weird that the first result does not show up more influences)
  • Some differences with the “reality” or common sense are certainly due to dbpedia’s extraction process.
  • It is certainly possible to use formal ontology to provide less gnostic categorization. Specially about what is a philosopher or not.
  • Speaking of which, I have never been very conf