[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: On current literal pattern...
Assume a graph contains result of adding the properties from the simple example in the most recent XDI Graph Patterns doc: 1 () () (=bob) 2 () () =bob 3 () () =alice 4 =bob () $!($uri) 5 =alice () $!(+tel) 6 =alice$!(+tel) () $!($t) 7 =alice +friend =bob 8 =bob$!($uri) ! (data:, http://xdi.example/com/=!0111.7af3.65d5.8cb7/) 9 =alice$!(+tel) ! (data:, +1-206-555-1212) 10 =alice$!(+tel)$!($t) ! (data:,2010-10-10T11:12:13Z) Assume I want to traverse the graph to get all literal properties under =alice at any depth, a situation that could occur due to serialization, or processing for an XDI IDE. Assume I want to do this solely by using graph operations, due to whatever algorithm I have. In other words I can walk the graph and test equality of a node or edge's label against a specific label, but I can't use a REGEX or parse the label. I think this is a reasonable assumption, and I think if we can't make it then we don't strictly have a *graph* model. Can I still get all the literals by walking the tree if I follow these assumptions? My concern is with the use of things like $!($uri) and $!(+tel). As a result I propose the following pattern instead of those statements: 1 () () (=bob) 2 () () =bob 3 () () =alice 4 =bob () $uri 5 =bob$uri () $! 6 =alice () +tel 7 =alice+tel () $t 8 =alice+tel () $! 9 =alice+tel$t () $! 10 =alice +friend =bob 11 =bob$uri$! ! (data:, http://xdi.example/com/=!0111.7af3.65d5.8cb7/) 12 =alice+tel$! ! (data:, +1-206-555-1212) 13 =alice+tel$t$! ! (data:,2010-10-10T11:12:13Z) Now I can find all literals under =alice by finding any walk from =alice to $! within the current graph. This also seems easier to parse, both for a human reading it and a software agent. Furthermore, I think we shouldn't use literals to represent a URI. A URI can be represented as an XRI just by wrapping it in cross ref. So I'd also suggest changing the following lines: 4 =bob () $uri 5 =bob$uri () $! 11 =bob$uri$! ! (data:, http://xdi.example/com/=!0111.7af3.65d5.8cb7/) to ... =bob $uri (http://xdi.example.com/=!0111.7af3.65d5.8cb7/) The complete result becomes 1 () () (=bob) 2 () () =bob 3 () () =alice 4 =bob $uri (http://xdi.example.com/=!0111.7af3.65d5.8cb7) 5 =alice () +tel 6 =alice+tel () $t 7 =alice+tel () $! 8 =alice+tel$t () $! 9 =alice +friend =bob 10 =alice+tel$! ! (data:, +1-206-555-1212) 11 =alice+tel$t$! ! (data:,2010-10-10T11:12:13Z) Note that I also changed the URI in 4 to have an authority ending in .com (was example/com/), and removed the trailing '/'.
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]