public static void Main(string[] args) { // The library can also construct new XRIs or XRI components. // For example, if we have an XRI +name, and a relative XRI reference +first, // we can construct a new XRI +name+first XRI xri = new XRI3("+name"); XRIReference xriReference = new XRI3Reference("+first"); Logger.Info("Got XRI " + xri.ToString()); Logger.Info("Got XRI reference " + xriReference.ToString()); XRI xriNew = new XRI3(xri, xriReference); Logger.Info("Constructed new XRI " + xriNew.ToString()); }
public static void Main(string[] args) { // Something like this may happen when working with XDI. // We use the following XRI address: +name+first/$is/+!3 // We want to know the following // - XDI subject // - XDI predicate // - XDI reference XRI xri = new XRI3("+name+first/$is/+!3"); XRIAuthority xriAuthority = xri.Authority; XRIPath xriPath = xri.Path; Logger.Info("Checking XDI address " + xri.ToString()); Logger.Info("XDI Subject: " + xriAuthority.ToString()); Logger.Info("XDI Predicate: " + xriPath.getSegment(0).ToString()); Logger.Info("XDI Reference: " + xriPath.getSegment(1).ToString()); }