FOAF
December 12, 2009
4 Store Triple Store
Posted by pj at 05:52 PM | Comments (0)
Social Graph API
About the Social Graph - Social Graph API - Google Code
Posted by pj at 04:12 PM | Comments (0)
FOAF in RDFa
Getting started with RDFa: Creating a basic FOAF profile | webBackplane
Posted by pj at 04:10 PM | Comments (0)
July 31, 2006
Relationship extension to FOAF
RELATIONSHIP: A vocabulary for describing relationships between people
Posted by pj at 08:22 PM
April 18, 2005
How to do RDF with Zope / ZPT
I've been trying to generate FOAF RDF from a Page Template. This has proven quite tricky. Zope 2.7 seems to stop wanting to parse and render the template if you change the content-type to text/xml
from text/html
.
This is not only a pain but is also intermittent.
The first thing I had to do therefore was re-set the content-type in the response header as follows, leaving the template content-type as text/html
so the ZPT engine would parse it:
<tal:block tal:define="
dummy python: container.REQUEST.RESPONSE.setHeader('Content-Type', 'text/xml');" />
Then I had to use tal:replace
to put the XML declaration back in:
<tal:block tal:define="dummy python:
container.REQUEST.RESPONSE.setHeader('Content-Type', 'text/xml');"
tal:replace="structure
string:<?xml version="1.0"?>"/>
Because I wanted to use the same template for single FOAFs and multiples I had to test for a foaf_email
parameter in the request. This is doable with has_key
.
However, because tal:condition
affects both subsequent tal:define
statements and the rendering of any child nodes within the block where it is called, and scope of tal:define
vars is limited to the current block, I've had to resort to passing variables up into the request namespace. This is due to the lack of a syntactic equivalent of <dtml-if>..<dtml-else>
. This gives very obfuscatory code:
<tal:block tal:define="
request python: container.REQUEST;
email python: None;
where_clause string: where 1;
wc python: request.set('where_clause', where_clause);
">
<tal:block tal:condition="python:request.has_key('foaf_email')">
<tal:block tal:define="
email python: request['foaf_email'];
where_clause python:' where foaf_email=\'' + str(email) + '\'';
wc python: request.set('where_clause', where_clause);
"/>
</tal:block>
<rdf:RDF
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#"
xmlns:mofoaf="http://minnesota.ncl.ac.uk/mofoaf/1.0/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:dc="http://purl.org/dc/elements/1.1"
tal:define="
foaf_recs
python:root.generic_query(query_sql='select * from ltsn01_ng.01_foafs' + request['where_clause']);
work_url string:http://www.ltsn-01.ac.uk;
info_url_stem python: work_url + '/new_site/contact/person_details?foaf_id=';
">
.....RDF stuff here.....
</rdf:RDF>
</tal:block>
You'll see the where clause for the SQL is fished out of the request namespace.
The full template is here:
Hmmm.. Seems if I'd read my own posts I could have done it with a PHP like global
statement instead.
Posted by pj at 01:24 PM
April 08, 2005
Meatspace metadata and authentication reminiscences
Super Springtime Dogtag Dignity contest results
Thanks for highlighting my lack of legal training Dr. P..
Posted by pj at 11:51 PM
November 24, 2004
FOAF explorer view of my weblog metadata
Posted by pj at 11:02 AM
Photo metadata
I've finished the cataloguing tool for my photo album and formalised how the RDF is represented for the album, each collection, associated events and event attendees and then person depictions in the images themselves.
This is done within the framework of the CC License and Work model to assign a CC license to everything aswell.
I've also set up an RSS feed of the latest catalogued pictures and then hacked Feed2JS so that it pics up the image thumbnails if they are in the feed:
Paul Hollands - Photo Album - RSS
Posted by pj at 10:14 AM
November 16, 2004
Photo metadata: the co-depiction experiment
RDFWeb: co-depiction photo metadata
Posted by pj at 10:14 PM
Script to generate just FOAF
I've added a PHP script that generates just my FOAF, as opposed to the FOAF and blog DC.
http://minnesota.ncl.ac.uk/foaf.rdf.php?email=p.j.hollands@ncl.ac.uk
Posted by pj at 05:02 PM
November 02, 2004
Addition to MT FOAF stuff
Added extra stuff to the MovableType metadata stuff I did yesterday. Thought it'd be nice if I could express my RSS subscriptions as foaf:subscribesTo statements. Wrote a stylesheet to convert NetNewsWire's output format OPML into FOAF RDF and then rolled it into the mt_metatada.rdf.php script I wrote yesterday.
The next step could be to build a web view of your aggregated feeds using the Magpie parser detailed earlier:
<http://minnesota.ncl.ac.uk/fuzzybuckets/archives/2004/10/index.html#000081 >
Posted by pj at 02:16 PM
November 01, 2004
Extracting DC and FOAF metadata from the MT table structure
I've just spent the day trying to extract some decent metadata for my blogs from the vanilla MT v3.121 database tables. There's enough information there for a quite a rich Dublin Core description of the blog itself plus a very basic FOAF entry. I've augmented the FOAF entry with a very very hacky new table.
This gives an RDF description of the site with dc:creator tied to the FOAF node to produce a correct graph.
To get the raw RDF see:
<http://minnesota.ncl.ac.uk/mt_metadata.rdf.php?blog_url=http://minnesota.ncl.ac.uk/fuzzybuckets/>
Note that you pass the blog URL to the PHP script as the argument.
To render this up as HTML I then run this through an XSL stylesheet to give this:
<http://minnesota.ncl.ac.uk/render_mt_metadata.php?blog_url=http://minnesota.ncl.ac.uk/fuzzybuckets/>
Posted by pj at 05:09 PM