Blog redesign

… in progress

Adding geolocation in FOAF files

If you plan to use FOAFMap, you certainly would like to add your coordinates to your FOAF file.

Richard Cyganiak created a nice script that gives you the code to add on your profile with a single-click on a Google Map. Well done !

You can also use this other FOAF geolocation tool, in which you type your address to get the required piece of code.

PHOAF v0.4 and performance tests for inference engine

I forgot to mention it on my previous post, but PHOAF v0.4 is available[1]. This version handles Relationship vocabulary as explained here.

Here are the results of a few tests about time / memory performance of 0.3 vs 0.4 - that uses inference engine. I choosed 3 FOAF files which differ in the way they represent relations between people:

I ran the tests under a 1.8Ghz Pentium-M with 512Mo RAM, and files were copied locally to avoid network latency:

alex@marvin:~/foaf-perf$ ./perf.sh
** Performances for models/danbri.rdf
* PHOAF v0.3:  Dan Brickley knows 22 people  Memory: 2159288  Time: 0.334619998932 seconds
* PHOAF v0.4:  Dan Brickley knows 22 people  Memory: 2722496  Time: 0.857136964798 seconds  

** Performances for models/iandavis.rdf
* PHOAF v0.3:  Ian Davis knows 15 people  Memory: 2162440  Time: 0.111047029495 seconds
* PHOAF v0.4:  Ian Davis knows 15 people  Memory: 2725496  Time: 0.747648954391 seconds  

** Performances for models/kasei.rdf
* PHOAF v0.3:  Gregory Todd Williams knows 1 people  Memory: 3096304  Time: 0.339249849319 seconds
* PHOAF v0.4:  Gregory Todd Williams knows 6 people  Memory: 3650496  Time: 1.99226093292 seconds

As you can see, the issue is more on time than memory, especially when it has to create new triples from default model using inference engine: script behavior is almost the same for the 2 first files, but really longer for the last one, where it discovers new <foaf:knows> relations.

Yet, even on files using only <foaf:knows> it can be problematic as it can make your PHP script timeout, as it seems to do in FOAFMap for files containing a lot of relationships (~100). So if you plan to use it on big models, update your PHP time limit.

Notes

[1] As I got some bugs reported since FOAFMap.net has been online, a new version is expected soon.

FOAFMap.net is online !

As I’m finally satisfied with the code I wrote, here’s a first public version of FOAFMap.net, a “not-beta Semantic Web2.0 geolocation mashup” (nice, isn’t it ?!).

Regarding the previous version of the tool, here are the main improvements:

Well, as you can see, what was at the begining just a small script to render FOAF files on a GoogleMap is now an more complex (and friendly, I hope) tool that takes ideas from both Semantic Web and Web2.0.

I think this could be a Semantic Web answer to geolocation tools such as frappr.com. The main advantage is that you own the data, and the tool just display it. If your blogging software, or wiki, creates a personnal/group FOAF file, you can use the tool to locate people, but data is still yours.

Some may insist on the privacy point, as there’s no logging system. Yet, as all data displayed on the tool is publicly available on the web, I don’t think that’s an issue. Anyway, you can drop me a mail if someone else has listed your profile and you want to remove it.

Finally, I’ll submit FOAFMap.net to SFSW06 scripting challenge, and will certainly release code (GPL-ed), so that you can use for Intranet or private working groups.

Have fun !

Flux RSS et tags

J’ai enfin mis en place les modifs proposées par Jérome pour avoir un flux RSS par tag sur ce blog.

Par contre, j’ai procédé un peu différement. De son côté, il considère qu’un type de flux peut être soit billet, soit commentaires, soit tag. Je pense que l’export RSS par tag ne doit pas se faire par l’intermédiaire de ce paramètre type, mais de la même façon que pour distinguer le flux général d’un flux de catégorie ou de langue.

Donc, j’ai changé

 //JL 2006-02 add RSS/tag  //$type = (!empty($_GET‘type’) && $_GET‘type’ == ‘co’) ? ‘co’ : ‘blog’;  $type = (!empty($_GET‘type’) && ($_GET‘type’ == ‘co’ or $_GET‘type’ == ‘tag’)) ? $_GET‘type’ : ‘blog’;  //$type = (!empty($_GET‘type’)) ? $_GET‘type’ : ‘blog’;  $tag = (!empty($_GET‘tag’)) ? $_GET‘tag’ : ”;

par

 $type = (!empty($_GET‘type’) && $_GET‘type’ == ‘co’) ? ‘co’ : ‘blog’;  $tag = (!empty($_GET‘tag’)) ? $_GET‘tag’ : ”;

et

 if ($meta_plug == true && $type == 'tag'){    $news = twPostMeta::getLastNews('tag', $tag,  10, 'post_dt DESC', $lang);  } else {

par

 if ($meta_plug == true && !empty($tag)) {    $news = twPostMeta::getLastNews('tag', $tag,  10, 'post_dt DESC', $lang);  } else {

Ca permet d’avoir des URLS comme rss.php?tag=montag plutot que rss.php?type=tag&tag=montag, comme pour les catégories. Exemple: http://apassant.net/rss.php?tag=dotclear

Plugin SIOC pour Dotclear

Ca a trainé, mais le plugin d’export SIOC pour dotclear est maintenant disponible.

Il ne s’agit pas d’un plugin au sens habituel des plugins dotclear, puisque c’est en fait un seul fichier à télécharger ici et à placer dans votre répertoire dotclear (au même niveau que les scripts d’export RSS), en l’ayant renommé en .php (sioc.php pour rester simple).

Il exporte donc des informations concernant:

conformément aux spécifications SIOC.

Si le Web Sémantique vous intéresse et que vous voulez exporter vos données - a la fois le contenu, ce que propose déjà RSS, mais surtout les relations entre utilisateurs, posts, commentaires … - dans un vocabulaire prévu à cet effet, n’hésitez pas à l’installer, et même à utiliser un des boutons prévu à cet effet pour l’indiquer sur votre blog.

Relationship vocabulary in PHOAF with RAP inference engine

I’ve just added support for Relationship vocabulary in PHOAF, so that the knows() method now recognise all Relationship properties (as they are subproperties of foaf:knows()).

I was wondering how such subproperties and inferencing could be handled in RAP, but this is actually really simple.

First, your model needs to be an InfModel (I choosed InfModelF, as the file is not supposed to evolve after being loaded). Then, you must add the statements that will define relations between properties and their “top-properties”.

Eg:

$this->add(new Statement(RELATIONSHIP::RELATIONSHIP(), RDFS::SUB_PROPERTY_OF(), FOAF::KNOWS());
$this->add(new Statement(RELATIONSHIP::ACQUAINTANCE_OF(), RDFS::SUB_PROPERTY_OF(), FOAF::KNOWS());
$this->add(new Statement(RELATIONSHIP::AMBIVALENT_OF(), RDFS::SUB_PROPERTY_OF(), FOAF::KNOWS());
$this->add(new Statement(RELATIONSHIP::ANCESTOR_OF(), RDFS::SUB_PROPERTY_OF(), FOAF::KNOWS());
$this->add(new Statement(RELATIONSHIP::ANTAGONIST_OF(), RDFS::SUB_PROPERTY_OF(), FOAF::KNOWS());
$this->add(new Statement(RELATIONSHIP::APPRENTICE_TO(), RDFS::SUB_PROPERTY_OF(), FOAF::KNOWS());

Now, when using $this->getMatchingStatements(NULL, FOAF::KNOWS(): NULL), and thanks to the inference engine, you’ll get all statements with rel:xxx as a predicate.