Small ideas, loosely coupled.

I recently got a little bit worried, spending most of many years advocating a timbl world view, don’t try anything clever with your software.

Damn you, stupid dannys. Just another kind of

foaf:Agent

I assume the schema.org has the same world view. You just cut everything down to a shared notion of communication we can understand. Something like HTTP.

Still true, innit.

Fielding still has a posse.

Contrast

Recently I had two poles apart ideas, both probably symptomatic of my recent mania, but please forget  their nativity, please look at them without that. Although I can only describe this way.

So one was “Always ON”. I’ve been a bit blabbly forever, enjoyed having a blog. Rare original ideas, but loving to tell people about the nice things I’d seen

Then concurrently I had two things going at my head at once. My lovely girlfriend had come back after some bad times, and I had a friend Julian staying. With the girlfriend, we would have those stupid rows, where you’d end up saying “I didn’t say that!”. So you wish you had a tape recorder to say, yes you did! She also suggested we get a dictafonic thing, record stuff to note down later.

Same time, I would see Julian doing his music stuff, and he’s do it all day. Seriously, he’s practice the same song for about 12 hours a day, and only tweak one little phrasing or a note somewhere from one day to the next. He’d often get worried about his progress, and I just wanted to say “listen!”. today – yesterday. Diffs.

The idea of Always ON. You record everything, audio, visual, fall back on a pen and paper. I’f you can’t do surround, just do audio. The dictaphone I got, bought something like a 16G card in it, with that, crappy voice compression stuff going on, that’s about a year’s worth of audio.

Why not video everything all the time? Record everything all the time? Share it all, show other people that we are human just like you. Ooops.

This is so obvious, and I know all those Californians have been there already. But when you start applying to your own life, thingz getz a bit weird.

The bits you, he, she or I might feel bad about. The relationship I have with this woman is about our interpretation of it, not the literals. Fairly sure I recorded a few rows, and no doubt inappropriate grunty noises at other times, then felt obliged to delete them. You just can’t do that. Not even if you are GCHQ, as if they’d ever ask first.

Also I kept losing dictaphones, oh dear.

Always ON. Get everything recorded, so I won’t miss that bit of birdsound, for my ambient CD. If anything ever happens to  that woman I love, I’ll have this lovely history, warts & all, to refer back to.

I’ll come back to this, but imagine reality has a timeline.

So that is Always ON, an idea I guess I’ve been building up to for decades.

But in the space of a couple of hours travelling, I came up with the Contrast.

Always OFF.

Not some nihilist bullshit, but actually quite a positive idea.

I’d been down to pick my mother up from Pisa airport. She been flying, so was knackered, I’d been up early, after a manic phase, so I was a bit tired too.

We’d done all that “no seen you in ages” hugs things, she’d already told me a Friend of a friend had said my father had said I was depraved, over some rubbish I’d said on Facebook.

Forget that. I wanted to know how to make some nice conversation, mental huggies.

So, how are you getting on with your novel then?

She, like me, has struggled with such stuff forever. Both have the same kind of hangups, would prefer to teach other people how to write than actually doing something original. Oddly enough, me dad has done a novel, hopefully published one day.

I’m thinking how the plot & characters move, but couldn’t be arsed getting pen & paper out. As little FOAF (gloggle it!) faces. Pretty much sorted it all out in my head.

Hang on, all in my head. Like the novel I’ve written. My own little virtual world, just internal to my skull. Except…

Maybe a bit in the rest of my body. Might have been that Michael Mosly rang to say that if you add up all the neurons in a human digestive tract, it works about the same as a cat brain.

My point being that the things that happen in all the synapses, it is just as real as the rest of it. Eyes might deceive a bit, but this is the VM we’re in.

Slightly distracted there, but it is very like the Geoff Hinton thing, compress the whole of the human race’s texts down to about 4 bit, you can reconstruct it the other side. I reckon that’s how mammalian, possibly saurian/chicken sexuality works. It just gets compressed down, to tell the front end bits whether to expand or not. Go on, Sex and Deep Learning, that has to be 9 column inches in The Mail…

I do think our current notions of what the universe is like owes more to bad 1960’s science fiction. cf. Matrix. But in one form or another, we do exist as information, somewhere, sometime. Which is kinda nice for atheists like me, all those nice things that have happened still exist, if you give the universe a timeline. Even works for the dietary-botherers. Same universes.

None of the universes cares at all, but there is satisfaction to be to be had by being in a flash of existenz when you hand your doggies a handful of peanuts. Jua-du-arrrrr-vive, as the French pirates say.

Even your every thought is there. Don’t get paranoid otherwise I’ll tell you why my dad thinks I’m depraved.

We don’t need to be always on or always off. Many teenage philosophers have reached that understanding already. Without a hard life, then sitting under a tree for a while.

SPARQL templating for fun and profit

tldr: SPARQL with a simple templating language gets incredibly powerful.

Hateful WordPress, must get my own host back up + silly danny code up again soon (will be hyperdata.it this time around, remind me to make that live soon).

Lost half of this doc because WP doesn’t do Job One. Oh sorry, wrong link, but I believe DanC is a good church-goer, so not too far off the mark. This is the more practical Job One (ymmv).

So Mr. DuCharme, take browser stuff, pump it through templating.

GRAPH ~{here}~

No sure that’s the best syntax, but it’s just a little config thing to make Mustache templating (presumably others too) recognise a slightly different marker for placeholders. I chose that to save me getting confused because of SPARQL’s big use of Mustaches {} .

I was able to make an editable site without even thinking, a Wiki that we’ve been using internally, it just works. Just use SPARQL Update, use Mustache templating on the queries/updates. Can do anything from the browser, little bit of jQuery for shinies to help, it’s Ajax bits don’t take a lot of thought. Fuseki is a very nice bit of code (thanks AndyS, Jena team). I’m sure the OpenLink stuff is too, but I get a bit scared because that seems to try to do too much. Nice that it uses the same endpoint for query and update, Kingsley or one of his awesome crew will no doubt correct me there. We all know it’s not SPARQL stores aren’t quite RESTful, but these things do solve a lot of problems in a straightforward fashion. At least it’s not Ajax with the last letter standing for XML, been there, done that, nice idea but it doesn’t simplify things. Can only be hypermedia to do this kind of stuff, webbishness. I think that Turtle gets there, opening the door to hyperdata, but even that can be a struggle sometimes. Can only be hypermedia to do this kind of stuff. It does seem like an uphill struggle, but all you really need is links in there, even PDFs can do that, despite the painful proprietary angle. Konwabueno innit, need to make sure i18n is in there too. RDF tends to be pretty good on that front, is pretty much native, timbl ftw. I haven’t even tried some of the other graph data store, the name/pointer kinda stuff, worries me that, like JSON, they don’t have URLs as native (JSON-LD ftw there, though I did wish they’d have let me flip the syntax over, put the simple JSON first, schema stuff, disambiguation after, more likely to engage the poor old API builders, IMHO).

Beware that despite it being a Recc, different stores have slightly different conventions for query/update URLs, not all support simple POSTing/PUTing of an RDF format (Fuseki does, and it’s even now got an Apache security mechanism available, thanks small gods).

With the project I was , am, working on I wound up doing rather a crude regex hack to shift the prefixes to the top, drop the @ from prefixes and add a dot (or the other way around, I forget which, another slight non-intuitive thing I’m afraid, just have to get over it, there was probably a good reason, like most W3C specs, ymmv again, but I couldn’t be arsed looking at the proper syntax def, sorry, not entirely i18n’d that phrase, but one does need simple answers, not that huge hornet buzzing around in autumn).

Only really posting to point Bob DuCharme at this idea, hoping to prompt maybe another book from him… (mine Gott, looks like you can even rent the pages, though I I suspect Bob’s got most of the material online somewhere anyway).

So, I love the SPARQL Protocol and RDF Query Language (naming recursion pretty much halts at RDF, the Resource Description Framework) . If you do code anywhere near the web, you should know it.

Before SPARQL arrived, I hated it. I’d had a few years in a sysadmin job which involved lots of SQL. Anything that looked like that quasi-relational nonsense, run a mile. (Looks like the Database Debunkers have gone offline, but check out anything by a guy called Date, or just that original paper which tells proper relational, I forget it’s author, but that makes sense, even though it’s a bit mathsy).

Thing is, RDF is a graph structure, so you can project it in every kinda way. Can look like a graph, a tree or even tables. Or just triple after triple. All the way down.

But when it did arrive, and I played, it turned out to be awesome. So much so I named a lovely cat for it (ok, not exactly, SPARQL is SPARQL, the lovely moggie was Sparql, see what I did there, syntax monsters?).

I can’t remember if there was actually a vote on it, but I know I favoured the approach to a query language as proposed by Uche & co. Pointerish things, taking you through the graph. But what was accepted seemed a monstrosity that looked painfully like SQL :

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name
WHERE {
   ?person foaf:name ?name .
}

But please take it from me, it’s a lot better than it looks.

Sorry I ran out of steam on this post. But if you got this far I’m sure you can think it through. Create SPARQL queries using a simple, well-tested templating thingy (like Mustache) to fill in the blanks, like graph name (just use the namespace, no?). Is very easy to get creative with simple queries and updates (SPARQL 1.1). These templating thingys support conditionals and basic loops etc. I did wind up with loads of cruft, because it was so easy to try things. And I nearly didn’t get remotely near the requirement spec when I got confused over FROM and FROM NAMED (isn’t very intuitive, IMHO agin, get the wrong SPARQL store config (easily done) and it just stops working).

Yeah, take that, and hopefully you can run with it, yet another IMHO.I have been around this stuff a long while, so there’s at least a 50/50 chance of it working

Web APIs are an Anti-Pattern

[draft – publish early/often…]

I know this sentiment has been expressed elsewhere, but I thought I should add my €0.02 (if I haven’t already). In short, most Web APIs aren’t Webby. If you need to call it an API you’re probably doing something wrong

fielding-has-a-posse

Thing is, APIs over HTTP continue to proliferate yet the vast majority have a fundamental flaw : they’re inherently incompatible. If you wish to say, programmatically post to Twitter and post to Facebook, you currently have to build separate blocks of code for each, each converting from your internal representation.

There is quasi-standardization. It’s typical to use standard HTTP methods (often limited to GET and POST) and use JSON as the payload. This is often described as being RESTful. Nothing could be farther from the truth.

ref. ProgrammableWeb

The key bits that are missing are Identification of resources and Hypermedia as the engine of application state.

[TODO fill this out]

ref. Mike Amundsen, hypermedia

JSON is a very nice way of representing data. However for the Web, it lacks a crucial requirement: native support for links. It’s not hypermedia. But it can be made hypermedia fairly transparently using JSON-LD.

HTML is the definitive hypermedia, but its support for arbitrary data (the kind that APIs in general may wish to pass around) is rather clunky, see RDF-A, microdata, microformats.

The answer : just use HTTP (with your preferred representation(s)).

The inimitable Paul Downey (@psd) expresses this well by flipping it on it’s head: Web APIs Are Just Web Sites.

[TODO – mention Hydra –  plus hydra-middleware – via @bergi_bergos ]

I’m biased by having used RDF for a long time, my preferred approach is to :

  • use RDF representations internal to the app
  • expose a Turtle representation (using content negotiation) alongside those of HTML etc.

The Quantum Thing

a starter for a sci-fi story that came to me earlier during nap, typed madly on waking. Still not got around to starting The Novel, one baby step at a time…

Of course it was the Quantum thing that made all the difference. that, followed a week later by the Singularity. Two of the most groundbreaking shifts in the evolution of life happening near-simultaneously, millenia after the last one, that being the old agriculture thing.

Quantum had come in first of all because of Tapping – being able to move something from A to B with a simple gesture was rather compelling. 70% of the world’s population converted by the end of day one, an amusing variety of strategies led to 95% by the end of day two, now the hold-outs were down to proportions close to those of quantum dimensions.
Lucky some folks had the foresight to start taking notes early on, having that on the humanity-public records was useful.

Then Moving almost immediately made a huge difference to most people’s lives. Being able to teleport with he minimum of thought got stuff going a lot faster, literally. Predictably it was those people without cars got it first. But now most people only use it a few times a day, walking regaining its early appeal. Along with singularity, a lot of other dominoes began falling.

So once everyone had got Tapping and Moving, we got the Singularity, and the human race had found its feet again, again literally, begin again. Incidentally, Sir Tim finally got the respect he was due for open-sourcing the Web, without which the Quantum thing might have taken another few centuries.

And here I am, another part-time, open source historian, adding to the new library of Alexandria in the only way achievable, proper old-fashioned sharing, facilitated by Quantum, curated by Singularity.

 

Seneca, or how this is another several minutes of our worthless lives we will never get back, or maybe we will, in another life, somewhere

Was just prompted to poke into another of my past lives by a tweet which referred to a blog post about the Stoic philosopher Seneca. The blog post in question is a fairly cookie-cut Positive Thinking piece of semi-great/semi-bullshit quoting said philosopher. Don’t get me wrong, I already like Maria‘s material (twitter following), just this one gives me a little cognitive dissonance.

Alas, as on various other totally uncorrelated topics, I know way too much about Seneca. Thing is, years back, I lived for about a year in Cordoba, in the hot bit of Spain, where Seneca hailed from. I shared a flat* with an erstwhile Beat Poet there, David Hoyt*. He was an English teacher, serious drunkard, extremely well read for someone from the noisier side of the Atlantic, he would have been a surprise this side, say in the toilets of the British Museum, truly. Anyhow, he told me all about Seneca.

Key bit, in the context of living for today, et cetera : Seneca was told by Nero to kill himself, and complied. Some tweets write themselves, way less than 140 chars.

  • the “flat” was in an ancient courtyard about 50 yards from the Mezquita, was the barest minimum you could put around your head and call it a living space. Bare power wires below the shower I never got around to fixing, frisson innit.
  • I have 1001 stories about David. Little one is just his name. His surname is Hoyt, Spanish “today” + t, mine is Ayers, yesterday + s. Knew we’d get on ok when he spotted that within seconds either way of me spotting it. Well, that and the fact he cracked up laughing at mine & Nicholas’ grammar, sitting in front of a sign reading “tengo hambre“. Immediately took us for a drink, his preference Cuba Libre.

Local-to-me-now connections I wasn’t aware of:

Dante placed Seneca in the First Circle of Hell, or Limbo. Seneca makes an appearance as a character in Monteverdi’s opera L’incoronazione di Poppea.

Girolamo Cardano in his apologia of Nero, Neronis Encomium Basel, 1562,[19] claims Seneca was a fraud, a fake philosopher, a corrupter of Nero, and that he deserved death.

I forget the literary term, but Seneca was from the branch of classical letters that today’s scholars would call fucking miserable. Think Roman-era Morrissey, with obligatory narcissus up his bum. His best-known work is probably Phaedra, his rewrite of a jolly old greek yarn about infidelity and swords, the falling on of.  As the Chorus say, Lucius Annaeus Finnegan, begin again.

The blog post mentioned above is actually quite sweet, I do want to read more of this person’s material. But must be close on 140 chars calling something The Shortness of Life: Seneca on Busyness and the Art of Living Wide Rather Than Living Long.

For want of a nail

Damnit!

I’ve just been trying to replace the PSU in the music room computer with an old, working one. Was going fine until I got to a drive connector, SATA on the one I was replacing, doesn’t exist on the older replacement.

I checked last night to see roughly how much a new PSU might cost, is in the region of €25, sourced locally a wee bit more. I spent my last $$$ soon after on medication to see me through the week. No point in asking the girlfriend to front me on this, she’ll only point out that I’ve easily spent that much on booze in the past week.

Now this might not seem a big deal, but that power supply means whether or not the music room as a whole can function. Right now the music room functioning is a prerequisite for a danny project that I’ve been calling the best idea I’ve ever had, probably the best idea I’ll ever have. We’re talking magnum opus here. Defining moment in this otherwise inconsequential life. Feeling derailed over a €25 PSU. Damn, that’s a painful place to be in. (Afraid I can’t reveal what the project is, for it to work it has to be presented as a fait accompli, proper press release etc.).

Stand back, breathe deeply. Is it actually in the critical path? Well no, I guess could work around it: I’ve got a clunky old stereo A/D-D/A thing I could use with Rosegarden or somesuch on this laptop.

Is it time-sensitive? Well, not so much I guess. Still plenty of other bits to get out of the way as well, some of them involving a lot of work. Part of the reason I believe the project will work is because of it’s audacity and originality. It is very simple conceptually, I’ve no doubt it’s been thought of a thousand times before. But implementation-wise that’s another story. My rather, erm, eclectic, skill set means I know how to pull all the necessary parts together. Most people would be blocked on some aspect, would file it away and move on. Is anyone else likely to come up with the same idea and build it in the next month or so? (The time before my next paycheck is likely). Seems very improbable.

So, no reason to panic. But still a bit demoralising that I could have got into a situation where €25 could be a major issue, at the age of 51, for heaven’s sake.

Oh well, another cliche to add to the litany.

For want of a nail the shoe was lost;
For want of a shoe the horse was lost;
For want of a horse the battle was lost;
For the failure of battle the kingdom was lost.

All for the want of a horse-shoe nail.

– possibly first used in full about Richard III (of rhyming slang fame) at Bosworth. Source (obviously) Wikipedia.