1 / 26

XDI Graph Patterns

This document contains XDI introductory materials plus illustrations of many standard XDI graph patterns: I-names, i -numbers, and synonyms: XDI statements used to assert multiple XRIs for the same logical resource

ivie
Télécharger la présentation

XDI Graph Patterns

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. This document contains XDI introductory materials plus illustrations of many standard XDI graph patterns: I-names, i-numbers, and synonyms: XDI statements used to assert multiple XRIs for the same logical resource Remote graphs and XDI discovery: statements used to describe and navigate the distributed global XDI graph Social graphs: relationships between XDI authorities Attribute singletons: contexts that contain a single literal value and can describe versioning of that value Attribute collections: contexts containing a collection of attribute singletons Entity singletons: contexts containing a single entity Entity collections: contexts containing a set of entity singletons Personas and roles:entities and relations that model contextual identity for individuals Link contracts: entities and relations used for XDI authorization Policy expression: conditional logic for rules evaluation Messages: XDI graphs used in the XDI protocol Dictionaries: machine-readableXDI ontology definitions XDI Graph Patterns OASIS XDI TC SubmissionDrummond Reed 2012-07-06

  2. XRI context symbols Global Context Symbols Symbol Context Meaning Examples = Globally unique identifiers controlled by natural persons =drummond =windley Individual Globally unique identifiers controlled by legal organizations (trademarks) @neustar @kynetx @ Institutional Globally unique identifiers controlled by the general public (generic nouns) +photo +email + Generic $and $or $ Globally unique identifiers controlled by standard bodies (e.g., XDI grammar) Specific Local Context Symbols Symbol Context Meaning Examples Locally unique identifiers that are assigned to a resource once and never reassigned (“i-numbers”) !1234 !4c3f.87e2 ! Immutable Locally unique identifiers that may be reassigned to different resources over time (“i-names”) *susan *back.forty * Mutable Cross-References Symbol Meaning Examples () An identifier assigned in one context being reused in another context (http://example.com/) @kynetx+customer(http://example.com/)

  3. XDI Graph Notation Symbol Usage In RDF graph model? Root context node: Represents the starting point of an XDI graph ✖ Context node: Represents any entity or attribute within the graph ✔ Literal node: Represents a leaf node containing data ✔ Contextual arc: Uniquely identifies a context node ✖ ✔ Relational arc: Non-uniquely links context nodes Literal arc: Singleton arc that identifies a Literal node ✔

  4. Simple examples local root remote root contextual contextual context contextual context literal literal contextual “value” relational context contextual literal literal “value” context contextual literal literal “value” context () (=bob) (=bob) $!($uri) (=bob)$!($uri) =bob =bob ! =alice “http://xdi.example.com/bob” =alice +friend $!(+tel) =alice$!(+tel) ! “+1-206-555-1212” $!($t) =alice$!(+tel)$!($t) ! “2010-10-10T11:12:13Z”

  5. JSON serialization (1) { "=alice/+friend": [ "=bob" ], "(=bob)$!($uri)/!": [ ”http://xdi.example.com/bob" ], "=alice$!(+tel)/!": [ "+1-206-555-1212" ], "=alice$!(+tel)$!($t)/! ": [ "2010-09-20T10:11:12Z" ] }

  6. JSON serialization (2) { "(=!1111.2222.3333.4444)/$is": [ "()" ], "=example/$is": [ "=!1111.2222.3333.4444" ], "=!1111.2222.3333.4444/$is+": [ "+person" ], "=!1111.2222.3333.4444/+friend": [ "=example2", "=example3*john.smith", "(mailto:friend@example.com)", "(http://example.com/friend)" ], "=!1111.2222.3333.4444$!(+age)/!": [ 33 ], "=!1111.2222.3333.4444$!(+vegetarian)/!": [ true ], "=!1111.2222.3333.4444+favorite$!(+colors)/!": [ "red", "blue", "green" ], "=!1111.2222.3333.4444+address$*(+street)$!1/!": [ "123 Corliss Ave N" ], "=!1111.2222.3333.4444+address$*(+street)$!2/!": [ "Apt 42" ], "=!1111.2222.3333.4444+address$!(+city)/!": [ "Seattle" ], "=!1111.2222.3333.4444+address$!(+state)/!": [ "WA" ], "=!1111.2222.3333.4444+address$!(+postal.code)/!": [ "98133" ] }

  7. Multiplicity Node All nodes that provide context for the data Leaf nodes of the graph that contain the raw data Context Literal Nodes that are neither starting nor leaf nodes Root Subgraph Starting nodes of the graph – may be local or remote Attribute Entity Entity Collection Entity Singleton Attribute Collection Attribute Singleton Contains zero or more entity singletons of the same type Contains zero or more attributes and zero or more entities Contains zero or more attribute singletons of the same type Contains zero or one literal node

  8. Multiplicity and dictionary syntax Concept English syntax XDI syntax Class – singular photo +photo photos Class – plural $(+photo) the photo Instance - singular $!(+photo) the photos Instance – plural $*(+photo) a photo Class definition +(+photo) color photoFlicker photo Class specialization +color+photo+(@flicker)+photo Specialized class definition a color photoa Flicker photo +(+color)+(+photo)+(@flicker)+(+photo)

  9. I-names, i-numbers, and synonyms Every non-root XDI node has exactly one canonical XDI address. A canonical equivalence relationship may be asserted between two XDI context nodes (i.e., that they represent the same logical resource and thus their XDI addresses are “synonyms”) using a $is relational arc. (The inverse relation is $is$is.) When navigating the graph, an XDI processor is required to redirect to the target node of a $is relation before continuing. The local root node address is () $is This is the “I am” statement, i.e., a way for the local root of this graph to assert its own XDI address. (=!0999.a7b2.25fd.c609) =abc =abc The XRI =abc, an i-name, is a synonym for the XRI =!0999.a7b2.25fd.c609, an i-number =!0999.a7b2.25fd.c609 $is =!0999.a7b2.25fd.c609 *home =!0999.a7b2.25fd.c609*home *household The top two i-names are synonyms for the bottom i-number =!0999.a7b2.25fd.c609*household $is $is !1 =!0999.a7b2.25fd.c609!1

  10. Remote graphs and XDI discovery The XDI global graph is a single logical graph of which subsets are distributed across a unlimited set of network locations (clients, servers, databases, etc.) Each subset, called a local graph, begins with a local root node, expressed as an empty XRI cross-reference, (). A local root node accessible on the network is called an XDI endpoint. A local graph may describe other remote XDI graphs by including XDI statements describing remote root nodes. This enables XDI clients to perform XDI discovery: navigation of the global graph by making XDI queries across a chain of local graphs to discover the URIs for other XDI endpoints. $is The “I am” statement where the local root node describes its own identifier(s) using a $is relation () (=!0111.7af3.65d5.8cb7) $*($uri) This $uriattribute collection is a property of the local root $!1 ! “http://xdi.example.com/(=!0111.7af3.65d5.8cb7)/” $!2 ! “http://xdi2.example.com/(=!0111.7af3.65d5.8cb7)/” (@!0111.db4a.e317.7a12) This local graph describes two remote roots each with a URI attribute singleton $!($uri) ! (=!0222.e3f2.76cb.904a) “http://xdi.example.com/(@!0111.db4a.e317.7a12)/” $!($uri) ! “http://xdi.example.com/(=!0222.e3f2.76cb.904a)/”

  11. Social graphs XDI graphs can express the relationships between XDI authorities in different contexts. This example illustrates the relationship between =abc (i-number =!1111) and =xyz (i-number =!2222) in a global context, *bob in a Facebook context, and in a Seattle soccer context. $is () (=!1111) Social graph expressed at the (=!1111) local graph, for which =abc is the authority =abc $is =!1111 =abc is best friends with =xyz =xyz $is =!2222 +best+friend $is (http://facebook.com/) =abc is friends with *bob in the Facebook context *bob $is !a726df +friend +seattle =abc is a teammate of =xyz in a Seattle soccer context +soccer =xyz $is =!2222 +teammate

  12. Attribute singletons An attribute singleton has a single literal arc to a literal node. It may also contain other contexts describing it (subproperties). An attribute singleton is always prefixed with $!. The diagram below illustrates a person's age, $!(+age), with two standard XDI subproperties: a timestamp and a versioning subgraph. $is () (=!1111) =abc $is =!1111 $!(+age) Attribute singleton +age ! $is “33” Literal value $!($t) Timestamp subgraph ! “2010-10-10T11:12:13Z” $*($v) Versioning subgraph $v $!1 $!2 First version context ! Second version context, which is also the current version “32” First version value $!($t) First version timestamp ! “2010-09-09T10:11:12Z”

  13. Attribute collections An attribute collection represents a set of attribute singletons of the same type and optionally ordinals expressing their order. An attribute collection is always expressed as a cross-reference prefixed with $*. Each member is a subcontext identified with an i-number prefixed with $!. The example shown below is a phone number with two instances, =abc$*(+tel)$!1 and =abc$*(+tel)$!2. Ordering of these instances is done with ordinal contexts – i-names in the form $*n, where n is a unique number. Relational arcs describe the non-unique type of each instance, e.g., +home, +home+fax, and +work. $is () (=!1111) +home+fax =abc +home $is ! $!1 “+1.206.555.1111” =!1111 $is $*2 $*(+tel) Two ordinal contexts, =abc$*(+tel)$*1 and =abc$*(+tel)$*2, assert the order of the two phone number instances $*1 $is $!2 +work ! “+1.206.555.2222” $!($t) $!($t) … … $*($v) $($v) … … Version subgraph – reflects changes at this level only Version subgraph – reflects changes to literal values only

  14. Combining attribute singletons and attribute collections Attribute singletons and attribute collections may be used together to express the full semantic richness of contextual data. This example illustrates how the XDI graph for a person (=abc) can express his/her default, work, home, and home fax telephone numbers. $is () (=!1111) =abc $!(+tel) $is +work $!(+tel) =!1111 +home $!(+tel) +fax $!(+tel) $is $is $is $is +home+fax +home $*(+tel) ! $!1 “+1.206.555.1111” $is $*2 $*1 $is $!2 +work ! “+1.206.555.2222”

  15. Entity singletons An entity singleton represents a single instance of an entity. Like a single noun in the English language, it does not use any prefix. The example shown below is +passport. It contains three attribute singletons: a country string, a number string, and an expiration date. $is () (=!1111) =abc $is =!1111 +passport $!(+country) ! $!(+num) “New Zealand” ! $!(+expires) “123456789” ! “2010-10-01T00:00:00Z” $!($t) $!($t) … … $*($v) $($v) … … Version subgraph – reflects changes to the literal value only Version subgraph – represents changes to this level only

  16. Entity collections An entity collection represents a set of entities of the same type. An entity collection is always expressed as a cross-reference prefixed with $. Each member is a subcontext identified with an i-number in the form $(!n), where n is an i-number. The example shown below is a set of passports. Two instances are shown, =abc$(+passport)$(!1) and =abc$(+passport)$(!2). (Ordering of these instances is not shown in this diagram, but uses the same pattern as with attribute collections.) $is () (=!1111) $!(+country) =abc ! $!(+num) “Canada” $is ! =!1111 $(!1) “987654321” $is +ca ! $!(+expires) “2005-01-01T00:00:00Z” $(+passport) $!(+country) +nz $is ! $(!2) $!(+num) “New Zealand” ! “123456789” ! $!(+expires) “2010-10-01T00:00:00Z” $!($t) $!($t) $!($t) … … … $($v) $*($v) $($v) … … … Version subgraph – reflects changes to this level only Version subgraph – reflects changes to the literal value only Version subgraph – reflects changes to this level only

  17. Personas and roles Personas are an example of using entities to model the identity of a person. In the example below, the person =!1111 (aka =abc) has two personas, $(=!1111)$(!1) and $(=!1111)$(!2). @!4444 (aka @example.co) is a company in which the $(=!1111)$(!2) persona plays the role of president. $is () (=!1111) $(!1) $is $(=!1111)$(!1) and $(=!1111)$(!2) are personas of =!1111 that enable =!1111 to control the sharing of portions of =!1111’s personal graph $(=!1111) *home *work $is =abc $(!2) $is =!1111 The ($) variable relation allows subgraphsto be included in other graphs – in this case, the $(=!1111)$(!2) persona includes =!1111$!(+age) $!(+age) ($) ! “33” @example.co $is +president @!4444 +president is a role that the persona $(=!1111)$(!2) plays in the context of company @!4444

  18. Link contracts (1) A link contract is an entity used for XDI authorization. A link contract is defined by a $do context. Shown below is the “bootstrap” link contract in a graph, called a root link contract: a $do child of the local root node. The $all relation pointing back to the root asserts that the assignee(s) of this contract have “root access”, i.e., permission to perform all XDI operations on the entire local graph. $is () (=!0999.a7b2.25fd.c609) =abc =!0999.a7b2.25fd.c609 $is $all $do $is$do $is$do (the inverse of the $do relation) is the relation used to explicitly assign a link contract to one or more XDI subjects This root link contract uses the $all relation to permit the XDI authorities to which it is assigned to perform all XDI operations on the local graph

  19. Link contracts (2) This diagram shows the addition of a link contract to the previous Personas and Roles diagram. This link contract, created by =!1111 to control access to the $(=!1111)$(!2) persona, gives the organization @!4444 $get (read) permission on that persona. $is This link contract gives the assignee(s) permission to do an XDI $get operation on the $(=!1111)$(!2) persona, i.e., read anything in its subgraph () (=!1111) $(!1) $is $(=!1111) *home *work $get $is =abc $(!2) $do $is =!1111 $!(+age) ($) ! “33” @example.co +president $is $is$do @!4444 The $is$do relation assigns this link contract to @!4444, which means people from that organ-ization will be able to access the $(=!1111)$(!2) persona

  20. Policy expression Policy expression is handled by the $if subgraph of a link contract. The three policy contexts are $and (all policies must be satisfied), $or (at least one policy must be satisfied), and $not (all policies must not be satisfied). These can be nested as needed for any boolean logic tree. $is (=!1111) $(=!1111) $(!2) $do Link contract $if begins the policy expression branch of a link contract $if $and branches group policy instances that must all evaluate to true $*($and) $!1 Each policy is a Javascript statement that may include standard XDI graph references ! “{policy}” $*($or) $or branches group policies of which at least one must evaluate to true $!1 ! $!2 “{policy}” $!($not) ! “{policy}” $not branches group policies that must evaluate to false ! “{policy}”

  21. Messages XDI messages are XDI graphs sent from the local XDI graph (the “from” graph) to remote XDI graph(s) (the “to” graph(s)) to perform an XDI operation (e.g., $get, $add, $mod, $del, $copy, $move). Every message must reference the link contract authorizing the operation(s) it is requesting. Note that the $add relation records the source graph for auditing purposes. $is “from” XDI local graph (=!1111) (!3) () =!1111 “from” XDI authority (sender) $($msg) $add Message collection Message singleton $(!1234) $is$do $!($t) Message timestamp (=!2222) $is() ! “2010-12-22T22:22:22Z” “to” XDIremote graph Message envelope Message operations $(=!2222) $do $get $(!1) Every message must include a $do reference to the link contract authorizing the opera-tion(s) it is requesting. For example, this message references the $(=!2222)$(!1)$do link contract for $get permission on the $(=!2222)$(!1) persona $get $do $do

  22. Dictionaries (1) XDI graphs containing XDI ontology statements are called XDI dictionaries. They are machine-readable definitions of entities and attributes. Attribute types are defined by reference to the XDI literal type tree, which includes the datatypes defined in JSON, XML, and MIME. Entity types are built up from attribute types and other entity types. $is () (+) The global + context is the root of the XDI literal type tree + $json $number All branches of the XDI literal type tree end in ! $xml ! $mime $is+ $is+ statements define supertype relationships +(+age) XBNF (XDI BNF) is a version of ABNF in which statement components can be XRIs. This provides 100% machine readability of the structure of the literal data $*($xbnf) $!1 ! $!2 “{XBNF statement}” ! “{XBNF statement}” $!($t) Dictionary statements may be timestamped and versioned like any other XDI graph ! “2010-09-09T10:11:12Z”

  23. Dictionaries (2) An entity type is defined using definitions of attribute types and/or other entity types. Note that these “definitions in context” may override the global definition. For instance, in the example below, the definition +(+num) in the context of the definition of +(+passport) overrides the global definition of +(+num) by providing its own specific XBNF. All other properties of the global definition still apply. $is () (+) +(+passport) $!($*) is the dictionary context for multiplicity – it takes a literal expression that defines the cardinality of a subcontext +(+country) $!($*) ! +(+num) “1” Values correspond to cardinality notation in UML, e.g., “1” means exactly one $!($*) ! “1” $*($xbnf) The XBNF for this definition of +num overrides the XBNF in the global definition $!1 ! $!2 “{XBNF statement}” +(+expires) ! “{XBNF statement}” $!($*) ! “1”

  24. Dictionaries (3) Relations for a context are defined using the dictionary context $has. Multiplicity of a relation is defined the same way as multiplicity for a subcontext. Note that complex relations can be defined, e.g., +(+best+friend). $is () (+) +(+person) $has +(+mother) $!($*) +(+father) ! “1” $!($*) +(+friend) ! “1” $!($*) ! +(+best+friend) “0-n” $!($*) ! “0-1”

  25. Extra Examples

  26. Device identity This pattern represents an approach to putting a device on the XDI graph. Since a device, such as a GPS transponder, may change ownership over time, the device is identified with a URI using the URN UUID schema. The XDI root node is identified using a cross-reference to this UUID. At any point in time, this cross-reference may be put in the context of a specific owner, such as =!2222. Data output by the device is in a subgraph in the context of the device identity. This subgraph is identified with an i-number which is cross-reference to the UUID. $is () (urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6) $is (=!2222) (urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6) $!($uri) @!1111 ! “http://xdi.example.com/(uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6)/” +gps !(urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6) $is+ +sensor … Sensor attributes +accuracy Accuracy attributes … $(+location) $(!1) … Location event instances

More Related