XDI Data Sharing

From Forge

Jump to: navigation, search

Conceptually, the current XDI model isn't that different from the old one. The key difference is that the new model uses triples (i.e. RDF) for metamodeling, whereas the old model used tuples (i.e. relational).

The Old Model

XDI is not a universal data model for XRI. It's a more constrained data model (single parent hierarchy) where every node is addressable via XRI.

XDI uses a two-level hierarchical structure with linking (a union) between trees. It's equivalent (probably) to relational data modeling.

An XDI query returns a node's entire tree (or at least the tree that is visible to the i-name requesting the information). The reason it returns the node's supertree, not just the subtree, is for optimization. The XDI engine can use the supertree to find a more optimal path to the desired data.

What makes XDI interesting for data sharing is that the notion of access control is built into the data structure itself. If you want to give someone access to data, you create a link, addressed as a cross-reference to that person's i-name, that links to the root of the data you want to share.

In a link contract, the final cross-reference is itself a direct path to the data. In other words, the link contract XRI points to the same node as the XRI contained in the final cross-reference. The XDI engine can take advantage of this fact to optimize queries.

Links between two nodes in actuality are two links between three nodes. You can think of it as a symbolic link in UNIX, which creates a new i-node that points to a file's i-node. A symbolic link is separately addressable, and when you delete it, the original file does not go away. The purpose of this intermediate node is largely social. For example, if I want to delete @blueoxen*eekim, that doesn't necessarily mean the actual node should go away. The intermediate node is addressable via a funky "dedereferencing" syntax (e.g. "@blueoxen*(eekim)").

The data modeling language is certainly adequate for modeling, although it also seems like a step back in some ways. (As Collab:Andy Dale pointed out, this depends on your point of view.) You essentially have to create a relational mapping to your data, which is most likely in a semistructured model (XML schema, for example). The trend in data modeling has been to map relational data as objects, because objects are more intuitive for human consumptions. (Again, point of view.) This effectively reverses that trend.

One thing I'd like to explore is, can we simply specify the schema (XML Schema, Relax-NG, whatever) and point to an XML file containing the data? XML data can be addressed granularly via XPath. This saves a ton of work, because a lot of schemas have already been created for common data needs.

This has other advantages. XDI doesn't seem to have a notion of cardinality. XML does.

Personal tools