Amazon’s RESTless WS API

Steve Maine’s Isomorphism post is really good until the end, where he tries to make a point about Amazon.com’s “touted” RESTful web service API. The REST crowd touts Amazon’s human-focusedservice as a REST example, not the WS API. Only Amazon themselves claim that their non-SOAP API is RESTful, and I believe it’s because they’re confused. … Continue reading “Amazon’s RESTless WS API”

Steve Maine’s Isomorphism post is really good until the end, where he tries to make a point about Amazon.com’s “touted” RESTful web service API.

The REST crowd touts Amazon’s human-focusedservice as a REST example, not the WS API.

Only Amazon themselves claim that their non-SOAP API is RESTful, and I believe it’s because they’re confused. As well, there’s not a marketing term for “simply using HTTP query strings to invoke RPC which returns XML without doing SOAP or XML/RPC”. Thus, everyone calls it REST, even though it isn’t, necessarily.

So, the reason that <wsa:Action>urn:GetCart</wsa:Action> and http://webservices.amazon.com/onca/xml?Operation=CartGet[...] are isomorphic is because they trivially are. They’re both RPC.

Re-creating the same thing in a purely RESTful way would not look isomorphic, depending on how much of HTTP you want to exploit. I’ll leave that as an exercise for the reader, for the moment. As well, Joe Gregorio has been developing that idea out.

mead and ESB

On the new-year’s eve, Odd and I brewed a mead. We’ll likely try some over the summer, but for the real spoils we will wait until the new year’s eve next, when we will enjoy it fully while brewing another batch. More recently, I’ve used the London Ale liquid yeast I received for Chistmas to … Continue reading “mead and ESB”

On the new-year’s eve, Odd and I brewed a mead. We’ll likely try some over the summer, but for the real spoils we will wait until the new year’s eve next, when we will enjoy it fully while brewing another batch.

More recently, I’ve used the London Ale liquid yeast I received for Chistmas to brew an ESB. I took the recipe – as I did for Ale Hallow’s Eve – from looking at a bunch of recipes and averaging a few together. I tried some while racking it over into a carboy, and it’s quite good! Better than most of the brews I’ve done so far … I attribute that primarily to the liquid yeast. I’m next going to do a bock or dopplebock with the other liquid yeast I got for Christmas; if there’s as-noticeable a quality improvement, I might not go back.

Anyways, since I still haven’t created a better publishing framework for these little structured-data tidbits, yet … and against all sense since it’s not even appropriate mime-typed, let alone easily seperable from the page-content or GRDDL’ed or anything …. here’s the data for both the mead and the ESB:

@prefix : http://asynchronous.org/ns/2004/homebrewing#. @prefix hb: :. @prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#. @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 xsd: http://www.w3.org/2001/XMLSchema#. @prefix cc: http://web.resource.org/cc/.

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

<#newYearsGingerMead> a hb:Recipe ; rdf:label “A ginger mead recipe based on Papazian.” ; hb:derivativeOf <#papazian_melimigueleniumGingerMead> ; foaf:maker <#jsled> ; hb:ingredient [ :amt [ rdf:value 15; hb:units “lbs” ]; rdf:label “local honey, clover” ] ,[ :amt [ rdf:value 0.5; hb:units “lbs” ]; rdf:label “grated ginger root” ] ,[ :amt [ rdf:value 2 ]; rdf:label “Red Star champagne yeast [yellow packet].” ] .

<#newYearsMead2004_5> a hb:BrewInstance ; hb:recipe <#newYearsGingerMead> ; dc:created “2004-12-31-05:00″^^xsd:date ; foaf:maker <#jsled>, <#oddmonster> ; hb:journal [ dc:created “2004-12-31-05:00″^^xsd:date; rdfs:label “OG 1.094 @~70 deg F; very sugary, very tasty!” ] ,[ dc:created “2005-01-06-05:00″^^xsd:date; rdfs:label “has been bubbling quite consistently every few seconds for days, now. No significant fermentation spike.” ] ,[ dc:created “2005-01-10-05:00″^^xsd:date; rdfs:label “bloop’ing every ~10 seconds at 2-ripples-full” ] .

<#averagedEsb> a hb:Recipe ; rdf:label “A basic ESB recipe.” ; dc:created “2005-01-10-05:00″^^xsd:date ; foaf:maker <#jsled> ; hb:ingredient [ :amt [ rdf:value 4; hb:units “lbs” ]; rdf:label “light extract” ] ,[ :amt [ rdf:value 3; hb:units “lbs” ]; rdf:label “amber extract” ] ,[ :amt [ rdf:value 1; hb:units “lbs” ]; rdf:label “local honey, clover” ] ,[ :amt [ rdf:value 2; hb:units “oz” ]; rdf:label “Fuggles @ 60 min” ] ,[ :amt [ rdf:value 1.5; hb:units “oz” ]; rdf:label “Fuggles @ 15 min” ] ,[ :amt [ rdf:value 0.5; hb:units “oz” ]; rdf:label “Fuggles @ 3 min” ] ,[ :amt [ rdf:value 2; hb:units “tsp” ]; rdf:label “gypsum” ] ,[ :amt [ rdf:value 1 ]; rdf:label “ale yeast” ] .

<#averagedEsb2005> a hb:BrewInstance ; hb:recipe <#averagedEsb> ; dc:created “2005-01-27T19:11:00-05:00″^^xsd:dateTime ; foaf:maker <#jsled> ; hb:journal [ dc:created “2005-01-10-05:00″^^xsd:date; rdf:label “Used liquid Wyeast 1968 from Nov 2004, incubated 2 days. OG: 1.056 @ 60 deg F.” ] ,[ dc:created “2005-01-22-05:00″^^xsd:date; rdf:label “racked to glass carboy; FG: 0.016 @ 60 deg F; tastes good, though still a bit sharp. The hops didn’t come throuhg nearly as strongly as expected. I’m looking forward to more maturation.” ] .

Winooski, VT water mineral content / analysis

When brewing beer, certain styles are partially characterized by the water quality. Since beer is some 90% water, it’s composition can weigh heavily on the output. As well certain styles have come to be popular or even viable because of historical local ground-water conditions; particular English bitter institutions such as Bass are that way because … Continue reading “Winooski, VT water mineral content / analysis”

When brewing beer, certain styles are partially characterized by the water quality. Since beer is some 90% water, it’s composition can weigh heavily on the output. As well certain styles have come to be popular or even viable because of historical local ground-water conditions; particular English bitter institutions such as Bass are that way because of the super-hard water of Burton-on-Trent … Czech pilsners aren’t the same unless they’re devoid of minerals, as the groundwater of Pilzen is.

Thus, it’s useful to get an anlysis of ones ground water if you’re trying to brew certain styles; this may be posted on-line if we were in Palo Alto or San Francisco, but the Winooski water dept. has some catching up to do.

In any case, this is as of 2003, I believe, so it should still be basically valid for a few years:

  • Calcium as CaCO3 (Calcium Carbonate): 45 ppm
  • Chloride: 17 ppm
  • Iron: < 0.01 pm
  • Manganese: 0.007-0.012 ppm
  • Sodium: 7.5 ppm
  • Potassium: 1.31 ppm
  • Sulfate: 15 ppm
  • Silica: 1.4 ppm
  • Silicon: 0.67 ppm

LML and RX

Last weekend I got to thinking about alternative representations for RDF in XML, inspired by Bill de hÓra’s LML format. Over the course of this week, there was some discussion on www-rdf-interest that prompted me to think through some of the details. This weekend, I wrote up what I was thinking a bit more specifically. … Continue reading “LML and RX”

Last weekend I got to thinking about alternative representations for RDF in XML, inspired by Bill de hÓra’s LML format.

Over the course of this week, there was some discussion on www-rdf-interest that prompted me to think through some of the details.

This weekend, I wrote up what I was thinking a bit more specifically. The result is a format for RDF in XML called Rx. It’s basically an unstriped syntax for RDF in XML which maps RDF Properties to XML elements, with RDF/XML’s parseType="Resource" the default.

Coming full circle, I can now re-express LML in RX, in order to get an idea of how different it is from Bill’s pure-XML syntax.

The major difference compared to Bill’s format is the moving of data out of attributes an into XML elements. RX just doesn’t allow it, since it’s yet another option for serialization that it is possible to do away with.

In any case, here’s the same LML example from last week, but in RX:

001 Bill de hora jsled rdf http://www.w3.org/RDF/ markup http://www.w3.org/XML/ 2005-01-08T10:57-0500 2005-01-08T10:57-0500 http://asynchronous.org/ns/lml yes original post http://www.dehora.net/journal/2005/01/lmllistmarkuplanguage.html Danny’s response http://dannyayers.com/archives/2005/01/08/list-markup-language/ followup to Danny http://www.dehora.net/journal/2005/01/dataabovethelevelofasinglesite.html

SOA and web services

The following is a message to the service-orientated-architecture yahoo group. It’s in response to a thread about standardized interfaces and protocol semantics. I don’t think it bring anything new to the table except my own understanding of some issues, but – especially since Yahoo Group’s search interface is so bad – I’m going to post … Continue reading “SOA and web services”

The following is a message to the service-orientated-architecture yahoo group. It’s in response to a thread about standardized interfaces and protocol semantics. I don’t think it bring anything new to the table except my own understanding of some issues, but – especially since Yahoo Group’s search interface is so bad – I’m going to post it here in case other people find it useful.

On Mon, 2005-01-10 at 19:14, Spork, Murray wrote:

Should we add new verbs that incorporate (for example) complex transactional semantics – or should we instead refine the current verbs through other mechanisms. For example – by layering other protocols on top of HTTP. If we do the later then I strongly agree with Mark – the semantics of the verbs in the higher level protocol should not contradict the verbs in HTTP.

Yes.

I think what is happening here is that the HTTP verbs are being implicitly refined by attaching some semantic behavior to the resource – in this case the verb PUT is refined by stating that a particular resource is of type “order-acceptor” – in this way a client (that understands what an order-acceptor is) can infer that PUTing an order to this resource will cause a order to be placed.

IMO verbs are all about defining side-effects.

Yes. The hard assurances, side-effects and basic semantics are defined by the verbs, and refined, as well as contextualized, by the type of the data being operated over.

It seems like all the effort that’s gone into WS-* in the last few years could have instead been directed at determining new verbs, collections of verb-profiles and more-rich media-types. Somehow, a lot of MEPs and the yet-another-RPC mechanism doesn’t seem as useful… I’m not exactly sure why not, though.

nor that HTTP is sufficiently flexible for allowing the incorporation of new verbs.

Hmm… is it even possible to have a protocol that both specifies operational semantics and does not do so … and still be efficient?

I’m not sure I understand your question – could you elaborate?

Not well enough, as it’s a poorly formed quesiton: “efficient” is too loose and relative of a word. But that won’t stop me from trying :) …

Especially for the “does not do so” part, I guess I’m thinking of a protocol whereby the operation isn’t specified, so much as the semantics of the unspecified operation being performed. I guess somewhere between HTTP and RPC; one would make an request^Winvocation of the form:

[ a :Invocation ; :informativeOperationName “get” ; :idempotent “true” ; :safe “true” ; :cacheControl [ :cacheable “true” ; :cacheStateTag “12345” ; :expirationDate “2005.01.12T10:19:00Z” ] ].

[For the “specifies” part I was thinking of something like HTTP, where the above properties for a handful of operations are specified in the … uh … specification. But that’s not important once you have the above.]

But what I’ve specifed is basically what’s become of SOAP and WS-*, except that — for the most part — the transfer semantics aren’t explicitly specified in the content of the messages, but are implicit in the namespaces and qualified-names present in the data being exchanged.

I guess that it is the obvious and direct consequence of the implementation of SOAP’s design… the quest for “protocol independence” leads to trivial use of a transport protocol that is basically: open connection and execute “Process Message”. Since all the semantics are defined in the data, there is no need for protocol-level verbs. As well, it actively seeks to ignore the semantics defined by any protcol it “rides”. Thus, an application protocol like HTTP is converted into transport.

As well, answers about “efficiency” are now more clear…

  1. no, it can’t be as efficient (as HTTP), since intermediateries need to do message inspection. A lot of message inspection.

  2. as well, it’s hard to see how one even describes the full semantics of these messages in a machine-processable way…

  3. but, it can be quite flexible, which further reduces intermediateries capabilities.

  4. the underlying protocol must be completely ignored to prevent conflict with higher-level semantics.

It continues to sound nothing like the web. I guess it could be used to implement services.

This is what happens

when you leave your journal open and unlocked. People write in and talk about how you have a soft spot for rabbits. Like the little white one currently crawling around on your head. And suddenly everyone on the Interweb knows that underneath the hard, RDF-driven exterior, beats the heart, of a bunny-lover. –Love, your girlfriend, … Continue reading “This is what happens”

when you leave your journal open and unlocked. People write in and talk about how you have a soft spot for rabbits. Like the little white one currently crawling around on your head. And suddenly everyone on the Interweb knows that underneath the hard, RDF-driven exterior, beats the heart, of a bunny-lover.

–Love, your girlfriend, who is paying attention.

Review: Logitech Harmony 676 Universal Remote

I recently purchased and received the Logitech Harmony 767 universal remote, and I can now officially say that I am a 21st century digital boy: my fscking TV remote has a USB interface. Thankfully, however, it’s used really well… One really good reason to build a service versus a stand-alone software is that all options … Continue reading “Review: Logitech Harmony 676 Universal Remote”

I recently purchased and received the Logitech Harmony 767 universal remote, and I can now officially say that I am a 21st century digital boy: my fscking TV remote has a USB interface. Thankfully, however, it’s used really well…

One really good reason to build a service versus a stand-alone software is that all options aren’t known at the time the software is written, and thus you want to maintain control over the data … this is actually a great description of a universal TV remote, as well: not only do you not want to distribute the IR code profile database of all potential devices in the world, but they may not yet even exist!

Logitech solves this problem by combining a universal remote with flash memory and a web site for peripherial device-configuration. You go through the web site with its extensive catalogue of devices and configurations in order to setup your profile of A/V devices. At various points it will prompt you to use your original device remote to ascertain various key-codes; it seems to do this for two reasons: to determine the particular device configuration from example, or to actually ascertain the specific IR code-sequence for a symbolic command.

The interface is extremely logical, and very in-depth; there’s obviously some rather sophisticated configuration-engine and decision-tree application logics backing the site … both in the device/function composition and excellent “this isn’t working; FIX IT!”-style help menus … the version on the web site is great, while the version on the remote is much more specific yet still very functional.

The UI of the remote is based around a handful of activity profiles: “watch a DVD”, “listen to a CD”, &c. Based on knowledge of the current state of the devices and the desired configuration, it will switch the appropriate devices into whatever specific configuration is necessary. Through the web site, however, you can redefine what would obviously occur to change from the generic configuration A to configuration B to suit your specific configurations A′ and B′.

One of the ways that the web site displayed its power – both potential and more importantly available – was when I had misconfigured my TV… the key buttons were working, but the volume +/-/mute weren’t. Through the web-site UI I was able to get a list of the symbolic commands-names that the remote would use to perform each function across each of the various devices that it knew it would need to control to provide such functionality, plus how the site+device knew it knew the control code — through it’s database or through learning from my existing remote … plus an option to redefine each code as necessary. Very nice. However, because the website is obviously generated via some expert system, it has that decidedly unpolished feel; its rough edges haven’t been filed down and away. This can be somewhat annoying, as a couple of configuration situations would do nicer with a bit of help text and/or different wording. But I’d rather have the generated configuration system than a hand-built website, so I guess I shouldn’t complain.

The website accomplishes most of its function in terms of interaction with the device through dynamically-downloaded executable files. It seemed to be: one generic initial app to make sure the device is accessible, one to learn commands at the direction of the server, and one to program new content into the device. They seem to be generated on the fly [stock executable + configuration data], and it surprisingly takes a bit of time to do it. But only a few seconds.

As well, it seem that one can define custom control codes and control-code sequences, as well as redefine the soft-keys and what they perform.

Problems: My wacky-cum-awesome-Prismiq device is supported, but problematically: it seems all codes are sent 3 times in succession. I’m happily surprised that it knows what the Prismiq is, however. As well, it believe my PS2 has an IR port that doesn’t seem to exist. Physically, the central directional control ring is a bit too small and a bit too finicky … but it also seems like one of those things where after a few evenings of interaction I’ll find a nice little groove with it.

Overall: easily 9/10. A very nice device. Still probably not worth the price tag on principle in the face of tsunamis and famine, but if you have more than one remote and any disposable income whatsoever, you’ll like this device, a lot. Kudos to Logitech.

@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://www.logitech.com/index.cfm/products/detailsharmony/CA/EN,CRID=2084,CONTENTID=9511 dc:title “Logitech Harmony 676” ; 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 “””This is a very good remote, with a great premise and a good execution. There are a couple of relatively minor flaws in the execution, but otherwise it’s right at the top of the state of the art. It’s hard to see how you’d be disappointed.””” .

Updated 2005-01-12T10:10-05:00 — I forgot to add a note about the website.

LML, XML and RDF

Bill de HÓra published a nice-and-simple List Markup Language today. He’s framed it as an XML language, and notes that it would be nice to have an XSLT transform into RDF. In a subsequent post, he talks a bit – basically – about the RDF tax. So, given that RDF is not RDF/XML, and since … Continue reading “LML, XML and RDF”

Bill de HÓra published a nice-and-simple List Markup Language today. He’s framed it as an XML language, and notes that it would be nice to have an XSLT transform into RDF. In a subsequent post, he talks a bit – basically – about the RDF tax.

So, given that RDF is not RDF/XML, and since it may be time to deprecate RDF/XML anyways, I was thinking two things:

  1. What’s the trivial translation into the RDF model?
  2. How far is the presented XML from RDF?

In Turtle

To get at the first, I simply re-wrote the presented data in Turtle, though I wanted a bit more meat, so I added some content into the example ( more specifically, since there’s so little syntactic framing in Turtle, there’s not much left if you don’t put example data in… ):

– n3 –

turtle, actually, but I only have an ‘n3’ mode for emacs…

@prefix i: http://www.dehora.net/lml/2005/01. @prefix xsd: http://www.w3.org/2001/XMLSchema# .

<#> a i:lml ; i:version “001” ; i:published [ i:when “2005-01-08T10:57-0500″^^xsd:datetime ] ; i:changed [ i:when “2005-01-08T10:57-0500″^^xsd:datetime ] ; i:author [ i:name “Bill de h\u00D3ra” ] ,[ i:name “jsled” ] ; i:category [ i:name “rdf”; i:subject “http://www.w3.org/RDF/” ] ,[ i:name “markup”; i:subject “http://www.w3.org/XML/” ] ; i:list [ i:ordered “yes” ; i:href “http://asynchronous.org/ns/lml” ; i:items ( [ a i:item ; i:content “original post” ; i:href “http://www.dehora.net/journal/2005/01/lmllistmarkuplanguage.html” ] [ a i:item ; i:content “Danny’s response” ; i:href “http://dannyayers.com/archives/2005/01/08/list-markup-language/” ] [ a i:item ; i:content “followup to Danny” ; i:href “http://www.dehora.net/journal/2005/01/dataabovethelevelofasinglesite.html” ] ) ] .

I noted a few things in doing this:

  1. The namespace should end in a ‘/’ or ‘#’ to make things prettier.
  2. It’d be nice if the version was an integer. I’m curious about it’s structure and semantics — does it need to be 3 digits? Does it represent some sort of compatability assurance?
  3. It’d be nice if the ordered attribute could trivially be a xsd:boolean “true”/”false” rather than “yes”/”no”.
  4. The published and changed dates probably don’t need to be to wrapped in bnodes [ owl:ObjectProperties], but could more directly be straight data-type properties [owl:DatatypeProperties].
  5. The item-list construct doesn’t map directly.

The first three are more spec quibbles, and the 4th is just a modeling question. But the last is bit more interesting of an issue. I’ve seen before and don’t yet fully understand the mis-match, but it’s definitely a sticking point about RDF…

… in any case, above I’ve inserted the itemsproperty, allowing the list bnode to hold it’s properties [ordered and href], and the “striping” to work out in the RDF model. It does make more sense to me this way — the list has 3 properties: ordered, href and it’s children/items…

I believe the primary mismatch is that in RDF there’s no notion of implicit children or containment. That is, in XML there is an un-named “hasA” or “isA” relation of a node being inside another node. In RDF, all relations are typed via a property.

In XML

The second question can be re-phrased as “what’s the minimum set of changes that need to be made in order for the presented example to be parsed as RDF/XML?” The answer is: very few, kinda.

Bill de hÓra jsled rdf http://www.w3.org/RDF/ markup http://www.w3.org/XML/

Here, I’ve inserted parseType="Resource" in a couple of places, as well as parseType="Collection" on the items element; this last one prevents rapper from parsing it correctly as RDF/XML, but I think it’s a bug in rapper, actually.

Now, what would happen if parseType="Resource" was the default? And there was a simpler way to specify collection-style parsing? I fear that the constraints imposed by RDF would continue to retard it’s adoption, but it might make for something a lot more palatable.

html.py

As a side-effect of a recent programming exercise, I’ve developed a simple html-generation library in python. It takes advantage of python’s built-in lists [and list-comprehensions] in order to allow you to generate a HTML object, and str(it) out; you can also str(out)any sub-fragment, naturally. The examples below assume an from html import *; the domain … Continue reading “html.py”

As a side-effect of a recent programming exercise, I’ve developed a simple html-generation library in python. It takes advantage of python’s built-in lists [and list-comprehensions] in order to allow you to generate a HTML object, and str(it) out; you can also str(out)any sub-fragment, naturally.

The examples below assume an from html import *; the domain is a music collection interaction web-app.

While I like this library, it’s incomplete — I lazily implemented only what I needed to work as I needed it. I’d rather use something more maintained and fleshed out, but what retains the same expressive-simplicity. Any suggestions?

Anyways, if there’s not, you might want it, too: html-0.1.py. If you fix or extend it, please contribute back the changes.