XDI Graph Patterns OASIS XDI TC Submission Drummond
XDI Graph Patterns OASIS XDI TC Submission Drummond Reed 2011 -04 -04 This document contains illustrations of eight basic XDI graph patterns: 1. Root context nodes and synonyms: properties used to assert multiple addresses for the same node in the graph. 2. Simple properties: properties that accept only a single literal value. 3. Complex properties: properties that may accept multiple literal values as well as describe typing and ordering of those values. 4. Simple subjects: subjects that may contain only instances of themselves and metadata describing those instances. 5. Complex subjects: subjects that may contain all of the above. 6. Social graphs: relationships between XDI authorities. 7. Link contracts: subgraphs used for XDI authorization. 8. Messages: XDI documents used in the XDI protocol. It also illustrates how versioning may be applied to any branch of the graph. Note: this document uses the XDI metagraph symbols as documented in the XDI Graph Model 2011 -02 -09. 1
Notation Root context node: Represents the root context of an XDI graph Context node: Represents an XDI subject Literal node: Represents a literal XDI object Contextual arc: Uniquely identifies a context node Literal arc: Uniquely identifies a literal node Relational arc: Non-uniquely links nodes Example root context literal “literal” relational contextual context literal contextual “literal” context relational contextual relational context 2
Root contexts and synonyms Every XDI context node has exactly one XRI address. Any two XDI context nodes may be declared as equivalent using a relational arc with the metagraph symbol $. Since this is an equivalence relationship, the inverse arc exists by definition, and is not shown in the graph. A $ relational arc requires XDI processors to redirect to its target node. $() (http: //example. com/ox/=!0999. a 7 b 2. 25 fd. c 609) These XRI cross-references are addresses for the root context of this graph $() (=!0999. a 7 b 2. 25 fd. c 609) =abc These two XRIs are synonyms $ =!0999. a 7 b 2. 25 fd. c 609 +pea-patch +garden These three XRIs are synonyms =!0999. a 7 b 2. 25 fd. c 609+pea-patch =!0999. a 7 b 2. 25 fd. c 609+garden $ $ !1 =!0999. a 7 b 2. 25 fd. c 609!1 3
Simple properties () =abc +age! =abc/+age! “ 33” +age Simple property graph =abc+age $d! Metadata subgraph fpr +age simple property =abc+age/$d! “ 2010 -10 -10 T 11: 12: 13 Z” Current version $v !2 Versioning metadata subgraph =abc+age$v The second version of the +age simple property is the current version, so it is a relational arc to the current simple property value !1! !1 =abc+age$v/!1! “ 32” First version value =abc+age$v!1 $d! First version datestamp =abc+age$v!1/$d! “ 2010 -09 -09 T 10: 11: 12 Z” $v as a relational arc expresses the current version – it points to the =abc+age$v!2 node $v !2 =abc+age$v!2 Second version datestamp $d! =abc+age$v!2/$d! “ 2010 -10 -10 T 11: 12: 13 Z” 4
Complex properties +home+fax () +home =abc+tel/+home+fax =abc+tel/+home =abc+tel/*2 =abc+tel/!1! *2 =abc !1! +tel “+1. 206. 555. 1111” !2! =abc+tel “+1. 206. 555. 2222” *1 =abc+tel/!2! =abc+tel/*1 =abc+tel/+work Complex property graph Current version !1 Metadata subgraphs for +tel complex property =abc+tel!1 $d! !2 =abc+tel!2 $d! =abc+tel!1/$d! “ 2010 -11 -11 T 11: 11 Z” =abc+tel!2/$d! “ 2010 -12 -22 T 22: 22 Z” Versioning metadata subgraph $v =abc+tel$v !1 $ $v !2 =abc+tel$v!1 First version snapshot(subgraph not shown) =abc+tel$v!2 Second version is the current version … 5
Simple subjects () =abc+passport!1 +passport =abc+passport !1 +country! =abc+passport!1/+country! +number! =abc+passport!1/+number! “Canada” “ 987654321” $d! *1 =abc+passport!1/+$d! “ 2005 -01 -01 T 00: 00 Z” *2 !2 +country! =abc+passport!2/+country! +number! =abc+passport!2/+number! “New Zealand” “ 123456789” $d! =abc+passport!2/+$d! =abc+passport!2 “ 2010 -10 -01 T 00: 00 Z” Simple subject graph () Metadata subgraph for +passport simple subject =abc+passport() !1 =abc+passport()!1 $d! !2 =abc+passport()!1/$d! “ 2010 -11 -11 T 11: 11 Z” =abc+passport()!2 $d! =abc+passport()!2/$d! Versioning metadata subgraph $v =abc+tel$v $ $v “ 2010 -12 -22 T 22: 22 Z” !1 =abc+tel$v!1 !2 =abc+tel$v!2 … First version snapshot(subgraph not shown) Second version is the current version 6
Complex subjects +age! () =abc/+age! “ 33” Examples of from previous pages (child subgraphs not shown) of attributes of the complex subject =abc+tel … +passport =abc+passport … !1 =abc!1 !2 =abc!2 Subgraphs for instances of the =abc complex subject (child subgraphs not shown) For a person, these would be “personas” … … () Metadata subgraph for =abc complex subject =abc() !1 =abc()!1 $d! !2 =abc()!2 $d! $v $ $v =abc()!1/$d! “ 2010 -11 -11 T 11: 11 Z” =abc()!2/$d! “ 2010 -12 -22 T 22: 22 Z” Versioning metadata subgraph =abc$v !1 =abc$v!1 !2 =abc$v!2 … First version snapshot(subgraph not shown) Second version is the current version 7
Social graphs $() () (=abc) =abc (=abc) Social graph expressed at the (=abc) endpoint =abc is best friends with =xyz +best+friend =xyz (http: //facebook. com) =xyz =abc is friends with =xyz in the Facebook context +friend (http: //facebook. com)=xyz +seattle +soccer +seattle+soccer =xyz =abc is a teammate of =xyz in a Seattle soccer context +teammate +seattle+soccer=xyz 8
Link contracts +age! () =abc +tel +passport =abc/+age! “ 33” =abc+tel … $ $ =abc+passport … !1 Subgraph of =abc properties included in the persona =abc!1 $do (=xyz) =abc!1$do $get (=xyz) $() Link contract $ Link contract root node =abc!1$do$get $ $add … Link contract assignment Permitted XDI operations =abc!1$do$add $for =abc!1$do$for … Policies under which these permissions are granted (subtree not shown) 9
Messages $() () (=!0999. a 7 b 2. 25 fd. c 609) “via” XDI endpoint =!0999. a 7 b 2. 25 fd. c 609 “from” XDI sender =!0999. a 7 b 2. 25 fd. c 609 $msg Message context =!0999. a 7 b 2. 25 fd. c 609$msg !1234 =!0999. a 7 b 2. 25 fd. c 609$msg!1234 Message ID (=!0111. 2222. 3333. 4444) $() $d! Message datestamp =!0999. a 7 b 2. 25 fd. c 609$msg!1234/$d! “ 2010 -12 -22 T 22: 22 Z” (=!0111. 2222. 3333. 4444) “to” XDI recipient(s) Message envelope Message actions $do =!0999. a 7 b 2. 25 fd. c 609$msg!1234$do Message action root $get =!0999. a 7 b 2. 25 fd. c 609$msg!1234$do$get … $add … Message actions (verbs and subgraphs must match link contracts) (subgraphs not shown) =!0999. a 7 b 2. 25 fd. c 609$msg!1234$do$add $for =!0999. a 7 b 2. 25 fd. c 609$msg!1234$do$for … Optional description of the message purpose (must match link contract) (subgraph not shown) 10
- Slides: 10