Difference between revisions of "Exploring data formats"

From Kosmos Wiki
Jump to navigation Jump to search
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Methods of structuring data =  
+
== Resources ==
  
== Server Credentials ==
+
* http://jasnell.github.io/w3c-socialwg-activitystreams/activitystreams2.html#extensibility''Italic text''
 +
* http://pin13.net/mf2/?url=http%3A%2F%2Fsocialwg.indiewebcamp.com%2Firc%2Fsocial%2F2015-06-05
 +
* https://developer.gitter.im/docs/messages-resource
 +
* http://rdfs.org/sioc/spec/#sec-overview
 +
* http://json-ld.org/playground/
  
=== AS2 ===
+
== Formats ==
  
{
+
=== Server Credentials ===
  testing: 'code block'
+
 
}
+
==== AS2 ====
 +
 
 +
  {
 +
    ...
 +
    "context": "irc",
 +
    "@type": "..." // could be 'create', 'add', 'author'... whatever we choose, this open for discussion
 +
    "actor": {
 +
      "@id": "irc://howard@irc.freenode.net",
 +
      "displayName": "howard"
 +
    },
 +
    "object": {
 +
      "@type" : "credentials",
 +
      "nick": : "howard",
 +
      "password": "radical",
 +
      "server": "irc.freenode.net",
 +
      "port": 1234,
 +
      "secure": true,
 +
      "altNicks": [ "howardtheduck", "famousduck" ] // this property would need to be added to the schema
 +
    },
 +
    "target": "irc://irc.freenode.net"
 +
  }
 +
 
 +
==== SIOC/Kosmos ====
 +
 
 +
Account:
 +
  {
 +
    "@context": "https://kosmos.org/ns/v1",
 +
    "@id": "accounts-irc/freenode/raucao",
 +
    "@type": ["UserAccount", "IrcAccount"],
 +
    "username": "",
 +
    "password": "",
 +
    "join": ["67p", "kosmos", "kosmos-dev"],
 +
    "channelUriTemplate": "messages/irc/freenode/{join}",
 +
    "server": {
 +
      "@id": "accounts-irc/freenode",
 +
      "@type": ["Space", "IrcServer"],
 +
      "host": "irc://irc.freenode.net",
 +
      "port": 6679,
 +
      "tls": true
 +
    },
 +
    "nickServ": {
 +
      "account": "binbasti",
 +
      "password": "123456"
 +
    }
 +
  }
 +
 
 +
 
 +
Space/server:
 +
 
 +
  {
 +
    "@context": "https://kosmos.org/ns/v1",
 +
    "@id": "accounts-irc/freenode",
 +
    "@type": ["Space", "IrcServer"],
 +
    "host": "irc://irc.freenode.net",
 +
    "port": 6679,
 +
    "tls": true
 +
  }
 +
 
 +
=== Messages ===
 +
 
 +
One day of chat messages in one channel, with e.g. the RS key <code>/irc/freenode/kosmos/2015/01/01</code> in the <code>messages</code> category:
 +
 
 +
  {
 +
    "@context": "https://kosmos.org/ns/v1",
 +
    "@id": "messages/irc/freenode/kosmos/",
 +
    "@type": "ChatChannel",
 +
    "name": "#kosmos",
 +
    "ircURI": "irc://irc.freenode.net/#kosmos",
 +
    "today":  {
 +
      "@id": "2015/01/01",
 +
      "@type": "ChatLog",
 +
      "messageType": "InstantMessage",
 +
      "previous": "2014/12/31",
 +
      "next": "2015/01/02",
 +
      "messages": [
 +
        { "date": "2015-06-05T17:35:28.454Z", "text": "Hi!" },
 +
        { "date": "2015-06-05T17:35:28.454Z", "text": "Hi!" },
 +
        { "date": "2015-06-05T17:35:28.454Z", "text": "Hi!" },
 +
        { "date": "2015-06-05T17:35:28.454Z", "text": "Hi!" },
 +
        { "date": "2015-06-05T17:35:28.454Z", "text": "Hi!" },
 +
        { "date": "2015-06-05T17:35:28.454Z", "text": "Hi!" }
 +
      ]
 +
    }
 +
  }
 +
 
 +
And its context:
 +
 
 +
  {
 +
    "@context": {
 +
      "kosmos": "https://kosmos.org/ns/#",
 +
      "sioc": "http://rdfs.org/sioc/ns#",
 +
      "sioc:container_of": "messages",
 +
      "kosmos:today": "today"
 +
    }
 +
  }

Latest revision as of 18:34, 5 June 2015

Resources

Formats

Server Credentials

AS2

 {
   ...
   "context": "irc", 
   "@type": "..." // could be 'create', 'add', 'author'... whatever we choose, this open for discussion
   "actor": {
     "@id": "irc://howard@irc.freenode.net",
     "displayName": "howard"
   },
   "object": {
     "@type" : "credentials",
     "nick": : "howard",
     "password": "radical",
     "server": "irc.freenode.net",
     "port": 1234,
     "secure": true,
     "altNicks": [ "howardtheduck", "famousduck" ] // this property would need to be added to the schema
   },
   "target": "irc://irc.freenode.net"
 }

SIOC/Kosmos

Account:

 {
   "@context": "https://kosmos.org/ns/v1",
   "@id": "accounts-irc/freenode/raucao",
   "@type": ["UserAccount", "IrcAccount"],
   "username": "",
   "password": "",
   "join": ["67p", "kosmos", "kosmos-dev"],
   "channelUriTemplate": "messages/irc/freenode/{join}",
   "server": {
     "@id": "accounts-irc/freenode",
     "@type": ["Space", "IrcServer"],
     "host": "irc://irc.freenode.net",
     "port": 6679,
     "tls": true
   },
   "nickServ": {
     "account": "binbasti",
     "password": "123456"
   }
 }


Space/server:

 {
   "@context": "https://kosmos.org/ns/v1",
   "@id": "accounts-irc/freenode",
   "@type": ["Space", "IrcServer"],
   "host": "irc://irc.freenode.net",
   "port": 6679,
   "tls": true
 }

Messages

One day of chat messages in one channel, with e.g. the RS key /irc/freenode/kosmos/2015/01/01 in the messages category:

 {
   "@context": "https://kosmos.org/ns/v1",
   "@id": "messages/irc/freenode/kosmos/",
   "@type": "ChatChannel",
   "name": "#kosmos",
   "ircURI": "irc://irc.freenode.net/#kosmos",
   "today":  {
     "@id": "2015/01/01",
     "@type": "ChatLog",
     "messageType": "InstantMessage",
     "previous": "2014/12/31",
     "next": "2015/01/02",
     "messages": [
       { "date": "2015-06-05T17:35:28.454Z", "text": "Hi!" },
       { "date": "2015-06-05T17:35:28.454Z", "text": "Hi!" },
       { "date": "2015-06-05T17:35:28.454Z", "text": "Hi!" },
       { "date": "2015-06-05T17:35:28.454Z", "text": "Hi!" },
       { "date": "2015-06-05T17:35:28.454Z", "text": "Hi!" },
       { "date": "2015-06-05T17:35:28.454Z", "text": "Hi!" }
     ]
   }
 }

And its context:

 {
   "@context": {
     "kosmos": "https://kosmos.org/ns/#",
     "sioc": "http://rdfs.org/sioc/ns#",
     "sioc:container_of": "messages",
     "kosmos:today": "today"
   }
 }