Re: Hungarian data for read-write apps

great points! i'm first going to try it out to see how it works, and
then i'm sure i'll move it around still. nevertheless, some comments
inline:

On Sat, May 12, 2012 at 12:40 PM, Markus Sabadello
<markus.sabadello@gmail.com> wrote:
> Hey Michiel,
>
> Interesting, so this would basically be an alternative to the RDF data model
> or other semantic data models, right?

i would say it's a way to improve them. for instance, we can improve
the following json-ld example:

{
  "@context": "http://json-ld.org/contexts/person",
  "name": "Manu Sporny",
  "homepage": "http://manu.sporny.org/",
  "depiction": "http://twitter.com/account/profile_image/manusporny"
}

by Hungarianizing it as follows:

{
  "@context": "http://json-ld.org/contexts/person",
  "hName": "Manu Sporny",
  "phHomepage": "http://manu.sporny.org/",
  "pDepiction": "http://twitter.com/account/profile_image/manusporny"
}

we've indicated that name is a human-readable string, but homepage is
not. it's /the URL of/ a human-readable string. depiction is also a
url, but the document it points to is not human-readable.

i haven't quite worked out whether we should distinguish strings from
documents or treat them as the same thing. in fact i haven't worked
out most of it yet, but i think especially the indication that
something is the URL rather than the contents of a document, and that
something is a string description rather than an attributes map, are
important to keep track of.

>
> I think it's great, but here are some ideas:
>
> * It took me a while to figure out what you meant by "hash". First, I
> thought it would mean that the value of that attribute is a cryptographic
> hash of something. Only then I realized that you meant hash in the sense of
> e.g. Perl, i.e. an associative array. Maybe a better word would be "map" ?

yeah, i have the same problem. i try soo hard not to say 'JSON
object', but i keep doing it. :) i agree hash is not the best choice.
it actually means a third thing; window.location.hash is the
fragment-part of a URL, after the 'hash sign'. so 'map' or
'dictionary' is better, i'm cool with 'map'.

>
> * In many data models I am familiar with, there is a distinction between
> "relations" (to other things) and "literals" (strings, scalars, booleans,
> etc). But I kind of like how you say everything is a "relation" between
> "things".

yeah, well, you can also say predicates/attributes are first-class
citizens of the world, it doesn't change much to the eventual variable
naming.

>
> * I think you use the word "statement" ambiguously. First, you say we can
> describe the real world as a set of "statements", each one of which contains
> a "relation" between "things". But then later you use the word "statement"
> to refer to boolean objects.

not statement to refer to boolean - a statement can have a
description, and it can evaluate to true or false in the current world
or world view. maybe it's easier to say that a boolean answers a
'question' with yes/true or no/false. anyway, it's not so important,
booleans are just yet another type of literals.

>
> * Instead of "document", why not just say "string"?
>

yeah maybe. but 'a document about an object' sounds better than 'a
string about an object', and so does 'retrieving a document from the
web' as opposed to 'retrieving a string from the web'. otoh there are
other contexts (like person.hName) where string is more appropriate
than document.

> * I don't think you ever mention the notation for a document/string that is
> not an encoding of an object. E.g. how would you express that my first name
> is "Markus"? Would that be what you call human-readable language ("h") ?
>

i /think/ this should be person.hName but i'm not sure, because names
play a specific role in the world. they don't so much describe an
object as more act as a global variable name for them. so maybe we
need something special for names.

> * Your use of the words "thing", "object" and "variable" was also a bit
> confusing to me, but only when I read it first, at the second time it all
> made sense :)

yeah, i started writing 'thing' throughout and then replaced it with
'object'. 'variable' is used in the javascript sense of a variable in
a computer program.

>
> Anyway, I think it's a great approach.
> I guess terminology is always a big challenge when defining data models.
> The next step would probably be to define operations on the data!

yes, in fact i was thinking of defining view templates. you can define
a template (and mvc frameworks do this) that turn json into the html
for a <div> or other element in a page. so then basically that's
retrying to achieve xml's dream of stylesheets for displaying data
objects depending on their type. but these templates would then also
have functionality, and since in
http://www.w3.org/community/rww/wiki/Read-write-web-00#simple we now
have the start of an ajax API to the rww, we can write html5 apps that
edit the web. so the views would have buttons and edit controls
(something i think xslt never tried, right? that was/is always more
about displaying, i think?).

so yeah, 'rww mvc' is going to be my weekend project for this weekend :)

Received on Saturday, 12 May 2012 13:59:51 UTC