Backporting N3 to 1990  
Monday, May 14, 2007, 04:27 PM - RDF
(X)emacs is an evil evil disease. Despite a great selection of other text-editors, I can never work as comfortably or quickly as with xemacs, and the xemacs keybindings are so deeply embedded in my soul that I've come to realise that I will never forget them, nor can I override them by learning something new. Therefore I bit into the sour apple that is emacs-lisp and made n3-mode for xemacs!



It's crappy, and does syntax highlighting and comment support only. It didn't take as long as I thought since I recycled the regexps from my previous three efforts:


If you want to take part in the glorious double-fun that is xemacs N3 editing:

  • Download n3mode.el into ~/.xemacs/
  • Add the following lines to ~/.xemacs:

(load "~/.xemacs/n3mode.el")
(setq auto-mode-alist (cons '("\\.n3$" . n3-mode) auto-mode-alist))
(add-hook 'n3-mode-hook 'turn-on-font-lock)

  • Open an N3 file and enjoy!

Now maybe I can finally get around to editting those N3 files, and stop wasting my time.

[ add comment ]   |  permalink  |   ( 3 / 3272 )
N3 Syntax highlighting for gtksourceview  
Thursday, May 10, 2007, 10:24 AM - RDF
Since finding a decent mode for N3 in xemacs seems impossible, and writing a new mode is non-trivial I decided to face the fact that there is more than one editor out there, and I dug out this N3 language definition I did for gtksourceview, the component uses in gedit and various other gnome applications.



Download the .lang file here and put it in /usr/share/gtksourceview-1.0/language-specs or ~/.gnome2/gtksourceview-1.0/language-specs. Now the N3 mode is available from the View->Highlight Mode->Markup menu.
To automatically highlight all .n3 files add:

<mime-type type="text/rdf+n3">
<comment>N3</comment>
<glob pattern="*.n3" />
</mime-type>

to ~/.local/share/mime/packages/Override.xml.



[ add comment ]   |  permalink  |   ( 3 / 3103 )
RDFRoom! VIRTUAL REALITY IS NOW!  
Thursday, March 30, 2006, 11:53 PM - RDF, Python
Too late to be verbose now, but after being encouraged by Danny last week, I've spent long evening hacking together this crappy demo. The webpage has all the info you need (including downloads), and the screenshot here should tickle your senses enough to click that link. If you like RDF that is. And you like old-fashioned computer games. And if you're bored.

Some notes:
  • Look at some RDF DATA, schemas dont work well just now.
  • Yes i know the fire effect is badly aligned.
  • You need data with rdfs:seeAlso links to get doors.

That's it for now, I refuse to waste any more time on this useless nonsense!

(Oh, and I submitted this to the ESWC Semantic Web Scripting Challenge :-)


[ 1 comment ] ( 706 views )   |  permalink  |   ( 3 / 4995 )
i love it when a plan comes together  
Monday, March 13, 2006, 09:11 PM - RDF, PhD
Recently I decided that for the planning part of Smeagol it would make sense if all the avaiable actions were specified in RDF. This seemed sensible since I was re-factoring the action/planning part of Smeagol anyway - it was all pretty much coded in one coffee fuelled weekend just before some paper deadline and was now completely incomprehensible to anyone.

Moving to RDF also seemed right and elegant because I enjoy moving "things" into a more explicit and structured format; like my very first thoughts on the internal structuring of Smeagol moved from being hard-coded to being dynamically planned, or how someone (Malte?) pointed out that Semantic Wikis and the [ur=http://en.wikipedia.org/wiki/Infobox]Infoboxes[/url] of wikipedia are steps on a road where soon all content will be represented in structured form.

Anyway, I digress. An action in Smeagol now looks like this:
(I steal freely from N3 Rules and cwm in general).
@prefix : <http://www.csd.abdn.ac.uk/~ggrimnes/dev/smeagol/ontology#>.
@prefix ac: <http://www.csd.abdn.ac.uk/~ggrimnes/dev/smeagol/actions#>.
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.

ac:read a :Action ;
rdfs:label "read" ;
:in ( ?u ) ;
:out () ;
:preconditions { ?u :source ?source . ?u :triples ?t1 } ;
:effects { ?u :triples ?t2 . ?t2 math:greaterThan ?t1} .

This represents an action "read something about this URI (?u)" - it needs a source of information about this uri to be known beforehand, and if executed it will result in Smeagol knowing more triples about ?u that we did before. Hardly rocket science, but I like the idea of using :triples as a magic property, which is evaluated rather than looked up in the graph. The idea is of course old, cause cwm and n3 rules/queries do exactly the same with builtin functions. Oh well - this time I got the idea from the handling of full-text lucene queries in sparql as done in Gnowsis.

So this evening I finished the planning module of Smeagol, and while I was developing it I used a list of only 2 actions for testing. And when it appeared to work I uncommented the other actions in the n3 file, and whoho! It just worked! And 4 different plans were generated! ... and then I thought of the subject line and sniggered to myself.

[ add comment ]   |  permalink  |   ( 3 / 2037 )