splitting semantic hairs

Adam Bosworth’s excellent ISOC’04 talk has inspired some apparently-indignant comment. But his recent post rubs me the wrong way.

There’s a pretty common conversational pattern that emerges in the RDF vs. XML discussions stemming from the fact that the RDF people are never really talking about XML. The discussion is really decomposable along two axes: RDF/XML vs. “vanilla” XML and RDF vs. no-DescriptionFramework: between the particular data-modeling framework of RDF vs. an ad-hoc or informal one.

It’s certainly easy to invent namespaces and to coin terms — for both things and thing-relations — within those namespaces. It’s also easy to declare how some piece of XML should look … what should be tags and what should be attributes and what they should contain in order to represent a particular structure of information. But, yes, that’s the easy part. The hard part is coming to agreement on those items.

This complexity comes in two forms: syntactic and semantic. RDF looks to focus on expressing semantics at the expense of some human readability of the syntax. XML is all about a particular verbose syntax, and says nothing (or, maybe, the wrong things) about the semantics.

Semweb proponents believe that the simple S-P-O and URI framework encourages interoperability [my properties can be in-relation-to your subjects if we both agree that subjects are URIs] and representational complexity [i.e., graphs, not trees], and will thus allow conversations to focus on the actually-hard part: the modeling and particulars of the terms involved.

A lot of the syntactic issues shouldn’t be — it doesn’t matter if you put the title in an attribute or in an element. It does matter if you leave out a referrant. If you want to represent something that’s not naturally acyclic … well … you should be able to. If I want to further describe some resource on the web, I should be able to using it’s URI:

@prefix rev: http://www.purl.org/stuff/rev#. @prefix foaf: http://xmlns.com/foaf/0.1/. @prefix dc: http://purl.org/dc/elements/1.1/. http://www.adambosworth.net/archives/000034.html dc:title “Well!” ; dc:creator [ a foaf:Person; foaf:name "Adam Bosworth" ] ; rev:hasReview [ a rev:Review; dc:creator [ a foaf:Person; foaf:nick "jsled" ]; rev:rating 9 ].

Perhaps more importantly, however, if you want to leverage many person-years that have gone into well-crafted specs like FOAF and Dublin Core so that you either don’t have to re-invent the wheel; you don’t want to re-invent the wheel, because it forces you to re-negotiate those agreements again.

Let’s postulate a Resource-and-Site-Summary format … RaSS … that has an open no-DF extension policy: in order to define extensions, you simply craft a new namespace and a set of terms in that namespace plus some rules about what’s an element vs. an attribute, publish it, get it noticed and get tool support build to understand the particular semantics it defines.

Note that while something like Relax-NG or XMLSchema can help with the syntactic defintion, the semantic description is mostly in human-readable text.

Once you do that enough, you’ll want some reasonably standard way to define such extensions.

Moreover, you’re going to need to enforce some consistency in how things are modeled in order to to promote interoperability. Maybe a regular pattern for statements. Referring to things at multiple places in the same document. Lexical interpretation of datatypes. Domain/range constraints. Relation cardinality constraints.

At the end, I bet what you end up with is a lot like RDF, RDF schema and OWL.

Or perhaps it’s not.

But I’m in agreement with Danny, here: structured information is better than unstructured, and RDF is a simple and compelling way to structure data.

Alternatives?

M-x return-to-emacs

The last time I was out in California for work, my coworkers ganged up on me…

“You just have to try IntelliJ. It’s so good. Check out this and this and that and the-other. It’s heaven.”

I bit the bullet and grabbed a license key from a departed colleague, and fired it up, I had someone show me the 3 important things I’d need to know, and grabbed the alpha-geek to show me how to get the servers up and running.

I spent the remainder of the week getting used to the environment, and have spent the last two weeks exclusively using IDEA. This morning, I switched back to emacs.

IDEA rocks

There’s no doubt that IDEA is simply the best IDE for Java projects. It’s really astounding. The keybindings are pretty well done, and it has an impressive wealth of features. The level of semantic “understanding” … especially around the configuration files for common frameworks like Struts is quite useful. In the end, I found it to be an approachable and easy-to-use masterpiece, with very little detracting from it’s excellence.

But, frankly, there are a lot of features that I didn’t have call to use. The quite extensive refactoring support — which seems great — just doesn’t enter into my day-to-day writing. I’m sure it works well and is productive when called for, but I’m not considering it compelling.

The features I ended up using day-to-day are:

  • C-n : open class by partial-name
  • C-S-n : open project file by partial-name
  • C-b : jump to appropriate thing for current token.
  • C-<SPC> : contextual complete
  • A-<RET> : auto-import, auto-cast, auto-…
  • C-7 : current class structure
  • C-q, C-p: in-line javadoc + method-signature popups
  • C-A-h : show method callers
  • JSP-parsing
  • debugging

emacs rolls

At the same time, there’s one area where emacs is simply better: editing text. Especially for someone who’s used it for many years, now, and has worked to patiently and effectively extend my emacs-fu … I believe emacs may be the best raw text-editor in existence. Moreover, it really is an operating system unto itself, which isn’t quite so silly … for instance, I’m only mildly curious about, say, any of the three emacs jabber clients, but having a simple calculator is pretty nice when it is.

But perhaps the most compelling reason for me right now is that I’m not strictly a Java programmer; I’ve been doing some fun python hacking in the evenings, and I still try to work on the Scheme + C beast that is GnuCash from time to time. As well as random text files, &c…

JDE

So I’ve re-embraced JDE, and found that pretty much all the major functionality I’ve grown used to is available…

  • C-n becomes C-c n, jde-open-class-source … doesn’t do the partial-value completion … but that sounds like a fun weekend hack … :)
  • C-b becomes C-c C-v C-g, jde-open-class-at-point … which also jumps to the appropriate method, too.
  • C-<SPC> becomes C-c <SPC>, jde-complete-minibuf
  • A-<RET> becomes C-c C-v C-z, jde-import-find-and-import
  • C-7 becomes C-c . l w, ecb-toggle-ecb-windows
  • C-A-h becomes jde-xref-display-call-tree

Now, for those playing along at home, those are the big ones anyways … complete, auto-import, “jump”, structure and show-callers. But that leaves a few things unaccounted for… specifically:

  • C-S-n : open project file by partial-name
  • this would be real nice, but also smells like a weekend hack.
  • A-<RET> : auto-cast, auto-…
  • I can cast myself, thanks. Fucking java, anyways…
  • C-q, C-p: in-line javadoc + method-signature popups
  • JdeDocIndex seems somewhat promising, but not exactly right either.
  • debugging
  • I haven’t tried JDE’s debugging support in a while, but I did have problems with it in the past. At the same time, I pretty generally want to ForgetTheDebugger … I’m just not of the UseTheDebugger school.

Which leaves the one major standout: first-order JSP support.

Now, I’ve tried … really tried … to use mmm-mode in order to switch between, say, nxml-mode and JDE. It just doesn’t work, primarily because the new-file parsing latency of JDE is so high. But that also sounds like a good weekend hack to craft some sort of a startup-effort caching into JDE, which would generally be beneficial.

Summary

IntelliJ is awesome. Emacs — and especially JDE [+ ECB + semantic + ... ] — is good enough, and fits better into my world. The Emacs Development Environment tools could all stand to get better, and in many cases would find benefits across mulitple languages. So that’s where I’m headed.

“Identity”

@prefix foaf: http://xmlns.com/foaf/0.1/. @prefix dc: http://purl.org/dc/elements/1.1/. @prefix review: http://www.purl.org/stuff/rev#. @prefix rdfs: http://www.w3.org/2000/01/rdf-schema# .

http://us.imdb.com/title/tt0309698/ dc:title “Identity” ; review:hasReview <#rev>.

<#rev> a review:Review ; review:rating 9 ; review:reviewer [ a foaf:Person; foaf:nick "jsled"; rdfs:seeAlso http://asynchronous.org/jsled/foaf ] ; review:text “”"John Cusack rocks. While Oddmo’ “got” this movie very quickly, it took me a bit of a while … which was a good thing because it gets you interested on a couple of levels. The ending’s good, but not great. Not super-scary, but we could have turned the lights off or something.”"” .

a fitful REST

Yesterday I found out about the Amazon Web Services Simple Queue Service (beta), which is an Amazon-provided generic web service, available with both SOAP and “REST” interfaces. Unfortunately, the nature of the “REST” interface is along the lines:

GET http://webservices.amazon.com/some/cgi?operation=[procedure-name]&subscriberId=[foo]&[other args]

(Note that I’m actually guessing on the ‘GET’ part, since the docs don’t specify an HTTP operation.)

I’m really happy that Amazon has opened up this service, and has provided a … more direct … interface than SOAP for interacting with it. My only gripe is that they labeled that interface “REST”. There’re at least two forms of REST that I’m aware of, and this fits neither.

I brought this up on the rest-discuss mailing list, and Jan Algermissen pointed out … basically … “talk is cheap, grousing is free; implementations will help change minds.” [my paraphrasing :)]. So, I have.

queue.py is a simple Python + Twisted web service implementing a /queue[/{name}[/{key}]] as you would expect give the HTTP operations GET, POST and DELETE.

ale hallows eve, 2004

Time for a pumpkin beer…

As I didn’t get around to doing it until All Hallows Eve itself, Odd’ suggested the one-day-appropriate name Ale Hallows Eve.


@prefix : http://asynchronous.org/ns/2004/homebrewing#. @prefix hb: :. @prefix rdfs: http://www.w3.org/2000/01/rdf-schema#. @prefix foaf: http://xmlns.com/foaf/0.1/. @prefix dc: http://purl.org/dc/elements/1.1/. @prefix cc: http://web.resource.org/cc/.

<#jsled> a foaf:Person ; foaf:nick “jsled” ; rdfs:seeAlso http://asynchronous.org/jsled/foaf .

<#aleHallowsEve2004> a hb:Recipe ; foaf:maker <#jsled> ; a cc:Work ; cc:license cc:PublicDomain ; hb:ingredient [ :amt "3 lbs"; dc:description "light malt extract" ] ,[ :amt "3 lbs"; dc:description "amber malt extract" ] ,[ :amt "1 lb" ; dc:description "Crystal 60L grain; crushed." ] ,[ :amt "1 oz" ; dc:description "Styrian Goldings [pellet]” ] ,[ :amt "0.5 oz"; dc:description "Fuggles [pellet]” ] ,[ :amt "1 tbs" ; dc:description "cinnamon" ] ,[ :amt "1/2 tbs"; dc:description "nutmeg" ] ,[ :amt "1 tbs"; dc:description "clove" ] ,[ :amt "dashes"; dc:description "coriander seed, ground" ] ,[ :amt "1 tsp"; dc:description "ginger, ground" ] ,[ :amt "1.5 tsp"; dc:description "Irish Moss" ] ,[ :amt "6g"; dc:description "Munton's Ale yeast, dried" ] ,[ :amt "3"; dc:description "pie pumpkins" ] ; hb:instruction “Combine spices together.” ,”Cut pumpkins open, remove strings and seeds. Reserve stringy innards.” ,”Bake on cookie sheets in oven, meat-side up, dusted with 1/2 of the spices. Bake at 350 deg F for ~1 hour.” ,”Remove skin; cut into 1/2-inch cubes.” ,”Steep grains + stringy innards in ~2 quarts water @ 170-160 deg F for 1 hour.” ,”Remove grains + pumpkin. Heat wort to boil.” ,”Add malt extract, bring to boil.” ,”At 60 minutes, add Goldings and dust surface of wort with spice mixture.” ,”At 30 minutes, add pumpkin and dust surface of wort with spice mixture. Add Fuggles.” ,”At 20 minutes, add Irish moss.” ,”At 15 minutes, add remaining spices.” ,”At 0 minutes, remove from heat and chill.” ,”During chilling, remove pumpkin pieces from cooling wort to cold water in fermenter.” ,”Transfer into fermenter.” ,”Pitch yeast.” .

<#aleHallowsEve2004inst> a hb:BrewInstance ; hb:recipe <#aleHallowsEve2004> ; dc:date “2004.10.31″ ; foaf:maker <#jsled> ; hb:journal [ a hb:JournalEntry; dc:created "2004.10.31T19:27-0500" ; dc:description "OG 1.046 ~ 84 deg F" ] .