This site has been deprecated. Do not edit pages here. Please visit the new Pico Labs documentation.


Skip to end of metadata
Go to start of metadata
Deprecated

This module is no longer supported in the KRL system.

Draft Specification

This integration with XDI is currently under development.

Issues:

  • xdi:create_new_graph() does not check the validity of the information that is passed. Developer should use a combination of xdi:has_account() and xdi:lookup() to verify account information

Account creation

has_account

                returns: 0|1

Predicate: Check to see if the current Kynetx account has an XDI account configured

create_new_graph

Local AccountGlobal iName
<map> = {
  ‘iname’ : <string>,
  ‘secret’ : <string>
}
<map> = {
  ‘iname’ : <string>,
  ‘secret’ : <string>,
  ‘inumber’ : <string>,
  ‘endpoint’ : <url>
}
Creates a kynetx local XDI account; ie: =kynetx*<string>Links KRL account with globally resolvable XDI server

 

flush_xdi

Nuclear.  Removes XDI information and deletes graph (wipe clean for testing)

Account information:

iname

                returns: string | undef

inumber

 

               returns: string | undef

lookup

returns array: [iname, inumber, endpoint_url]

Use resolution services to find the inumber and endpoint of an iname

returns: 0|1

Check the Kynetx (local) repository for a configured xdi account, takes the <iname> provided, prepends the ‘users’ iname as defined in kns_config.yml; ie: =kynetx*headSock

global_definitions

              returns: array of definitions map

                ex:

'+(+name)+fr' => {

    'fields' => [

      {

        'field_type' => '$json$string',

        'contexts' => [

          '+(+formal)',

          '+(+suffix)',

          '+(+legal)',

          '+(+prefix)',

          '+(+full)',

          '+(+informal)',

          '+(+middle)',

          '+(+preferred)',

          '+(+last)',

          '+(+first)'

        ],

        'name' => '+(+name)',

        'label' => 'Nom',

        'description' => ''

      }

    ],

    'mtype' => 'attribute',

    'locale' => '+fr',

    'label' => '+(+name)',

    'key' => '+(+name)+fr'

  },

  '+(+name)+en' => {

    'fields' => [

      {

        'field_type' => '$json$string',

        'contexts' => [

          '+(+formal)',

          '+(+suffix)',

          '+(+legal)',

          '+(+prefix)',

          '+(+full)',

          '+(+informal)',

          '+(+middle)',

          '+(+preferred)',

          '+(+last)',

          '+(+first)'

        ],

        'name' => '+(+name)',

        'label' => 'Name',

        'description' => 'A human-readable string used to identify a specific person, company, place, etc.'

      }

    ],

    'mtype' => 'attribute',

    'locale' => '+en',

    'label' => '+(+name)',

    'key' => '+(+name)+en'

  }

local_definitions

Returns a list (in the usually definitions format) of locally definitions

Format for xdi:global/local_definitions() is still in flux as requirements for creating dynamic forms are still being developed

XDI CRUD

add

get

mod

del

 

 

 All CRUD operators should accept either a single string as an xdi statement or an array of XDI statements

 

XDI utility methods

tuple

returns the first tuple that matches the parameters passed <string>| regex | undef

tuples

returns the tuples that match the parameters passed <string>| regex | undef

properties

shortcut for xdi:tuples(graph,[<key>,’()’,undef])

equivalents

shortcut for xdi:tuples(graph,[<key>,’$is’,undef])

all_literals

shortcut for xdi:tuples(graph,[/.+/,’!’,undef]) 

literal

shortcut for xdi:tuples(graph,[<key>,’!’,undef])

set_link_contract

Sets the link contract to allow access for the current ruleset to the user graph

 

 

Labels: