Java


22
Sep 03

MusicBrainz Java API beta-1

I’ve just uploaded the beta-1 of my shiny new Java API onto the MusicBrainz RDF web service.
If you’re not familiar with MusicBrainz, it’s similar to CDDB: it stores lists of artists, albums and tracks that can be used to add metadata to your music collection. Aaron Swartz wrote a nice article on it a while ago: “MusicBrainz: A Semantic Web Service” (warning PDF).
There’s been a C/C++ API for some time now with bindings for other languages, but no Java API. And as I want to hook some Java code up to the server I went ahead and wrote one.
It’s not complete yet. It’s read-only at the moment so doesn’t support the query methods used to authenticate and submit data to the service. However this is enough for me at present and I thought I’d release it in case anyone else finds it useful.
The API is built on the spangly new Jena 2 API, and provides “raw” access to the RDF responses from the server or a simple bean interface for those of you not interested in the RDF.
You can download the API and read the package documentation online. The latter contains a few code fragments and enough information to get you started. The unit tests are pretty comprehensive too, so look there for additional examples.
This API is released under the Creative Commons Attribution-ShareAlike License


19
Sep 03

JBoss Documentation Wiki

A while ago I bemoaned the fact that there wasn’t an independent JBoss documentation project. I was pleasantly surprised to discover via a comment left under that posting that there is now such as beast:
JBoss Documentation Wiki
There’s even some initial content in there. If this gets some serious attention from you Java bloggers out there, who knows what we’ll end up with?
In fact if all the people who have spent the last few days raving about the JBoss project management, and the fact that some guy called Gavin has recently changed his job, instead spent their time doing a bit of Wiki gardening, we’d probably have a very useful resource indeed.


15
Sep 03

RDFX

Thanks to Danny this morning I came across RDFX, an RDF plugin for Eclipse.
The howto document includes some interesting screenshots, based around exploring a FOAF document.
To install the plugin I found that I had to follow a few different steps (I’m currently using an Eclipse 3.0.0 integration build; 200309100800 to be precise) that those given in the download document:

  • Click Help -> Software Updates -> Find and Install.
  • Then choose “Search for new features to install”
  • Click “Add Update Site” and then follow the RDFX instructions from that point (Step 6) onwards.

The tool is fairly easy to use. You can import new RDF resources into the main graph and then explore the links and properties of the resources. I’m not sure whether it’s user error, or the fact that I’m using Eclipse 3.0 but I didn’t get the pretty person icons shown in the RDFX screenshots.
My other gripe is that there’s no way to load remote resources. It would be nice to be able to specify a URL from which to import the RDF. It would also be useful to be able to select a property (e.g. rdfs:seeAlso) and have RDFX import the URL. Then we’d be able to actually browse the FOAF web.
I also couldn’t see how to clear out the internal model, I could only import. It would be useful to be able to completely delete the contents, as well as individual resources. The model is deleted when Eclipse is restarted however. Being able to save the model would be another useful feature
Other than that I’m quite excited by this as I spent the weekend fishing about in RDF documents and this would have made life a bit easier, especially if I could add icons, etc to flag up different resources.
Update: Rich Boakes pointed out to me that if you enter a URL in the “file explorer” box it will actually load a URL rather than a file. So that’s one item solved.
Rich also notes that “I’m adding a provenance facility soon which will annotate each resource as it’s loaded, enabling files to be added and removed at will.” Cool!


9
Sep 03

Java and PGP?

Hello Java people, can anyone recommend a decent open source PGP API for Java?
Basically I need something to help me implement signing and encrypting FOAF files from a Java application.
Recommendations most welcome. I’ll provide a summary of anything I find (either through your kind help gentle reader, or as a result of the almightly bashing I’m about to give Google).


4
Jul 03

MP3 GPS

Here’s something I came across whilst looking for a Java API into WinAmp. Why was I looking for a such a beast? Well mainly because I’m a Java weenie and can’t be bothered to dredge up the bits of C/C++ I know to write WinAmp plugins properly.
The plugin I’m thinking about would be used to extract some RDF data from WinAmp — the playlist, what I’m listening to, etc.
Anyway, this lead me to Mp3 GPS, a WinAmp plugin written in Java that communicates to a GPS device attached to the serial port of your computer. (See the installation page for a link to the Java API; it doesn’t seem to have an official separate home page)
The MP3 GPS plugin can be configured to select a playlist based on information such as the system time, the current speed, direction, latitude, longitude and altitude. Which is a cool idea.
Apart from the use cases the author mentions, there are some other interesting possibilities. Such as being able to have a playlist for a particular scenic location; something that might complement the mood perhaps. Currently at high altitude and moving very fast? No problem, WinAmp will start playing some soothing tunes to make your flight more enjoyable.
There are some interesting art works that could be constructed with something like this. It basically allows a musician or DJ to take the listeners environment into account when mixing a tune. They just need to provide the rules for selecting the right playlist.
This is also related to Linked which I saw chumped earlier this week.
It would be useful to extract the rules into something more generic, similarly the playlists. That way MP3 and GPS enabled phones could make use of the data. There are already some geo vocabularies for RDF, so there’s probably work to build on already.
It’s just a shame I don’t have any GPS peripherals!


1
Jul 03

More, More, MORE

I’ve been meaning to have a play with the POI API for some time now. So, when a colleague mentioned how easy it is to work with, I decided it was high time I had a look. Whilst thinking of a suitable utility it occured to me that Office documents have metadata stored in them (see the File -> Properties dialog), and so I wondered whether it would be able to extract this data as RDF.
The result is MORE (Microsoft Office RDF Extractor).

Continue reading →


20
May 03

The JBoss Documentation Project. Why Doesn’t It Exist?

Has anyone considered starting a collaborative, open source JBoss documentation project?
The current JBoss documentation is out of date. Even the “for fee” documentation is lagging behind the current release which is a pretty poor state of affairs anyway, but for a company thats trying to make money out of an open source project it seems pretty foolhardy: surely you need to build as good a level of supporting services as possible? Raw documentation is basically entry level, no hand holding support after all.
Even when it is up to date, the documentation is still not that hot. It could do with a good editor, IMHO.

Continue reading →


11
Mar 03

Ant Fan

Ant is rapidly becoming my favourite Java and XML processing tool. It features heavily in my next tutorial for IBM developerWorks (working title “Code Generation using XSLT”) which describes how to use XSLT as a code generation tool using an Ant based build framework. Basically using Ant + Jalopy takes all the hard work out of handling multi-step transformations that have to result in nice clean Java code.

Continue reading →


11
Mar 03

(Not) Creating Apps with Mozilla

Having recently picked up a copy of Creating Applications with Mozilla on one of my occasional hit-and-run attacks on Amazon, I’ve been tinkering a bit with XUL to see how easy it is to build applications.
This is part of some ongoing tinkering I’ve been doing to look at ways to quickly prototype user interfaces. My immediate interest is to decide on a toolkit for building internal administration tools for work, but I’d like to try out creating client-side user interfaces for web applications/services in general.

Continue reading →


24
Jan 03

Spooky

This is spooky. Matt Biddulph has just posted a template for Java projects which is basically a tar ball of a standard project directory structure and an Ant build script to go with it.
In my last couple of lunch hours, after updating eclectic I’ve been tinkering with something very similar which I’d nicknamed “project maker”. Basically its a little language for describing project structures. The language is implemented using XSLT.

Continue reading →