100 likes | 232 Views
This document contains illustrations of eight basic XDI graph patterns: Primary and secondary addresses : properties used to assert multiple addresses for the same node in the graph. Simple properties : properties that accept only a single literal value.
E N D
This document contains illustrations of eight basic XDI graph patterns: Primary and secondary addresses: properties used to assert multiple addresses for the same node in the graph. Simple properties: properties that accept only a single literal value. Complex properties: properties that may accept multiple literal values as well as describe typing and ordering of those values. Simple subjects: subjects that may contain only instances of themselves and metadata describing those instances. Complex subjects: subjects that may contain all of the above. Social graphs: relationships between XDI authorities. Link contracts: subgraphs used for XDI authorization. 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. XDI Graph Patterns OASIS XDI TC SubmissionDrummond Reed 2011-03-24
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” contextual context literal contextual “literal” context contextual relational context
Primary and Secondary Addresses Every XDI context node has exactly one primary address. It may have zero-to-n secondary addresses – different XRIs that identify the same logical node. The relational arc from a secondary address to a primary address is expressed using the metagraphsymbol $. The inverse relational arc from a primary address to a secondary address is expressed with $$. Expresses that the root context with the primary address () has the secondary address (=!0999.a7b2.25fd.c609) $$ (=!0999.a7b2.25fd.c609) () (=!0999.a7b2.25fd.c609) $$ Expresses that the root context also has the secondary address (http://example.com/ox/=!0999.a7b2.25fd.c609) (http://example.com/ox/=!0999.a7b2.25fd.c609) (http://example.com/ox/=!0999.a7b2.25fd.c609) =abc =abc Expresses that the primary address =!0999.a7b2.25fd.c609 has the secondary address: =abc and the inverse. $$ $ =!0999.a7b2.25fd.c609 =!0999.a7b2.25fd.c609 +pea-patch =!0999.a7b2.25fd.c609+pea-patch Expresses that the secondary addresses: =!0999.a7b2.25fd.c609+pea-patch =!0999.a7b2.25fd.c609+garden have the primary address: =!0999.a7b2.25fd.c609!1Note that this particular subgraphdoes npt express the inverse, i.e., the secondary addresses are not discoverable from =!0999.a7b2.25fd.c609!1 +garden =!0999.a7b2.25fd.c609+garden $ $ !1 =!0999.a7b2.25fd.c609!1
Simple properties () =abc =abc +age! =abc/+age! “33” Simple property graph +age =abc+age Metadata subgraphfpr +age simple property =abc+age/$d! $d! “2010-10-10T11:12:13Z” Versioning metadata subgraph $v =abc+age$v !2! Second version is the current version, so it cross-references the current simple property value =abc+age$v/!1! !1! “32” First version value !1 =abc+age$v!1 First version datestamp $d! =abc+age$v!1/$d! “2010-09-09T10:11:12Z” !2 =abc+age$v!2 Second version datestamp $d! =abc+age$v!2/$d! “2010-10-10T11:12:13Z”
Complex properties +home+fax +home () =abc+tel/+home+fax =abc+tel/+home =abc+tel/*2 =abc+tel/!1! =abc *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 +work Complex property graph Metadata subgraphs for +tel complex property !1 =abc+tel!1 $d! =abc+tel!1/$d! “2010-11-11T11:11:11Z” !2 =abc+tel!2 $d! =abc+tel!2/$d! “2010-12-22T22:22:22Z” Versioning metadata subgraph $v =abc+tel$v !1 =abc+tel$v!1 First version snapshot(subgraph not shown) … !2 =abc+tel$v!2 $ Second version is the current version
Simple subjects =abc+passport!1/+country! +country! () “Canada” =abc+passport!1/+number! +number! =abc+passport!1 =abc =abc !1 “987654321” $d! =abc+passport!1/+$d! +passport *1 “2005-01-01T00:00:00Z” =abc+passport!2/+country! =abc+passport +country! *2 “New Zealand” !2 =abc+passport!2/+number! +number! “123456789” $d! =abc+passport!2 =abc+passport!2/+$d! “2010-10-01T00:00:00Z” Simple subject graph Metadata subgraph for +passport simple subject () =abc+passport() !1 =abc+passport()!1 $d! =abc+passport()!1/$d! “2010-11-11T11:11:11Z” !2 =abc+passport()!2 $d! =abc+passport()!2/$d! “2010-12-22T22:22:22Z” Versioning metadata subgraph $v =abc+tel$v !1 =abc+tel$v!1 First version snapshot(subgraph not shown) … !2 =abc+tel$v!2 $ Second version is the current version
Complex subjects =abc/+age! +age! () “33” Examples of from previous pages (child subgraphs not shown) of attributes of the complex subject =abc =abc =abc+tel +tel =abc … +passport =abc+passport … !1 Subgraphs for instances of the =abc complex subject (child subgraphs not shown) =abc!1 … !2 =abc!2 For a person, these would be “personas” … Metadata subgraph for =abc complex subject () =abc() !1 =abc()!1 $d! =abc()!1/$d! !2 “2010-11-11T11:11:11Z” =abc()!2 $d! =abc()!2/$d! “2010-12-22T22:22:22Z” Versioning metadata subgraph $v =abc$v !1 =abc$v!1 First version snapshot(subgraph not shown) … !2 =abc$v!2 $ Second version is the current version
Social graphs $$ () (=abc) (=abc) Social graph expressed at the (=abc) endpoint =abc =abc =abc is best friends with =xyz =xyz +best+friend =xyz (http://facebook.com) (http://facebook.com) =abc is friends with =xyz in the Facebook context +friend =xyz (http://facebook.com)=xyz +seattle +seattle +soccer =abc is a teammate of =xyz in a Seattle soccer context +seattle+soccer +teammate =xyz +seattle+soccer=xyz
Link contracts +age! =abc/+age! () “33” =abc +tel =abc+tel =abc … +passport =abc+passport … +age! =abc!1/+age! Subgraph of =abc properties included in the persona =abc!1 !1 +tel =abc!1 =abc!1/+tel Link contract $do =abc!1$do Link contract root node $get =abc!1$do$get (=xyz) … $() Permitted XDI operations on the =abc!1 graph (subtrees not shown) (=xyz) $add … Link contract assignment =abc!1$do$add $for =abc!1$do$for … Policies under which these permissions are granted (subtree not shown)
Messages $$ (=!0999.a7b2.25fd.c609) () (=abc) “from” XDI endpoint =!0999.a7b2.25fd.c609 “from” XDI sender ID =!0999.a7b2.25fd.c609 $msg Message context =!0999.a7b2.25fd.c609$msg Message ID !1234 =!0999.a7b2.25fd.c609$msg!1234 (=!0111.2222.3333.4444) Message datestamp $d! $() =!0999.a7b2.25fd.c609$msg!1234/$d! “2010-12-22T22:22:22Z” (=!0111.2222.3333.4444) “to” target XDI endpoint(s) Message envelope Message actions $do =!0999.a7b2.25fd.c609$msg!1234$do Message action root $get =!0999.a7b2.25fd.c609$msg!1234$do$get … Message actions (verbs and subgraphs must match link contracts) (subgraphs not shown) $add … =!0999.a7b2.25fd.c609$msg!1234$do$add $for =!0999.a7b2.25fd.c609$msg!1234$do$for … Optional description of the message purpose (must match link contract) (subgraph not shown)