26 January 2010

QuoteEditor

It's 00H25 here, and while one of my programs is aligning some SNPs on the human genome, I'm going to describe the tiny tool I wrote this Week-end. QuoteEditor is a java editor used to store some famous quotes in a RDF/XML file. The java 'jar' and the documentation are available at :

.

Usage


java -jar lindenb/build/quotes.jar [-f <rdf-file> ]
the optional parameter '-f' is the name of the XML/RDF file where the quotes will be added. If this file does not exists, it will be created by QuoteEditor (default is ~/quotes.rdf )

The Interface


  • Author: must be a URL or a name that must be resolved in wikipedia. For example 'Victor Hugo' will be resolved as http://en.wikipedia.org/wiki/Victor_Hugo
  • Source: a free text. The source of the quote
  • Date: a free text: A date for this quote
  • Keywords: one or more keywords ( or URL ) , space delimited. Each keyword must be resolved as a Category in wikipedia. For example Scientists will be resolved as http://en.wikipedia.org/wiki/Category:Scientists
  • Quote Source: a free text. Where this quote was found
  • lang: the language for this quote


each time a new quote is saved it will be added at the end of the rdf-file.

Result


Here is an example of RDF/XML file generated by QuoteEditor:
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:q="urn:ontology:quotes:">
<q:Quote>
<q:quote xml:lang="fr">L'œil était dans la tombe et regardait Caïn.</q:quote>
<q:author rdf:resource="http://en.wikipedia.org/wiki/Victor Hugo"/>
<q:source>La Conscience, from La Légende des siècles (1859),</q:source>
<q:date>1859</q:date>
<q:origin>http://en.wikiquote.org/wiki/Victor_Hugo</q:origin>
<q:subject rdf:resource="http://en.wikipedia.org/wiki/Category:Murders"/>
<q:subject rdf:resource="http://en.wikipedia.org/wiki/Remorse"/>
<q:subject rdf:resource="http://en.wikipedia.org/wiki/Category:Emotions"/>
</q:Quote>
<q:Quote>
<q:quote xml:lang="fr">Des mouches pour des enfants espiègles, voilà ce que nous sommes pour les Dieux ;
Ils nous tuent pour se divertir.</q:quote>
<q:author rdf:resource="http://en.wikipedia.org/wiki/William Shakespeare"/>
<q:source>Le Roi Lear (1605), William Shakespeare</q:source>
<q:date>1605</q:date>
<q:origin>http://fr.wikiquote.org/wiki/William_Shakespeare</q:origin>
<q:subject rdf:resource="http://en.wikipedia.org/wiki/Category:God"/>
<q:subject rdf:resource="http://en.wikipedia.org/wiki/Category:Crimes"/>
<q:subject rdf:resource="http://en.wikipedia.org/wiki/Category:Flies"/>
<q:subject rdf:resource="http://en.wikipedia.org/wiki/Category:Recreation"/>
</q:Quote>
(...)
</rdf:RDF>


That's it
Pierre

PS: Hum, my program mapping the SNPs is still running... 200Mo generated so far...

4 comments:

Unknown said...

Hi, just about to write somtehing similar I looked around what there is already.

Why are you sing your own ontology, why not dc:subject and dc:creator?

Cheers,
reto

Pierre Lindenbaum said...

I use my own ontology because the range of dc:subject/creator can be a literal and I wanted a URI.

Unknown said...

There is dcterm:creator which has a more limited range, and as far as I know using dc:subject is the standard way for skos-tagging.

I just came across http://purl.org/ontology/bibo/ which could also be used to describe quotes, see http://groups.google.com/group/bibliographic-ontology-specification-group/browse_thread/thread/369df8ce47ee9653 for examples.

Pierre Lindenbaum said...

@retbog, thank you about comments. The most important here was to save the quotes. In the futyre, I will be able to easily change the ontology using XLST.