Server fixed

I’ve just fixed some configuration problems on this Debian box (sid), which made my website and other hosted services (SIOC browser, foafmap …) unavailable since yesterday. Trouble came from apache2.2 and libapache2-mod-php5, so I switched back to Apache 2.0.

Sorry for those that were looking for something here !

RDF export of SIOC wiki content

Based on Leigh Dodds idea about FOAF Bulletin Board RDF Export, I wrote some scripts that transform SIOC Wiki pages into RDF description:

The export is done with PHP5 and XSLT, using embedded PHP within XSL stylesheets, so that I can call PHP functions in it. For each link found during the transformation, a PHP function opens the URL and gets the SIOC link using autodiscovery feature. I’ve also added a function that remove links that shouldn’t be exported.

With the 2 links provided below, you’ve got an up-to-date description of where to find raw SIOC data or SPARQL stores, that you can use in your crawler or any application. A cache version is also created on each request made, you can use it if you need to access the RDF files several times in a short interval.

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.

PHOAF update

I’ve updated PHOAF so that it now includes RAP 0.9.3, especially for bugfixes as I don’t use SPARQL in the library. I’ve also added a few methods I forgot to implement before, as getHomepage(), plus the usual bugfixes.

PHOAF v0.2 can be downloaded here.

Actualité du Web Sémantique

Quelques nouveautés software ces derniers temps:

Retrieving FOAF informations with PHP

After reading this tutorial by Ian Davis about parsing FOAF files with PHP - which is also a good introduction to RDF and FOAF -, I started to write a PHP5 library to easilly retrieve informations from FOAF files.

The goal of PHOAF is to provide a set of functions to get information from a FOAF file without any knowledge about FOAF or RDF.

Eg:

$foaf = new FOAFProfile("http://mywebsite/profile.rdf"); $me = $foaf->root(); echo $me->getName() . " knows " . $sizeof($me->knows()) . " people";

It still needs some documentation, code cleaning and so on, but information about the project can be found on its gna.org homepage, and you can download a first package here.

A first app using it will be online soon, in the next 2 weeks I hope, and updates of the library will occur at the same time.

RDF, FOAF et PHP

RAP est une API PHP permettant de manipuler simplement un modèle RDF. En plus de RDF, RDFS et OWL, plusieurs vocabulaires sont référencés, dont FOAF, DublinCore ou encore vCard.

J’ai codé une couche supplémentaire permettant d’obtenir facilement des informations depuis un fichier FOAF. J’y reviendrai prochainement, le temps de nettoyer un peu le code.

Astuce Gregarius

Si vous souhaitez que seuls les admins puissent éditer les tags sous Gregarius, il suffit de rajouter le test suivant à la ligne 19 du fichier themes/default/item.php

Avant:

[<span id="ta<?= rss_item_id(); ?>"> <a href="#" onclick="_et(<?= rss_item_id(); ?>); return false;"> <?= LBL_TAG_EDIT ?></a></span>]

Après:

<?php if(!hidePrivate()) { ?> [<span id="ta<?= rss_item_id(); ?>"> <a href="#" onclick="_et(<?= rss_item_id(); ?>); return false;"> <?= LBL_TAG_EDIT ?></a></span>] <?php } ?>

(Ou, plus simplement, de remplacer le fichier item.php par celui-ci, à renommer en .php)