RDF

October 27, 2010

SPARQL Toot

SPARQL Tutorial | AllegroGraph 4.1

Posted by pj at 12:56 PM | Comments (0)

August 04, 2010

Firing up and querying 4store

4s-backend staff

4s-query staff 'select ?firstname, ?lastname { ?person <http://xmlns.com/foaf/0.1/lastName> ?lastname . ?person <http://xmlns.com/foaf/0.1/firstName> ?firstname }'

Posted by pj at 02:22 PM | Comments (0)

July 13, 2010

Twins!

PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>

SELECT ?person, ?birth, ?death, ?name, ?first, ?last, ?description, ?place {
     ?person rdf:type dbo:PlayboyPlaymate .
     ?person dbo:birthDate ?birth .
     OPTIONAL{ ?person dbo:birthPlace ?place. }
     ?person foaf:name ?name .
     OPTIONAL { ?person foaf:givenname ?first . }
     OPTIONAL { ?person foaf:surname ?last . }
     OPTIONAL{ ?person dbo:deathDate ?death . }
     OPTIONAL{ ?person dbo:nationality ?nationality . }
     OPTIONAL{ ?person dbo:ethnicGroup ?race . }
     OPTIONAL{ ?person dc:description ?description . }
     FILTER regex(str(?name), " and ") .
}

Twins!

Posted by pj at 04:16 PM | Comments (0)

June 09, 2010

RDFS Schema for GP Salaries

Fuzzy Buckets: GP Salary RDF Schema

Posted by pj at 09:03 PM | Comments (0)

Funding opportunities RDF example

<?xml version='1.0'?>
<rdf:RDF
	xml:base="http://www.medev.ac.uk/fundops_example.rdf"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
	xmlns:owl="http://www.w3.org/2002/07/owl#"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
	xmlns:fundops="http://www.medev.ac.uk/interoperability/rss/1.0/modules/fundops/rss1.0fundopsmodule#"
	xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#"
	xmlns:dcterms="http://purl.org/dc/terms/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:event="http://purl.org/rss/1.0/modules/event/"
	xmlns:foaf="http://xmlns.com/foaf/0.1/"
	xmlns:cc="http://web.resource.org/cc/"
	xmlns:rss="http://purl.org/rss/1.0/"
	xmlns="http://purl.org/rss/1.0/"
	>
	<owl:Ontology rdf:about="http://www.medev.ac.uk/fundops_example.rdf"/>
	
	<cc:License rdf:nodeID="license">
		<dc:identifier rdf:resource="http://creativecommons.org/licenses/by-nc-sa/2.0/"/>
		<cc:requires rdf:resource="http://web.resource.org/cc/Attribution"/>
		<cc:requires rdf:resource="http://web.resource.org/cc/Notice"/>
		<cc:requires rdf:resource="http://web.resource.org/cc/ShareAlike"/>
		<cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/>
		<cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/>
		<cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/>
		<cc:prohibits rdf:resource="http://web.resource.org/cc/CommercialUse"/>
	</cc:License>
	
	<channel rdf:about="http://www.medev.ac.uk/fundops_example.rdf">
		<dc:title xml:lang="en-GB">Sample fundops RSS 1.0 feed.</dc:title>
		<dc:description xml:lang="en-GB">
	  		Sample fundops module feed using new schema definition.
		</dc:description>
		<link rdf:resource="http://www.medev.ac.uk/resources/fundops/"/>
		<dc:date rdf:value="2005-06-16T15:55:00Z"/>
		<items>
		<rdf:Seq>
		<rdf:li rdf:resource="http://www.britishendodonticssociety.org/awards.htm#harty"/>
		</rdf:Seq>
		</items>
		<cc:license rdf:nodeID="license"/>
	</channel>
	
	<item rdf:about="http://www.britishendodonticssociety.org/awards.htm#harty">
		<dc:format>text/html</dc:format>
		<dc:date>2004-03-03T17:30:00Z</dc:date>
		<dc:source rdf:resource="http://www.medev.ac.uk/resources/fundops/"/>
		<title xml:lang="en-GB">The Harty Prize: Student essay prize in endodontics</title>
		<description xml:lang="en-GB">
			The British Endodontic Society aims to support: High standards of endodontic 
treatment; research in the field of endodontics; undergraduate elective period projects in endodontics; 
continuing education for general practitioners.

			The title of the essay is: Student Perceptions of Teaching and Learning in 
Endodontology.

			The closing date is 30th March each year. The student who submits the winning 
essay will be invited to the Spring Scientific Meeting, in March, for the presentation of the prize. 
Registration, accommodation and travel costs will be paid. Please see website for full restrictions and 
application details.

			The prize will be open to any undergraduate dental student in a dental school 
within the United Kingdom or a dental graduate from one of these schools who has been on the Dentist's 
Register for no more than one year on 30th June in each year of application.
			Closing date for applications: Tuesday 30th March 2004
			Contact: brett.robinson@kcl.ac.uk
		</description>
		<dc:subject xml:lang="en-GB"
			rdf:value="HEALTH CARE / MEDICINE / HEALTH & SAFETY" 
  rdf:type="http://www.learndirect-advice.co.uk/provider/standardsandclassifications/classpage/bigdoc.pdf"/>
		<dc:subject xml:lang="en-GB"
			rdf:value="DENTAL SERVICES"
  rdf:type="http://www.learndirect-advice.co.uk/provider/standardsandclassifications/classpage/bigdoc.pdf"/>
	</item>

	<fundops:Opportunity rdf:about="http://www.britishendodonticssociety.org/awards.htm#harty">
		<fundops:type xml:lang="en-GB">prize or funding</fundops:type>
		<fundops:programme xml:lang="en-GB">
		  The British Endodontic Society Awards and Prizes
		</fundops:programme>
		<fundops:frequency xml:lang="en-GB">annual</fundops:frequency>
		<fundops:deadline rdf:nodeID="deadline_1"/>
		<fundops:sponsor rdf:nodeID="sponsor_1"/>
		<fundops:applyto rdf:nodeID="applyto_1"/>
		<fundops:budget rdf:nodeID="budget_1"/>
		<fundops:purpose xml:lang="en-GB">
			To reward the dental student or recent dental graduate who writes the best essay on 
the subject of 'Coronal restoration is more relevant than root filling for the ultimate endodontic success'.
		</fundops:purpose>
		<fundops:targetsector rdf:nodeID="HE"/>
		<fundops:targetgroup rdf:nodeID="targetgroup_1"/>
		<fundops:awardconditions xml:lang="en-GB">
			The prize will be awarded by the Council of the British Endodontic Society on the 
recommendation of the examiners. The Council reserves the right to withhold the prize if the standard of 
the essays submitted is not of sufficient merit.

			The value of the prize shall be GBP 500. The Harty Medal shall also be awarded to 
the prize winner. There are also six runner-up prizes of a year's free membership to the Society.

			The prize will be open to any undergraduate dental student in a dental school within 
the United Kingdom or a dental graduate from one of these schools who has been on the Dentist's Register for 
no more than one year on 30th June in each year of application. All essays, apart from that of the winner, 
will be returned to the writers. Only the name of the prize winner will be published.

			The essay must be written in English and shall not exceed 3000 words. It must be 
typed on one side of the paper only, size A4, in double spacing. Pages must be fixed together and preceded 
by a title page. One copy of the essay shall be submitted.
		</fundops:awardconditions>
		<fundops:howtoapply xml:lang="en-GB">
			Each entry must be written under a pseudonym. The student's full name, address and 
dental school must accompany the essay in a sealed envelope bearing the pseudonym. Essays should be 
submitted to the Assistant Secretary.
		</fundops:howtoapply>
		<fundops:duration rdf:nodeID="duration_1"/>
	</fundops:Opportunity>

	<fundops:Deadline rdf:nodeID="deadline_1">
		<event:startdate>2004-02-03T08:30:00Z</event:startdate>
		<event:enddate>2004-03-03T17:30:00Z</event:enddate>
	</fundops:Deadline>
	
	<fundops:Sponsor rdf:nodeID="sponsor_1">
		<fundops:organization rdf:resource="http://www.britishendodonticssociety.org/"/>
	</fundops:Sponsor>

	<fundops:Organization rdf:about="http://www.britishendodonticssociety.org/">
		<vcard:ORG rdf:parseType="Resource">
			<vcard:Orgname xml:lang="en-GB">The British Endodontic Society</vcard:Orgname>
		</vcard:ORG>
		<vcard:ADDR rdf:parseType="Resource">
			<vcard:Street xml:lang="en-GB">
			  The King's Dental Institute, King's Campus, Denmark Hill
			</vcard:Street>
			<vcard:Locality xml:lang="en-GB">London</vcard:Locality>
			<vcard:Pcode>SE5 9RW</vcard:Pcode>
			<vcard:Region 
  rdf:type="http://www.rdn.ac.uk/publications/rdn-ltsn/geographic-coverage/" xml:lang="en-GB" rdf:value="UK"/>
		</vcard:ADDR>
	</fundops:Organization>
		
	<fundops:ApplyTo rdf:nodeID="applyto_1">
		<fundops:person rdf:resource="mailto:brett.robinson@kcl.ac.uk"/>
	</fundops:ApplyTo>
	
	<fundops:Person rdf:about="mailto:brett.robinson@kcl.ac.uk">
		<foaf:name xml:lang="en-GB">Brett Robinson</foaf:name>
		<foaf:mbox>mailto:brett.robinson@kcl.ac.uk</foaf:mbox>
		<vcard:TEL rdf:parseType="Resource">
			<rdf:value>0207 346 3585</rdf:value>
			<rdf:type rdf:resource="http://www.w3.org/2001/vcard-rdf/3.0#voice"/>
			<rdf:type rdf:resource="http://www.w3.org/2001/vcard-rdf/3.0#work"/>
		</vcard:TEL>
	</fundops:Person>
		
	<fundops:Budget rdf:nodeID="budget_1">
		<fundops:currency rdf:value="GBP"/>
		<fundops:totalbudget><xsd:integer rdf:value="500"/></fundops:totalbudget>
		<fundops:minvalue><xsd:integer rdf:value="500"/></fundops:minvalue>
		<fundops:maxvalue><xsd:integer rdf:value="500"/></fundops:maxvalue>
		<fundops:availableawards><xsd:integer rdf:value="1"/></fundops:availableawards>
	</fundops:Budget>
	
	<fundops:TargetSector rdf:nodeID="HE" xml:lang="en-GB" rdf:value="Higher Education"/>

	<fundops:TargetGroup rdf:nodeID="targetgroup_1">
		<dc:description>
			The prize will be open to any undergraduate dental student in a dental school within 
the United Kingdom or a dental graduate from one of these schools who has been on the Dentist's Register for 
no more than one year on 30th June in each year of application. All essays, apart from that of the winner, 
will be returned to the writers. Only the name of the prize winner will be published.
		</dc:description>
	</fundops:TargetGroup>
	
	<fundops:Duration rdf:nodeID="duration_1">
		<event:startdate>2004-03-04T08:30:00Z</event:startdate>
		<event:enddate>2005-03-03T17:30:00Z</event:enddate>
		<fundops:minduration><xsd:integer rdf:value="365"/></fundops:minduration>
		<fundops:maxduration><xsd:integer rdf:value="365"/></fundops:maxduration>
	</fundops:Duration>

	<item rdf:about="http://www.bad.org.uk/doctors/fellowships/index.htm">
		<dc:format>text/html</dc:format>
		<dc:date>2004-03-31T00:00:00</dc:date>
		<dc:source>http://www.ltsn-01.ac.uk/resources/fundops/index_html</dc:source>
	<title>Medical student projects</title>
	<link>
	http://www.bad.org.uk/doctors/fellowships/index.htm
	</link>
	<description>
		To encourage students to undertake small research projects or optional period in the study of topics 
related to dermatology or skin biology. With recent changes in the undergraduate curriculum in medicine many 
medical students have the opportunity of spending a few months studying a particular topic in detail. 10 
awards are available. Single Payment Funding of 500 GBP towards student research projects. 
	Closing date for applications: Wednesday 31st March 2004
	</description>
	</item>

</rdf:RDF>

Posted by pj at 11:04 AM | Comments (0)

XSLT to turn RDFS into an HTML view

rdfs2html.xsl

<xsl:stylesheet version="1.0" id="my_style" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:dubcore="http://dublincore.org/2003/03/24/dces#" xmlns:dc="http://orlando.drc.com/SemanticWeb/DAML/Ontology/DC/ver/0.1.0/dces-ont#" xmlns:ves="http://orlando.drc.com/SemanticWeb/DAML/Ontology/VES/ver/0.1.0/drc-ves-ont#" xmlns:event="http://purl.org/rss/1.0/modules/event/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:fundops="http://www.medev.ac.uk/interoperability/rss/1.0/modules/fundops/rss1.0fundopsmodule#">

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>

<!-- <xsl:strip-space elements ="*" /> -->

<xsl:template match="/">
<div id="schema" xmlns="http://www.w3.org/1999/xhtml" class="example">
 <xsl:apply-templates/>
</div>

</xsl:template>

<xsl:template match="owl:Ontology">
 <h3><xsl:value-of select="@dubcore:title"/></h3>
 <p><xsl:value-of select="rdfs:comment"/></p>
</xsl:template>

<xsl:template match="rdfs:Class">
	<xsl:if test="@rdfs:label">
		<h4><xsl:value-of select="@rdfs:label"/> Class</h4>
		<p><xsl:value-of select="@rdfs:comment"/></p>
	</xsl:if>
	<xsl:if test="rdfs:label">
		<h4><xsl:value-of select="rdfs:label"/> Class</h4>
		<p><xsl:value-of select="rdfs:comment"/></p>
	</xsl:if>

	<xsl:if test="rdfs:subClassOf">
	
		<p>This is a sub-class of:</p>

		<ul>
		<xsl:for-each select="rdfs:subClassOf">
			<li><xsl:value-of select="./@rdf:resource"/></li>
		</xsl:for-each>
		</ul>
	</xsl:if>

	<xsl:if test="rdfs:isDefinedBy">
	
		<p>Class defined by:</p>

		<ul>
		<xsl:for-each select="rdfs:isDefinedBy">
			<li><xsl:value-of select="./@rdf:resource"/></li>
		</xsl:for-each>
		</ul>
	</xsl:if>

	<xsl:if test="rdfs:domain">
	
		<p>This class is in the following domains:</p>

		<ul>
		<xsl:for-each select="rdfs:domain">
			<li><xsl:value-of select="./@rdf:resource"/></li>
		</xsl:for-each>
		</ul>
	</xsl:if>

	<xsl:if test="rdfs:range/owl:oneOf">
	
		<p>Range should be one of:</p>

		<ul>
		<xsl:for-each select="rdfs:range/owl:oneOf/owl:Thing">
			<li><xsl:value-of select="./@rdf:about"/></li>
		</xsl:for-each>
		</ul>
	</xsl:if>
	<xsl:if test="rdfs:range/owl:someValuesFrom">
	
		<p>Range should be some values from:</p>

		<ul>
		<xsl:for-each select="rdfs:range/owl:someValuesFrom/owl:Thing">
			<li>
			<xsl:value-of select="./@rdf:about"/>
			<xsl:if test="./rdf:value"><xsl:value-of select="./rdf:value"/></xsl:if>
			</li>
		</xsl:for-each>
		</ul>
	</xsl:if>
	<xsl:if test="owl:equivalentClass">
	
		<p>This class is an equivalent of:</p>

		<ul>
		<xsl:for-each select="owl:equivalentClass">
			<li>
			<xsl:value-of select="./@rdf:resource"/>
			</li>
		</xsl:for-each>
		</ul>
	</xsl:if>
	<xsl:if test="owl:disjointWith">
	
		<p>This class is disjoint with:</p>

		<ul>
		<xsl:for-each select="owl:disjointWith">
			<li>
			<xsl:value-of select="./@rdf:resource"/>
			</li>
		</xsl:for-each>
		</ul>
	</xsl:if>
</xsl:template>

<xsl:template match="rdf:Property">
	<xsl:if test="@rdfs:label">
		<h4><xsl:value-of select="@rdfs:label"/> property</h4>
		<p><xsl:value-of select="@rdfs:comment"/></p>
	</xsl:if>
	<xsl:if test="rdfs:label">
		<h4><xsl:value-of select="rdfs:label/@rdf:value"/> property</h4>
		<p><xsl:value-of select="@rdfs:comment"/></p>
	</xsl:if>
	<xsl:if test="rdfs:subPropertyOf">
	
		<p>This is a sub-property of:</p>

		<ul>
		<xsl:for-each select="rdfs:subPropertyOf">
			<li><xsl:value-of select="./@rdf:resource"/></li>
		</xsl:for-each>
		</ul>
	</xsl:if>

	<xsl:if test="rdfs:isDefinedBy">
	
		<p>Property defined by:</p>

		<ul>
		<xsl:for-each select="rdfs:isDefinedBy">
			<li><xsl:value-of select="./@rdf:resource"/></li>
		</xsl:for-each>
		</ul>
	</xsl:if>

	<xsl:if test="rdfs:domain">
	
		<p>Property is in the following domains:</p>

		<ul>
		<xsl:for-each select="rdfs:domain">
			<li><xsl:value-of select="./@rdf:resource"/></li>
		</xsl:for-each>
		</ul>
	</xsl:if>

	<xsl:if test="rdfs:range/@rdf:resource">
	<p>Is in the range of:</p>

		<ul>
		<xsl:for-each select="rdfs:range/@rdf:resource">
		<li><xsl:value-of select="."/></li>
		</xsl:for-each>
		</ul>
	</xsl:if>
	<xsl:if test="rdfs:range/owl:oneOf">
	
		<p>Range should be one of:</p>

		<ul>
		<xsl:for-each select="rdfs:range/owl:oneOf/owl:Thing">
			<li>
			<xsl:value-of select="./@rdf:about"/>
			<xsl:if test="./rdf:value"><xsl:value-of select="./rdf:value"/></xsl:if>
			</li>
		</xsl:for-each>
		</ul>
	</xsl:if>
	<xsl:if test="rdfs:range/owl:someValuesFrom">
	
		<p>Range should be some values from:</p>

		<ul>
		<xsl:for-each select="rdfs:range/owl:someValuesFrom/owl:Thing">
			<li>
			<xsl:value-of select="./@rdf:about"/><xsl:if test="./rdf:value">
			<xsl:value-of select="./rdf:value"/></xsl:if>
			</li>
		</xsl:for-each>
		</ul>
	</xsl:if>
	<xsl:if test="owl:equivalentProperty">
	
		<p>This property is an equivalent of:</p>

		<ul>
		<xsl:for-each select="owl:equivalentProperty">
			<li>
			<xsl:value-of select="./@rdf:resource"/>
			</li>
		</xsl:for-each>
		</ul>
	</xsl:if>
	<xsl:if test="owl:disjointWith">
	
		<p>This property is disjoint with:</p>

		<ul>
		<xsl:for-each select="owl:disjointWith">
			<li>
			<xsl:value-of select="./@rdf:resource"/>
			</li>
		</xsl:for-each>
		</ul>
	</xsl:if>
</xsl:template>

</xsl:stylesheet>

Posted by pj at 10:53 AM | Comments (0)

December 12, 2009

4 Store Triple Store

4store - Scalable RDF storage

Posted by pj at 05:52 PM | Comments (0)

March 12, 2009

BibClassify Keyword Extraction into SKOS RDF

Atlantis Institute of Fictive Science: BibClassify Admin Guide

Posted by pj at 03:10 PM | Comments (0)

March 05, 2009

XSL for Twitter to RDF

twitter-rdf.xsl at a0ec36781e3af9995a3bccb228e48dd51692b814 from tommorris's twitter-rdf - GitHub

Posted by pj at 09:47 PM | Comments (0)

July 16, 2008

The RDF API for PHP

Introduction to RAP

Also and more usefully:

http://www4.wiwiss.fu-berlin.de/bizer/rdfapi/tests.html

Posted by pj at 01:37 PM | Comments (0)

July 10, 2008

RDF for Glossary Entries

<rdf:Description rdf:about="http://example.org/specGL/20030210#discretionaryChoices">
  <rdfs:label xml:lang="en">discretionary choices</rdfs:label>
  <rdfs:comment>a value or behavior may be chosen from a well-defined enumerated set of two or more possibilities</rdfs:comment>
  <rdfs:isDefinedBy rdf:resource="http://www.w3.org/TR/2003/WD-qaframe-spec-20030210/"/>
  ...
</rdf:Description>

See also:

http://www.w3.org/TR/2001/REC-ruby-20010531/


http://www.w3.org/2003/03/glossary-project/analysis

Posted by pj at 11:19 AM | Comments (0)

July 09, 2008

RDFLib Python Libraries

RDFLib: Home

Posted by pj at 11:14 PM | Comments (0)

3store

AKT - Technologies - 3store from The University of Southampton

Posted by pj at 11:09 PM | Comments (0)

Redland Paper by Dajobe

Redland RDF Storage

Posted by pj at 11:07 PM | Comments (0)

May 19, 2008

XML.com: Building Metadata Applications with RDF

Posted by pj at 12:59 PM | Comments (0)

February 21, 2007

New RDF syntax embedded in XHTML attributes

XML.com: Introducing RDFa

See also The Primer:

http://www.w3.org/TR/xhtml-rdfa-primer/

Posted by pj at 10:28 AM | Comments (0)

December 14, 2006

Semantic extensions to MediaWiki

Semantic MediaWiki - Ontoworld.org

Posted by pj at 09:42 PM

May 30, 2006

Haystack Project - PIM using RDF

Haystack Project

Posted by pj at 03:39 PM | Comments (0)

May 26, 2006

Qualified DC RSS module

RDF Site Summary 1.0 Modules: Qualified Dublin Core

Posted by pj at 11:21 AM | Comments (0)

June 23, 2005

SKOS - An RDF schema for thesaural representations

XML.com: Introducing SKOS

Posted by pj at 10:07 PM

June 15, 2005

More RDF play things for Eclipse

A suite of RDF type plug-ins for Eclipse:

RDFX

Posted by pj at 03:03 PM

April 09, 2005

Embedding RDF in XHTML the hard way

RDF in HTML: Approaches

Posted by pj at 05:27 PM

April 08, 2005

A Python RDF parser

rdfxml.py: An RDF/XML Parser in under 10KB of Python

Posted by pj at 04:50 PM

February 17, 2005

Recipe metadata (meatadata?) in RDF? not

XML.com: Eat Drink Feel Good Markup Language

Posted by pj at 12:27 PM

November 24, 2004

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 08, 2004

Publishing my iCalendar files as RDF

I've been tinkering with the Python tool by Dan Connolly for converting .ics files into RDF. I've set up a series of cron jobs to grab my .ics files from the Zope server where I store them and convert them and publish them to the web server as RDF:

< http://minnesota.ncl.ac.uk/Work.rdf.xml >

< http://minnesota.ncl.ac.uk/Home.rdf.xml >

The cron jobs update the file every half an hour.

Posted by pj at 03:16 PM