Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
JSON APML RFC
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David P. Novakovic  
View profile  
 More options Dec 11 2007, 7:14 pm
From: "David P. Novakovic" <davidnovako...@gmail.com>
Date: Wed, 12 Dec 2007 10:14:27 +1000
Local: Tues, Dec 11 2007 7:14 pm
Subject: JSON APML RFC
Request for comments on this proposal for APML-JSON. Cheers.

APML JSON

Rationale

As more and more web applications become APML aware there will be
services delivering "APML-Like" data as JSON, often converted directly
from APML itself. This document seeks to outline a sane specification
for JSON-APML to take the guess work out of it for developers seeking
to do work with APML in Javascript, or even seeking a lightweight
alternative to APML itself. Henceforth in this document the original
APML spec will be referred to as "APML" and the new JSON specification
will be referred to as "APML-JSON".

For the most part this specification will mirror the original APML
specification as closely as possible. The largest difference is that
where a NodeList of Concept/Source nodes with "key" attributes exist
in the APML spec now are replaced with keyword indexed values in a
JSON associative array. This will become clearer in the example.
Another relatively large difference is the use of camelCase for keys
that are capitalised in the XML nodes, rather than all caps. This is a
compromise between the reccomendation of W3 for using no caps with
underscores and the APML all caps way. Naturally people will do what
they want. ;)  Additionally, with  the JSON version, if fields are
missing, they are just assumed to be empty, this saves having to
transmit redundant markup.

To see an example of javascript using JSON with this notation, head
over to Ben Novakovic's example at http://bmn.name/examples/apml/ .
Look at the source to see the javascript.

Basically the root element contains two main parts, the head and the body:

{
    "head":{},
    "body":{}

}

The head contains some metadata:

"head": {
    "version": 0.6,
    "title": "Example APML-JSON file for apml.org",
    "generator": "Written by Hand",
    "userEmail": "sam...@apml.org",
    "dateCreated": "2007-03-11T01:55:00Z"

}

Then the body contains some profiles and also has a default profile:

"body": {
    "defaultProfile": "Work",
    "profiles": {}

}

Each profile contains explicitdata and implicitdata

"profiles": {
    "work": {
        "implicitData": {},
        "explicitData": {}
    }
    "home": {
        "implicitData": {},
        "explicitData": {}
    }

}

Explicit data and implicit data are similar with slightly different
attribute, so we'll look aty implicit ones here. There will be
examples of others in the example APML-JSON file that will be at the
end of this documents. Data can be in the form of sources or concepts.

"implicitData": {
    "concepts": {
        "attention": {
            "value": "1.0",
            "from": "",
            "updated": "2007-03-11T01:55:00Z"
        },
        "content distribution": {
            "value": "1.0",
            "from": "GatheringTool.com",
            "updated": "2007-03-11T01:55:00Z"
        }
    },
    "sources":   {
        "http://feeds.feedburner.com/apmlspec": {
            "name": "APML.org",
            "value": "1.0",
            "type":  "application/rss+xml",
            "value": "0.4"
        }
    }

}

Sources can also contain an Author.

"http://feeds.feedburner.com/apmlspec": {
    "name": "APML.org",
    "value": "1.00",
    "type":  "application/rss+xml",
    "value": "0.4"
    "author": {
            "key": "Sample",
            "value": "0.5",
            "from": "GatheringTool.com",
            "updated": "2007-03-11T01:55:00Z"
    }

}

So here we have a full example:

{
    "head": {
           "version": "0.6",
           "title": "Example APML-JSON file for apml.org",
           "generator": "Written by Hand",
           "userEmail": "sam...@apml.org",
           "dateCreated": "2007-03-11T01:55:00Z"
    },
    "body": {
        "defaultProfile": "Work",
        "profiles": {
            "work": {
                "implicitData": {
                    "concepts": {
                        "attention": {
                            "value": "0.1",
                            "from": "",
                            "updated": "2007-03-11T01:55:00Z"
                        },
                        "content distribution": {
                            "value": "0.1",
                            "from": "",
                            "updated": "2007-03-11T01:55:00Z"
                        }
                    },
                    "sources":   {
                        "http://feeds.feedburner.com/apmlspec": {
                            "name": "APML.org",
                            "value": "1.00",
                            "type":  "application/rss+xml"
                            "author": {
                                    "key": "Sample",
                                    "value": "0.5",
                                    "from": "GatheringTool.com",
                                    "updated": "2007-03-11T01:55:00Z"
                            }
                        }
                    }
                },
                "explicitData": {
                    "concepts": {
                        "attention": {
                            "value": "0.1"
                        },
                        "content distribution": {
                          "value": "0.1",
                        }
                    },
                    "sources":   {
                        "http://feeds.feedburner.com/apmlspec": {
                            "name": "APML.org",
                            "value": "1.00",
                            "type":  "application/rss+xml"
                            "author": {
                                    "key": "Sample",
                                    "value": "0.5",
                            }
                        }
                    }
                }
            },
            "home": {
                "implicitData": {},
                "explicitData": {}
            }
        },
        "applications": {
            "sample.com": {
                "sampleAppEI": {}
            }
        }
    }


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
TSchultz55  
View profile  
 More options Dec 12 2007, 6:45 am
From: TSchultz55 <TSchult...@gmail.com>
Date: Wed, 12 Dec 2007 03:45:20 -0800 (PST)
Local: Wed, Dec 12 2007 6:45 am
Subject: Re: JSON APML RFC
Very nice.

Not too familiar with JSON - could you possibly also supply some
examples of how one could extract this information in JavaScript?

Ex:  Show me all ImplicitData Concepts for my "Home" profile.

On Dec 11, 7:14 pm, "David P. Novakovic" <davidnovako...@gmail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David P. Novakovic  
View profile  
 More options Dec 12 2007, 6:55 am
From: "David P. Novakovic" <davidnovako...@gmail.com>
Date: Wed, 12 Dec 2007 21:55:44 +1000
Local: Wed, Dec 12 2007 6:55 am
Subject: Re: [APML] Re: JSON APML RFC
Yep, check out the source at http://bmn.name/examples/apml/ in
particular you want the function "parseAPML"

very simple! A lot simpler than the code required to parse XML, hence
this suggestion :)

Never fear though, Paul has asked me to provide an XSLT template, so
soon you will be able to convert APML to JSON with minimal of fuss.

David

On Dec 12, 2007 9:45 PM, TSchultz55 <TSchult...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Novakovic  
View profile  
 More options Dec 12 2007, 7:24 am
From: Ben Novakovic <bennovako...@gmail.com>
Date: Wed, 12 Dec 2007 04:24:24 -0800 (PST)
Local: Wed, Dec 12 2007 7:24 am
Subject: Re: JSON APML RFC
TSchultz55, JSON is native serialized javascript objects, hence the
JavaScript Object Notation. To parse JSON text into javascript object,
you can simply call eval() around the string. That example script
returns the JSON string wrapped in the parseJSON function call, the
browser then hands the eval()d string to the parseAPML function. As a
result, the parseJSON function just processes the APML JSON data as if
it were native objects.

If you want to read more, you can checkout the wikipedia page
( http://en.wikipedia.org/wiki/JSON ) or the JSON website ( http://json.org
)

Hope this helps.

Ben.

On Dec 12, 9:45 pm, TSchultz55 <TSchult...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Novakovic  
View profile  
 More options Dec 12 2007, 7:34 am
From: Ben Novakovic <bennovako...@gmail.com>
Date: Wed, 12 Dec 2007 04:34:55 -0800 (PST)
Local: Wed, Dec 12 2007 7:34 am
Subject: Re: JSON APML RFC
TSchultz55 - to give you a solution to your example request, see
below.

/*
 * parseAPML javascript function
 * prints all ImplicitData Concepts for the "Home" profile.
 */

// o is a javascript APML object representation
function parseAPML(o) {
        var s = '';
        //grab the implicitData node in the 'Home' profile
        var home = o.body.profiles.Home.implicitData;
        for(var k in home) { // for each of the implicit concepts
                s += k + "\n";
        }
        alert(s); //alert the resulting values

}

On Dec 12, 10:24 pm, Ben Novakovic <bennovako...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Novakovic  
View profile  
 More options Dec 14 2007, 6:13 am
From: David Novakovic <davidnovako...@gmail.com>
Date: Fri, 14 Dec 2007 03:13:49 -0800 (PST)
Local: Fri, Dec 14 2007 6:13 am
Subject: Re: JSON APML RFC
Ok, I found a problem with the spec, it doesn't allow for multiple
authors.

I'll fix that in the version I post to the Wiki.

David

On Dec 12, 10:14 am, "David P. Novakovic" <davidnovako...@gmail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »