Some days ago I was checking how I could use the SIOC (Semantically Interlinked Online Communities) ontology to broadcast/share Talk Digger’s content in a meaningful way. (read more: Using SIOC ontology to connect Talk Digger with other online communities)
The implementation using RDF
Now it’s time to implement it by formatting that content using RDF/XML following the ontology’s guideline.
To create a good ontology you have to process by iteration: refining the ontology with testing and peer reviews.
Implementing an existing ontology in a system (such as Talk Digger) also has that process: generating a RDF file accordingly to the ontology and then trying to figure out how to link everything together (defining URI classes, defining resources, linking to resources, etc.) to optimize the graph (optimizing the relations betweens the resources to have as much meaning (easy to query) as possible).
Visualizing the RDF graph using IsaViz
The tool I used to implement the SIOC and the FOAF ontologies in Talk Digger is a RDF editor/visualization tool called IsaViz.
My procedure was simple:
- Generating the RDF/XML files (accordingly to SIOC and FOAF) with Talk Digger’s content database.
- Importing the RDF/XML file in IsaViz.
- Visualizing and analyzing the resulting graph.
- I checked all the relations between the resources and tried to figure out if it was possible to cut/add some of them to simplify/optimize the resulting graph.
- I checked all the anonymous nodes (bNodes) of the graph and checked if it was possible to relate them to an existing resource.
- I performed these 5 steps until I was satisfied by the resulting graph.
Playing with URIs and xml:base
What is great is that I can distribute Talk Digger’s content anywhere on the Web (with different URLs) and a crawler can download all these snipped of content (FOAF profiles, conversations content, etc.), aggregate them and merge them in a unique RDF graph. That way they can have their hands on all the relations that exist in the Talk Digger system and then querying it(the RDF graph) in useful and meaningful ways.
All that magic is possible by the fact that we can define a different URI for a given RDF/XML document using the xml:base attribute. That way I can:
- Host a RDF/XML document at the URL http://talkdigger.com.com/a.php
- Define the xml:base with the URI “http://talkdigger.com.com/db/”
- Host a RDF/XML document at the URL http://talkdigger.com.com/b.php
- Also Defining the xml:base with the URI “http://talkdigger.com.com/db/”
Then if a crawler downloads both RDF documents “a.php” and “b.php”, it can merge them to recreate the single RDF document defined at “http://talkdigger.com.com/db/”. By example, this merged RDF document would be the graph of all relations defined between Talk Digger’s content.
Talk Digger’s URI classes
I refer to a “URI class” when I talk about a “part” of a URI that is general to many URI “instances”. I refer to an “URI instance” when I talk about a URI that refer to a resource.
By example, the “URI class” of Talk Digger subscribed users is:
But an “instance” of that “URI class” would be the URI that describe a particular Talk Digger user:
In that example, this “instance” refers to a resource that is the Talk Digger subscribed user called “fgiasson”.
There are the “URI classes” defined in Talk Digger:
- URI class referring to a conversation container (work as a container for the conversation components)
http://www.talkdigger.com/…/conversation.php?url=[$url]
- URI class referring to a conversation
http://www.talkdigger.com/…/conversation.php?url=[$url]#conversation
- URI class referring to a usergroup (a group of users tracking that conversation)
http://www.talkdigger.com/…/conversation.php?url=[$url]#usergroup
- URI class referring to a subscribed user
http://www.talkdigger.com/…/foaf.php?nick=[$nick]
SIOC and FOAF instances generated with Talk Digger content
In the next sections I will show you how Talk Digger will use the SIOC and FOAF ontologies to broadcast/share its content.
I’ll use 3 RDF documents for my presentation:
- sioc-fgiasson.rdf. This file describe the conversation evolving around my personal website [fgiasson.com] (in fact it is only a snippet for the example’s sake).
- foaf-fgiasson.rdf. This file is the FOAF profile of my Talk Digger user [fgiasson].
- sioc-blogspot.rdf. This file describe the conversation evolving around a specific blog post on a Blogspot blog called “Guilty of being…”. This blog post refers to an article I wrote on my blog.
All the RDF graphs have been exported in SVG files from IsaViz. Many mainstream applications like Visio or CorelDraw can read these files. If you don’t have access to one of these software you can refer to that list of tools to read SVG files (I am unfortunately not able to find any tool to convert a SVG file into a huge JPEG or GIF file).
Note: the path of the interesting results I found in these graphs are highlighted in red.
The SIOC document describing the conversation evolving around fgiasson.com
You can download the RDF document here: sioc-fgiasson.rdf.
The resulting RDF graph of this document is available here: fgiasson-conversation.svg
What is interesting in that graph is the interaction between
-a sioc:User
-[http://www.talkdigger.com/…/user.php?nick=fgiasson]-a sioc:Usergroup
-[http://www.talkdigger.com/…/conversation.php?url=fgiasson.com#usergroup]-some sioc: Post
-[http://www.talkdigger.com/…/conversation.php?url=fgiasson.com#comment-1]-a sioc:Site
-[http://talkdigger.com]-a sioc:Forum
-[http://www.talkdigger.com/…/conversation.php?url=fgiasson.com#conversation]
Merging a FOAF document with this SIOC document
Now I merged the FOAF document that describe more in deep my sioc:User fgiasson.
You can download these RDF documents here: sioc-fgiasson.rdf, foaf-fgiasson.rdf
The resulting RDF graph of these documents is available here: fgiasson-conversation-foaf.svg
The link between the FOAF to the SIOC document is made using the foaf:holdsAccount property. The result is:
[http://www.talkdigger.com/…/foaf/foaf.php?nick=fgiasson]
— foaf:holdsAccount —>
[http://www.talkdigger.com/…/user.php?nick=fgiasson]
The link between the SIOC to the FOAF document is made using the rdfs:seeAlso property. The result is:
[http://www.talkdigger.com/…/user.php?nick=fgiasson]
— rdfs:seeAlso —>
[http://www.talkdigger.com/…/foaf/foaf.php?nick=fgiasson]
If you take a closer look at the resulting RDF graph, you will see that I highlighted a “loop” in red. This is one of the really interesting results when you merge different ontologies.
What is happening here? By merging the FOAF document of the “fgiasson” user with the SIOC document of the “fgiasson.com” conversation, I uncovered some interesting relations.
In fact, the sioc:User “fgiasson” is a friend of “dgiasson” another sioc:User. However, it was impossible to know that fact before merging the two documents because that information is held in the FOAF document and not the SIOC one! At the same time, we know that “fgiasson” and “dgiasson” also belong to the same sioc:Usergroup
[www.talkdigger.com/…/conversation.php?url=fgiasson.com#usergroup].
That way we are able to extend the power of our queries because we are able to know who are the people that belongs to a sioc:Usergroup and that are also friends. We could possibly even extend that feature by using the “relationship” ontology and then developing some type of trust networks by analyzing the relationships between people belonging to a same group.
Merging a new SIOC document to that RDF graph
Finally I merged another SIOC document that describes a conversation evolving around a blog post that link-back to the conversation about “fgiasson.com”.
You can download these RDF documents here: sioc-fgiasson.rdf, foaf-fgiasson.rdf, sioc-blogspot.rdf
The resulting RDF graph of these documents is available here: fgiasson-conversation-foaf-other-conversation.svg
In this graph I highlighted in red the fact that a sioc:User “fgiasson” is a member of two different sioc:Usergroup and that a sioc:Forum is the parent of another sioc:Forum.
Conclusion
In this blog post I described how I would use the SIOC and the FOAF ontologies to share the content available on Talk Digger.
There are probably some glitches, errors, or best-practices (I don’t follow) in the way I handle some classes and/or properties of these ontologies (specially about how to relate a sioc:User and a foaf: Person). Considering this it would be really appreciated to report any glitch/errors/best-practices you find to help me improving this implementation in Talk Digger.
Technorati: sioc | foaf | semantic | web | rdf | talkdigger | xml | svg | ontology | online | communities | conversation |
Cloud
June 9, 2006 — 7:01 am
Hi Fred – I was worried that that loop was a problem but having two sioc:User accounts associated with foaf:Person(s) that are friends is okay ๐ We did initially have sioc:knows which was a duplication of the FOAF term so was dropped, and thought about having sioc:has_buddy or something for buddy lists, but it’s the Person associated with the account that would know someone, not the account itself so the way you have done it makes sense.
As regards the link from sioc:User to foaf:Person, it is being talked about on the rdfweb-dev list. Also, see http://b4mad.net/datenbrei/archives/2006/06/09/no-loopback-from-siocuser-to-foafperson/
I can’t see your SVGs unfortunately, can’t seem to zoom in – might try another client…
Talk soon,
John.
—
Fred
June 9, 2006 — 9:38 am
Hi John!
the sioc:has_buddy would have sense because it would be the users that knows each others in a closed system.
The thing is that in Talk Digger, the foaf:knows property doesn’t only link people that know each other in the Talk Digger community, it also give the possibility to its users to foaf:knows someone outside the community. So, if you take a closer look at the foaf file, you will see that “fgiasson” know not only people from Talk Digger.
Considering that difference, I think that the sioc:has_buddy make senses.
For the sioc:User and foaf:Person thing, the problem is that there is no such properties right now. So, does it makes sense to use the rdfs:seeAlso property? In fact, the sioc:User is a resource and the foaf:Person is another resource. So [sioc:User — rdfs:seeAlso –> foaf:Person] make sense (in my opinion) because the foaf:Person resource “add information” to the sioc:User resource (if we take a look at the rdfs:seeAlso definition, it is what it is intended too).
It’s sad for the SVG. Do you know how I could convert them in PNG, JPEG or GIF file? I took 1 or 2 hours without any success ehehhe.
thanks!
salutations,
Fred
Cloud
June 9, 2006 — 10:41 am
Cool – well seeAlso is the best you can do for now ๐ But we’ve petitioned for the accountOf property; failing that we can point out from SIOC to FOAF using account_of or account_holder or something that would be a logical inverse to holdsAccount…
Fred
June 9, 2006 — 3:34 pm
Hi John,
Yeah great. Personally I like account_of. The semantic is good, in fact, we are talking about an account (a sioc:User), so this is the “account_of” a person (foaf: Person).
Keep up the good work with the SIOC ontology, it’s sure that I’ll do my best to help it grows. I will be a pleasure to help you if you need any!
Take care,
Salutations,
Fred