Envoi de mails et attachements

En me baladant sur le site du W3C, je viens de tomber sur cette page.

Ca ne concerne sans doute pas beaucoup de monde ici, mais :

 Avoid unnecessary email attachments.  Use an attachment only when it is likely to benefit to recipients.  Otherwise, place the information (in plain text format) in the body of your message.

A retenir ! N’oubliez pas que si vous avez fait une lettre ou un document .doc que vous voulez envoyer, la personne en face n’a pas forcément l’outil pour le lire - ou même le temps de le lancer - , et que c’est donc beaucoup plus simple de copier / coller le contenu directement dans le mail (si possible en texte seul, ou en tout cas en évitant des polices ou couleurs agressives).

Interroger le Web Sémantique

En supposant que vous ayez suivi l’article de Got sur RDF, ou tout autre tutoriel du même genre, vous voyez sans doute - j’espère ;) - l’intérêt de disposer de données RDF pour représenter des resources sur le Web[1] .

Et apres ? Parcequ’on a beau avoir des données, encore faut-il les exploiter, l’interrogation étant un moyen d’en tirer profilt.

Première étape que j’évoquerai dans ce billet: SPARQL. Ce langage - et protocole - de requête pour RDF est supporté par le W3C et s’impose comme le langage de référence pour exprimer des requêtes sur des données RDF, malgré certaines limites (par exemple, pas de support de fonctions d’agrégation: MAX, COUNT …), mais avec une grande facilité puisqu’on retrouve dans une clause WHERE la notion de graphe et de triplets.

Par exemple, à partir de mon profil FOAF, pour connaitre l’ensemble des personnes que je connais, je peux utiliser la requête suivante:

  PREFIX foaf: <http://xmlns.com/foaf/0.1/>  SELECT ?who  WHERE {    ?x foaf:primaryTopic ?me    ?me foaf:knows ?who  }

qui retournera les connaissances (URIs) définies dans mon profil de façon à ce qu’un lien foaf:knows existe entre moi (i.e. le noeud identifié comme foaf:primaryTopic) et ces URIs.

Une API comme redland permet de charger plusieurs graphes en mémoire et d’effectuer une requête unique, cependant, si l’on souhaite interroger un grand nombre de document, la pratique commune est de centraliser ceux-cis dans un triple store.

Pour faire simple, il s’agit d’un système stockant les données sous forme de triplets, et proposant une API pour ajouter / supprimer ceux-cis et différents moyens de les requêter (par ex. avec SPARQL). La plupart reposent sur une base de donnée relationnelle[2] et il existe donc de nombreux systèmes, avec des spécificités (contexte, inférence …) et langages différents. J’utilise personnelement Joseki pour stocker des triplets sans contextualisation et 3store, qui gère le contexte, dans le cas contraire.

Problème(s): il est nécessaire de connaitre à l’avance les données à interroger, et en cas de modification de documents sources, il faut mettre à jour l’entrepôt (en utilisant par exemple Ping The Semantic Web).

Toutes ces explications pour en arriver à la librairie que j’évoquais dans le billet précédent: Semantic Web Client Library. A partir d’un document source et en utilisant les liens qui peuvent exister entre les différents documents présents sur le Web via l’utilisation de rdfs:seeAlso, la librairie va en fonction de la requête - toujours en SPARQL - récupérer d’autres documents qui pourraient la satisfaire - moyennant quelques précautions dans la définition de celle-ci - , à la manière du Tabulator.

Donc, d’une part, plus besoin de disposer d’entrepôt pour des requêtes sur plusieurs documents, mais surtout le fait que les document requêtés n’ont pas besoin d’être connus à l’avance, puisqu’ils seront recupérés au fur et à mesure du parcours des liens si l’algorithme juge nécessaire de les utiliser, pour ensuite lancer la requête sur le graphe “global”. On peut ainsi en pointant un seul graphe effectuer une requête comme “Quels sont les amis de mes amis”. Le temps de traitement est nettement plus long qu’une requête sur un entrepôt, puisque chaque graphe doit être récupérer puis chargé en mémoire, cependant, c’est un excellement moyen de parcourir un Web Sémantique “ouvert”, à quelques détails près qui évoluront sans doute en fonction des besoins utilisateurs.

Plus d’informations sur la page du projet.

Notes

[1] J’avait évoqué des posts en français sur le Web Sémantique lors de la création de la planète, voila le premier :) J’essayerai donc d’écrire des posts de “vulgarisation” sur le sujet régulièrement en fonction du temps.

[2] C’est d’ailleurs assez marrant de voir les transformations SPARQL / SQL et de retrouver des bonnes requêtes de 15 lignes avec moults jointures :)

SIOC Exporter pour Dotclear, v.1.4.3

Quelques corrections dans l’API d’export SIOC afin de régler des problèmes de RDF/XML mal formé ainsi qu’un problème d’identification du blog dans les différents fichiers (cf ce thread), et donc une nouvelle version du plugin:

Le format RDF/XML produit est ainsi accessible en utilisant la Semantic Web Client Library, sur laquelle je reviendrai un peu plus tard dans la soirée.

Weblogs sur le Web Sémantique

Je connaissais les blogs de Karl, Gautier et David qui traitent - plus ou moins fréquemment - de Web Sémantique. J’ai redécouvert récemment celui de Pascal et de Charles.

Il y en a sans doute d’autres, donc afin de recenser les blogs "francophones" (du moins leurs auteurs) traitant du Web Sémantique, j’ai ouvert une page sur le wiki websemantique.org.

Dites, un planet, ca vous branche ?

Fun with Google Code Search

I’m sure most of you already commented source code like that - so did I - , but this one must be my favourite :)

Back from BlogTalk Reloaded

Back from BlogTalk Reloaded a few days ago, where I enjoyed a lot of interesting talks and presentations[1] about social software and weblogging, especially :

Regarding my talk - apologizes for the english ;) - what I felt is that Semantic Web still fears people (especially using and maintaining ontologies / knowledge bases), but I hope attendees were interested in the approach. I also got this feeling during SIOC presentation (.ppt) by Uldis and John, especially regarding the questions about microformats and SIOC differences and advantages. John wrote some ideas about creating links between both communities.

So, thanks again to Thomas, Jan and BlogTalk organizers for these two days.

Just a few suggestions:

Finally, for those that didn’t attend, there’s a lot of stuff to look at on BlogTalk wiki, Technorati, Flickr

Notes

[1] All talks where video-recorded and uploaded a few minutes after, and are still available on the program page.

OSX, ssh, screen and irssi

I’m using ssh + screen + irssi to go on IRC. I recently switched to a MacbookPro, and didn’t see how I could pageup in irssi.

I’ve finally got the answer yesterday, thanks to #mac and this post:

Now, I’m still confused with making it work on vim: while the second one works fine, the first is mapped to a vim sequence. Any hint ?

From RSS to SIOC using SPARQL

Recently, Danny Ayers asked on sioc-dev:

My blog has RDF inside, core stuff is RSS 1.0 vocab. Does anyone happen to a SPARQL CONSTRUCT for RSS 1.0 to SIOC?

I’ve never looked at the CONSTRUCT feature of SPARQL before, so I thought it was a good motivation to look at it. Basically, the goal of CONSTRUCT is to create a RDF graph from a SPARQL query (instead of getting the XML / JSON formatted-results). So it can be used to translate RDF data from one format to another, as soon as you can get data from source using a SPARQL query.

Regarding RSS 1.0 to SIOC, the mappings can be defined as:

So, the RSS1.0 “core” to SIOC CONSTRUCT query is:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX sioc: <http://rdfs.org/sioc/ns#>
PREFIX rss: <http://purl.org/rss/1.0/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>

CONSTRUCT {
  ?channel rdf:type sioc:Forum .
  ?channel sioc:link ?channel_url .
  ?channel dc:title ?channel_title .
  ?channel dc:description ?channel_description .
  ?channel sioc:container_of ?item .
  ?item rdf:type sioc:Post .
  ?item sioc:link ?item_url .
  ?item dc:title ?item_title .
  ?item sioc:content ?item_content .
} WHERE {
  ?channel rdf:type rss:channel .
  ?channel rss:link ?channel_url .
  ?channel rss:title ?channel_title .
  ?channel rss:description ?channel_description .
  ?channel rss:items ?items .
  ?items ?li ?item .
  ?item rdf:type rss:item .
  ?item rss:link ?item_url .
  ?item rss:title ?item_title .
  ?item rss:description ?item_content .
}

As an example, here’s my RSS feed (core only) translated to SIOC, and rendered in the SIOC browser.

Yet, most blogs also use DC and content RSS extensions to add more information to each rss:item, so I mapped dc:date to dcterms:created, and kept content:encoded, both using OPTIONAL in the query [1].

Finally, I also wanted to map dc:creator, but this is more tricky as there’s different use cases:

?item foaf:maker _:foaf .
_:foaf foaf:name ?item_creator .
_:foaf foaf:holdsAccount _:sioc .
_:foaf rdf:type foaf:Person .
?item sioc:has_creator _:sioc .
_:sioc rdf:type sioc:User .
_:sioc sioc:name ?item_creator .

in the CONSTRUCT part, and

?item dc:creator ?item_creator

in the WHERE clause. (eg: my RSS feed + browing it);

?item foaf:maker _:foaf .
_:foaf rdf:type foaf:Person .
_:foaf foaf:name ?item_creator .

(eg: my comments feed + browsing it)

?item foaf:maker _:foaf .
_:foaf rdf:type foaf:Person .
_:foaf foaf:name ?item_creator .
_:foaf foaf:holdsAccount _:sioc .
_:foaf foaf:nick ?foaf_nick .
_:foaf foaf:mbox_sha1sum ?foaf_sha1 .
_:foaf foaf:homepage ?foaf_homepage .
_:foaf rdfs:seeAlso ?foaf_seealso .
?item sioc:has_creator _:sioc .
_:sioc rdf:type sioc:User .
_:sioc sioc:name ?item_creator .

in the CONSTRUCT part, and

?item foaf:maker ?foaf .
?foaf rdf:type foaf:Person .
?foaf foaf:nick ?foaf_nick .
?foaf foaf:mbox_sha1sum ?foaf_sha1 .
?foaf foaf:homepage ?foaf_homepage .
?foaf rdfs:seeAlso ?foaf_seealso

in the WHERE clause, see result here + browsing it. Yet, I still can’t see how to merge all foaf:User into only one using only CONSTRUCT. If someone knows, I’ll be happy to get it.

So, basically, as most feeds contain only RSS, DC, and content vocabularies, here’s a SPARQL CONSTRUCT that should fits most of it (remove the SIOC part in CONSTRUCT for comments feeds):

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX sioc: <http://rdfs.org/sioc/ns#>
PREFIX rss: <http://purl.org/rss/1.0/>
PREFIX content: <http://purl.org/rss/1.0/modules/content/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
CONSTRUCT {
  ?channel rdf:type sioc:Forum .
  ?channel sioc:link ?channel_url .
  ?channel dc:title ?channel_title .
  ?channel dc:description ?channel_description .
  ?channel sioc:container_of ?item .
  ?item rdf:type sioc:Post .
  ?item sioc:link ?item_url .
  ?item dc:title ?item_title .
  ?item dcterms:created ?item_created .
  ?item sioc:content ?item_content .
  ?item content:encoded ?item_content_encoded .
  ?item dc:subject ?item_subject .
  ?item foaf:maker _:foaf .
  _:foaf foaf:name ?item_creator .
  _:foaf foaf:holdsAccount _:sioc .
  _:foaf rdf:type foaf:Person .
  ?item sioc:has_creator _:sioc .
  _:sioc rdf:type sioc:User .
  _:sioc sioc:name ?item_creator .
} WHERE {
  ?channel rdf:type rss:channel .
  ?channel rss:link ?channel_url .
  ?channel rss:title ?channel_title .
  ?channel rss:description ?channel_description .
  ?channel rss:items ?items .
  ?items ?li ?item .
  ?item rdf:type rss:item .
  ?item rss:link ?item_url .
  ?item rss:title ?item_title .
  ?item rss:description ?item_content .
  OPTIONAL {
    ?item dc:date ?item_created
  } . OPTIONAL {
    ?item content:encoded ?item_content_encoded
  } . OPTIONAL {
    ?item dc:subject ?item_subject
  } . OPTIONAL {
    ?item dc:creator ?item_creator
  }
}

My translated RSS feed there, and the same one in the browser.

 

Notes

[1] I fist struggled with CONSTRUCT / OPTIONAL, before realising thanks to #swig guys that it was a librdf bug, not a SPARQL one, and it runs fine with Jena/ARQ which runs in these examples with sparql.org service.

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 !

SIOC News

John mentionned 2 weeks ago the latest developments of the SIOC-osphere, but things are still hot !

Wow !