Archive for the ‘FOAF’ Category

Logging in with FOAF+SSL

Friday, April 17th, 2009

“FOAF+SSL is an authentication and authorization protocol that links a Web ID to a public key, thereby enabling a global, decentralized/distributed, and open yet secure social network.”

In my case my FOAF file http://www.3kbo.com/people/richard.hancock/foaf.rdf#i is my Web ID.

A site using FOAF+SSL is Shout Box. Once a user has logged in to Shout Box and left a comment Shout Box displays the users Web ID along side their comment.

foaf-me-shout-box

A user logging in to Shout Box identifies themselves with a certificate stored in their browser. If a user has more than one certificate installed they can choose from the list of certificates presented by the browser certifcate manager (shown below for Firefox).

Selecting a certificate for a FOAF+SSL login is simpler and quicker than typing a user name and password.

The two obvious things are user needs in order to login with FOAF+SSL are:

FOAF+SSL also requires:

  • A reference to the Web ID from the certificate. This is provided by setting the Web ID as the value for  “X509v3 Subject Alternative Name”.
  • The public key of the certificate published in the Web ID (FOAF file).

If the key published in the Web ID matches that contained in the certificate then the server can conclude that the person logging in is the owner of the Web ID (FOAF file).

I can check the details of the certificate I have been using and see the reference to my Web ID by first opening the Firefox Certificate Manager (by pasting chrome://pippki/content/certManager.xul into the brower location bar). The Certificate Manager lists all the installed certificates.

To see more information about this certificate I select it then click “View …” to get a dialog box with two tabs “General” and “Details”.  Selecting the “Details” tab and “Certificate Subject Alt Name” shows that my Web ID, http://www.3kbo.com/people/richard.hancock/foaf.rdf#i is the value set for the “X509v3 Subject Alternative Name.

An easy way to create an X509 certificate with a reference to a Web ID is to follow the steps outlined in Henry Storys article creating a foaf+ssl cert in a few clicks. I used this process to create the other two certificates shown above.

I created my main X509 certificate by following the steps outlined by Henry in his earlier article foaf+ssl: a first implementation. This gives a good programmatic understanding of what’s happening.

( The code is under activate development so if you try it and have problems then check out revision 468 to get the code that matches the article i.e. svn checkout https://sommer.dev.java.net/svn/sommer/trunk sommer-r468 –username guest -r 468 )

Using this approach the main tasks for setting up a user with FOAF+SSL are:

  • Running GenerateKey to create an X509 certificate , setting an existing FOAF file as the Web ID.
  • Adding the RDF statements defining the public key to the FOAF file.
  • Adding the X509 certificate to the users browser.

GenerateKey generates the RDF statements defining the public key in N3 format. If your FOAF file is in RDF/XML format like mine then you need to convert from N3 to the RDF/XML.

Adding the following worked for me:

<rsa:RSAPublicKey>
<cert:identity rdf:resource="#i"/>
<rsa:public_exponent cert:decimal="65537"/>
<rsa:modulus cert:hex="d258d85da71a4f1199cae5e8e18a5ffa9127d9796526299b746de9fdcbc1364e074dc143d0ebbd3d3890d7e95b8b4931e3798a7a8f8dbd3441927b6601fb504ca2a919a803e31a6112fea227102dc1424946fb92f8f651f3da855ec43e496f8e0098b596f33af80e7b86d831d46948e040a656f3f00a67b724ccfb55fa4660d3" />
</rsa:RSAPublicKey>

 

A GoodRelations Semantic Web Description of a Business

Saturday, April 11th, 2009

Tried out the newly released GoodRelations Annotator to create a Semantic Web description of a business.

The GoodRelations Annotator is an online form-based tool that creates an RDF/XML file “semanticweb.rdf” containing a description of the key aspects of the business. The description is based on concepts defined in the GoodRelations OWL ontology. In particular the description contains a BusinessEntity representing the business and one or more Offerings. Each Offering describes the intent to provide a Business Function for a certain Product or Service to a specified target audience.

The generated RDF/XML file can be either be published directly on the company’s Web site or used as a skeleton for developing a more fine-grained description.

The link Publishing GoodRelations Data on the Web provides guidelines on publishing to the web.

In my case I created a description for my embryonic business 3kbo.

I’m interested in linking the generated semanticweb.rdf to other things, in particular linking the BusinessEntity with people and with other BusinessEntitys.

Initially I added the URI of my foaf file to the BusinessEntity instance using rdfs:seeAlso, but after reading the definition of BusinessEntity i.e. that it represents the legal agent making a particular offering and
can be a legal body or a person, I changed it to owl:sameAs.

E.g.

<gr:BusinessEntity rdf:ID=”BusinessEntity”>

<owl:sameAs
rdf:resource=”http://www.3kbo.com/people/richard.hancock/foaf.rdf#i“/>

</gr:BusinessEntity>

This makes sense for my simple case, since as a sole trader I am the BusinessEntity. When viewed in Firefox using the Tabulator Extension owl:sameAs also provides an inferred link from my foaf file to my semanticweb.rdf as shown below.

foaf-infers-goodrelations

A part of the business description I don’t understand yet is how best to use the eClassOWL ontology to describe the Product or Service.

For example using the GoodRelations Annotator I selected “19 information, communication and media technology” as the Category and “1904 Software” as the Group.

eClassProductCategory

This leads to http://www.ebusiness-unibw.org/ontologies/eclass/5.1.4/#C_AKJ317003-tax being used in the definition of the product or service, i.e.

<gr:typeOfGood>
<gr:ProductOrServicesSomeInstancesPlaceholder rdf:ID=“ProductOrServicesSomeInstancesPlaceholder_1″>
<rdf:type rdf:resource=”"&eco;#C_AKJ317003-tax”>

<gr:ProductOrServicesSomeInstancesPlaceholder>
<gr:typeOfGood>

Because of the size of the eClassOWL ontology it takes awhile to dereference this link. It would be good to be able to provide a  more user friendly reference at this point that provided a description of the product or service.

Beyond this simple example I am interested in semantic web descriptions of other more complex relationships between a BusinessEntity (when not a person) and the people involved with the business (e.g. directors, CEO etc …) and between other BusinessEntitys.

Potentially GoodRelations and eClassOWL could be used as part of an Enterprise Architecture describing the who, what, how, when, where and why of a business.

A Semantic Web Architecture for a Rails Hosted Environment

Saturday, October 20th, 2007

Last week-end I installed ActiveRDF on my Mac OS X Powerbook, together with the Sparql, RDFLite and Redland adapters. Ideally I am working towards setting up an environment that allows me to build RESTful Semantic Web Applications that support reasoning over RDF data and implement a SPARQL query end point. Support for OpenID authentication, integrated with FOAF, is also at the top of the list.

On the Powerbook I could also install the ActiverRDF adapters for Sesame and Jena to give me the functionality that I am after but that only works in my development environment. Sesame and Jena are Java based. When it comes to deploying an application onto the web my options are currently more limited. 3kbo is deployed into hosted environment which supports PHP, Python, Ruby and Ruby On Rails and PERL, but no Java. (There is C/C++, limited to my local user account.)

Currently there are two PHP SPARQL implementations, ARC and RAP. RAP also provides a reasoning engine InfModel, with support for owl:sameAs and owl:inverseOf.

So at this stage the architecture that is emerging is an ActiveRDF RESTful Ruby On Rails application that uses RAP as the triple store, SPARQL query engine and reasoning engine. To integrate Rails with PHP I am planning to implement a RESTful PHP interface that acts as a facade to RAP.

Description of a Project

Wednesday, September 12th, 2007

In an earlier article Migrating an existing application to the iPhone and the Semantic Web I discussed some of the areas where Semantic Web concepts could be beneficially applied to the “Compliance Data Management Service” (CDMS) .To show the benefits of using RDF and OWL vocabularies I need to build up a number of practical examples.

In this article I present the first example, based on the Friend of a Friend (FOAF) and Description of a Project (DOAP) vocabularies.

There is a similarity between the concepts and descriptions used in the DOAP vocabulary, which describes open source software projects and the descriptions and concepts which relate to the building and construction projects the “Compliance Data Management Service” is used on. Both types of projects bring together people from different locations and organisations to work together. On both types of projects people may assume one or more roles as they work on different tasks. The DOAP vocabulary imports the Friend of a Friend (FOAF) vocabulary which is widely used on the Semantic Web to describe people and the people they know. It is used by the DOAP vocabulary and is the logical choice for describing the people working on CDMS projects.

Since CDMS itself is a software project (but not open source) the easiest example to create is a static DOAP (Description of a Project) file describing the CDMS software project, combined with a number of static FOAF files describing the various people working on it. The example follows the recipe for serving static RDF files outlined in the tutorial “How to Publish Linked Data on the Web“. It creates the CDMS DOAP file and related FOAF files, demonstrating basic linking between people and the project they work on.

The CDMS software project is being developed at ABE Services by four people, John Anderson, Mike Evans, Rob Beasley and myself. To represent this I created the following five static RDF files at www.abeservices.com.au.

Also Irene Bell-Hancock has created some icons and images for us and has been added to the CDMS project description as a documenter. Irene already has FOAF file at 3kbo so the CDMS DOAP file references Irene using the URI http://www.3kbo.com/people/irene.bell-hancock/foaf.rdf#me.

The basic structure of the CDMS DOAP file is outlined in the image below.

CDMS Developers

But a better way to understand the RDF files and how they link together is to use a good RDF browser such as one of the following:

Each of these browser have an input field which accepts a URI. Once the URI has been entered the RDF browser follows the RDF links and displays them as HTML. For example Disco “renders all information, that it can find on the Semantic Web about a specific resource, as an HTML page”. “While you move from resource to resource, the browser (Disco) dynamically retrieves information by dereferencing HTTP URIs and by following rdfs:seeAlso links.” The other RDF browser work in a similar way. Tabulator requires some configuration as described on the Tabulator home page.

Also available from the Tabulator home page is the Tabulator Firefox extension which makes browsing RDF data with Firefox extremely easy. Below is what is seen with Tabulator Firefox extension when the CDMS DOAP URI ( http://www.abeservices.com.au/projects/cdms/cdms-doap.rdf#CDMS )is first opened.

CDMS DOAP RDF File

Following the link to Irene displays her FOAF file (from 3kbo ) within the same html page that is displaying the CDMS DOAP file.

Irenes FOAF file within CDMS DOAP

On 3kbo there are two foaf.rdf files, http://www.3kbo.com/people/richard.hancock/foaf.rdf and http://www.3kbo.com/people/irene.bell-hancock/foaf.rdf. In both files the foaf:knows property is used to show that Richard knows Irene and Irene knows Richard. Using Tabulator it is easy to navigate from Irene’s foaf file to Richard’s.

Navigation via RDF data across web servers is illustrated by starting at the CDMS Description of a Project (DOAP) at www.abeservices.com.au and following the CDMS “Documenter” link to Irene then Irenes “Knows” link to Richard.

Richard’s 3kbo foaf file uses the built-in OWL property owl:sameAs to indicate that Richard at 3kbo is the same individual as Richard at abeservices. Setting owl:sameAs to the following <owl:sameAs rdf:resource=”http://www.abeservices.com.au/people/rhancock/foaf.rdf#rhancock“/> in the definition of Richard at http://www.3kbo.com/people/richard.hancock/foaf.rdf#i allows Tabulator to recognize the equivalence of the two definitions and merges the information from the two sources. This is shown in the image below.

Richards 3kbo FOAF Profile

A visual indication of the merging is that the two images reside on different servers, within different FOAF definitions of Richard, i.e. http://www.abeservices.com.au/people/rhancock/richard-hancock.jpg resides on www.abeservices.com.au and http://www.3kbo.com/people/richard.hancock/richard-hancock.jpg resides on www.3kbo.com.

Tabulator follows the principles of Web Architecture outlined in the tutorial How to Publish Linked Data on the Web. When it finds that an RDF data link leads to a standard html web document or image these are displayed within the page showing the RDF data. In addition to showing embedded images (like those shown above) Tabulator can also displays web sites embedded in the same page. A good example is Irene’s home page http://picasaweb.google.com/goannagraphics. In the image below the picasaweb slide show of the embedded home page has been activated and is fully functional.

Irene’s Homepage

Examples of FOAF properties which lead to web documents include foaf:homepage, foaf:weblog and foaf:workplaceHomepage. foaf:homepage and foaf:weblog are defined to be properties of OWL Type: InverseFunctionalProperty. As such they uniquely identify the person whose homepage or weblog it is and within Tabulator can lead to the merging of information in a way similar to that seen when the owl:sameAs property is applied.

In summary, the example above shows a number of the benefits of using RDF data and reusing RDF and OWL vocabularies. These include:

  1. Using standardized representations of people (FOAF) and (software) projects (DOAP) .
  2. Interlinking between sites using RDF data links allows data from different sources to be easily combined.
  3. Reasoning over data, e.g. the basic inferencing using owl:sameAs. Other examples include the foaf:homepage and foaf:weblog properties which are defined as owl:InverseFunctionalProperty. Taking selective advantage of the features of the Web Ontology Language (OWL) has the potential to reduce the amount of application specific code (e.g. java code) that needs to be written.

Future articles based on the examples created above and the existing CDMS application will include:

  1. Demonstrating the ability to query the constructed RDF data files using the SPARQL Query Lanaguage.
  2. Accessing existing data stored in a relational database as RDF using the D2R Server . The D2R Server enables RDF and HTML browsers to navigate the content of the database, and allows applications to query the database using the SPARQL Query Lanaguage.
  3. Develop a prototype semantic web application using an RDF Triple Store that supports the SPARQL Update specification.
  4. Create a SKOS glossary based on the blog entry Glossary of Common CDMS Term. The glossary would support the development of a building industry related ontologies.
  5. Define an ontology which provides a “Description of a Building Project” and link it to a suitable ontology which describes the tasks undertaken as part of a building project.