projectdanube$xdi2
String xriString,State state
XDIAddress
XDIAddress makeXDIAddress(String xriString,State state)
String xriString,State state
XDI3Segment
XDI3Segment makeXDI3Segment(String xriString,State state)
projectdanube$xdi2
String xriString,State state
XDIArc
XDIArc makeXDIArc(String xriString,State state)
String xriString,State state
XDI3SubSegment
XDI3SubSegment makeXDI3SubSegment(String xriString,State state)
projectdanube$xdi2
BufferedWriter bufferedWriter,ContextNode contextNode,XDIArc contextNodeArc
void
void writecontextNodeArc(BufferedWriter bufferedWriter,ContextNode contextNode,XDIArc contextNodeArc)
BufferedWriter bufferedWriter,ContextNode contextNode,XDI3SubSegment contextNodeArcXri
void
void writeContextNodeArcXri(BufferedWriter bufferedWriter,ContextNode contextNode,XDI3SubSegment contextNodeArcXri)
projectdanube$xdi2
BufferedWriter bufferedWriter,XDIAddress contextNodeAddress,XDIArc contextNodeArc
void
void writecontextNodeArc(BufferedWriter bufferedWriter,XDIAddress contextNodeAddress,XDIArc contextNodeArc)
BufferedWriter bufferedWriter,XDI3Segment contextNodeXri,XDI3SubSegment contextNodeArcXri
void
void writeContextNodeArcXri(BufferedWriter bufferedWriter,XDI3Segment contextNodeXri,XDI3SubSegment contextNodeArcXri)
projectdanube$xdi2
BufferedWriter bufferedWriter,XDIAddress contextNodeAddress
void
void writecontextNodeAddress(BufferedWriter bufferedWriter,XDIAddress contextNodeAddress)
BufferedWriter bufferedWriter,XDI3Segment contextNodeXri
void
void writeContextNodeXri(BufferedWriter bufferedWriter,XDI3Segment contextNodeXri)
projectdanube$xdi2
XDIAddress address,XDIStatement statement
XDIStatement
XDIStatement concatAddressStatement(XDIAddress address,XDIStatement statement)
XDI3Segment xri,XDI3Statement statementXri
XDI3Statement
XDI3Statement concatXriStatement(XDI3Segment xri,XDI3Statement statementXri)
projectdanube$xdi2
XDIArc
XDIArc createarc()
XDI3SubSegment
XDI3SubSegment createArcXri()
projectdanube$xdi2
XDIArc arc
return arc;
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isAttributeXs()) return false;
		if (arc.isClassXs()) return false;
		if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
XDIArc
XDIArc createarc(XDIArc arc)
XDI3SubSegment arcXri
return arcXri;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isAttributeXs()) return false;
		if (arcXri.isClassXs()) return false;
		if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
XDI3SubSegment
XDI3SubSegment createArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
return arc;
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isAttributeXs()) return false;
		if (arc.isClassXs()) return false;
		if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
XDIArc
XDIArc createarc(XDIArc arc)
XDI3SubSegment arcXri
return arcXri;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isAttributeXs()) return false;
		if (arcXri.isClassXs()) return false;
		if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
XDI3SubSegment
XDI3SubSegment createArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
return arc;
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isAttributeXs()) return false;
		if (arc.isClassXs()) return false;
		if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
XDIArc
XDIArc createarc(XDIArc arc)
XDI3SubSegment arcXri
return arcXri;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isAttributeXs()) return false;
		if (arcXri.isClassXs()) return false;
		if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
XDI3SubSegment
XDI3SubSegment createArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
return arc;
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isAttributeXs()) return false;
		if (arc.isClassXs()) return false;
		if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
XDIArc
XDIArc createarc(XDIArc arc)
XDI3SubSegment arcXri
return arcXri;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isAttributeXs()) return false;
		if (arcXri.isClassXs()) return false;
		if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
XDI3SubSegment
XDI3SubSegment createArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
String identifier,boolean attribute
XDIArc
XDIArc createarc(String identifier,boolean attribute)
String identifier,boolean attribute
XDI3SubSegment
XDI3SubSegment createArcXri(String identifier,boolean attribute)
projectdanube$xdi2
String identifier,boolean attribute
XDIArc
XDIArc createarc(String identifier,boolean attribute)
String identifier,boolean attribute
XDI3SubSegment
XDI3SubSegment createArcXri(String identifier,boolean attribute)
projectdanube$xdi2
String string,boolean attribute
XDIArc
XDIArc createDigestarc(String string,boolean attribute)
String string,boolean attribute
XDI3SubSegment
XDI3SubSegment createDigestArcXri(String string,boolean attribute)
projectdanube$xdi2
String string,boolean attribute,String algorithm
XDIArc
XDIArc createDigestarc(String string,boolean attribute,String algorithm)
String string,boolean attribute,String algorithm
XDI3SubSegment
XDI3SubSegment createDigestArcXri(String string,boolean attribute,String algorithm)
projectdanube$xdi2
XDIAddress subject,XDIAddress predicate
XDIArc
XDIArc createInnerRootarc(XDIAddress subject,XDIAddress predicate)
XDI3Segment subject,XDI3Segment predicate
XDI3SubSegment
XDI3SubSegment createInnerRootArcXri(XDI3Segment subject,XDI3Segment predicate)
projectdanube$xdi2
XDIAddress address
XDIArc
XDIArc createPeerRootArc(XDIAddress address)
XDI3Segment xri
XDI3SubSegment
XDI3SubSegment createPeerRootArcXri(XDI3Segment xri)
projectdanube$xdi2
boolean attribute
XDIArc
XDIArc createRandomUuidarc(boolean attribute)
boolean attribute
XDI3SubSegment
XDI3SubSegment createRandomUuidArcXri(boolean attribute)
projectdanube$xdi2
String uuid,boolean attribute
XDIArc
XDIArc createUuidarc(String uuid,boolean attribute)
String uuid,boolean attribute
XDI3SubSegment
XDI3SubSegment createUuidArcXri(String uuid,boolean attribute)
projectdanube$xdi2
XDIAddress
XDIAddress getArc()
XDI3Segment
XDI3Segment getArcXri()
projectdanube$xdi2
XDIArc
XDIArc getArc()
XDI3SubSegment
XDI3SubSegment getArcXri()
projectdanube$xdi2
XDIArc
XDIArc getArc()
XDI3SubSegment
XDI3SubSegment getArcXri()
projectdanube$xdi2
XDIArc arc
XDIArc
XDIArc getBasearc(XDIArc arc)
XDI3SubSegment arcXri
XDI3SubSegment
XDI3SubSegment getBaseArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIAddress
XDIAddress getContextNodeAddress()
XDI3Segment
XDI3Segment getContextNodeXri()
projectdanube$xdi2
XDIArc arc
String
String getIriOfPeerRootArc(XDIArc arc)
XDI3SubSegment arcXri
String
String getIriOfPeerRootArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
String
String getLiteralOfPeerRootArc(XDIArc arc)
XDI3SubSegment arcXri
String
String getLiteralOfPeerRootArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIAddress
XDIAddress getRelationAddress()
XDI3Segment
XDI3Segment getRelationArcXri()
projectdanube$xdi2
XDIAddress
XDIAddress getSenderAddress()
XDI3Segment
XDI3Segment getSenderXri()
projectdanube$xdi2
XDIAddress
XDIAddress getSenderAddress()
XDI3Segment
XDI3Segment getSenderXri()
projectdanube$xdi2
XDIAddress
XDIAddress getTargetContextNodeAddress()
XDI3Segment
XDI3Segment getTargetContextNodeXri()
projectdanube$xdi2
XDIAddress
XDIAddress getAddress()
XDI3Segment
XDI3Segment getXri()
projectdanube$xdi2
XDIAddress
XDIAddress getAddress()
XDI3Segment
XDI3Segment getXri()
projectdanube$xdi2
XDIArc arc
XDIAddress
XDIAddress getAddressOfPeerRootArc(XDIArc arc)
XDI3SubSegment arcXri
XDI3Segment
XDI3Segment getXriOfPeerRootArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
boolean
boolean hasAddress()
boolean
boolean hasSegment()
projectdanube$xdi2
XDIArc arc
boolean
boolean isInnerRootarc(XDIArc arc)
XDI3SubSegment arcXri
boolean
boolean isInnerRootArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
boolean
boolean isPeerRootArc(XDIArc arc)
XDI3SubSegment arcXri
boolean
boolean isPeerRootArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
boolean
boolean isRootarc(XDIArc arc)
XDI3SubSegment arcXri
boolean
boolean isRootArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
boolean
boolean isValidarc(XDIArc arc)
XDI3SubSegment arcXri
boolean
boolean isValidArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
boolean
boolean isValidarc(XDIArc arc)
XDI3SubSegment arcXri
boolean
boolean isValidArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
boolean
boolean isValidarc(XDIArc arc)
XDI3SubSegment arcXri
boolean
boolean isValidArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
boolean
boolean isValidarc(XDIArc arc)
XDI3SubSegment arcXri
boolean
boolean isValidArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
boolean
boolean isValidarc(XDIArc arc)
XDI3SubSegment arcXri
boolean
boolean isValidArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
boolean
boolean isValidarc(XDIArc arc)
XDI3SubSegment arcXri
boolean
boolean isValidArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
boolean
boolean isValidarc(XDIArc arc)
XDI3SubSegment arcXri
boolean
boolean isValidArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
boolean
boolean isValidarc(XDIArc arc)
XDI3SubSegment arcXri
boolean
boolean isValidArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
boolean
boolean isValidarc(XDIArc arc)
XDI3SubSegment arcXri
boolean
boolean isValidArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc,boolean attribute
boolean
boolean isValidarc(XDIArc arc,boolean attribute)
XDI3SubSegment arcXri,boolean attribute
boolean
boolean isValidArcXri(XDI3SubSegment arcXri,boolean attribute)
projectdanube$xdi2
XDIArc arc,boolean attribute
boolean
boolean isValidarc(XDIArc arc,boolean attribute)
XDI3SubSegment arcXri,boolean attribute
boolean
boolean isValidArcXri(XDI3SubSegment arcXri,boolean attribute)
projectdanube$xdi2
String string
XDIAddress
XDIAddress parseXDIAddress(String string)
String string
XDI3Segment
XDI3Segment parseXDI3Segment(String string)
projectdanube$xdi2
String string
XDIStatement
XDIStatement parseXDIStatement(String string)
String string
XDI3Statement
XDI3Statement parseXDI3Statement(String string)
projectdanube$xdi2
String string
XDIArc
XDIArc parseXDIArc(String string)
String string
XDI3SubSegment
XDI3SubSegment parseXDI3SubSegment(String string)
projectdanube$xdi2
String string
XDIXRef
XDIXRef parseXDIXRef(String string)
String string
XDI3XRef
XDI3XRef parseXDI3XRef(String string)
projectdanube$xdi2
XDIStatement statement,XDIAddress start,boolean variablesInAddress,boolean variablesInStart
XDIStatement
XDIStatement removeStartAddressStatement(XDIStatement statement,XDIAddress start,boolean variablesInAddress,boolean variablesInStart)
XDI3Statement statementXri,XDI3Segment start,boolean variablesInXri,boolean variablesInStart
XDI3Statement
XDI3Statement removeStartXriStatement(XDI3Statement statementXri,XDI3Segment start,boolean variablesInXri,boolean variablesInStart)
projectdanube$xdi2
void
void testarcs()
void
void testArcXris()
projectdanube$xdi2
void
void testcontextNodeAddresss()
void
void testContextNodeXris()
projectdanube$xdi2
void
void testIllegalarcs()
void
void testIllegalArcXris()
projectdanube$xdi2
void
void testTypeToXdiEntitySingletonarc()
void
void testTypeToXdiEntitySingletonArcXri()
projectdanube$xdi2
String type
if (log.isTraceEnabled()) log.trace("typeToXdiarc(" + type + ")");
		XDIArc xdiarc = null;
		try { xdiarc = XDIArc.create(type);
XDIArc
XDIArc typeToXdiarc(String type)
String type
if (log.isTraceEnabled()) log.trace("typeToXdiArcXri(" + type + ")");
		XDI3SubSegment xdiArcXri = null;
		try { xdiArcXri = XDI3SubSegment.create(type);
XDI3SubSegment
XDI3SubSegment typeToXdiArcXri(String type)
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/client%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fclient%2Fconstants%2FXDIClientConstants.java
https://api.github.com/repos/projectdanube/xdi2/contents/client%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fclient%2Fconstants%2FXDIClientConstants.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
client/src/main/java/xdi2/client/constants/XDIClientConstants.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
	public static final XDIAddress XDI_ADD_AC_XDI = XDIAddress.create("[<$xdi>]");
	public static final XDIAddress XDI_ADD_AC_URI = XDIAddress.create("[<$uri>]");
	public static final XDIAddress XDI_ADD_AS_XDI = XDIAddress.create("<$xdi>");
	public static final XDIAddress XDI_ADD_AS_URI = XDIAddress.create("<$uri>");
	public static final XDIArc XDI_ARC_AC_XDI = XDIArc.create("[<$xdi>]");
	public static final XDIArc XDI_ARC_AC_URI = XDIArc.create("[<$uri>]");
	public static final XDIArc XDI_ARC_AS_XDI = XDIArc.create("<$xdi>");
	public static final XDIArc XDI_ARC_AS_URI = XDIArc.create("<$uri>");

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
	public static final XDI3Segment XRI_S_AC_XDI = XDI3Segment.create("[<$xdi>]");
	public static final XDI3Segment XRI_S_AC_URI = XDI3Segment.create("[<$uri>]");
	public static final XDI3Segment XRI_S_AS_XDI = XDI3Segment.create("<$xdi>");
	public static final XDI3Segment XRI_S_AS_URI = XDI3Segment.create("<$uri>");
	public static final XDI3SubSegment XRI_SS_AC_XDI = XDI3SubSegment.create("[<$xdi>]");
	public static final XDI3SubSegment XRI_SS_AC_URI = XDI3SubSegment.create("[<$uri>]");
	public static final XDI3SubSegment XRI_SS_AS_XDI = XDI3SubSegment.create("<$xdi>");
	public static final XDI3SubSegment XRI_SS_AS_URI = XDI3SubSegment.create("<$uri>");

@@ -1,7 +1,7 @@
 package xdi2.client.constants;
 
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 
 /**
  * Constants for XDI client and discovery.
@@ -10,17 +10,17 @@
  */
 public final class XDIClientConstants {
 
-	public static final XDI3Segment XRI_S_AC_XDI = XDI3Segment.create("[<$xdi>]");
-	public static final XDI3Segment XRI_S_AC_URI = XDI3Segment.create("[<$uri>]");
+	public static final XDIAddress XDI_ADD_AC_XDI = XDIAddress.create("[<$xdi>]");
+	public static final XDIAddress XDI_ADD_AC_URI = XDIAddress.create("[<$uri>]");
 
-	public static final XDI3Segment XRI_S_AS_XDI = XDI3Segment.create("<$xdi>");
-	public static final XDI3Segment XRI_S_AS_URI = XDI3Segment.create("<$uri>");
+	public static final XDIAddress XDI_ADD_AS_XDI = XDIAddress.create("<$xdi>");
+	public static final XDIAddress XDI_ADD_AS_URI = XDIAddress.create("<$uri>");
 
-	public static final XDI3SubSegment XRI_SS_AC_XDI = XDI3SubSegment.create("[<$xdi>]");
-	public static final XDI3SubSegment XRI_SS_AC_URI = XDI3SubSegment.create("[<$uri>]");
+	public static final XDIArc XDI_ARC_AC_XDI = XDIArc.create("[<$xdi>]");
+	public static final XDIArc XDI_ARC_AC_URI = XDIArc.create("[<$uri>]");
 
-	public static final XDI3SubSegment XRI_SS_AS_XDI = XDI3SubSegment.create("<$xdi>");
-	public static final XDI3SubSegment XRI_SS_AS_URI = XDI3SubSegment.create("<$uri>");
+	public static final XDIArc XDI_ARC_AS_XDI = XDIArc.create("<$xdi>");
+	public static final XDIArc XDI_ARC_AS_URI = XDIArc.create("<$uri>");
 
 	private XDIClientConstants() { }
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/client%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fclient%2Fconstants%2FXDIClientConstants.java
cb738fe3eb44c95b99ea72a317b24dd936f5c81b
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/client%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fclient%2Fevents%2FXDIDiscoverFromRegistryEvent.java
https://api.github.com/repos/projectdanube/xdi2/contents/client%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fclient%2Fevents%2FXDIDiscoverFromRegistryEvent.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
client/src/main/java/xdi2/client/events/XDIDiscoverFromRegistryEvent.java
import xdi2.core.syntax.XDIAddress;
	private XDIAddress query;
	public XDIDiscoverFromRegistryEvent(Object source, MessageEnvelope messageEnvelope, XDIDiscoveryResult discoveryResult, XDIAddress query) {
	public XDIAddress getQuery() {

import xdi2.core.xri3.XDI3Segment;
	private XDI3Segment query;
	public XDIDiscoverFromRegistryEvent(Object source, MessageEnvelope messageEnvelope, XDIDiscoveryResult discoveryResult, XDI3Segment query) {
	public XDI3Segment getQuery() {

@@ -1,23 +1,23 @@
 package xdi2.client.events;
 
-import xdi2.core.xri3.XDI3Segment;
+import xdi2.core.syntax.XDIAddress;
 import xdi2.discovery.XDIDiscoveryResult;
 import xdi2.messaging.MessageEnvelope;
 
 public class XDIDiscoverFromRegistryEvent extends XDIDiscoverEvent {
 
 	private static final long serialVersionUID = -4512281567446646198L;
 
-	private XDI3Segment query;
+	private XDIAddress query;
 
-	public XDIDiscoverFromRegistryEvent(Object source, MessageEnvelope messageEnvelope, XDIDiscoveryResult discoveryResult, XDI3Segment query) {
+	public XDIDiscoverFromRegistryEvent(Object source, MessageEnvelope messageEnvelope, XDIDiscoveryResult discoveryResult, XDIAddress query) {
 
 		super(source, messageEnvelope, discoveryResult);
 
 		this.query = query;
 	}
 
-	public XDI3Segment getQuery() {
+	public XDIAddress getQuery() {
 
 		return this.query;
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/client%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fclient%2Fevents%2FXDIDiscoverFromRegistryEvent.java
73a8b386abdc740015909ab743b8b6979d52a640
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/client%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fclient%2Futil%2FXDIClientUtil.java
https://api.github.com/repos/projectdanube/xdi2/contents/client%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fclient%2Futil%2FXDIClientUtil.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
client/src/main/java/xdi2/client/util/XDIClientUtil.java
import xdi2.core.syntax.CloudNumber;
import xdi2.core.syntax.XDIAddress;
import xdi2.core.util.AddressUtil;
		Message message = messageEnvelope.createMessage(cloudNumber.getAddress());
		message.setToPeerRootXri(cloudNumber.getPeerRootArc());
		message.setLinkContractXri(RootLinkContract.createRootLinkContractXri(cloudNumber.getAddress()));
		message.createGetOperation(RootLinkContract.createRootLinkContractXri(cloudNumber.getAddress()));
		return retrievePrivateKey(cloudNumber, xdiEndpointUri, secretToken, XDIAuthenticationConstants.XDI_ADD_MSG_SIG_KEYPAIR_PRIVATE_KEY);
		return retrievePrivateKey(cloudNumber, xdiEndpointUri, secretToken, XDIAuthenticationConstants.XDI_ADD_MSG_ENCRYPT_KEYPAIR_PRIVATE_KEY);
	private static PrivateKey retrievePrivateKey(CloudNumber cloudNumber, String xdiEndpointUri, String secretToken, XDIAddress privateKeyRelativeAddress) throws Xdi2ClientException, GeneralSecurityException {
		XDIAddress privateKeyAddress = AddressUtil.concatAddresses(cloudNumber.getAddress(), privateKeyRelativeAddress);
		Message message = messageEnvelope.createMessage(cloudNumber.getAddress());
		message.setToPeerRootXri(cloudNumber.getPeerRootArc());
		message.setLinkContractXri(RootLinkContract.createRootLinkContractXri(cloudNumber.getAddress()));
		XdiEntity authorityXdiEntity = XdiLocalRoot.findLocalRoot(authorityMessageResultGraph).getXdiEntity(cloudNumber.getAddress(), false);
import xdi2.core.util.XDI3Util;
import xdi2.core.xri3.CloudNumber;
import xdi2.core.xri3.XDI3Segment;
		Message message = messageEnvelope.createMessage(cloudNumber.getXri());
		message.setToPeerRootXri(cloudNumber.getPeerRootXri());
		message.setLinkContractXri(RootLinkContract.createRootLinkContractXri(cloudNumber.getXri()));
		message.createGetOperation(RootLinkContract.createRootLinkContractXri(cloudNumber.getXri()));
		return retrievePrivateKey(cloudNumber, xdiEndpointUri, secretToken, XDIAuthenticationConstants.XRI_S_MSG_SIG_KEYPAIR_PRIVATE_KEY);
		return retrievePrivateKey(cloudNumber, xdiEndpointUri, secretToken, XDIAuthenticationConstants.XRI_S_MSG_ENCRYPT_KEYPAIR_PRIVATE_KEY);
	private static PrivateKey retrievePrivateKey(CloudNumber cloudNumber, String xdiEndpointUri, String secretToken, XDI3Segment privateKeyRelativeAddress) throws Xdi2ClientException, GeneralSecurityException {
		XDI3Segment privateKeyAddress = XDI3Util.concatXris(cloudNumber.getXri(), privateKeyRelativeAddress);
		Message message = messageEnvelope.createMessage(cloudNumber.getXri());
		message.setToPeerRootXri(cloudNumber.getPeerRootXri());
		message.setLinkContractXri(RootLinkContract.createRootLinkContractXri(cloudNumber.getXri()));
		XdiEntity authorityXdiEntity = XdiLocalRoot.findLocalRoot(authorityMessageResultGraph).getXdiEntity(cloudNumber.getXri(), false);
@@ -11,9 +11,9 @@
 import xdi2.core.features.linkcontracts.RootLinkContract;
 import xdi2.core.features.nodetypes.XdiEntity;
 import xdi2.core.features.nodetypes.XdiLocalRoot;
-import xdi2.core.util.XDI3Util;
-import xdi2.core.xri3.CloudNumber;
-import xdi2.core.xri3.XDI3Segment;
+import xdi2.core.syntax.CloudNumber;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.util.AddressUtil;
 import xdi2.messaging.Message;
 import xdi2.messaging.MessageEnvelope;
 import xdi2.messaging.MessageResult;
@@ -25,37 +25,37 @@ public static void authenticateSecretToken(CloudNumber cloudNumber, String xdiEn
 		XDIHttpClient xdiHttpClient = new XDIHttpClient(xdiEndpointUri);
 
 		MessageEnvelope messageEnvelope = new MessageEnvelope();
-		Message message = messageEnvelope.createMessage(cloudNumber.getXri());
-		message.setToPeerRootXri(cloudNumber.getPeerRootXri());
-		message.setLinkContractXri(RootLinkContract.createRootLinkContractXri(cloudNumber.getXri()));
+		Message message = messageEnvelope.createMessage(cloudNumber.getAddress());
+		message.setToPeerRootXri(cloudNumber.getPeerRootArc());
+		message.setLinkContractXri(RootLinkContract.createRootLinkContractXri(cloudNumber.getAddress()));
 		message.setSecretToken(secretToken);
-		message.createGetOperation(RootLinkContract.createRootLinkContractXri(cloudNumber.getXri()));
+		message.createGetOperation(RootLinkContract.createRootLinkContractXri(cloudNumber.getAddress()));
 
 		xdiHttpClient.send(messageEnvelope, null);
 	}
 
 	public static PrivateKey retrieveSignaturePrivateKey(CloudNumber cloudNumber, String xdiEndpointUri, String secretToken) throws Xdi2ClientException, GeneralSecurityException {
 
-		return retrievePrivateKey(cloudNumber, xdiEndpointUri, secretToken, XDIAuthenticationConstants.XRI_S_MSG_SIG_KEYPAIR_PRIVATE_KEY);
+		return retrievePrivateKey(cloudNumber, xdiEndpointUri, secretToken, XDIAuthenticationConstants.XDI_ADD_MSG_SIG_KEYPAIR_PRIVATE_KEY);
 	}
 
 	public static PrivateKey retrieveEncryptionPrivateKey(CloudNumber cloudNumber, String xdiEndpointUri, String secretToken) throws Xdi2ClientException, GeneralSecurityException {
 
-		return retrievePrivateKey(cloudNumber, xdiEndpointUri, secretToken, XDIAuthenticationConstants.XRI_S_MSG_ENCRYPT_KEYPAIR_PRIVATE_KEY);
+		return retrievePrivateKey(cloudNumber, xdiEndpointUri, secretToken, XDIAuthenticationConstants.XDI_ADD_MSG_ENCRYPT_KEYPAIR_PRIVATE_KEY);
 	}
 
-	private static PrivateKey retrievePrivateKey(CloudNumber cloudNumber, String xdiEndpointUri, String secretToken, XDI3Segment privateKeyRelativeAddress) throws Xdi2ClientException, GeneralSecurityException {
+	private static PrivateKey retrievePrivateKey(CloudNumber cloudNumber, String xdiEndpointUri, String secretToken, XDIAddress privateKeyRelativeAddress) throws Xdi2ClientException, GeneralSecurityException {
 
 		// request the private key from the graph
 
 		XDIHttpClient xdiHttpClient = new XDIHttpClient(xdiEndpointUri);
 
-		XDI3Segment privateKeyAddress = XDI3Util.concatXris(cloudNumber.getXri(), privateKeyRelativeAddress);
+		XDIAddress privateKeyAddress = AddressUtil.concatAddresses(cloudNumber.getAddress(), privateKeyRelativeAddress);
 
 		MessageEnvelope messageEnvelope = new MessageEnvelope();
-		Message message = messageEnvelope.createMessage(cloudNumber.getXri());
-		message.setToPeerRootXri(cloudNumber.getPeerRootXri());
-		message.setLinkContractXri(RootLinkContract.createRootLinkContractXri(cloudNumber.getXri()));
+		Message message = messageEnvelope.createMessage(cloudNumber.getAddress());
+		message.setToPeerRootXri(cloudNumber.getPeerRootArc());
+		message.setLinkContractXri(RootLinkContract.createRootLinkContractXri(cloudNumber.getAddress()));
 		message.setSecretToken(secretToken);
 		message.createGetOperation(privateKeyAddress);
 
@@ -65,7 +65,7 @@ private static PrivateKey retrievePrivateKey(CloudNumber cloudNumber, String xdi
 
 		// find authority
 
-		XdiEntity authorityXdiEntity = XdiLocalRoot.findLocalRoot(authorityMessageResultGraph).getXdiEntity(cloudNumber.getXri(), false);
+		XdiEntity authorityXdiEntity = XdiLocalRoot.findLocalRoot(authorityMessageResultGraph).getXdiEntity(cloudNumber.getAddress(), false);
 		if (authorityXdiEntity == null) return null;
 
 		// find private key
https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/client%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fclient%2Futil%2FXDIClientUtil.java
b966ba7a69316b87fe8374c17480429b5212188c
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/client%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fdiscovery%2FXDIDiscoveryClient.java
https://api.github.com/repos/projectdanube/xdi2/contents/client%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fdiscovery%2FXDIDiscoveryClient.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
client/src/main/java/xdi2/discovery/XDIDiscoveryClient.java
import xdi2.core.syntax.CloudNumber;
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIStatement;
import xdi2.core.util.AddressUtil;
	public XDIDiscoveryResult discover(XDIAddress query, XDIAddress[] endpointUriTypes) throws Xdi2ClientException {
	public XDIDiscoveryResult discoverFromRegistry(XDIAddress query, XDIAddress[] endpointUriTypes) throws Xdi2ClientException {
			registryMessage.createGetOperation(XDIAddress.fromComponent(XdiPeerRoot.createPeerRootArc(query)));
	public XDIDiscoveryResult discoverFromAuthority(String xdiEndpointUri, CloudNumber cloudNumber, XDIAddress[] endpointUriTypes) throws Xdi2ClientException {
			authorityMessage.setToPeerRootXri(cloudNumber.getPeerRootArc());
			authorityMessage.setLinkContractXri(PublicLinkContract.createPublicLinkContractXri(cloudNumber.getAddress()));
			authorityMessage.createGetOperation(XDIStatement.fromRelationComponents(XDIConstants.XDI_ADD_ROOT, XDIDictionaryConstants.XDI_ADD_IS_REF, XDIConstants.XDI_ADD_VARIABLE));
			authorityMessage.createGetOperation(XDIStatement.fromRelationComponents(cloudNumber.getAddress(), XDIDictionaryConstants.XDI_ADD_IS_REF, XDIConstants.XDI_ADD_VARIABLE));
			authorityMessage.createGetOperation(AddressUtil.concatAddresses(cloudNumber.getAddress(), XDIAuthenticationConstants.XDI_ADD_MSG_SIG_KEYPAIR_PUBLIC_KEY));
			authorityMessage.createGetOperation(AddressUtil.concatAddresses(cloudNumber.getAddress(), XDIAuthenticationConstants.XDI_ADD_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY));
				for (XDIAddress endpointUriType : endpointUriTypes) {
					authorityMessage.createGetOperation(AddressUtil.concatAddresses(cloudNumber.getAddress(), endpointUriType, XDIClientConstants.XDI_ADD_AS_URI));
		private XDIAddress query;
		private Set<XDIAddress> endpointUriTypes;
		public DiscoveryCacheKey(XDIAddress query, String xdiEndpointUri, Set<XDIAddress> endpointUriTypes) {
		private static DiscoveryCacheKey build(XDIAddress query, XDIHttpClient registryXdiHttpClient, XDIAddress[] endpointUriTypes) {
			return new DiscoveryCacheKey(query, registryXdiHttpClient.getEndpointUri().toString(), endpointUriTypes == null ? null : new HashSet<XDIAddress> (Arrays.asList(endpointUriTypes)));
		private static DiscoveryCacheKey build(CloudNumber cloudNumber, String xdiEndpointUri, XDIAddress[] endpointUriTypes) {
			return new DiscoveryCacheKey(cloudNumber.getAddress(), xdiEndpointUri, endpointUriTypes == null ? null : new HashSet<XDIAddress> (Arrays.asList(endpointUriTypes)));

import xdi2.core.util.XDI3Util;
import xdi2.core.xri3.CloudNumber;
import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
	public XDIDiscoveryResult discover(XDI3Segment query, XDI3Segment[] endpointUriTypes) throws Xdi2ClientException {
	public XDIDiscoveryResult discoverFromRegistry(XDI3Segment query, XDI3Segment[] endpointUriTypes) throws Xdi2ClientException {
			registryMessage.createGetOperation(XDI3Segment.fromComponent(XdiPeerRoot.createPeerRootArcXri(query)));
	public XDIDiscoveryResult discoverFromAuthority(String xdiEndpointUri, CloudNumber cloudNumber, XDI3Segment[] endpointUriTypes) throws Xdi2ClientException {
			authorityMessage.setToPeerRootXri(cloudNumber.getPeerRootXri());
			authorityMessage.setLinkContractXri(PublicLinkContract.createPublicLinkContractXri(cloudNumber.getXri()));
			authorityMessage.createGetOperation(XDI3Statement.fromRelationComponents(XDIConstants.XRI_S_ROOT, XDIDictionaryConstants.XRI_S_IS_REF, XDIConstants.XRI_S_VARIABLE));
			authorityMessage.createGetOperation(XDI3Statement.fromRelationComponents(cloudNumber.getXri(), XDIDictionaryConstants.XRI_S_IS_REF, XDIConstants.XRI_S_VARIABLE));
			authorityMessage.createGetOperation(XDI3Util.concatXris(cloudNumber.getXri(), XDIAuthenticationConstants.XRI_S_MSG_SIG_KEYPAIR_PUBLIC_KEY));
			authorityMessage.createGetOperation(XDI3Util.concatXris(cloudNumber.getXri(), XDIAuthenticationConstants.XRI_S_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY));
				for (XDI3Segment endpointUriType : endpointUriTypes) {
					authorityMessage.createGetOperation(XDI3Util.concatXris(cloudNumber.getXri(), endpointUriType, XDIClientConstants.XRI_S_AS_URI));
		private XDI3Segment query;
		private Set<XDI3Segment> endpointUriTypes;
		public DiscoveryCacheKey(XDI3Segment query, String xdiEndpointUri, Set<XDI3Segment> endpointUriTypes) {
		private static DiscoveryCacheKey build(XDI3Segment query, XDIHttpClient registryXdiHttpClient, XDI3Segment[] endpointUriTypes) {
			return new DiscoveryCacheKey(query, registryXdiHttpClient.getEndpointUri().toString(), endpointUriTypes == null ? null : new HashSet<XDI3Segment> (Arrays.asList(endpointUriTypes)));
		private static DiscoveryCacheKey build(CloudNumber cloudNumber, String xdiEndpointUri, XDI3Segment[] endpointUriTypes) {
			return new DiscoveryCacheKey(cloudNumber.getXri(), xdiEndpointUri, endpointUriTypes == null ? null : new HashSet<XDI3Segment> (Arrays.asList(endpointUriTypes)));

@@ -22,10 +22,10 @@
 import xdi2.core.constants.XDIDictionaryConstants;
 import xdi2.core.features.linkcontracts.PublicLinkContract;
 import xdi2.core.features.nodetypes.XdiPeerRoot;
-import xdi2.core.util.XDI3Util;
-import xdi2.core.xri3.CloudNumber;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
+import xdi2.core.syntax.CloudNumber;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIStatement;
+import xdi2.core.util.AddressUtil;
 import xdi2.messaging.Message;
 import xdi2.messaging.MessageEnvelope;
 import xdi2.messaging.MessageResult;
@@ -103,7 +103,7 @@ public XDIDiscoveryClient() {
 		this(NEUSTAR_PROD_DISCOVERY_XDI_CLIENT);
 	}
 
-	public XDIDiscoveryResult discover(XDI3Segment query, XDI3Segment[] endpointUriTypes) throws Xdi2ClientException {
+	public XDIDiscoveryResult discover(XDIAddress query, XDIAddress[] endpointUriTypes) throws Xdi2ClientException {
 
 		// first discover from registry
 
@@ -146,7 +146,7 @@ public XDIDiscoveryResult discover(XDI3Segment query, XDI3Segment[] endpointUriT
 		return xdiDiscoveryResult;
 	}
 
-	public XDIDiscoveryResult discoverFromRegistry(XDI3Segment query, XDI3Segment[] endpointUriTypes) throws Xdi2ClientException {
+	public XDIDiscoveryResult discoverFromRegistry(XDIAddress query, XDIAddress[] endpointUriTypes) throws Xdi2ClientException {
 
 		XDIDiscoveryResult discoveryResult = new XDIDiscoveryResult();
 
@@ -173,7 +173,7 @@ public XDIDiscoveryResult discoverFromRegistry(XDI3Segment query, XDI3Segment[]
 
 			registryMessageEnvelope = new MessageEnvelope();
 			Message registryMessage = registryMessageEnvelope.createMessage(null);
-			registryMessage.createGetOperation(XDI3Segment.fromComponent(XdiPeerRoot.createPeerRootArcXri(query)));
+			registryMessage.createGetOperation(XDIAddress.fromComponent(XdiPeerRoot.createPeerRootArc(query)));
 
 			try {
 
@@ -213,7 +213,7 @@ public XDIDiscoveryResult discoverFromRegistry(XDI3Segment query, XDI3Segment[]
 		return discoveryResult;
 	}
 
-	public XDIDiscoveryResult discoverFromAuthority(String xdiEndpointUri, CloudNumber cloudNumber, XDI3Segment[] endpointUriTypes) throws Xdi2ClientException {
+	public XDIDiscoveryResult discoverFromAuthority(String xdiEndpointUri, CloudNumber cloudNumber, XDIAddress[] endpointUriTypes) throws Xdi2ClientException {
 
 		XDIDiscoveryResult discoveryResult = new XDIDiscoveryResult();
 
@@ -240,18 +240,18 @@ public XDIDiscoveryResult discoverFromAuthority(String xdiEndpointUri, CloudNumb
 
 			authorityMessageEnvelope = new MessageEnvelope();
 			Message authorityMessage = authorityMessageEnvelope.createMessage(null);
-			authorityMessage.setToPeerRootXri(cloudNumber.getPeerRootXri());
-			authorityMessage.setLinkContractXri(PublicLinkContract.createPublicLinkContractXri(cloudNumber.getXri()));
-			authorityMessage.createGetOperation(XDI3Statement.fromRelationComponents(XDIConstants.XRI_S_ROOT, XDIDictionaryConstants.XRI_S_IS_REF, XDIConstants.XRI_S_VARIABLE));
-			authorityMessage.createGetOperation(XDI3Statement.fromRelationComponents(cloudNumber.getXri(), XDIDictionaryConstants.XRI_S_IS_REF, XDIConstants.XRI_S_VARIABLE));
-			authorityMessage.createGetOperation(XDI3Util.concatXris(cloudNumber.getXri(), XDIAuthenticationConstants.XRI_S_MSG_SIG_KEYPAIR_PUBLIC_KEY));
-			authorityMessage.createGetOperation(XDI3Util.concatXris(cloudNumber.getXri(), XDIAuthenticationConstants.XRI_S_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY));
+			authorityMessage.setToPeerRootXri(cloudNumber.getPeerRootArc());
+			authorityMessage.setLinkContractXri(PublicLinkContract.createPublicLinkContractXri(cloudNumber.getAddress()));
+			authorityMessage.createGetOperation(XDIStatement.fromRelationComponents(XDIConstants.XDI_ADD_ROOT, XDIDictionaryConstants.XDI_ADD_IS_REF, XDIConstants.XDI_ADD_VARIABLE));
+			authorityMessage.createGetOperation(XDIStatement.fromRelationComponents(cloudNumber.getAddress(), XDIDictionaryConstants.XDI_ADD_IS_REF, XDIConstants.XDI_ADD_VARIABLE));
+			authorityMessage.createGetOperation(AddressUtil.concatAddresses(cloudNumber.getAddress(), XDIAuthenticationConstants.XDI_ADD_MSG_SIG_KEYPAIR_PUBLIC_KEY));
+			authorityMessage.createGetOperation(AddressUtil.concatAddresses(cloudNumber.getAddress(), XDIAuthenticationConstants.XDI_ADD_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY));
 
 			if (endpointUriTypes != null) {
 
-				for (XDI3Segment endpointUriType : endpointUriTypes) {
+				for (XDIAddress endpointUriType : endpointUriTypes) {
 
-					authorityMessage.createGetOperation(XDI3Util.concatXris(cloudNumber.getXri(), endpointUriType, XDIClientConstants.XRI_S_AS_URI));
+					authorityMessage.createGetOperation(AddressUtil.concatAddresses(cloudNumber.getAddress(), endpointUriType, XDIClientConstants.XDI_ADD_AS_URI));
 				}
 			}
 
@@ -301,25 +301,25 @@ private static class DiscoveryCacheKey implements Serializable {
 
 		private static final long serialVersionUID = -2109761083423630152L;
 
-		private XDI3Segment query;
+		private XDIAddress query;
 		private String xdiEndpointUri;
-		private Set<XDI3Segment> endpointUriTypes;
+		private Set<XDIAddress> endpointUriTypes;
 
-		public DiscoveryCacheKey(XDI3Segment query, String xdiEndpointUri, Set<XDI3Segment> endpointUriTypes) {
+		public DiscoveryCacheKey(XDIAddress query, String xdiEndpointUri, Set<XDIAddress> endpointUriTypes) {
 
 			this.query = query;
 			this.xdiEndpointUri = xdiEndpointUri;
 			this.endpointUriTypes = endpointUriTypes;
 		}
 
-		private static DiscoveryCacheKey build(XDI3Segment query, XDIHttpClient registryXdiHttpClient, XDI3Segment[] endpointUriTypes) {
+		private static DiscoveryCacheKey build(XDIAddress query, XDIHttpClient registryXdiHttpClient, XDIAddress[] endpointUriTypes) {
 
-			return new DiscoveryCacheKey(query, registryXdiHttpClient.getEndpointUri().toString(), endpointUriTypes == null ? null : new HashSet<XDI3Segment> (Arrays.asList(endpointUriTypes)));
+			return new DiscoveryCacheKey(query, registryXdiHttpClient.getEndpointUri().toString(), endpointUriTypes == null ? null : new HashSet<XDIAddress> (Arrays.asList(endpointUriTypes)));
 		}
 
-		private static DiscoveryCacheKey build(CloudNumber cloudNumber, String xdiEndpointUri, XDI3Segment[] endpointUriTypes) {
+		private static DiscoveryCacheKey build(CloudNumber cloudNumber, String xdiEndpointUri, XDIAddress[] endpointUriTypes) {
 
-			return new DiscoveryCacheKey(cloudNumber.getXri(), xdiEndpointUri, endpointUriTypes == null ? null : new HashSet<XDI3Segment> (Arrays.asList(endpointUriTypes)));
+			return new DiscoveryCacheKey(cloudNumber.getAddress(), xdiEndpointUri, endpointUriTypes == null ? null : new HashSet<XDIAddress> (Arrays.asList(endpointUriTypes)));
 		}
 
 		@Override

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/client%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fdiscovery%2FXDIDiscoveryClient.java
3f170d9d0c920c85778e7ea6054de27feebf6909
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/client%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fdiscovery%2FXDIDiscoveryResult.java
https://api.github.com/repos/projectdanube/xdi2/contents/client%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fdiscovery%2FXDIDiscoveryResult.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
client/src/main/java/xdi2/discovery/XDIDiscoveryResult.java
import xdi2.core.syntax.CloudNumber;
import xdi2.core.syntax.XDIAddress;
import xdi2.core.util.AddressUtil;
	private Map<XDIAddress, String> endpointUris;
		this.endpointUris = new HashMap<XDIAddress, String> ();
	void initFromRegistryAndAuthorityDiscoveryResult(XDIDiscoveryResult xdiDiscoveryResultRegistry, XDIDiscoveryResult xdiDiscoveryResultAuthority, XDIAddress query, XDIAddress[] endpointUriTypes) throws Xdi2ClientException {
	void initFromRegistryMessageResult(MessageEnvelope registryMessageEnvelope, MessageResult registryMessageResult, XDIAddress query, XDIAddress[] endpointUriTypes) throws Xdi2ClientException {
		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getAddressOfPeerRoot())) {
			this.cloudNumber = CloudNumber.fromPeerRootArc(((XdiPeerRoot) xdiRoot).getArc());
		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getAddressOfPeerRoot())) {
			this.cloudNumber = CloudNumber.fromPeerRootArc(((XdiPeerRoot) xdiRoot).getArc());
		endpointUriTypes = new XDIAddress[] { XDIClientConstants.XDI_ADD_AS_XDI };
		for (XDIAddress endpointUriType : endpointUriTypes) {
			XDIAddress endpointUriXdiAttributeAddress = AddressUtil.concatAddresses(endpointUriType, XDIClientConstants.XDI_ARC_AS_URI);
	void initFromAuthorityMessageResult(MessageEnvelope authorityMessageEnvelope, MessageResult authorityMessageResult, XDIAddress[] endpointUriTypes) throws Xdi2ClientException {
		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getAddressOfPeerRoot())) {
			this.cloudNumber = CloudNumber.fromPeerRootArc(((XdiPeerRoot) xdiRoot).getArc());
		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getAddressOfPeerRoot())) {
			this.cloudNumber = CloudNumber.fromPeerRootArc(((XdiPeerRoot) xdiRoot).getArc());
		XdiEntity authorityXdiEntity = XdiLocalRoot.findLocalRoot(authorityMessageResultGraph).getXdiEntity(this.cloudNumber.getAddress(), false);
			for (XDIAddress endpointUriType : endpointUriTypes) {
				XDIAddress endpointUriXdiAttributeAddress = AddressUtil.concatAddresses(endpointUriType, XDIClientConstants.XDI_ARC_AS_URI);
	public Map<XDIAddress, String> getEndpointUris() {
		return this.getEndpointUris().get(XDIClientConstants.XDI_ADD_AS_XDI);

import xdi2.core.util.XDI3Util;
import xdi2.core.xri3.CloudNumber;
import xdi2.core.xri3.XDI3Segment;
	private Map<XDI3Segment, String> endpointUris;
		this.endpointUris = new HashMap<XDI3Segment, String> ();
	void initFromRegistryAndAuthorityDiscoveryResult(XDIDiscoveryResult xdiDiscoveryResultRegistry, XDIDiscoveryResult xdiDiscoveryResultAuthority, XDI3Segment query, XDI3Segment[] endpointUriTypes) throws Xdi2ClientException {
	void initFromRegistryMessageResult(MessageEnvelope registryMessageEnvelope, MessageResult registryMessageResult, XDI3Segment query, XDI3Segment[] endpointUriTypes) throws Xdi2ClientException {
		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getXriOfPeerRoot())) {
			this.cloudNumber = CloudNumber.fromPeerRootXri(((XdiPeerRoot) xdiRoot).getArcXri());
		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getXriOfPeerRoot())) {
			this.cloudNumber = CloudNumber.fromPeerRootXri(((XdiPeerRoot) xdiRoot).getArcXri());
		endpointUriTypes = new XDI3Segment[] { XDIClientConstants.XRI_S_AS_XDI };
		for (XDI3Segment endpointUriType : endpointUriTypes) {
			XDI3Segment endpointUriXdiAttributeAddress = XDI3Util.concatXris(endpointUriType, XDIClientConstants.XRI_SS_AS_URI);
	void initFromAuthorityMessageResult(MessageEnvelope authorityMessageEnvelope, MessageResult authorityMessageResult, XDI3Segment[] endpointUriTypes) throws Xdi2ClientException {
		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getXriOfPeerRoot())) {
			this.cloudNumber = CloudNumber.fromPeerRootXri(((XdiPeerRoot) xdiRoot).getArcXri());
		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getXriOfPeerRoot())) {
			this.cloudNumber = CloudNumber.fromPeerRootXri(((XdiPeerRoot) xdiRoot).getArcXri());
		XdiEntity authorityXdiEntity = XdiLocalRoot.findLocalRoot(authorityMessageResultGraph).getXdiEntity(this.cloudNumber.getXri(), false);
			for (XDI3Segment endpointUriType : endpointUriTypes) {
				XDI3Segment endpointUriXdiAttributeAddress = XDI3Util.concatXris(endpointUriType, XDIClientConstants.XRI_SS_AS_URI);
	public Map<XDI3Segment, String> getEndpointUris() {
		return this.getEndpointUris().get(XDIClientConstants.XRI_S_AS_XDI);

@@ -17,9 +17,9 @@
 import xdi2.core.features.nodetypes.XdiPeerRoot;
 import xdi2.core.features.nodetypes.XdiRoot;
 import xdi2.core.features.nodetypes.XdiValue;
-import xdi2.core.util.XDI3Util;
-import xdi2.core.xri3.CloudNumber;
-import xdi2.core.xri3.XDI3Segment;
+import xdi2.core.syntax.CloudNumber;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.util.AddressUtil;
 import xdi2.messaging.MessageEnvelope;
 import xdi2.messaging.MessageResult;
 
@@ -30,7 +30,7 @@ public class XDIDiscoveryResult implements Serializable {
 	private CloudNumber cloudNumber;
 	private PublicKey signaturePublicKey;
 	private PublicKey encryptionPublicKey;
-	private Map<XDI3Segment, String> endpointUris;
+	private Map<XDIAddress, String> endpointUris;
 
 	private MessageEnvelope messageEnvelope;
 	private MessageResult messageResult;
@@ -40,19 +40,19 @@ public XDIDiscoveryResult() {
 		this.cloudNumber = null;
 		this.signaturePublicKey = null;
 		this.encryptionPublicKey = null;
-		this.endpointUris = new HashMap<XDI3Segment, String> ();
+		this.endpointUris = new HashMap<XDIAddress, String> ();
 
 		this.messageEnvelope = null;
 		this.messageResult = null;
 	}
 
-	void initFromRegistryAndAuthorityDiscoveryResult(XDIDiscoveryResult xdiDiscoveryResultRegistry, XDIDiscoveryResult xdiDiscoveryResultAuthority, XDI3Segment query, XDI3Segment[] endpointUriTypes) throws Xdi2ClientException {
+	void initFromRegistryAndAuthorityDiscoveryResult(XDIDiscoveryResult xdiDiscoveryResultRegistry, XDIDiscoveryResult xdiDiscoveryResultAuthority, XDIAddress query, XDIAddress[] endpointUriTypes) throws Xdi2ClientException {
 
 		this.initFromRegistryMessageResult(xdiDiscoveryResultRegistry.getMessageEnvelope(), xdiDiscoveryResultRegistry.getMessageResult(), query, endpointUriTypes);
 		this.initFromAuthorityMessageResult(xdiDiscoveryResultAuthority.getMessageEnvelope(), xdiDiscoveryResultAuthority.getMessageResult(), endpointUriTypes);
 	}
 
-	void initFromRegistryMessageResult(MessageEnvelope registryMessageEnvelope, MessageResult registryMessageResult, XDI3Segment query, XDI3Segment[] endpointUriTypes) throws Xdi2ClientException {
+	void initFromRegistryMessageResult(MessageEnvelope registryMessageEnvelope, MessageResult registryMessageResult, XDIAddress query, XDIAddress[] endpointUriTypes) throws Xdi2ClientException {
 
 		this.messageEnvelope = registryMessageEnvelope;
 		this.messageResult = registryMessageResult;
@@ -66,25 +66,25 @@ void initFromRegistryMessageResult(MessageEnvelope registryMessageEnvelope, Mess
 		XdiRoot xdiRoot = XdiLocalRoot.findLocalRoot(registryMessageResultGraph).getPeerRoot(query, false);
 		if (xdiRoot == null) return;
 
-		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getXriOfPeerRoot())) {
+		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getAddressOfPeerRoot())) {
 
-			this.cloudNumber = CloudNumber.fromPeerRootXri(((XdiPeerRoot) xdiRoot).getArcXri());
+			this.cloudNumber = CloudNumber.fromPeerRootArc(((XdiPeerRoot) xdiRoot).getArc());
 		}
 
 		xdiRoot = xdiRoot == null ? null : xdiRoot.dereference();
 
-		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getXriOfPeerRoot())) {
+		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getAddressOfPeerRoot())) {
 
-			this.cloudNumber = CloudNumber.fromPeerRootXri(((XdiPeerRoot) xdiRoot).getArcXri());
+			this.cloudNumber = CloudNumber.fromPeerRootArc(((XdiPeerRoot) xdiRoot).getArc());
 		}
 
 		// find XDI endpoint uri
 
-		endpointUriTypes = new XDI3Segment[] { XDIClientConstants.XRI_S_AS_XDI };
+		endpointUriTypes = new XDIAddress[] { XDIClientConstants.XDI_ADD_AS_XDI };
 
-		for (XDI3Segment endpointUriType : endpointUriTypes) {
+		for (XDIAddress endpointUriType : endpointUriTypes) {
 
-			XDI3Segment endpointUriXdiAttributeAddress = XDI3Util.concatXris(endpointUriType, XDIClientConstants.XRI_SS_AS_URI);
+			XDIAddress endpointUriXdiAttributeAddress = AddressUtil.concatAddresses(endpointUriType, XDIClientConstants.XDI_ARC_AS_URI);
 			XdiAttribute endpointUriXdiAttribute = xdiRoot.getXdiAttributeSingleton(endpointUriXdiAttributeAddress, false);
 			if (endpointUriXdiAttribute == null) continue;
 
@@ -103,7 +103,7 @@ void initFromRegistryMessageResult(MessageEnvelope registryMessageEnvelope, Mess
 		}
 	}
 
-	void initFromAuthorityMessageResult(MessageEnvelope authorityMessageEnvelope, MessageResult authorityMessageResult, XDI3Segment[] endpointUriTypes) throws Xdi2ClientException {
+	void initFromAuthorityMessageResult(MessageEnvelope authorityMessageEnvelope, MessageResult authorityMessageResult, XDIAddress[] endpointUriTypes) throws Xdi2ClientException {
 
 		this.messageEnvelope = authorityMessageEnvelope;
 		this.messageResult = authorityMessageResult;
@@ -118,24 +118,24 @@ void initFromAuthorityMessageResult(MessageEnvelope authorityMessageEnvelope, Me
 		if (xdiRoot == null) xdiRoot = XdiLocalRoot.findLocalRoot(authorityMessageResultGraph);
 		if (xdiRoot == null) return;
 
-		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getXriOfPeerRoot())) {
+		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getAddressOfPeerRoot())) {
 
-			this.cloudNumber = CloudNumber.fromPeerRootXri(((XdiPeerRoot) xdiRoot).getArcXri());
+			this.cloudNumber = CloudNumber.fromPeerRootArc(((XdiPeerRoot) xdiRoot).getArc());
 		}
 
 		xdiRoot = xdiRoot == null ? null : xdiRoot.dereference();
 
-		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getXriOfPeerRoot())) {
+		if (xdiRoot instanceof XdiPeerRoot && CloudNumber.isValid(((XdiPeerRoot) xdiRoot).getAddressOfPeerRoot())) {
 
-			this.cloudNumber = CloudNumber.fromPeerRootXri(((XdiPeerRoot) xdiRoot).getArcXri());
+			this.cloudNumber = CloudNumber.fromPeerRootArc(((XdiPeerRoot) xdiRoot).getArc());
 		}
 
 		// find cloud names
 
 
 		// find authority
 
-		XdiEntity authorityXdiEntity = XdiLocalRoot.findLocalRoot(authorityMessageResultGraph).getXdiEntity(this.cloudNumber.getXri(), false);
+		XdiEntity authorityXdiEntity = XdiLocalRoot.findLocalRoot(authorityMessageResultGraph).getXdiEntity(this.cloudNumber.getAddress(), false);
 		if (authorityXdiEntity == null) return;
 
 		// find signature public key
@@ -162,9 +162,9 @@ void initFromAuthorityMessageResult(MessageEnvelope authorityMessageEnvelope, Me
 
 		if (endpointUriTypes != null) {
 
-			for (XDI3Segment endpointUriType : endpointUriTypes) {
+			for (XDIAddress endpointUriType : endpointUriTypes) {
 
-				XDI3Segment endpointUriXdiAttributeAddress = XDI3Util.concatXris(endpointUriType, XDIClientConstants.XRI_SS_AS_URI);
+				XDIAddress endpointUriXdiAttributeAddress = AddressUtil.concatAddresses(endpointUriType, XDIClientConstants.XDI_ARC_AS_URI);
 				XdiAttribute endpointUriXdiAttribute = authorityXdiEntity.getXdiAttributeSingleton(endpointUriXdiAttributeAddress, false);
 				if (endpointUriXdiAttribute == null) continue;
 
@@ -210,14 +210,14 @@ public PublicKey getEncryptionPublicKey() {
 		return this.encryptionPublicKey;
 	}
 
-	public Map<XDI3Segment, String> getEndpointUris() {
+	public Map<XDIAddress, String> getEndpointUris() {
 
 		return this.endpointUris;
 	}
 
 	public String getXdiEndpointUri() {
 
-		return this.getEndpointUris().get(XDIClientConstants.XRI_S_AS_XDI);
+		return this.getEndpointUris().get(XDIClientConstants.XDI_ADD_AS_XDI);
 	}
 
 	public String getDefaultEndpointUri() {

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/client%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fdiscovery%2FXDIDiscoveryResult.java
06a770da205a8279ff7bd2199346c70db4902b35
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2FContextNode.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2FContextNode.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/ContextNode.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.syntax.XDIStatement;
	 * Every context node has an associated arc.
	 * @return The arc associated with this context node.
	public XDIArc getArc();
	 * Gets the address of this context node.
	 * @return The address of this context node.
	public XDIAddress getAddress();
	 * @param arc The arc of the new or existing context node.
	public ContextNode setContextNode(XDIArc arc);
	public ContextNode setDeepContextNode(XDIAddress relativecontextNodeAddress);
	 * Returns the context node with a given arc.
	 * @param arc The arc of the context node.
	 * @return The context node with the given arc, or null.
	public ContextNode getContextNode(XDIArc arc, boolean subgraph);
	 * Returns the context node with a given arc.
	 * @param arc The arc of the context node.
	 * @return The context node with the given arc, or null.
	public ContextNode getContextNode(XDIArc arc);
	public ContextNode getDeepContextNode(XDIAddress relativecontextNodeAddress, boolean subgraph);
	public ContextNode getDeepContextNode(XDIAddress relativecontextNodeAddress);
	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDIAddress relativecontextNodeAddress);
	 * Checks if a context node with a given arc exists under this context node.
	 * @param arc The arc to look for. 
	 * @return True if this context node has a context node with the given arc.
	public boolean containsContextNode(XDIArc arc);
	 * Deletes the context node with a given arc.
	 * @param arc The arc of the context node.
	public void delContextNode(XDIArc arc);
	 * @param arc The arc of the relation.
	 * @param targetContextNodeAddress The target context node XRI of the relation.
	public Relation setRelation(XDIAddress arc, XDIAddress targetContextNodeAddress);
	 * Deep version of ContextNode.setRelation(XDIAddress, XDIAddress), operates at a context node further down in the graph.
	public Relation setDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress);
	 * @param arc The arc of the relation.
	public Relation setRelation(XDIAddress arc, ContextNode targetContextNode);
	 * Deep version of ContextNode.setRelation(XDIAddress, ContextNode), operates at a context node further down in the graph.
	public Relation setDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc, ContextNode targetContextNode);
	 * @param arc The arc to look for. 
	 * @param targetContextNodeAddress The target context node XRI of the relation.
	 * @return The relation with the given arc, or null.
	public Relation getRelation(XDIAddress arc, XDIAddress targetContextNodeAddress);
	 * Deep version of ContextNode.getRelation(XDIAddress, XDIAddress), operates at a context node further down in the graph.
	public Relation getDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress);
	 * @param arc The arc to look for. 
	 * @return The relation with the given arc, or null.
	public Relation getRelation(XDIAddress arc);
	 * Deep version of ContextNode.getRelation(XDIAddress), operates at a context node further down in the graph.
	public Relation getDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc);
	 * @param arc The arc to look for. 
	 * @return An iterator over relations with the given arc, or null.
	public ReadOnlyIterator<Relation> getRelations(XDIAddress arc);
	 * Deep version of ContextNode.getRelations(XDIAddress), operates at a context node further down in the graph.
	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress relativecontextNodeAddress, XDIAddress arc);
	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress relativecontextNodeAddress);
	 * Returns the incoming relations with a given arc.
	 * @param arc The arc to look for. 
	 * @return An iterator over relations with the given arc, or null.
	public ReadOnlyIterator<Relation> getIncomingRelations(XDIAddress arc);
	 * Checks if a relation with a given arc and target context node XRI exists in this context node.
	 * @param arc The arc of the relations. 
	 * @param targetContextNodeAddress The target context node XRI of the relation.
	 * @return True if this context node has a relation with the given arc and target context node XRI.
	public boolean containsRelation(XDIAddress arc, XDIAddress targetContextNodeAddress);
	 * Checks if relations with a given arc exist in this context node.
	 * @param arc The arc of the relations. 
	 * @return True if this context node has relations with the given arc.
	public boolean containsRelations(XDIAddress arc);
	 * Checks if incoming relations with a given arc exist in this context node.
	 * @param arc The arc of the incoming relations. 
	 * @return True if this context node has incoming relations with the given arc.
	public boolean containsIncomingRelations(XDIAddress arc);
	 * Deletes the relation with a given arc from this context node.
	 * @param arc The arc of the relation.
	 * @param targetContextNodeAddress The target context node XRI of the relation.
	public void delRelation(XDIAddress arc, XDIAddress targetContextNodeAddress);
	 * Deletes the relation with a given arc from this context node.
	 * @param arc The arc of the relation.
	public void delRelations(XDIAddress arc);
	 * @param arc The arc to look for. 
	public long getRelationCount(XDIAddress arc);
	public Literal setDeepLiteral(XDIAddress relativecontextNodeAddress, Object literalData);
	public Literal setDeepLiteralString(XDIAddress relativecontextNodeAddress, String literalData);
	public Literal setDeepLiteralNumber(XDIAddress relativecontextNodeAddress, Double literalData);
	public Literal setDeepLiteralBoolean(XDIAddress relativecontextNodeAddress, Boolean literalData);
	public Literal getDeepLiteral(XDIAddress relativecontextNodeAddress, Object literalData);
	public Literal getDeepLiteralString(XDIAddress relativecontextNodeAddress, String literalData);
	public Literal getDeepLiteralNumber(XDIAddress relativecontextNodeAddress, Double literalData);
	public Literal getDeepLiteralBoolean(XDIAddress relativecontextNodeAddress, Boolean literalData);
	public Literal getDeepLiteral(XDIAddress relativecontextNodeAddress);
	public Statement setStatement(XDIStatement statementXri);
	public Statement getStatement(XDIStatement statementXri);
	public boolean containsStatement(XDIStatement statementXri);

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
import xdi2.core.xri3.XDI3SubSegment;
	 * Every context node has an associated arc XRI.
	 * @return The arc XRI associated with this context node.
	public XDI3SubSegment getArcXri();
	 * Gets the XRI of this context node.
	 * @return The XRI of this context node.
	public XDI3Segment getXri();
	 * @param arcXri The arc XRI of the new or existing context node.
	public ContextNode setContextNode(XDI3SubSegment arcXri);
	public ContextNode setDeepContextNode(XDI3Segment relativeContextNodeXri);
	 * Returns the context node with a given arc XRI.
	 * @param arcXri The arc XRI of the context node.
	 * @return The context node with the given arc XRI, or null.
	public ContextNode getContextNode(XDI3SubSegment arcXri, boolean subgraph);
	 * Returns the context node with a given arc XRI.
	 * @param arcXri The arc XRI of the context node.
	 * @return The context node with the given arc XRI, or null.
	public ContextNode getContextNode(XDI3SubSegment arcXri);
	public ContextNode getDeepContextNode(XDI3Segment relativeContextNodeXri, boolean subgraph);
	public ContextNode getDeepContextNode(XDI3Segment relativeContextNodeXri);
	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDI3Segment relativeContextNodeXri);
	 * Checks if a context node with a given arc XRI exists under this context node.
	 * @param arcXri The arc XRI to look for. 
	 * @return True if this context node has a context node with the given arc XRI.
	public boolean containsContextNode(XDI3SubSegment arcXri);
	 * Deletes the context node with a given arc XRI.
	 * @param arcXri The arc XRI of the context node.
	public void delContextNode(XDI3SubSegment arcXri);
	 * @param arcXri The arc XRI of the relation.
	 * @param targetContextNodeXri The target context node XRI of the relation.
	public Relation setRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
	 * Deep version of ContextNode.setRelation(XDI3Segment, XDI3Segment), operates at a context node further down in the graph.
	public Relation setDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
	 * @param arcXri The arc XRI of the relation.
	public Relation setRelation(XDI3Segment arcXri, ContextNode targetContextNode);
	 * Deep version of ContextNode.setRelation(XDI3Segment, ContextNode), operates at a context node further down in the graph.
	public Relation setDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri, ContextNode targetContextNode);
	 * @param arcXri The arc XRI to look for. 
	 * @param targetContextNodeXri The target context node XRI of the relation.
	 * @return The relation with the given arc XRI, or null.
	public Relation getRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
	 * Deep version of ContextNode.getRelation(XDI3Segment, XDI3Segment), operates at a context node further down in the graph.
	public Relation getDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
	 * @param arcXri The arc XRI to look for. 
	 * @return The relation with the given arc XRI, or null.
	public Relation getRelation(XDI3Segment arcXri);
	 * Deep version of ContextNode.getRelation(XDI3Segment), operates at a context node further down in the graph.
	public Relation getDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri);
	 * @param arcXri The arc XRI to look for. 
	 * @return An iterator over relations with the given arc XRI, or null.
	public ReadOnlyIterator<Relation> getRelations(XDI3Segment arcXri);
	 * Deep version of ContextNode.getRelations(XDI3Segment), operates at a context node further down in the graph.
	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri);
	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment relativeContextNodeXri);
	 * Returns the incoming relations with a given arc XRI.
	 * @param arcXri The arc XRI to look for. 
	 * @return An iterator over relations with the given arc XRI, or null.
	public ReadOnlyIterator<Relation> getIncomingRelations(XDI3Segment arcXri);
	 * Checks if a relation with a given arc XRI and target context node XRI exists in this context node.
	 * @param arcXri The arc XRI of the relations. 
	 * @param targetContextNodeXri The target context node XRI of the relation.
	 * @return True if this context node has a relation with the given arc XRI and target context node XRI.
	public boolean containsRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
	 * Checks if relations with a given arc XRI exist in this context node.
	 * @param arcXri The arc XRI of the relations. 
	 * @return True if this context node has relations with the given arc XRI.
	public boolean containsRelations(XDI3Segment arcXri);
	 * Checks if incoming relations with a given arc XRI exist in this context node.
	 * @param arcXri The arc XRI of the incoming relations. 
	 * @return True if this context node has incoming relations with the given arc XRI.
	public boolean containsIncomingRelations(XDI3Segment arcXri);
	 * Deletes the relation with a given arc XRI from this context node.
	 * @param arcXri The arc XRI of the relation.
	 * @param targetContextNodeXri The target context node XRI of the relation.
	public void delRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
	 * Deletes the relation with a given arc XRI from this context node.
	 * @param arcXri The arc XRI of the relation.
	public void delRelations(XDI3Segment arcXri);
	 * @param arcXri The arc XRI to look for. 
	public long getRelationCount(XDI3Segment arcXri);
	public Literal setDeepLiteral(XDI3Segment relativeContextNodeXri, Object literalData);
	public Literal setDeepLiteralString(XDI3Segment relativeContextNodeXri, String literalData);
	public Literal setDeepLiteralNumber(XDI3Segment relativeContextNodeXri, Double literalData);
	public Literal setDeepLiteralBoolean(XDI3Segment relativeContextNodeXri, Boolean literalData);
	public Literal getDeepLiteral(XDI3Segment relativeContextNodeXri, Object literalData);
	public Literal getDeepLiteralString(XDI3Segment relativeContextNodeXri, String literalData);
	public Literal getDeepLiteralNumber(XDI3Segment relativeContextNodeXri, Double literalData);
	public Literal getDeepLiteralBoolean(XDI3Segment relativeContextNodeXri, Boolean literalData);
	public Literal getDeepLiteral(XDI3Segment relativeContextNodeXri);
	public Statement setStatement(XDI3Statement statementXri);
	public Statement getStatement(XDI3Statement statementXri);
	public boolean containsStatement(XDI3Statement statementXri);

@@ -3,10 +3,10 @@
 import java.io.Serializable;
 
 import xdi2.core.Statement.ContextNodeStatement;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.syntax.XDIStatement;
 import xdi2.core.util.iterators.ReadOnlyIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
-import xdi2.core.xri3.XDI3SubSegment;
 
 /**
  * This interface represents a context node in an XDI graph.
@@ -67,61 +67,61 @@ public interface ContextNode extends Serializable, Comparable<ContextNode> {
 	public boolean isEmpty();
 
 	/**
-	 * Every context node has an associated arc XRI.
+	 * Every context node has an associated arc.
 	 * This returns null for the root context node.
-	 * @return The arc XRI associated with this context node.
+	 * @return The arc associated with this context node.
 	 */
-	public XDI3SubSegment getArcXri();
+	public XDIArc getArc();
 
 	/**
-	 * Gets the XRI of this context node.
+	 * Gets the address of this context node.
 	 * This returns the empty string for the root context node.
-	 * @return The XRI of this context node.
+	 * @return The address of this context node.
 	 */
-	public XDI3Segment getXri();
+	public XDIAddress getAddress();
 
 	/*
 	 * Methods related to context nodes of this context node
 	 */
 
 	/**
 	 * Creates a new context node and adds it to this context node, or returns an existing context node.
-	 * @param arcXri The arc XRI of the new or existing context node.
+	 * @param arc The arc of the new or existing context node.
 	 * @return The newly created or existing context node.
 	 */
-	public ContextNode setContextNode(XDI3SubSegment arcXri);
+	public ContextNode setContextNode(XDIArc arc);
 
 	/**
 	 * Deep version of ContextNode.setContextNode(XDI3SubSegment), operates at a context node further down in the graph.
 	 */
-	public ContextNode setDeepContextNode(XDI3Segment relativeContextNodeXri);
+	public ContextNode setDeepContextNode(XDIAddress relativecontextNodeAddress);
 
 	/**
-	 * Returns the context node with a given arc XRI.
-	 * @param arcXri The arc XRI of the context node.
+	 * Returns the context node with a given arc.
+	 * @param arc The arc of the context node.
 	 * @param subgraph This is simply a hint to the implementation whether 
 	 * child context nodes will subsequently be requested. Implementations may 
 	 * or may not actually use this parameter.
-	 * @return The context node with the given arc XRI, or null.
+	 * @return The context node with the given arc, or null.
 	 */
-	public ContextNode getContextNode(XDI3SubSegment arcXri, boolean subgraph);
+	public ContextNode getContextNode(XDIArc arc, boolean subgraph);
 
 	/**
-	 * Returns the context node with a given arc XRI.
-	 * @param arcXri The arc XRI of the context node.
-	 * @return The context node with the given arc XRI, or null.
+	 * Returns the context node with a given arc.
+	 * @param arc The arc of the context node.
+	 * @return The context node with the given arc, or null.
 	 */
-	public ContextNode getContextNode(XDI3SubSegment arcXri);
+	public ContextNode getContextNode(XDIArc arc);
 
 	/**
 	 * Deep version of ContextNode.getContextNode(XDI3SubSegment, boolean), operates at a context node further down in the graph.
 	 */
-	public ContextNode getDeepContextNode(XDI3Segment relativeContextNodeXri, boolean subgraph);
+	public ContextNode getDeepContextNode(XDIAddress relativecontextNodeAddress, boolean subgraph);
 
 	/**
 	 * Deep version of ContextNode.getContextNode(XDI3SubSegment), operates at a context node further down in the graph.
 	 */
-	public ContextNode getDeepContextNode(XDI3Segment relativeContextNodeXri);
+	public ContextNode getDeepContextNode(XDIAddress relativecontextNodeAddress);
 
 	/**
 	 * Returns the context nodes under this context node.
@@ -132,7 +132,7 @@ public interface ContextNode extends Serializable, Comparable<ContextNode> {
 	/**
 	 * Deep version of ContextNode.getContextNodes(), operates at a context node further down in the graph.
 	 */
-	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDI3Segment relativeContextNodeXri);
+	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDIAddress relativecontextNodeAddress);
 
 	/**
 	 * Returns all context nodes under this context node.
@@ -147,11 +147,11 @@ public interface ContextNode extends Serializable, Comparable<ContextNode> {
 	public ReadOnlyIterator<ContextNode> getAllLeafContextNodes();
 
 	/**
-	 * Checks if a context node with a given arc XRI exists under this context node.
-	 * @param arcXri The arc XRI to look for. 
-	 * @return True if this context node has a context node with the given arc XRI.
+	 * Checks if a context node with a given arc exists under this context node.
+	 * @param arc The arc to look for. 
+	 * @return True if this context node has a context node with the given arc.
 	 */
-	public boolean containsContextNode(XDI3SubSegment arcXri);
+	public boolean containsContextNode(XDIArc arc);
 
 	/**
 	 * Checks if this context node has one or more context nodes.
@@ -160,10 +160,10 @@ public interface ContextNode extends Serializable, Comparable<ContextNode> {
 	public boolean containsContextNodes();
 
 	/**
-	 * Deletes the context node with a given arc XRI.
-	 * @param arcXri The arc XRI of the context node.
+	 * Deletes the context node with a given arc.
+	 * @param arc The arc of the context node.
 	 */
-	public void delContextNode(XDI3SubSegment arcXri);
+	public void delContextNode(XDIArc arc);
 
 	/**
 	 * Deletes all context nodes from this context node.
@@ -188,66 +188,66 @@ public interface ContextNode extends Serializable, Comparable<ContextNode> {
 
 	/**
 	 * Creates a new relation and adds it to this context node, or returns an existing relation.
-	 * @param arcXri The arc XRI of the relation.
-	 * @param targetContextNodeXri The target context node XRI of the relation.
+	 * @param arc The arc of the relation.
+	 * @param targetContextNodeAddress The target context node XRI of the relation.
 	 * @return The newly created or existing relation.
 	 */
-	public Relation setRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
+	public Relation setRelation(XDIAddress arc, XDIAddress targetContextNodeAddress);
 
 	/**
-	 * Deep version of ContextNode.setRelation(XDI3Segment, XDI3Segment), operates at a context node further down in the graph.
+	 * Deep version of ContextNode.setRelation(XDIAddress, XDIAddress), operates at a context node further down in the graph.
 	 */
-	public Relation setDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
+	public Relation setDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress);
 
 	/**
 	 * Creates a new relation and adds it to this context node, or returns an existing relation.
-	 * @param arcXri The arc XRI of the relation.
+	 * @param arc The arc of the relation.
 	 * @param targetContextNode The target context node of the relation.
 	 * @return The newly created or existing relation.
 	 */
-	public Relation setRelation(XDI3Segment arcXri, ContextNode targetContextNode);
+	public Relation setRelation(XDIAddress arc, ContextNode targetContextNode);
 
 	/**
-	 * Deep version of ContextNode.setRelation(XDI3Segment, ContextNode), operates at a context node further down in the graph.
+	 * Deep version of ContextNode.setRelation(XDIAddress, ContextNode), operates at a context node further down in the graph.
 	 */
-	public Relation setDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri, ContextNode targetContextNode);
+	public Relation setDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc, ContextNode targetContextNode);
 
 	/**
 	 * Returns a relation at this context node. 
-	 * @param arcXri The arc XRI to look for. 
-	 * @param targetContextNodeXri The target context node XRI of the relation.
-	 * @return The relation with the given arc XRI, or null.
+	 * @param arc The arc to look for. 
+	 * @param targetContextNodeAddress The target context node XRI of the relation.
+	 * @return The relation with the given arc, or null.
 	 */
-	public Relation getRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
+	public Relation getRelation(XDIAddress arc, XDIAddress targetContextNodeAddress);
 
 	/**
-	 * Deep version of ContextNode.getRelation(XDI3Segment, XDI3Segment), operates at a context node further down in the graph.
+	 * Deep version of ContextNode.getRelation(XDIAddress, XDIAddress), operates at a context node further down in the graph.
 	 */
-	public Relation getDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
+	public Relation getDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress);
 
 	/**
 	 * Returns a relation at this context node. 
-	 * @param arcXri The arc XRI to look for. 
-	 * @return The relation with the given arc XRI, or null.
+	 * @param arc The arc to look for. 
+	 * @return The relation with the given arc, or null.
 	 */
-	public Relation getRelation(XDI3Segment arcXri);
+	public Relation getRelation(XDIAddress arc);
 
 	/**
-	 * Deep version of ContextNode.getRelation(XDI3Segment), operates at a context node further down in the graph.
+	 * Deep version of ContextNode.getRelation(XDIAddress), operates at a context node further down in the graph.
 	 */
-	public Relation getDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri);
+	public Relation getDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc);
 
 	/**
 	 * Returns relations at this context node. 
-	 * @param arcXri The arc XRI to look for. 
-	 * @return An iterator over relations with the given arc XRI, or null.
+	 * @param arc The arc to look for. 
+	 * @return An iterator over relations with the given arc, or null.
 	 */
-	public ReadOnlyIterator<Relation> getRelations(XDI3Segment arcXri);
+	public ReadOnlyIterator<Relation> getRelations(XDIAddress arc);
 
 	/**
-	 * Deep version of ContextNode.getRelations(XDI3Segment), operates at a context node further down in the graph.
+	 * Deep version of ContextNode.getRelations(XDIAddress), operates at a context node further down in the graph.
 	 */
-	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri);
+	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress relativecontextNodeAddress, XDIAddress arc);
 
 	/**
 	 * Returns the relations of this context node.
@@ -258,14 +258,14 @@ public interface ContextNode extends Serializable, Comparable<ContextNode> {
 	/**
 	 * Deep version of ContextNode.getRelations(), operates at a context node further down in the graph.
 	 */
-	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment relativeContextNodeXri);
+	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress relativecontextNodeAddress);
 
 	/**
-	 * Returns the incoming relations with a given arc XRI.
-	 * @param arcXri The arc XRI to look for. 
-	 * @return An iterator over relations with the given arc XRI, or null.
+	 * Returns the incoming relations with a given arc.
+	 * @param arc The arc to look for. 
+	 * @return An iterator over relations with the given arc, or null.
 	 */
-	public ReadOnlyIterator<Relation> getIncomingRelations(XDI3Segment arcXri);
+	public ReadOnlyIterator<Relation> getIncomingRelations(XDIAddress arc);
 
 	/**
 	 * Returns the incoming relations of this context node.
@@ -286,19 +286,19 @@ public interface ContextNode extends Serializable, Comparable<ContextNode> {
 	public ReadOnlyIterator<Relation> getAllIncomingRelations();
 
 	/**
-	 * Checks if a relation with a given arc XRI and target context node XRI exists in this context node.
-	 * @param arcXri The arc XRI of the relations. 
-	 * @param targetContextNodeXri The target context node XRI of the relation.
-	 * @return True if this context node has a relation with the given arc XRI and target context node XRI.
+	 * Checks if a relation with a given arc and target context node XRI exists in this context node.
+	 * @param arc The arc of the relations. 
+	 * @param targetContextNodeAddress The target context node XRI of the relation.
+	 * @return True if this context node has a relation with the given arc and target context node XRI.
 	 */
-	public boolean containsRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
+	public boolean containsRelation(XDIAddress arc, XDIAddress targetContextNodeAddress);
 
 	/**
-	 * Checks if relations with a given arc XRI exist in this context node.
-	 * @param arcXri The arc XRI of the relations. 
-	 * @return True if this context node has relations with the given arc XRI.
+	 * Checks if relations with a given arc exist in this context node.
+	 * @param arc The arc of the relations. 
+	 * @return True if this context node has relations with the given arc.
 	 */
-	public boolean containsRelations(XDI3Segment arcXri);
+	public boolean containsRelations(XDIAddress arc);
 
 	/**
 	 * Checks if this context node has one or more relations.
@@ -307,11 +307,11 @@ public interface ContextNode extends Serializable, Comparable<ContextNode> {
 	public boolean containsRelations();
 
 	/**
-	 * Checks if incoming relations with a given arc XRI exist in this context node.
-	 * @param arcXri The arc XRI of the incoming relations. 
-	 * @return True if this context node has incoming relations with the given arc XRI.
+	 * Checks if incoming relations with a given arc exist in this context node.
+	 * @param arc The arc of the incoming relations. 
+	 * @return True if this context node has incoming relations with the given arc.
 	 */
-	public boolean containsIncomingRelations(XDI3Segment arcXri);
+	public boolean containsIncomingRelations(XDIAddress arc);
 
 	/**
 	 * Checks if this context node has one or more incoming relations.
@@ -320,17 +320,17 @@ public interface ContextNode extends Serializable, Comparable<ContextNode> {
 	public boolean containsIncomingRelations();
 
 	/**
-	 * Deletes the relation with a given arc XRI from this context node.
-	 * @param arcXri The arc XRI of the relation.
-	 * @param targetContextNodeXri The target context node XRI of the relation.
+	 * Deletes the relation with a given arc from this context node.
+	 * @param arc The arc of the relation.
+	 * @param targetContextNodeAddress The target context node XRI of the relation.
 	 */
-	public void delRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
+	public void delRelation(XDIAddress arc, XDIAddress targetContextNodeAddress);
 
 	/**
-	 * Deletes the relation with a given arc XRI from this context node.
-	 * @param arcXri The arc XRI of the relation.
+	 * Deletes the relation with a given arc from this context node.
+	 * @param arc The arc of the relation.
 	 */
-	public void delRelations(XDI3Segment arcXri);
+	public void delRelations(XDIAddress arc);
 
 	/**
 	 * Deletes all relations from this context node.
@@ -344,10 +344,10 @@ public interface ContextNode extends Serializable, Comparable<ContextNode> {
 
 	/**
 	 * Returns the number of relations of this context node.
-	 * @param arcXri The arc XRI to look for. 
+	 * @param arc The arc to look for. 
 	 * @return The number of relations.
 	 */
-	public long getRelationCount(XDI3Segment arcXri);
+	public long getRelationCount(XDIAddress arc);
 
 	/**
 	 * Returns the number of relations of this context node.
@@ -396,22 +396,22 @@ public interface ContextNode extends Serializable, Comparable<ContextNode> {
 	/**
 	 * Deep version of ContextNode.setLiteral(Object), operates at a context node further down in the graph.
 	 */
-	public Literal setDeepLiteral(XDI3Segment relativeContextNodeXri, Object literalData);
+	public Literal setDeepLiteral(XDIAddress relativecontextNodeAddress, Object literalData);
 
 	/**
 	 * Deep version of ContextNode.setLiteralString(String), operates at a context node further down in the graph.
 	 */
-	public Literal setDeepLiteralString(XDI3Segment relativeContextNodeXri, String literalData);
+	public Literal setDeepLiteralString(XDIAddress relativecontextNodeAddress, String literalData);
 
 	/**
 	 * Deep version of ContextNode.setLiteralNumber(Double), operates at a context node further down in the graph.
 	 */
-	public Literal setDeepLiteralNumber(XDI3Segment relativeContextNodeXri, Double literalData);
+	public Literal setDeepLiteralNumber(XDIAddress relativecontextNodeAddress, Double literalData);
 
 	/**
 	 * Deep version of ContextNode.setLiteralBoolean(Boolean), operates at a context node further down in the graph.
 	 */
-	public Literal setDeepLiteralBoolean(XDI3Segment relativeContextNodeXri, Boolean literalData);
+	public Literal setDeepLiteralBoolean(XDIAddress relativecontextNodeAddress, Boolean literalData);
 
 	/**
 	 * Returns the literal of this context node.
@@ -450,27 +450,27 @@ public interface ContextNode extends Serializable, Comparable<ContextNode> {
 	/**
 	 * Deep version of ContextNode.getLiteral(Object), operates at a context node further down in the graph.
 	 */
-	public Literal getDeepLiteral(XDI3Segment relativeContextNodeXri, Object literalData);
+	public Literal getDeepLiteral(XDIAddress relativecontextNodeAddress, Object literalData);
 
 	/**
 	 * Deep version of ContextNode.getLiteralString(String), operates at a context node further down in the graph.
 	 */
-	public Literal getDeepLiteralString(XDI3Segment relativeContextNodeXri, String literalData);
+	public Literal getDeepLiteralString(XDIAddress relativecontextNodeAddress, String literalData);
 
 	/**
 	 * Deep version of ContextNode.getLiteraNumber(Double), operates at a context node further down in the graph.
 	 */
-	public Literal getDeepLiteralNumber(XDI3Segment relativeContextNodeXri, Double literalData);
+	public Literal getDeepLiteralNumber(XDIAddress relativecontextNodeAddress, Double literalData);
 
 	/**
 	 * Deep version of ContextNode.getLiteralBoolean(Boolean), operates at a context node further down in the graph.
 	 */
-	public Literal getDeepLiteralBoolean(XDI3Segment relativeContextNodeXri, Boolean literalData);
+	public Literal getDeepLiteralBoolean(XDIAddress relativecontextNodeAddress, Boolean literalData);
 
 	/**
 	 * Deep version of ContextNode.getLiteral(), operates at a context node further down in the graph.
 	 */
-	public Literal getDeepLiteral(XDI3Segment relativeContextNodeXri);
+	public Literal getDeepLiteral(XDIAddress relativecontextNodeAddress);
 
 	/**
 	 * Returns all literals of this context node.
@@ -536,12 +536,12 @@ public interface ContextNode extends Serializable, Comparable<ContextNode> {
 	/**
 	 * Sets a statement in this context node.
 	 */
-	public Statement setStatement(XDI3Statement statementXri);
+	public Statement setStatement(XDIStatement statementXri);
 
 	/**
 	 * Gets a statement in this context node.
 	 */
-	public Statement getStatement(XDI3Statement statementXri);
+	public Statement getStatement(XDIStatement statementXri);
 
 	/**
 	 * Gets all statements in this context node.
@@ -552,7 +552,7 @@ public interface ContextNode extends Serializable, Comparable<ContextNode> {
 	/**
 	 * Check if a statement exists in this context node.
 	 */
-	public boolean containsStatement(XDI3Statement statementXri);
+	public boolean containsStatement(XDIStatement statementXri);
 
 	/**
 	 * Returns the number of all statements in this context node.

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2FContextNode.java
647c3e7e99d2509d0745528902b83e61da03e831
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2FGraph.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2FGraph.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/Graph.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIStatement;
	 * Deep version of ContextNode.setContextNode(XDIArc), operates at a context node further down in the graph.
	public ContextNode setDeepContextNode(XDIAddress contextNodeAddress);
	 * Deep version of ContextNode.getContextNode(XDIArc, boolean), operates at a context node further down in the graph.
	public ContextNode getDeepContextNode(XDIAddress contextNodeAddress, boolean subgraph);
	 * Deep version of ContextNode.getContextNode(XDIArc), operates at a context node further down in the graph.
	public ContextNode getDeepContextNode(XDIAddress contextNodeAddress);
	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDIAddress contextNodeAddress);
	 * Deep version of ContextNode.setRelation(XDIAddress, XDIAddress), operates at a context node further down in the graph.
	public Relation setDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress);
	 * Deep version of ContextNode.setRelation(XDIAddress, ContextNode), operates at a context node further down in the graph.
	public Relation setDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc, ContextNode targetContextNode);
	 * Deep version of ContextNode.getRelation(XDIAddress, XDIAddress), operates at a context node further down in the graph.
	public Relation getDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress);
	 * Deep version of ContextNode.getRelation(XDIAddress), operates at a context node further down in the graph.
	public Relation getDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc);
	 * Deep version of ContextNode.getRelations(XDIAddress), operates at a context node further down in the graph.
	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress contextNodeAddress, XDIAddress arc);
	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress contextNodeAddress);
	public Literal setDeepLiteral(XDIAddress contextNodeAddress, Object literalData);
	public Literal setDeepLiteralString(XDIAddress contextNodeAddress, String literalData);
	public Literal setDeepLiteralNumber(XDIAddress contextNodeAddress, Double literalData);
	public Literal setDeepLiteralBoolean(XDIAddress contextNodeAddress, Boolean literalData);
	public Literal getDeepLiteral(XDIAddress contextNodeAddress, Object literalData);
	public Literal getDeepLiteralString(XDIAddress contextNodeAddress, String literalData);
	public Literal getDeepLiteralNumber(XDIAddress contextNodeAddress, Double literalData);
	public Literal getDeepLiteralBoolean(XDIAddress contextNodeAddress, Boolean literalData);
	public Literal getDeepLiteral(XDIAddress contextNodeAddress);
	public Statement setStatement(XDIStatement statementXri);
	public Statement getStatement(XDIStatement statementXri);
	public boolean containsStatement(XDIStatement statementXri);

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
	 * Deep version of ContextNode.setContextNode(XDI3SubSegment), operates at a context node further down in the graph.
	public ContextNode setDeepContextNode(XDI3Segment contextNodeXri);
	 * Deep version of ContextNode.getContextNode(XDI3SubSegment, boolean), operates at a context node further down in the graph.
	public ContextNode getDeepContextNode(XDI3Segment contextNodeXri, boolean subgraph);
	 * Deep version of ContextNode.getContextNode(XDI3SubSegment), operates at a context node further down in the graph.
	public ContextNode getDeepContextNode(XDI3Segment contextNodeXri);
	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDI3Segment contextNodeXri);
	 * Deep version of ContextNode.setRelation(XDI3Segment, XDI3Segment), operates at a context node further down in the graph.
	public Relation setDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
	 * Deep version of ContextNode.setRelation(XDI3Segment, ContextNode), operates at a context node further down in the graph.
	public Relation setDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri, ContextNode targetContextNode);
	 * Deep version of ContextNode.getRelation(XDI3Segment, XDI3Segment), operates at a context node further down in the graph.
	public Relation getDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
	 * Deep version of ContextNode.getRelation(XDI3Segment), operates at a context node further down in the graph.
	public Relation getDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri);
	 * Deep version of ContextNode.getRelations(XDI3Segment), operates at a context node further down in the graph.
	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment contextNodeXri, XDI3Segment arcXri);
	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment contextNodeXri);
	public Literal setDeepLiteral(XDI3Segment contextNodeXri, Object literalData);
	public Literal setDeepLiteralString(XDI3Segment contextNodeXri, String literalData);
	public Literal setDeepLiteralNumber(XDI3Segment contextNodeXri, Double literalData);
	public Literal setDeepLiteralBoolean(XDI3Segment contextNodeXri, Boolean literalData);
	public Literal getDeepLiteral(XDI3Segment contextNodeXri, Object literalData);
	public Literal getDeepLiteralString(XDI3Segment contextNodeXri, String literalData);
	public Literal getDeepLiteralNumber(XDI3Segment contextNodeXri, Double literalData);
	public Literal getDeepLiteralBoolean(XDI3Segment contextNodeXri, Boolean literalData);
	public Literal getDeepLiteral(XDI3Segment contextNodeXri);
	public Statement setStatement(XDI3Statement statementXri);
	public Statement getStatement(XDI3Statement statementXri);
	public boolean containsStatement(XDI3Statement statementXri);

@@ -4,9 +4,9 @@
 import java.util.Properties;
 
 import xdi2.core.io.MimeType;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIStatement;
 import xdi2.core.util.iterators.ReadOnlyIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
 
 /**
  * This interface represents a whole XDI graph.
@@ -83,99 +83,99 @@ public interface Graph extends Serializable, Comparable<Graph> {
 	 */
 
 	/**
-	 * Deep version of ContextNode.setContextNode(XDI3SubSegment), operates at a context node further down in the graph.
+	 * Deep version of ContextNode.setContextNode(XDIArc), operates at a context node further down in the graph.
 	 */
-	public ContextNode setDeepContextNode(XDI3Segment contextNodeXri);
+	public ContextNode setDeepContextNode(XDIAddress contextNodeAddress);
 
 	/**
-	 * Deep version of ContextNode.getContextNode(XDI3SubSegment, boolean), operates at a context node further down in the graph.
+	 * Deep version of ContextNode.getContextNode(XDIArc, boolean), operates at a context node further down in the graph.
 	 */
-	public ContextNode getDeepContextNode(XDI3Segment contextNodeXri, boolean subgraph);
+	public ContextNode getDeepContextNode(XDIAddress contextNodeAddress, boolean subgraph);
 
 	/**
-	 * Deep version of ContextNode.getContextNode(XDI3SubSegment), operates at a context node further down in the graph.
+	 * Deep version of ContextNode.getContextNode(XDIArc), operates at a context node further down in the graph.
 	 */
-	public ContextNode getDeepContextNode(XDI3Segment contextNodeXri);
+	public ContextNode getDeepContextNode(XDIAddress contextNodeAddress);
 
 	/**
 	 * Deep version of ContextNode.getContextNodes(), operates at a context node further down in the graph.
 	 */
-	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDI3Segment contextNodeXri);
+	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDIAddress contextNodeAddress);
 
 	/**
-	 * Deep version of ContextNode.setRelation(XDI3Segment, XDI3Segment), operates at a context node further down in the graph.
+	 * Deep version of ContextNode.setRelation(XDIAddress, XDIAddress), operates at a context node further down in the graph.
 	 */
-	public Relation setDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
+	public Relation setDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress);
 
 	/**
-	 * Deep version of ContextNode.setRelation(XDI3Segment, ContextNode), operates at a context node further down in the graph.
+	 * Deep version of ContextNode.setRelation(XDIAddress, ContextNode), operates at a context node further down in the graph.
 	 */
-	public Relation setDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri, ContextNode targetContextNode);
+	public Relation setDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc, ContextNode targetContextNode);
 
 	/**
-	 * Deep version of ContextNode.getRelation(XDI3Segment, XDI3Segment), operates at a context node further down in the graph.
+	 * Deep version of ContextNode.getRelation(XDIAddress, XDIAddress), operates at a context node further down in the graph.
 	 */
-	public Relation getDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri);
+	public Relation getDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress);
 
 	/**
-	 * Deep version of ContextNode.getRelation(XDI3Segment), operates at a context node further down in the graph.
+	 * Deep version of ContextNode.getRelation(XDIAddress), operates at a context node further down in the graph.
 	 */
-	public Relation getDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri);
+	public Relation getDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc);
 
 	/**
-	 * Deep version of ContextNode.getRelations(XDI3Segment), operates at a context node further down in the graph.
+	 * Deep version of ContextNode.getRelations(XDIAddress), operates at a context node further down in the graph.
 	 */
-	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment contextNodeXri, XDI3Segment arcXri);
+	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress contextNodeAddress, XDIAddress arc);
 
 	/**
 	 * Deep version of ContextNode.getRelations(), operates at a context node further down in the graph.
 	 */
-	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment contextNodeXri);
+	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress contextNodeAddress);
 
 	/**
 	 * Deep version of ContextNode.setLiteral(Object), operates at a context node further down in the graph.
 	 */
-	public Literal setDeepLiteral(XDI3Segment contextNodeXri, Object literalData);
+	public Literal setDeepLiteral(XDIAddress contextNodeAddress, Object literalData);
 
 	/**
 	 * Deep version of ContextNode.setLiteralString(String), operates at a context node further down in the graph.
 	 */
-	public Literal setDeepLiteralString(XDI3Segment contextNodeXri, String literalData);
+	public Literal setDeepLiteralString(XDIAddress contextNodeAddress, String literalData);
 
 	/**
 	 * Deep version of ContextNode.setLiteralNumber(Double), operates at a context node further down in the graph.
 	 */
-	public Literal setDeepLiteralNumber(XDI3Segment contextNodeXri, Double literalData);
+	public Literal setDeepLiteralNumber(XDIAddress contextNodeAddress, Double literalData);
 
 	/**
 	 * Deep version of ContextNode.setLiteralBoolean(Boolean), operates at a context node further down in the graph.
 	 */
-	public Literal setDeepLiteralBoolean(XDI3Segment contextNodeXri, Boolean literalData);
+	public Literal setDeepLiteralBoolean(XDIAddress contextNodeAddress, Boolean literalData);
 
 	/**
 	 * Deep version of ContextNode.getLiteral(Object), operates at a context node further down in the graph.
 	 */
-	public Literal getDeepLiteral(XDI3Segment contextNodeXri, Object literalData);
+	public Literal getDeepLiteral(XDIAddress contextNodeAddress, Object literalData);
 
 	/**
 	 * Deep version of ContextNode.getLiteralString(String), operates at a context node further down in the graph.
 	 */
-	public Literal getDeepLiteralString(XDI3Segment contextNodeXri, String literalData);
+	public Literal getDeepLiteralString(XDIAddress contextNodeAddress, String literalData);
 
 	/**
 	 * Deep version of ContextNode.getLiteralNumber(Double), operates at a context node further down in the graph.
 	 */
-	public Literal getDeepLiteralNumber(XDI3Segment contextNodeXri, Double literalData);
+	public Literal getDeepLiteralNumber(XDIAddress contextNodeAddress, Double literalData);
 
 	/**
 	 * Deep version of ContextNode.getLiteralBoolean(Boolean), operates at a context node further down in the graph.
 	 */
-	public Literal getDeepLiteralBoolean(XDI3Segment contextNodeXri, Boolean literalData);
+	public Literal getDeepLiteralBoolean(XDIAddress contextNodeAddress, Boolean literalData);
 
 	/**
 	 * Deep version of ContextNode.getLiteral(), operates at a context node further down in the graph.
 	 */
-	public Literal getDeepLiteral(XDI3Segment contextNodeXri);
+	public Literal getDeepLiteral(XDIAddress contextNodeAddress);
 
 	/*
 	 * Methods related to statements
@@ -184,12 +184,12 @@ public interface Graph extends Serializable, Comparable<Graph> {
 	/**
 	 * Sets a statement in this graph.
 	 */
-	public Statement setStatement(XDI3Statement statementXri);
+	public Statement setStatement(XDIStatement statementXri);
 
 	/**
 	 * Gets a statement in this graph.
 	 */
-	public Statement getStatement(XDI3Statement statementXri);
+	public Statement getStatement(XDIStatement statementXri);
 
 	/**
 	 * Gets all statements in this graph.
@@ -200,7 +200,7 @@ public interface Graph extends Serializable, Comparable<Graph> {
 	/**
 	 * Check if a statement exists in this graph.
 	 */
-	public boolean containsStatement(XDI3Statement statementXri);
+	public boolean containsStatement(XDIStatement statementXri);
 
 	/**
 	 * Returns the number of all statements in this graph.

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2FGraph.java
577c1a64b7b50eeed0f0c1530b20fd362e3a2e94
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2FRelation.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2FRelation.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/Relation.java
import xdi2.core.syntax.XDIAddress;
	 * Every relation has an associated arc.
	 * @return The arc associated with the relation.
	public XDIAddress getArc();
	 * Get the target context node address.
	 * @return The target context node address of the relation.
	public XDIAddress getTargetContextNodeAddress();

import xdi2.core.xri3.XDI3Segment;
	 * Every relation has an associated arc XRI.
	 * @return The arc XRI associated with the relation.
	public XDI3Segment getArcXri();
	 * Get the target context node XRI.
	 * @return The target context node XRI of the relation.
	public XDI3Segment getTargetContextNodeXri();

@@ -3,7 +3,7 @@
 import java.io.Serializable;
 
 import xdi2.core.Statement.RelationStatement;
-import xdi2.core.xri3.XDI3Segment;
+import xdi2.core.syntax.XDIAddress;
 
 /**
  * This interface represents a relation in an XDI graph.
@@ -34,16 +34,16 @@ public interface Relation extends Serializable, Comparable<Relation> {
 	public void delete();
 
 	/**
-	 * Every relation has an associated arc XRI.
-	 * @return The arc XRI associated with the relation.
+	 * Every relation has an associated arc.
+	 * @return The arc associated with the relation.
 	 */
-	public XDI3Segment getArcXri();
+	public XDIAddress getArc();
 
 	/**
-	 * Get the target context node XRI.
-	 * @return The target context node XRI of the relation.
+	 * Get the target context node address.
+	 * @return The target context node address of the relation.
 	 */
-	public XDI3Segment getTargetContextNodeXri();
+	public XDIAddress getTargetContextNodeAddress();
 
 	/**
 	 * Follows the relation to the target context node.

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2FRelation.java
f66f61454ea1fafc89af219c0c22a59e78e28ad8
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2FStatement.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2FStatement.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/Statement.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.syntax.XDIStatement;
	public XDIAddress getSubject();
	public XDIAddress getPredicate();
	public XDIStatement getXri();
		public XDIAddress getSubject();
		public XDIAddress getPredicate();
		public XDIArc getObject();
		public XDIAddress getSubject();
		public XDIAddress getPredicate();
		public XDIAddress getObject();
		public XDIAddress getSubject();
		public XDIAddress getPredicate();

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
import xdi2.core.xri3.XDI3SubSegment;
	public XDI3Segment getSubject();
	public XDI3Segment getPredicate();
	public XDI3Statement getXri();
		public XDI3Segment getSubject();
		public XDI3Segment getPredicate();
		public XDI3SubSegment getObject();
		public XDI3Segment getSubject();
		public XDI3Segment getPredicate();
		public XDI3Segment getObject();
		public XDI3Segment getSubject();
		public XDI3Segment getPredicate();

@@ -2,9 +2,9 @@
 
 import java.io.Serializable;
 
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.syntax.XDIStatement;
 
 /**
  * This interface represents a statement in an XDI graph.
@@ -22,13 +22,13 @@ public interface Statement extends Serializable, Comparable<Statement> {
 	 * Gets the subject of this statement.
 	 * @return A subject.
 	 */
-	public XDI3Segment getSubject();
+	public XDIAddress getSubject();
 
 	/**
 	 * Gets the predicate of this statement.
 	 * @return A predicate.
 	 */
-	public XDI3Segment getPredicate();
+	public XDIAddress getPredicate();
 
 	/**
 	 * Gets the object of this statement.
@@ -57,7 +57,7 @@ public interface Statement extends Serializable, Comparable<Statement> {
 	 * Expresses the statement as an XDI statement in the form subject/predicate/object
 	 * @return An XDI statement.
 	 */
-	public XDI3Statement getXri();
+	public XDIStatement getXri();
 
 	/*
 	 * Sub-interfaces
@@ -66,38 +66,38 @@ public interface Statement extends Serializable, Comparable<Statement> {
 	public interface ContextNodeStatement extends Statement {
 
 		@Override
-		public XDI3Segment getSubject();
+		public XDIAddress getSubject();
 
 		@Override
-		public XDI3Segment getPredicate();
+		public XDIAddress getPredicate();
 
 		@Override
-		public XDI3SubSegment getObject();
+		public XDIArc getObject();
 
 		public ContextNode getContextNode();
 	}
 
 	public interface RelationStatement extends Statement {
 
 		@Override
-		public XDI3Segment getSubject();
+		public XDIAddress getSubject();
 
 		@Override
-		public XDI3Segment getPredicate();
+		public XDIAddress getPredicate();
 
 		@Override
-		public XDI3Segment getObject();
+		public XDIAddress getObject();
 
 		public Relation getRelation();
 	}
 
 	public interface LiteralStatement extends Statement {
 
 		@Override
-		public XDI3Segment getSubject();
+		public XDIAddress getSubject();
 
 		@Override
-		public XDI3Segment getPredicate();
+		public XDIAddress getPredicate();
 
 		@Override
 		public Object getObject();

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2FStatement.java
980825f2b92c99da2fd05bc8ffa52b0bbf0b7650
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDIAuthenticationConstants.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDIAuthenticationConstants.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/constants/XDIAuthenticationConstants.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.util.AddressUtil;
	public static final XDIAddress XDI_ADD_ANONYMOUS = XDIAddress.create("$anon");
	public static final XDIArc XDI_ARC_SIGNATURE = XDIArc.create("$sig");
	public static final XDIAddress XDI_ADD_SECRET_TOKEN = XDIAddress.create("<$secret><$token>");
	public static final XDIAddress XDI_ADD_OAUTH_TOKEN = XDIAddress.create("<$oauth><$token>");
	public static final XDIAddress XDI_ADD_SECRET_TOKEN_VALID = XDIAddress.create("<$secret><$token><$valid>");
	public static final XDIAddress XDI_ADD_OAUTH_TOKEN_VALID = XDIAddress.create("<$oauth><$token><$valid>");
	public static final XDIAddress XDI_ADD_SIGNATURE_VALID = XDIAddress.create("<$sig><$valid>");
	public static final XDIAddress XDI_ADD_DIGEST_SECRET_TOKEN = XDIAddress.create("<$digest><$secret><$token>");
	public static final XDIAddress XDI_ADD_PUBLIC_KEY = XDIAddress.create("<$public><$key>");
	public static final XDIAddress XDI_ADD_PRIVATE_KEY = XDIAddress.create("<$private><$key>");
	public static final XDIAddress XDI_ADD_SECRET_KEY = XDIAddress.create("<$secret><$key>");
	public static final XDIAddress XDI_ADD_MSG_SIG_KEYPAIR = XDIAddress.create("$msg$sig$keypair");
	public static final XDIAddress XDI_ADD_MSG_SIG_KEYPAIR_PUBLIC_KEY = AddressUtil.concatAddresses(XDI_ADD_MSG_SIG_KEYPAIR, XDI_ADD_PUBLIC_KEY);
	public static final XDIAddress XDI_ADD_MSG_SIG_KEYPAIR_PRIVATE_KEY = AddressUtil.concatAddresses(XDI_ADD_MSG_SIG_KEYPAIR, XDI_ADD_PRIVATE_KEY);
	public static final XDIAddress XDI_ADD_MSG_ENCRYPT_KEYPAIR = XDIAddress.create("$msg$encrypt$keypair");
	public static final XDIAddress XDI_ADD_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY = AddressUtil.concatAddresses(XDI_ADD_MSG_ENCRYPT_KEYPAIR, XDI_ADD_PUBLIC_KEY);
	public static final XDIAddress XDI_ADD_MSG_ENCRYPT_KEYPAIR_PRIVATE_KEY = AddressUtil.concatAddresses(XDI_ADD_MSG_ENCRYPT_KEYPAIR, XDI_ADD_PRIVATE_KEY);

import xdi2.core.util.XDI3Util;
import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
	public static final XDI3Segment XRI_S_ANONYMOUS = XDI3Segment.create("$anon");
	public static final XDI3SubSegment XRI_SS_SIGNATURE = XDI3SubSegment.create("$sig");
	public static final XDI3Segment XRI_S_SECRET_TOKEN = XDI3Segment.create("<$secret><$token>");
	public static final XDI3Segment XRI_S_OAUTH_TOKEN = XDI3Segment.create("<$oauth><$token>");
	public static final XDI3Segment XRI_S_SECRET_TOKEN_VALID = XDI3Segment.create("<$secret><$token><$valid>");
	public static final XDI3Segment XRI_S_OAUTH_TOKEN_VALID = XDI3Segment.create("<$oauth><$token><$valid>");
	public static final XDI3Segment XRI_S_SIGNATURE_VALID = XDI3Segment.create("<$sig><$valid>");
	public static final XDI3Segment XRI_S_DIGEST_SECRET_TOKEN = XDI3Segment.create("<$digest><$secret><$token>");
	public static final XDI3Segment XRI_S_PUBLIC_KEY = XDI3Segment.create("<$public><$key>");
	public static final XDI3Segment XRI_S_PRIVATE_KEY = XDI3Segment.create("<$private><$key>");
	public static final XDI3Segment XRI_S_SECRET_KEY = XDI3Segment.create("<$secret><$key>");
	public static final XDI3Segment XRI_S_MSG_SIG_KEYPAIR = XDI3Segment.create("$msg$sig$keypair");
	public static final XDI3Segment XRI_S_MSG_SIG_KEYPAIR_PUBLIC_KEY = XDI3Util.concatXris(XRI_S_MSG_SIG_KEYPAIR, XRI_S_PUBLIC_KEY);
	public static final XDI3Segment XRI_S_MSG_SIG_KEYPAIR_PRIVATE_KEY = XDI3Util.concatXris(XRI_S_MSG_SIG_KEYPAIR, XRI_S_PRIVATE_KEY);
	public static final XDI3Segment XRI_S_MSG_ENCRYPT_KEYPAIR = XDI3Segment.create("$msg$encrypt$keypair");
	public static final XDI3Segment XRI_S_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY = XDI3Util.concatXris(XRI_S_MSG_ENCRYPT_KEYPAIR, XRI_S_PUBLIC_KEY);
	public static final XDI3Segment XRI_S_MSG_ENCRYPT_KEYPAIR_PRIVATE_KEY = XDI3Util.concatXris(XRI_S_MSG_ENCRYPT_KEYPAIR, XRI_S_PRIVATE_KEY);

@@ -1,8 +1,8 @@
 package xdi2.core.constants;
 
-import xdi2.core.util.XDI3Util;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.util.AddressUtil;
 
 /**
  * Constants for XDI authentication.
@@ -11,29 +11,29 @@
  */
 public final class XDIAuthenticationConstants {
 
-	public static final XDI3Segment XRI_S_ANONYMOUS = XDI3Segment.create("$anon");
+	public static final XDIAddress XDI_ADD_ANONYMOUS = XDIAddress.create("$anon");
 
-	public static final XDI3SubSegment XRI_SS_SIGNATURE = XDI3SubSegment.create("$sig");
+	public static final XDIArc XDI_ARC_SIGNATURE = XDIArc.create("$sig");
 
-	public static final XDI3Segment XRI_S_SECRET_TOKEN = XDI3Segment.create("<$secret><$token>");
-	public static final XDI3Segment XRI_S_OAUTH_TOKEN = XDI3Segment.create("<$oauth><$token>");
+	public static final XDIAddress XDI_ADD_SECRET_TOKEN = XDIAddress.create("<$secret><$token>");
+	public static final XDIAddress XDI_ADD_OAUTH_TOKEN = XDIAddress.create("<$oauth><$token>");
 
-	public static final XDI3Segment XRI_S_SECRET_TOKEN_VALID = XDI3Segment.create("<$secret><$token><$valid>");
-	public static final XDI3Segment XRI_S_OAUTH_TOKEN_VALID = XDI3Segment.create("<$oauth><$token><$valid>");
-	public static final XDI3Segment XRI_S_SIGNATURE_VALID = XDI3Segment.create("<$sig><$valid>");
+	public static final XDIAddress XDI_ADD_SECRET_TOKEN_VALID = XDIAddress.create("<$secret><$token><$valid>");
+	public static final XDIAddress XDI_ADD_OAUTH_TOKEN_VALID = XDIAddress.create("<$oauth><$token><$valid>");
+	public static final XDIAddress XDI_ADD_SIGNATURE_VALID = XDIAddress.create("<$sig><$valid>");
 
-	public static final XDI3Segment XRI_S_DIGEST_SECRET_TOKEN = XDI3Segment.create("<$digest><$secret><$token>");
+	public static final XDIAddress XDI_ADD_DIGEST_SECRET_TOKEN = XDIAddress.create("<$digest><$secret><$token>");
 
-	public static final XDI3Segment XRI_S_PUBLIC_KEY = XDI3Segment.create("<$public><$key>");
-	public static final XDI3Segment XRI_S_PRIVATE_KEY = XDI3Segment.create("<$private><$key>");
-	public static final XDI3Segment XRI_S_SECRET_KEY = XDI3Segment.create("<$secret><$key>");
+	public static final XDIAddress XDI_ADD_PUBLIC_KEY = XDIAddress.create("<$public><$key>");
+	public static final XDIAddress XDI_ADD_PRIVATE_KEY = XDIAddress.create("<$private><$key>");
+	public static final XDIAddress XDI_ADD_SECRET_KEY = XDIAddress.create("<$secret><$key>");
 
-	public static final XDI3Segment XRI_S_MSG_SIG_KEYPAIR = XDI3Segment.create("$msg$sig$keypair");
-	public static final XDI3Segment XRI_S_MSG_SIG_KEYPAIR_PUBLIC_KEY = XDI3Util.concatXris(XRI_S_MSG_SIG_KEYPAIR, XRI_S_PUBLIC_KEY);
-	public static final XDI3Segment XRI_S_MSG_SIG_KEYPAIR_PRIVATE_KEY = XDI3Util.concatXris(XRI_S_MSG_SIG_KEYPAIR, XRI_S_PRIVATE_KEY);
-	public static final XDI3Segment XRI_S_MSG_ENCRYPT_KEYPAIR = XDI3Segment.create("$msg$encrypt$keypair");
-	public static final XDI3Segment XRI_S_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY = XDI3Util.concatXris(XRI_S_MSG_ENCRYPT_KEYPAIR, XRI_S_PUBLIC_KEY);
-	public static final XDI3Segment XRI_S_MSG_ENCRYPT_KEYPAIR_PRIVATE_KEY = XDI3Util.concatXris(XRI_S_MSG_ENCRYPT_KEYPAIR, XRI_S_PRIVATE_KEY);
+	public static final XDIAddress XDI_ADD_MSG_SIG_KEYPAIR = XDIAddress.create("$msg$sig$keypair");
+	public static final XDIAddress XDI_ADD_MSG_SIG_KEYPAIR_PUBLIC_KEY = AddressUtil.concatAddresses(XDI_ADD_MSG_SIG_KEYPAIR, XDI_ADD_PUBLIC_KEY);
+	public static final XDIAddress XDI_ADD_MSG_SIG_KEYPAIR_PRIVATE_KEY = AddressUtil.concatAddresses(XDI_ADD_MSG_SIG_KEYPAIR, XDI_ADD_PRIVATE_KEY);
+	public static final XDIAddress XDI_ADD_MSG_ENCRYPT_KEYPAIR = XDIAddress.create("$msg$encrypt$keypair");
+	public static final XDIAddress XDI_ADD_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY = AddressUtil.concatAddresses(XDI_ADD_MSG_ENCRYPT_KEYPAIR, XDI_ADD_PUBLIC_KEY);
+	public static final XDIAddress XDI_ADD_MSG_ENCRYPT_KEYPAIR_PRIVATE_KEY = AddressUtil.concatAddresses(XDI_ADD_MSG_ENCRYPT_KEYPAIR, XDI_ADD_PRIVATE_KEY);
 
 	private XDIAuthenticationConstants() { }
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDIAuthenticationConstants.java
fa2015b43787ce0a63000d5a15864f6e8769760e
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDIConstants.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDIConstants.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/constants/XDIConstants.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
	public static final XDIAddress XDI_ADD_ROOT = XDIAddress.create("");
	public static final XDIAddress XDI_ADD_CONTEXT = XDIAddress.create("");
	public static final XDIAddress XDI_ADD_VALUE = XDIAddress.create(XDIConstants.CS_VALUE.toString());
	public static final XDIAddress XDI_ADD_LITERAL = XDIAddress.create(XDIConstants.CS_VALUE.toString());
	public static final XDIArc XDI_ARC_VALUE = XDIArc.create(XDIConstants.CS_VALUE.toString());
	public static final XDIArc XDI_ARC_LITERAL = XDIArc.create(XDIConstants.CS_VALUE.toString());
	public static final XDIAddress XDI_ADD_TRUE = XDIAddress.create("$true");
	public static final XDIAddress XDI_ADD_FALSE = XDIAddress.create("$false");
	public static final XDIArc XDI_ARC_TRUE = XDIArc.create("$true");
	public static final XDIArc XDI_ARC_FALSE = XDIArc.create("$false");
	public static final XDIAddress XDI_ADD_VARIABLE = XDIAddress.create(XDIConstants.XS_VARIABLE);

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
	public static final XDI3Segment XRI_S_ROOT = XDI3Segment.create("");
	public static final XDI3Segment XRI_S_CONTEXT = XDI3Segment.create("");
	public static final XDI3Segment XRI_S_VALUE = XDI3Segment.create(XDIConstants.CS_VALUE.toString());
	public static final XDI3Segment XRI_S_LITERAL = XDI3Segment.create(XDIConstants.CS_VALUE.toString());
	public static final XDI3SubSegment XRI_SS_VALUE = XDI3SubSegment.create(XDIConstants.CS_VALUE.toString());
	public static final XDI3SubSegment XRI_SS_LITERAL = XDI3SubSegment.create(XDIConstants.CS_VALUE.toString());
	public static final XDI3Segment XRI_S_TRUE = XDI3Segment.create("$true");
	public static final XDI3Segment XRI_S_FALSE = XDI3Segment.create("$false");
	public static final XDI3SubSegment XRI_SS_TRUE = XDI3SubSegment.create("$true");
	public static final XDI3SubSegment XRI_SS_FALSE = XDI3SubSegment.create("$false");
	public static final XDI3Segment XRI_S_VARIABLE = XDI3Segment.create(XDIConstants.XS_VARIABLE);

@@ -1,7 +1,7 @@
 package xdi2.core.constants;
 
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 
 /**
  * General XDI syntax and graph constants.
@@ -27,21 +27,21 @@ public class XDIConstants {
 
 	public static final Character[] CS_ARRAY = new Character[] { CS_AUTHORITY_PERSONAL, CS_AUTHORITY_LEGAL, CS_AUTHORITY_GENERAL, CS_CLASS_UNRESERVED, CS_CLASS_RESERVED, CS_VALUE, CS_MEMBER_UNORDERED, CS_MEMBER_ORDERED };
 
-	public static final XDI3Segment XRI_S_ROOT = XDI3Segment.create("");
-	public static final XDI3Segment XRI_S_CONTEXT = XDI3Segment.create("");
-	public static final XDI3Segment XRI_S_VALUE = XDI3Segment.create(XDIConstants.CS_VALUE.toString());
-	public static final XDI3Segment XRI_S_LITERAL = XDI3Segment.create(XDIConstants.CS_VALUE.toString());
+	public static final XDIAddress XDI_ADD_ROOT = XDIAddress.create("");
+	public static final XDIAddress XDI_ADD_CONTEXT = XDIAddress.create("");
+	public static final XDIAddress XDI_ADD_VALUE = XDIAddress.create(XDIConstants.CS_VALUE.toString());
+	public static final XDIAddress XDI_ADD_LITERAL = XDIAddress.create(XDIConstants.CS_VALUE.toString());
 
-	public static final XDI3SubSegment XRI_SS_VALUE = XDI3SubSegment.create(XDIConstants.CS_VALUE.toString());
-	public static final XDI3SubSegment XRI_SS_LITERAL = XDI3SubSegment.create(XDIConstants.CS_VALUE.toString());
+	public static final XDIArc XDI_ARC_VALUE = XDIArc.create(XDIConstants.CS_VALUE.toString());
+	public static final XDIArc XDI_ARC_LITERAL = XDIArc.create(XDIConstants.CS_VALUE.toString());
 
-	public static final XDI3Segment XRI_S_TRUE = XDI3Segment.create("$true");
-	public static final XDI3Segment XRI_S_FALSE = XDI3Segment.create("$false");
+	public static final XDIAddress XDI_ADD_TRUE = XDIAddress.create("$true");
+	public static final XDIAddress XDI_ADD_FALSE = XDIAddress.create("$false");
 
-	public static final XDI3SubSegment XRI_SS_TRUE = XDI3SubSegment.create("$true");
-	public static final XDI3SubSegment XRI_SS_FALSE = XDI3SubSegment.create("$false");
+	public static final XDIArc XDI_ARC_TRUE = XDIArc.create("$true");
+	public static final XDIArc XDI_ARC_FALSE = XDIArc.create("$false");
 
-	public static final XDI3Segment XRI_S_VARIABLE = XDI3Segment.create(XDIConstants.XS_VARIABLE);
+	public static final XDIAddress XDI_ADD_VARIABLE = XDIAddress.create(XDIConstants.XS_VARIABLE);
 
 	private XDIConstants() { }
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDIConstants.java
f259ef78e99d817aefb31e14d54f761784ea3b5f
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDIDictionaryConstants.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDIDictionaryConstants.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/constants/XDIDictionaryConstants.java
import xdi2.core.syntax.XDIAddress;
	public static final XDIAddress XDI_ADD_IS = XDIAddress.create("$is");
	public static final XDIAddress XDI_ADD_IS_TYPE = XDIAddress.create("$is#");
	public static final XDIAddress XDI_ADD_REF = XDIAddress.create("$ref");
	public static final XDIAddress XDI_ADD_IS_REF = XDIAddress.create("$is$ref");
	public static final XDIAddress XDI_ADD_REP = XDIAddress.create("$rep");
	public static final XDIAddress XDI_ADD_IS_REP = XDIAddress.create("$is$rep");
	public static final XDIAddress XDI_ADD_BOOLEAN = XDIAddress.create("$b");
	public static final XDIAddress XDI_ADD_NUMBER = XDIAddress.create("$n");

import xdi2.core.xri3.XDI3Segment;
	public static final XDI3Segment XRI_S_IS = XDI3Segment.create("$is");
	public static final XDI3Segment XRI_S_IS_TYPE = XDI3Segment.create("$is#");
	public static final XDI3Segment XRI_S_REF = XDI3Segment.create("$ref");
	public static final XDI3Segment XRI_S_IS_REF = XDI3Segment.create("$is$ref");
	public static final XDI3Segment XRI_S_REP = XDI3Segment.create("$rep");
	public static final XDI3Segment XRI_S_IS_REP = XDI3Segment.create("$is$rep");
	public static final XDI3Segment XRI_S_BOOLEAN = XDI3Segment.create("$b");
	public static final XDI3Segment XRI_S_NUMBER = XDI3Segment.create("$n");

@@ -1,6 +1,6 @@
 package xdi2.core.constants;
 
-import xdi2.core.xri3.XDI3Segment;
+import xdi2.core.syntax.XDIAddress;
 
 /**
  * Constants for XDI dictionaries.
@@ -9,18 +9,18 @@
  */
 public final class XDIDictionaryConstants {
 
-	public static final XDI3Segment XRI_S_IS = XDI3Segment.create("$is");
+	public static final XDIAddress XDI_ADD_IS = XDIAddress.create("$is");
 
-	public static final XDI3Segment XRI_S_IS_TYPE = XDI3Segment.create("$is#");
+	public static final XDIAddress XDI_ADD_IS_TYPE = XDIAddress.create("$is#");
 
-	public static final XDI3Segment XRI_S_REF = XDI3Segment.create("$ref");
-	public static final XDI3Segment XRI_S_IS_REF = XDI3Segment.create("$is$ref");
+	public static final XDIAddress XDI_ADD_REF = XDIAddress.create("$ref");
+	public static final XDIAddress XDI_ADD_IS_REF = XDIAddress.create("$is$ref");
 
-	public static final XDI3Segment XRI_S_REP = XDI3Segment.create("$rep");
-	public static final XDI3Segment XRI_S_IS_REP = XDI3Segment.create("$is$rep");
+	public static final XDIAddress XDI_ADD_REP = XDIAddress.create("$rep");
+	public static final XDIAddress XDI_ADD_IS_REP = XDIAddress.create("$is$rep");
 
-	public static final XDI3Segment XRI_S_BOOLEAN = XDI3Segment.create("$b");
-	public static final XDI3Segment XRI_S_NUMBER = XDI3Segment.create("$n");
+	public static final XDIAddress XDI_ADD_BOOLEAN = XDIAddress.create("$b");
+	public static final XDIAddress XDI_ADD_NUMBER = XDIAddress.create("$n");
 
 	private XDIDictionaryConstants() { }
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDIDictionaryConstants.java
d288ceb952e83ea706f9f9570d4e16fcd4da453a
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDILinkContractConstants.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDILinkContractConstants.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/constants/XDILinkContractConstants.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
	public static final XDIAddress XDI_ADD_DO = XDIAddress.create("$do");
	public static final XDIAddress XDI_ADD_EC_DO = XDIAddress.create("[$do]");
	public static final XDIAddress XDI_ADD_DO_VARIABLE = XDIAddress.create("{$do}");
	public static final XDIArc XDI_ARC_DO = XDIArc.create("$do");
	public static final XDIArc XDI_ARC_EC_DO = XDIArc.create("[$do]");
	public static final XDIArc XDI_ARC_DO_VARIABLE = XDIArc.create("{$do}");
	public static final XDIAddress XDI_ADD_PUBLIC = XDIAddress.create("$public");
	public static final XDIAddress XDI_ADD_TO_VARIABLE = XDIAddress.create("{$to}");
	public static final XDIAddress XDI_ADD_FROM_VARIABLE = XDIAddress.create("{$from}");
	public static final XDIArc XDI_ARC_TO_VARIABLE = XDIArc.create("{$to}");
	public static final XDIArc XDI_ARC_FROM_VARIABLE = XDIArc.create("{$from}");
	public static final XDIAddress XDI_ADD_ALL = XDIAddress.create("$all");
	public static final XDIAddress XDI_ADD_GET = XDIAddress.create("$get");
	public static final XDIAddress XDI_ADD_SET = XDIAddress.create("$set");
	public static final XDIAddress XDI_ADD_SET_DO = XDIAddress.create("$set{$do}");
	public static final XDIAddress XDI_ADD_SET_REF = XDIAddress.create("$set{$ref}");
	public static final XDIAddress XDI_ADD_DEL = XDIAddress.create("$del");
	public static final XDIAddress XDI_ADD_NOT = XDIAddress.create("$not");

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
	public static final XDI3Segment XRI_S_DO = XDI3Segment.create("$do");
	public static final XDI3Segment XRI_S_EC_DO = XDI3Segment.create("[$do]");
	public static final XDI3Segment XRI_S_DO_VARIABLE = XDI3Segment.create("{$do}");
	public static final XDI3SubSegment XRI_SS_DO = XDI3SubSegment.create("$do");
	public static final XDI3SubSegment XRI_SS_EC_DO = XDI3SubSegment.create("[$do]");
	public static final XDI3SubSegment XRI_SS_DO_VARIABLE = XDI3SubSegment.create("{$do}");
	public static final XDI3Segment XRI_S_PUBLIC = XDI3Segment.create("$public");
	public static final XDI3Segment XRI_S_TO_VARIABLE = XDI3Segment.create("{$to}");
	public static final XDI3Segment XRI_S_FROM_VARIABLE = XDI3Segment.create("{$from}");
	public static final XDI3SubSegment XRI_SS_TO_VARIABLE = XDI3SubSegment.create("{$to}");
	public static final XDI3SubSegment XRI_SS_FROM_VARIABLE = XDI3SubSegment.create("{$from}");
	public static final XDI3Segment XRI_S_ALL = XDI3Segment.create("$all");
	public static final XDI3Segment XRI_S_GET = XDI3Segment.create("$get");
	public static final XDI3Segment XRI_S_SET = XDI3Segment.create("$set");
	public static final XDI3Segment XRI_S_SET_DO = XDI3Segment.create("$set{$do}");
	public static final XDI3Segment XRI_S_SET_REF = XDI3Segment.create("$set{$ref}");
	public static final XDI3Segment XRI_S_DEL = XDI3Segment.create("$del");
	public static final XDI3Segment XRI_S_NOT = XDI3Segment.create("$not");

@@ -1,7 +1,7 @@
 package xdi2.core.constants;
 
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 
 /**
  * Constants for XDI link contracts.
@@ -10,29 +10,29 @@
  */
 public final class XDILinkContractConstants {
 
-	public static final XDI3Segment XRI_S_DO = XDI3Segment.create("$do");
-	public static final XDI3Segment XRI_S_EC_DO = XDI3Segment.create("[$do]");
-	public static final XDI3Segment XRI_S_DO_VARIABLE = XDI3Segment.create("{$do}");
+	public static final XDIAddress XDI_ADD_DO = XDIAddress.create("$do");
+	public static final XDIAddress XDI_ADD_EC_DO = XDIAddress.create("[$do]");
+	public static final XDIAddress XDI_ADD_DO_VARIABLE = XDIAddress.create("{$do}");
 
-	public static final XDI3SubSegment XRI_SS_DO = XDI3SubSegment.create("$do");
-	public static final XDI3SubSegment XRI_SS_EC_DO = XDI3SubSegment.create("[$do]");
-	public static final XDI3SubSegment XRI_SS_DO_VARIABLE = XDI3SubSegment.create("{$do}");
+	public static final XDIArc XDI_ARC_DO = XDIArc.create("$do");
+	public static final XDIArc XDI_ARC_EC_DO = XDIArc.create("[$do]");
+	public static final XDIArc XDI_ARC_DO_VARIABLE = XDIArc.create("{$do}");
 
-	public static final XDI3Segment XRI_S_PUBLIC = XDI3Segment.create("$public");
+	public static final XDIAddress XDI_ADD_PUBLIC = XDIAddress.create("$public");
 
-	public static final XDI3Segment XRI_S_TO_VARIABLE = XDI3Segment.create("{$to}");
-	public static final XDI3Segment XRI_S_FROM_VARIABLE = XDI3Segment.create("{$from}");
+	public static final XDIAddress XDI_ADD_TO_VARIABLE = XDIAddress.create("{$to}");
+	public static final XDIAddress XDI_ADD_FROM_VARIABLE = XDIAddress.create("{$from}");
 
-	public static final XDI3SubSegment XRI_SS_TO_VARIABLE = XDI3SubSegment.create("{$to}");
-	public static final XDI3SubSegment XRI_SS_FROM_VARIABLE = XDI3SubSegment.create("{$from}");
+	public static final XDIArc XDI_ARC_TO_VARIABLE = XDIArc.create("{$to}");
+	public static final XDIArc XDI_ARC_FROM_VARIABLE = XDIArc.create("{$from}");
 
-	public static final XDI3Segment XRI_S_ALL = XDI3Segment.create("$all");
-	public static final XDI3Segment XRI_S_GET = XDI3Segment.create("$get");
-	public static final XDI3Segment XRI_S_SET = XDI3Segment.create("$set");
-	public static final XDI3Segment XRI_S_SET_DO = XDI3Segment.create("$set{$do}");
-	public static final XDI3Segment XRI_S_SET_REF = XDI3Segment.create("$set{$ref}");
-	public static final XDI3Segment XRI_S_DEL = XDI3Segment.create("$del");
-	public static final XDI3Segment XRI_S_NOT = XDI3Segment.create("$not");
+	public static final XDIAddress XDI_ADD_ALL = XDIAddress.create("$all");
+	public static final XDIAddress XDI_ADD_GET = XDIAddress.create("$get");
+	public static final XDIAddress XDI_ADD_SET = XDIAddress.create("$set");
+	public static final XDIAddress XDI_ADD_SET_DO = XDIAddress.create("$set{$do}");
+	public static final XDIAddress XDI_ADD_SET_REF = XDIAddress.create("$set{$ref}");
+	public static final XDIAddress XDI_ADD_DEL = XDIAddress.create("$del");
+	public static final XDIAddress XDI_ADD_NOT = XDIAddress.create("$not");
 
 	private XDILinkContractConstants() { }
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDILinkContractConstants.java
1d3685c445a5d71202737b18c1ed2591be33ab1a
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDIPolicyConstants.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDIPolicyConstants.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/constants/XDIPolicyConstants.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
	public static final XDIAddress XDI_ADD_IF = XDIAddress.create("$if");
	public static final XDIArc XDI_ARC_IF = XDIArc.create("$if");
	public static final XDIArc XDI_ARC_AND = XDIArc.create("$and");
	public static final XDIArc XDI_ARC_OR = XDIArc.create("$or");
	public static final XDIArc XDI_ARC_NOT = XDIArc.create("$not");
	public static final XDIAddress XDI_ADD_EQUALS = XDIAddress.create("$equals");
	public static final XDIAddress XDI_ADD_MATCHES = XDIAddress.create("$matches");
	public static final XDIAddress XDI_ADD_GREATER = XDIAddress.create("$greater");
	public static final XDIAddress XDI_ADD_LESSER = XDIAddress.create("$lesser");
	public static final XDIAddress XDI_ADD_IS = XDIAddress.create("$is");

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
	public static final XDI3Segment XRI_S_IF = XDI3Segment.create("$if");
	public static final XDI3SubSegment XRI_SS_IF = XDI3SubSegment.create("$if");
	public static final XDI3SubSegment XRI_SS_AND = XDI3SubSegment.create("$and");
	public static final XDI3SubSegment XRI_SS_OR = XDI3SubSegment.create("$or");
	public static final XDI3SubSegment XRI_SS_NOT = XDI3SubSegment.create("$not");
	public static final XDI3Segment XRI_S_EQUALS = XDI3Segment.create("$equals");
	public static final XDI3Segment XRI_S_MATCHES = XDI3Segment.create("$matches");
	public static final XDI3Segment XRI_S_GREATER = XDI3Segment.create("$greater");
	public static final XDI3Segment XRI_S_LESSER = XDI3Segment.create("$lesser");
	public static final XDI3Segment XRI_S_IS = XDI3Segment.create("$is");

@@ -1,7 +1,7 @@
 package xdi2.core.constants;
 
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 
 /**
  * Constants for XDI policies.
@@ -10,19 +10,19 @@
  */
 public final class XDIPolicyConstants {
 
-	public static final XDI3Segment XRI_S_IF = XDI3Segment.create("$if");
+	public static final XDIAddress XDI_ADD_IF = XDIAddress.create("$if");
 
-	public static final XDI3SubSegment XRI_SS_IF = XDI3SubSegment.create("$if");
+	public static final XDIArc XDI_ARC_IF = XDIArc.create("$if");
 
-	public static final XDI3SubSegment XRI_SS_AND = XDI3SubSegment.create("$and");
-	public static final XDI3SubSegment XRI_SS_OR = XDI3SubSegment.create("$or");
-	public static final XDI3SubSegment XRI_SS_NOT = XDI3SubSegment.create("$not");
+	public static final XDIArc XDI_ARC_AND = XDIArc.create("$and");
+	public static final XDIArc XDI_ARC_OR = XDIArc.create("$or");
+	public static final XDIArc XDI_ARC_NOT = XDIArc.create("$not");
 
-	public static final XDI3Segment XRI_S_EQUALS = XDI3Segment.create("$equals");
-	public static final XDI3Segment XRI_S_MATCHES = XDI3Segment.create("$matches");
-	public static final XDI3Segment XRI_S_GREATER = XDI3Segment.create("$greater");
-	public static final XDI3Segment XRI_S_LESSER = XDI3Segment.create("$lesser");
-	public static final XDI3Segment XRI_S_IS = XDI3Segment.create("$is");
+	public static final XDIAddress XDI_ADD_EQUALS = XDIAddress.create("$equals");
+	public static final XDIAddress XDI_ADD_MATCHES = XDIAddress.create("$matches");
+	public static final XDIAddress XDI_ADD_GREATER = XDIAddress.create("$greater");
+	public static final XDIAddress XDI_ADD_LESSER = XDIAddress.create("$lesser");
+	public static final XDIAddress XDI_ADD_IS = XDIAddress.create("$is");
 
 	private XDIPolicyConstants() { }
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDIPolicyConstants.java
5c5e41cebc9b27528a45e694eaaffc1cba3961a8
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDITimestampsConstants.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDITimestampsConstants.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/constants/XDITimestampsConstants.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
	public static final XDIAddress XDI_ADD_AS_CREATED = XDIAddress.create("<#created>");
	public static final XDIAddress XDI_ADD_AS_EXPIRES = XDIAddress.create("<#expires>");
	public static final XDIAddress XDI_ADD_AS_T = XDIAddress.create("<$t>");
	public static final XDIArc XDI_ARC_AS_CREATED = XDIArc.create("<#created>");
	public static final XDIArc XDI_ARC_AS_EXPIRES = XDIArc.create("<#expires>");
	public static final XDIArc XDI_ARC_AS_T = XDIArc.create("<$t>");

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
	public static final XDI3Segment XRI_S_AS_CREATED = XDI3Segment.create("<#created>");
	public static final XDI3Segment XRI_S_AS_EXPIRES = XDI3Segment.create("<#expires>");
	public static final XDI3Segment XRI_S_AS_T = XDI3Segment.create("<$t>");
	public static final XDI3SubSegment XRI_SS_AS_CREATED = XDI3SubSegment.create("<#created>");
	public static final XDI3SubSegment XRI_SS_AS_EXPIRES = XDI3SubSegment.create("<#expires>");
	public static final XDI3SubSegment XRI_SS_AS_T = XDI3SubSegment.create("<$t>");

@@ -3,8 +3,8 @@
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 
 /**
  * Constants for XDI timestamps.
@@ -13,13 +13,13 @@
  */
 public final class XDITimestampsConstants {
 
-	public static final XDI3Segment XRI_S_AS_CREATED = XDI3Segment.create("<#created>");
-	public static final XDI3Segment XRI_S_AS_EXPIRES = XDI3Segment.create("<#expires>");
-	public static final XDI3Segment XRI_S_AS_T = XDI3Segment.create("<$t>");
+	public static final XDIAddress XDI_ADD_AS_CREATED = XDIAddress.create("<#created>");
+	public static final XDIAddress XDI_ADD_AS_EXPIRES = XDIAddress.create("<#expires>");
+	public static final XDIAddress XDI_ADD_AS_T = XDIAddress.create("<$t>");
 
-	public static final XDI3SubSegment XRI_SS_AS_CREATED = XDI3SubSegment.create("<#created>");
-	public static final XDI3SubSegment XRI_SS_AS_EXPIRES = XDI3SubSegment.create("<#expires>");
-	public static final XDI3SubSegment XRI_SS_AS_T = XDI3SubSegment.create("<$t>");
+	public static final XDIArc XDI_ARC_AS_CREATED = XDIArc.create("<#created>");
+	public static final XDIArc XDI_ARC_AS_EXPIRES = XDIArc.create("<#expires>");
+	public static final XDIArc XDI_ARC_AS_T = XDIArc.create("<$t>");
 
 	public static final DateFormat[] FORMATS_TIMESTAMP = new SimpleDateFormat[] {
 

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fconstants%2FXDITimestampsConstants.java
bad8cdbffe9b6fe806c890a88ab3252304ad12ec
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fdatatypes%2FDataTypes.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fdatatypes%2FDataTypes.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/datatypes/DataTypes.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.util.iterators.MappingRelationTargetContextNodeAddressIterator;
	public static final XDIAddress XRI_DATATYPE_XSD = XDIAddress.create("" + XDIConstants.CS_CLASS_UNRESERVED + XDIConstants.CS_CLASS_RESERVED + "xsd");
	public static final XDIAddress XRI_DATATYPE_JSON = XDIAddress.create("" + XDIConstants.CS_CLASS_UNRESERVED + XDIConstants.CS_CLASS_RESERVED + "json");
	public static final XDIAddress XRI_DATATYPE_MIME = XDIAddress.create("" + XDIConstants.CS_CLASS_UNRESERVED + XDIConstants.CS_CLASS_RESERVED + "mime");
	public static XDIAddress booleanToXri(Boolean b) {
		if (Boolean.TRUE.equals(b)) return XDIConstants.XDI_ADD_TRUE;
		if (Boolean.FALSE.equals(b)) return XDIConstants.XDI_ADD_FALSE;
	public static Boolean xriToBoolean(XDIAddress xri) {
		if (XDIConstants.XDI_ADD_TRUE.equals(xri)) return Boolean.TRUE;
		if (XDIConstants.XDI_ADD_FALSE.equals(xri)) return Boolean.FALSE;
	public static void setDataType(ContextNode contextNode, XDIAddress dataTypeXri) {
		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_IS_TYPE, dataTypeXri);
	public static List<XDIAddress> getDataTypes(ContextNode contextNode) {
		ReadOnlyIterator<Relation> relations = contextNode.getRelations(XDIDictionaryConstants.XDI_ADD_IS_TYPE);
		return new IteratorListMaker<XDIAddress> (new MappingRelationTargetContextNodeAddressIterator(relations)).list();
	public static XDIAddress getDataType(ContextNode contextNode) {
		Relation relation = contextNode.getRelation(XDIDictionaryConstants.XDI_ADD_IS_TYPE);
		return relation == null ? null : relation.getTargetContextNodeAddress();
	 * Returns XDIAddress for a xsd datatype string.
	 * @return a xsd datatype XDIAddress
	public static XDIAddress dataTypeXriFromXsdType(String xsdType) {
		return XDIAddress.create("" + XRI_DATATYPE_XSD + XDIConstants.CS_CLASS_RESERVED + xsdType);
	public static String xsdTypeFromDataTypeXri(XDIAddress dataTypeXri) {
	 * Returns XDIAddress for a json datatype string.
	 * @return a json datatype XDIAddress
	public static XDIAddress dataTypeXriFromJsonType(String jsonType) {
		return XDIAddress.create("" + XRI_DATATYPE_JSON + XDIConstants.CS_CLASS_RESERVED + jsonType);
	public static String jsonTypeFromDataTypeXri(XDIAddress dataTypeXri) {
	 * Returns XDIAddress for a mime datatype string.
	 * @return a mime datatype XDIAddress.
	public static XDIAddress dataTypeXriFromMimeType(String mimeType) {
		XDIAddress xri = null;
			xri = XDIAddress.create("" + XRI_DATATYPE_MIME + XDIConstants.CS_CLASS_RESERVED + parts[0] + XDIConstants.CS_CLASS_UNRESERVED + parts[1]);
	public static String mimeTypeFromDataTypeXri(XDIAddress dataTypeXri) {
			throw new Xdi2RuntimeException("Invalid XDIAddress ", ex);

import xdi2.core.util.iterators.MappingRelationTargetContextNodeXriIterator;
import xdi2.core.xri3.XDI3Segment;
	public static final XDI3Segment XRI_DATATYPE_XSD = XDI3Segment.create("" + XDIConstants.CS_CLASS_UNRESERVED + XDIConstants.CS_CLASS_RESERVED + "xsd");
	public static final XDI3Segment XRI_DATATYPE_JSON = XDI3Segment.create("" + XDIConstants.CS_CLASS_UNRESERVED + XDIConstants.CS_CLASS_RESERVED + "json");
	public static final XDI3Segment XRI_DATATYPE_MIME = XDI3Segment.create("" + XDIConstants.CS_CLASS_UNRESERVED + XDIConstants.CS_CLASS_RESERVED + "mime");
	public static XDI3Segment booleanToXri(Boolean b) {
		if (Boolean.TRUE.equals(b)) return XDIConstants.XRI_S_TRUE;
		if (Boolean.FALSE.equals(b)) return XDIConstants.XRI_S_FALSE;
	public static Boolean xriToBoolean(XDI3Segment xri) {
		if (XDIConstants.XRI_S_TRUE.equals(xri)) return Boolean.TRUE;
		if (XDIConstants.XRI_S_FALSE.equals(xri)) return Boolean.FALSE;
	public static void setDataType(ContextNode contextNode, XDI3Segment dataTypeXri) {
		contextNode.setRelation(XDIDictionaryConstants.XRI_S_IS_TYPE, dataTypeXri);
	public static List<XDI3Segment> getDataTypes(ContextNode contextNode) {
		ReadOnlyIterator<Relation> relations = contextNode.getRelations(XDIDictionaryConstants.XRI_S_IS_TYPE);
		return new IteratorListMaker<XDI3Segment> (new MappingRelationTargetContextNodeXriIterator(relations)).list();
	public static XDI3Segment getDataType(ContextNode contextNode) {
		Relation relation = contextNode.getRelation(XDIDictionaryConstants.XRI_S_IS_TYPE);
		return relation == null ? null : relation.getTargetContextNodeXri();
	 * Returns XDI3Segment for a xsd datatype string.
	 * @return a xsd datatype XDI3Segment
	public static XDI3Segment dataTypeXriFromXsdType(String xsdType) {
		return XDI3Segment.create("" + XRI_DATATYPE_XSD + XDIConstants.CS_CLASS_RESERVED + xsdType);
	public static String xsdTypeFromDataTypeXri(XDI3Segment dataTypeXri) {
	 * Returns XDI3Segment for a json datatype string.
	 * @return a json datatype XDI3Segment
	public static XDI3Segment dataTypeXriFromJsonType(String jsonType) {
		return XDI3Segment.create("" + XRI_DATATYPE_JSON + XDIConstants.CS_CLASS_RESERVED + jsonType);
	public static String jsonTypeFromDataTypeXri(XDI3Segment dataTypeXri) {
	 * Returns XDI3Segment for a mime datatype string.
	 * @return a mime datatype XDI3Segment.
	public static XDI3Segment dataTypeXriFromMimeType(String mimeType) {
		XDI3Segment xri = null;
			xri = XDI3Segment.create("" + XRI_DATATYPE_MIME + XDIConstants.CS_CLASS_RESERVED + parts[0] + XDIConstants.CS_CLASS_UNRESERVED + parts[1]);
	public static String mimeTypeFromDataTypeXri(XDI3Segment dataTypeXri) {
			throw new Xdi2RuntimeException("Invalid XDI3Segment ", ex);

@@ -7,10 +7,10 @@
 import xdi2.core.constants.XDIConstants;
 import xdi2.core.constants.XDIDictionaryConstants;
 import xdi2.core.exceptions.Xdi2RuntimeException;
+import xdi2.core.syntax.XDIAddress;
 import xdi2.core.util.iterators.IteratorListMaker;
-import xdi2.core.util.iterators.MappingRelationTargetContextNodeXriIterator;
+import xdi2.core.util.iterators.MappingRelationTargetContextNodeAddressIterator;
 import xdi2.core.util.iterators.ReadOnlyIterator;
-import xdi2.core.xri3.XDI3Segment;
 
 /**
  * A helper class to work with data types, i.e. get or set them. Supported data
@@ -22,26 +22,26 @@ public class DataTypes {
 
 	private DataTypes() { }
 
-	public static final XDI3Segment XRI_DATATYPE_XSD = XDI3Segment.create("" + XDIConstants.CS_CLASS_UNRESERVED + XDIConstants.CS_CLASS_RESERVED + "xsd");
-	public static final XDI3Segment XRI_DATATYPE_JSON = XDI3Segment.create("" + XDIConstants.CS_CLASS_UNRESERVED + XDIConstants.CS_CLASS_RESERVED + "json");
-	public static final XDI3Segment XRI_DATATYPE_MIME = XDI3Segment.create("" + XDIConstants.CS_CLASS_UNRESERVED + XDIConstants.CS_CLASS_RESERVED + "mime");
+	public static final XDIAddress XRI_DATATYPE_XSD = XDIAddress.create("" + XDIConstants.CS_CLASS_UNRESERVED + XDIConstants.CS_CLASS_RESERVED + "xsd");
+	public static final XDIAddress XRI_DATATYPE_JSON = XDIAddress.create("" + XDIConstants.CS_CLASS_UNRESERVED + XDIConstants.CS_CLASS_RESERVED + "json");
+	public static final XDIAddress XRI_DATATYPE_MIME = XDIAddress.create("" + XDIConstants.CS_CLASS_UNRESERVED + XDIConstants.CS_CLASS_RESERVED + "mime");
 
 	/*
 	 * Methods for booleans
 	 */
 
-	public static XDI3Segment booleanToXri(Boolean b) {
+	public static XDIAddress booleanToXri(Boolean b) {
 
-		if (Boolean.TRUE.equals(b)) return XDIConstants.XRI_S_TRUE;
-		if (Boolean.FALSE.equals(b)) return XDIConstants.XRI_S_FALSE;
+		if (Boolean.TRUE.equals(b)) return XDIConstants.XDI_ADD_TRUE;
+		if (Boolean.FALSE.equals(b)) return XDIConstants.XDI_ADD_FALSE;
 
 		return null;
 	}
 
-	public static Boolean xriToBoolean(XDI3Segment xri) {
+	public static Boolean xriToBoolean(XDIAddress xri) {
 
-		if (XDIConstants.XRI_S_TRUE.equals(xri)) return Boolean.TRUE;
-		if (XDIConstants.XRI_S_FALSE.equals(xri)) return Boolean.FALSE;
+		if (XDIConstants.XDI_ADD_TRUE.equals(xri)) return Boolean.TRUE;
+		if (XDIConstants.XDI_ADD_FALSE.equals(xri)) return Boolean.FALSE;
 
 		return null;
 	}
@@ -56,9 +56,9 @@ public static Boolean xriToBoolean(XDI3Segment xri) {
 	 * @param contextNode
 	 * @param dataTypeXri
 	 */
-	public static void setDataType(ContextNode contextNode, XDI3Segment dataTypeXri) {
+	public static void setDataType(ContextNode contextNode, XDIAddress dataTypeXri) {
 
-		contextNode.setRelation(XDIDictionaryConstants.XRI_S_IS_TYPE, dataTypeXri);
+		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_IS_TYPE, dataTypeXri);
 	}
 
 	/**
@@ -67,11 +67,11 @@ public static void setDataType(ContextNode contextNode, XDI3Segment dataTypeXri)
 	 * @param contextNode
 	 * @return list of datatypes
 	 */
-	public static List<XDI3Segment> getDataTypes(ContextNode contextNode) {
+	public static List<XDIAddress> getDataTypes(ContextNode contextNode) {
 
-		ReadOnlyIterator<Relation> relations = contextNode.getRelations(XDIDictionaryConstants.XRI_S_IS_TYPE);
+		ReadOnlyIterator<Relation> relations = contextNode.getRelations(XDIDictionaryConstants.XDI_ADD_IS_TYPE);
 
-		return new IteratorListMaker<XDI3Segment> (new MappingRelationTargetContextNodeXriIterator(relations)).list();
+		return new IteratorListMaker<XDIAddress> (new MappingRelationTargetContextNodeAddressIterator(relations)).list();
 	}
 
 	/**
@@ -80,26 +80,26 @@ public static List<XDI3Segment> getDataTypes(ContextNode contextNode) {
 	 * @param contextNode
 	 * @return datatype
 	 */
-	public static XDI3Segment getDataType(ContextNode contextNode) {
+	public static XDIAddress getDataType(ContextNode contextNode) {
 
-		Relation relation = contextNode.getRelation(XDIDictionaryConstants.XRI_S_IS_TYPE);
+		Relation relation = contextNode.getRelation(XDIDictionaryConstants.XDI_ADD_IS_TYPE);
 
-		return relation == null ? null : relation.getTargetContextNodeXri();
+		return relation == null ? null : relation.getTargetContextNodeAddress();
 	}
 
 	/*
 	 * Methods for data type XRIs
 	 */
 
 	/**
-	 * Returns XDI3Segment for a xsd datatype string.
+	 * Returns XDIAddress for a xsd datatype string.
 	 * 
 	 * @param xsdType
-	 * @return a xsd datatype XDI3Segment
+	 * @return a xsd datatype XDIAddress
 	 */
-	public static XDI3Segment dataTypeXriFromXsdType(String xsdType) {
+	public static XDIAddress dataTypeXriFromXsdType(String xsdType) {
 
-		return XDI3Segment.create("" + XRI_DATATYPE_XSD + XDIConstants.CS_CLASS_RESERVED + xsdType);
+		return XDIAddress.create("" + XRI_DATATYPE_XSD + XDIConstants.CS_CLASS_RESERVED + xsdType);
 	}
 
 	/**
@@ -108,22 +108,22 @@ public static XDI3Segment dataTypeXriFromXsdType(String xsdType) {
 	 * @param dataTypeXri
 	 * @return a string of xsd datatype
 	 */
-	public static String xsdTypeFromDataTypeXri(XDI3Segment dataTypeXri) {
+	public static String xsdTypeFromDataTypeXri(XDIAddress dataTypeXri) {
 
 		String dataTypeXriString = dataTypeXri.toString();
 
 		return getDataTypeFromXRISegment(dataTypeXriString, true);
 	}
 
 	/**
-	 * Returns XDI3Segment for a json datatype string.
+	 * Returns XDIAddress for a json datatype string.
 	 * 
 	 * @param jsonType
-	 * @return a json datatype XDI3Segment
+	 * @return a json datatype XDIAddress
 	 */
-	public static XDI3Segment dataTypeXriFromJsonType(String jsonType) {
+	public static XDIAddress dataTypeXriFromJsonType(String jsonType) {
 
-		return XDI3Segment.create("" + XRI_DATATYPE_JSON + XDIConstants.CS_CLASS_RESERVED + jsonType);
+		return XDIAddress.create("" + XRI_DATATYPE_JSON + XDIConstants.CS_CLASS_RESERVED + jsonType);
 	}
 
 	/**
@@ -132,28 +132,28 @@ public static XDI3Segment dataTypeXriFromJsonType(String jsonType) {
 	 * @param dataTypeXri
 	 * @return a string of json datatype
 	 */
-	public static String jsonTypeFromDataTypeXri(XDI3Segment dataTypeXri) {
+	public static String jsonTypeFromDataTypeXri(XDIAddress dataTypeXri) {
 
 		String dataTypeJSONString = dataTypeXri.toString();
 
 		return getDataTypeFromXRISegment(dataTypeJSONString, false);
 	}
 
 	/**
-	 * Returns XDI3Segment for a mime datatype string.
+	 * Returns XDIAddress for a mime datatype string.
 	 * 
 	 * @param mimeType
-	 * @return a mime datatype XDI3Segment.
+	 * @return a mime datatype XDIAddress.
 	 */
-	public static XDI3Segment dataTypeXriFromMimeType(String mimeType) {
+	public static XDIAddress dataTypeXriFromMimeType(String mimeType) {
 
 		String[] parts;
-		XDI3Segment xri = null;
+		XDIAddress xri = null;
 
 		try {
 
 			parts = mimeType.split("/");
-			xri = XDI3Segment.create("" + XRI_DATATYPE_MIME + XDIConstants.CS_CLASS_RESERVED + parts[0] + XDIConstants.CS_CLASS_UNRESERVED + parts[1]);
+			xri = XDIAddress.create("" + XRI_DATATYPE_MIME + XDIConstants.CS_CLASS_RESERVED + parts[0] + XDIConstants.CS_CLASS_UNRESERVED + parts[1]);
 		} catch (Exception ex) {
 
 			throw new Xdi2RuntimeException("Invalid MIME Type ", ex);
@@ -168,7 +168,7 @@ public static XDI3Segment dataTypeXriFromMimeType(String mimeType) {
 	 * @param dataTypeXri
 	 * @return a string of mime datatype
 	 */
-	public static String mimeTypeFromDataTypeXri(XDI3Segment dataTypeXri) {
+	public static String mimeTypeFromDataTypeXri(XDIAddress dataTypeXri) {
 
 		String dataTypeMIMEString = dataTypeXri.toString();
 
@@ -210,7 +210,7 @@ private static String getDataTypeFromXRISegment(String xriSegment, boolean isXSD
 			}
 		} catch (Exception ex) {
 
-			throw new Xdi2RuntimeException("Invalid XDI3Segment ", ex);
+			throw new Xdi2RuntimeException("Invalid XDIAddress ", ex);
 		}
 
 		return buffer.toString();

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fdatatypes%2FDataTypes.java
25bd78657ac95181af8c575aa18e2f247e5941e5
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fdictionary%2FDictionary.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fdictionary%2FDictionary.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/dictionary/Dictionary.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.util.iterators.MappingContextNodeAddressIterator;
	public static XDIArc instanceXriToDictionaryXri(XDIArc instanceXri) {
		return XDIArc.create("" + XDIConstants.CS_CLASS_UNRESERVED + "(" + instanceXri + ")");
	public static XDIArc dictionaryXriToInstanceXri(XDIArc dictionaryXri) {
		return XDIArc.create(dictionaryXri.getXRef().getValue());
	public static XDIArc nativeIdentifierToInstanceXri(String nativeIdentifier) {
		return XDIArc.create("" + XDIConstants.CS_CLASS_UNRESERVED + "(" + nativeIdentifier + ")");
	public static String instanceXriToNativeIdentifier(XDIArc instanceXri) {
	public static Iterator<XDIAddress> getContextNodeTypes(ContextNode contextNode) {
		return new MappingContextNodeAddressIterator(new MappingRelationTargetContextNodeIterator(contextNode.getRelations(XDIDictionaryConstants.XDI_ADD_IS_TYPE)));
	public static XDIAddress getContextNodeType(ContextNode contextNode) {
		return contextNode.getRelation(XDIDictionaryConstants.XDI_ADD_IS_TYPE).getTargetContextNodeAddress();
	public static boolean isContextNodeType(ContextNode contextNode, XDIAddress type) {
		return contextNode.containsRelation(XDIDictionaryConstants.XDI_ADD_IS_TYPE, type);
	public static void setContextNodeType(ContextNode contextNode, XDIAddress type) {
		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_IS_TYPE, type);
	public static void delContextNodeType(ContextNode contextNode, XDIAddress type) {
		contextNode.delRelation(XDIDictionaryConstants.XDI_ADD_IS_TYPE, type);
		contextNode.delRelations(XDIDictionaryConstants.XDI_ADD_IS_TYPE);
	public static void replaceContextNodeType(ContextNode contextNode, XDIAddress type) {

import xdi2.core.util.iterators.MappingContextNodeXriIterator;
import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
	public static XDI3SubSegment instanceXriToDictionaryXri(XDI3SubSegment instanceXri) {
		return XDI3SubSegment.create("" + XDIConstants.CS_CLASS_UNRESERVED + "(" + instanceXri + ")");
	public static XDI3SubSegment dictionaryXriToInstanceXri(XDI3SubSegment dictionaryXri) {
		return XDI3SubSegment.create(dictionaryXri.getXRef().getValue());
	public static XDI3SubSegment nativeIdentifierToInstanceXri(String nativeIdentifier) {
		return XDI3SubSegment.create("" + XDIConstants.CS_CLASS_UNRESERVED + "(" + nativeIdentifier + ")");
	public static String instanceXriToNativeIdentifier(XDI3SubSegment instanceXri) {
	public static Iterator<XDI3Segment> getContextNodeTypes(ContextNode contextNode) {
		return new MappingContextNodeXriIterator(new MappingRelationTargetContextNodeIterator(contextNode.getRelations(XDIDictionaryConstants.XRI_S_IS_TYPE)));
	public static XDI3Segment getContextNodeType(ContextNode contextNode) {
		return contextNode.getRelation(XDIDictionaryConstants.XRI_S_IS_TYPE).getTargetContextNodeXri();
	public static boolean isContextNodeType(ContextNode contextNode, XDI3Segment type) {
		return contextNode.containsRelation(XDIDictionaryConstants.XRI_S_IS_TYPE, type);
	public static void setContextNodeType(ContextNode contextNode, XDI3Segment type) {
		contextNode.setRelation(XDIDictionaryConstants.XRI_S_IS_TYPE, type);
	public static void delContextNodeType(ContextNode contextNode, XDI3Segment type) {
		contextNode.delRelation(XDIDictionaryConstants.XRI_S_IS_TYPE, type);
		contextNode.delRelations(XDIDictionaryConstants.XRI_S_IS_TYPE);
	public static void replaceContextNodeType(ContextNode contextNode, XDI3Segment type) {

@@ -5,10 +5,10 @@
 import xdi2.core.ContextNode;
 import xdi2.core.constants.XDIConstants;
 import xdi2.core.constants.XDIDictionaryConstants;
-import xdi2.core.util.iterators.MappingContextNodeXriIterator;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.util.iterators.MappingContextNodeAddressIterator;
 import xdi2.core.util.iterators.MappingRelationTargetContextNodeIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
 
 public class Dictionary {
 
@@ -18,25 +18,25 @@ private Dictionary() { }
 	 * Methods for dictionary XRIs
 	 */
 
-	public static XDI3SubSegment instanceXriToDictionaryXri(XDI3SubSegment instanceXri) {
+	public static XDIArc instanceXriToDictionaryXri(XDIArc instanceXri) {
 
-		return XDI3SubSegment.create("" + XDIConstants.CS_CLASS_UNRESERVED + "(" + instanceXri + ")");
+		return XDIArc.create("" + XDIConstants.CS_CLASS_UNRESERVED + "(" + instanceXri + ")");
 	}
 
-	public static XDI3SubSegment dictionaryXriToInstanceXri(XDI3SubSegment dictionaryXri) {
+	public static XDIArc dictionaryXriToInstanceXri(XDIArc dictionaryXri) {
 
 		if (! XDIConstants.CS_CLASS_UNRESERVED.equals(dictionaryXri.getCs())) return null;
 		if (! dictionaryXri.hasXRef()) return null;
 
-		return XDI3SubSegment.create(dictionaryXri.getXRef().getValue());
+		return XDIArc.create(dictionaryXri.getXRef().getValue());
 	}
 
-	public static XDI3SubSegment nativeIdentifierToInstanceXri(String nativeIdentifier) {
+	public static XDIArc nativeIdentifierToInstanceXri(String nativeIdentifier) {
 
-		return XDI3SubSegment.create("" + XDIConstants.CS_CLASS_UNRESERVED + "(" + nativeIdentifier + ")");
+		return XDIArc.create("" + XDIConstants.CS_CLASS_UNRESERVED + "(" + nativeIdentifier + ")");
 	}
 
-	public static String instanceXriToNativeIdentifier(XDI3SubSegment instanceXri) {
+	public static String instanceXriToNativeIdentifier(XDIArc instanceXri) {
 
 		if (! instanceXri.hasXRef()) return null;
 
@@ -47,37 +47,37 @@ public static String instanceXriToNativeIdentifier(XDI3SubSegment instanceXri) {
 	 * Methods for types of context nodes.
 	 */
 
-	public static Iterator<XDI3Segment> getContextNodeTypes(ContextNode contextNode) {
+	public static Iterator<XDIAddress> getContextNodeTypes(ContextNode contextNode) {
 
-		return new MappingContextNodeXriIterator(new MappingRelationTargetContextNodeIterator(contextNode.getRelations(XDIDictionaryConstants.XRI_S_IS_TYPE)));
+		return new MappingContextNodeAddressIterator(new MappingRelationTargetContextNodeIterator(contextNode.getRelations(XDIDictionaryConstants.XDI_ADD_IS_TYPE)));
 	}
 
-	public static XDI3Segment getContextNodeType(ContextNode contextNode) {
+	public static XDIAddress getContextNodeType(ContextNode contextNode) {
 
-		return contextNode.getRelation(XDIDictionaryConstants.XRI_S_IS_TYPE).getTargetContextNodeXri();
+		return contextNode.getRelation(XDIDictionaryConstants.XDI_ADD_IS_TYPE).getTargetContextNodeAddress();
 	}
 
-	public static boolean isContextNodeType(ContextNode contextNode, XDI3Segment type) {
+	public static boolean isContextNodeType(ContextNode contextNode, XDIAddress type) {
 
-		return contextNode.containsRelation(XDIDictionaryConstants.XRI_S_IS_TYPE, type);
+		return contextNode.containsRelation(XDIDictionaryConstants.XDI_ADD_IS_TYPE, type);
 	}
 
-	public static void setContextNodeType(ContextNode contextNode, XDI3Segment type) {
+	public static void setContextNodeType(ContextNode contextNode, XDIAddress type) {
 
-		contextNode.setRelation(XDIDictionaryConstants.XRI_S_IS_TYPE, type);
+		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_IS_TYPE, type);
 	}
 
-	public static void delContextNodeType(ContextNode contextNode, XDI3Segment type) {
+	public static void delContextNodeType(ContextNode contextNode, XDIAddress type) {
 
-		contextNode.delRelation(XDIDictionaryConstants.XRI_S_IS_TYPE, type);
+		contextNode.delRelation(XDIDictionaryConstants.XDI_ADD_IS_TYPE, type);
 	}
 
 	public static void delContextNodeTypes(ContextNode contextNode) {
 
-		contextNode.delRelations(XDIDictionaryConstants.XRI_S_IS_TYPE);
+		contextNode.delRelations(XDIDictionaryConstants.XDI_ADD_IS_TYPE);
 	}
 
-	public static void replaceContextNodeType(ContextNode contextNode, XDI3Segment type) {
+	public static void replaceContextNodeType(ContextNode contextNode, XDIAddress type) {
 
 		delContextNodeTypes(contextNode);
 		setContextNodeType(contextNode, type);

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fdictionary%2FDictionary.java
1c248f1a5341afcf9e507bde0e35f1a3525a7b1c
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fequivalence%2FEquivalence.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fequivalence%2FEquivalence.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/equivalence/Equivalence.java
import xdi2.core.syntax.XDIAddress;
		return contextNode.getRelations(XDIDictionaryConstants.XDI_ADD_IS);
		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_IS, identityContextNode);
	public static void setIdentityContextNode(ContextNode contextNode, XDIAddress identitycontextNodeAddress) {
		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_IS, identitycontextNodeAddress);
		Iterator<Relation> identityRelations = contextNode.getIncomingRelations(XDIDictionaryConstants.XDI_ADD_IS);
		return contextNode.getRelation(XDIDictionaryConstants.XDI_ADD_REF);
		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_REF, referenceContextNode);
	public static void setReferenceContextNode(ContextNode contextNode, XDIAddress referencecontextNodeAddress) {
		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_REF, referencecontextNodeAddress);
		Iterator<Relation> referenceRelations = contextNode.getIncomingRelations(XDIDictionaryConstants.XDI_ADD_REF);
		return contextNode.getRelation(XDIDictionaryConstants.XDI_ADD_REP);
		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_REP, replacementContextNode);
	public static void setReplacementContextNode(ContextNode contextNode, XDIAddress replacementcontextNodeAddress) {
		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_REP, replacementcontextNodeAddress);
		Iterator<Relation> replacementRelations = contextNode.getIncomingRelations(XDIDictionaryConstants.XDI_ADD_REP);
				return relation.getArc().equals(XDIDictionaryConstants.XDI_ADD_REF) || relation.getArc().equals(XDIDictionaryConstants.XDI_ADD_REP);

import xdi2.core.xri3.XDI3Segment;
		return contextNode.getRelations(XDIDictionaryConstants.XRI_S_IS);
		contextNode.setRelation(XDIDictionaryConstants.XRI_S_IS, identityContextNode);
	public static void setIdentityContextNode(ContextNode contextNode, XDI3Segment identityContextNodeXri) {
		contextNode.setRelation(XDIDictionaryConstants.XRI_S_IS, identityContextNodeXri);
		Iterator<Relation> identityRelations = contextNode.getIncomingRelations(XDIDictionaryConstants.XRI_S_IS);
		return contextNode.getRelation(XDIDictionaryConstants.XRI_S_REF);
		contextNode.setRelation(XDIDictionaryConstants.XRI_S_REF, referenceContextNode);
	public static void setReferenceContextNode(ContextNode contextNode, XDI3Segment referenceContextNodeXri) {
		contextNode.setRelation(XDIDictionaryConstants.XRI_S_REF, referenceContextNodeXri);
		Iterator<Relation> referenceRelations = contextNode.getIncomingRelations(XDIDictionaryConstants.XRI_S_REF);
		return contextNode.getRelation(XDIDictionaryConstants.XRI_S_REP);
		contextNode.setRelation(XDIDictionaryConstants.XRI_S_REP, replacementContextNode);
	public static void setReplacementContextNode(ContextNode contextNode, XDI3Segment replacementContextNodeXri) {
		contextNode.setRelation(XDIDictionaryConstants.XRI_S_REP, replacementContextNodeXri);
		Iterator<Relation> replacementRelations = contextNode.getIncomingRelations(XDIDictionaryConstants.XRI_S_REP);
				return relation.getArcXri().equals(XDIDictionaryConstants.XRI_S_REF) || relation.getArcXri().equals(XDIDictionaryConstants.XRI_S_REP);

@@ -7,11 +7,11 @@
 import xdi2.core.ContextNode;
 import xdi2.core.Relation;
 import xdi2.core.constants.XDIDictionaryConstants;
+import xdi2.core.syntax.XDIAddress;
 import xdi2.core.util.iterators.CompositeIterator;
 import xdi2.core.util.iterators.MappingRelationContextNodeIterator;
 import xdi2.core.util.iterators.MappingRelationTargetContextNodeIterator;
 import xdi2.core.util.iterators.SelectingIterator;
-import xdi2.core.xri3.XDI3Segment;
 
 public class Equivalence {
 
@@ -23,7 +23,7 @@ private Equivalence() { }
 
 	public static Iterator<Relation> getIdentityRelations(ContextNode contextNode) {
 
-		return contextNode.getRelations(XDIDictionaryConstants.XRI_S_IS);
+		return contextNode.getRelations(XDIDictionaryConstants.XDI_ADD_IS);
 	}
 
 	public static Iterator<ContextNode> getIdentityContextNodes(ContextNode contextNode) {
@@ -33,17 +33,17 @@ public static Iterator<ContextNode> getIdentityContextNodes(ContextNode contextN
 
 	public static void setIdentityContextNode(ContextNode contextNode, ContextNode identityContextNode) {
 
-		contextNode.setRelation(XDIDictionaryConstants.XRI_S_IS, identityContextNode);
+		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_IS, identityContextNode);
 	}
 
-	public static void setIdentityContextNode(ContextNode contextNode, XDI3Segment identityContextNodeXri) {
+	public static void setIdentityContextNode(ContextNode contextNode, XDIAddress identitycontextNodeAddress) {
 
-		contextNode.setRelation(XDIDictionaryConstants.XRI_S_IS, identityContextNodeXri);
+		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_IS, identitycontextNodeAddress);
 	}
 
 	public static Iterator<Relation> getIncomingIdentityRelations(ContextNode contextNode) {
 
-		Iterator<Relation> identityRelations = contextNode.getIncomingRelations(XDIDictionaryConstants.XRI_S_IS);
+		Iterator<Relation> identityRelations = contextNode.getIncomingRelations(XDIDictionaryConstants.XDI_ADD_IS);
 
 		List<Iterator<? extends Relation>> iterators = new ArrayList<Iterator<? extends Relation>> ();
 		iterators.add(identityRelations);
@@ -64,7 +64,7 @@ public static Iterator<ContextNode> getIncomingIdentityContextNodes(ContextNode
 
 	public static Relation getReferenceRelation(ContextNode contextNode) {
 
-		return contextNode.getRelation(XDIDictionaryConstants.XRI_S_REF);
+		return contextNode.getRelation(XDIDictionaryConstants.XDI_ADD_REF);
 	}
 
 	public static ContextNode getReferenceContextNode(ContextNode contextNode) {
@@ -83,23 +83,23 @@ public static void setReferenceContextNode(ContextNode contextNode, ContextNode
 		Relation replacementRelation = getReplacementRelation(contextNode);
 		if (replacementRelation != null) replacementRelation.delete();
 
-		contextNode.setRelation(XDIDictionaryConstants.XRI_S_REF, referenceContextNode);
+		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_REF, referenceContextNode);
 	}
 
-	public static void setReferenceContextNode(ContextNode contextNode, XDI3Segment referenceContextNodeXri) {
+	public static void setReferenceContextNode(ContextNode contextNode, XDIAddress referencecontextNodeAddress) {
 
 		Relation referenceRelation = getReferenceRelation(contextNode);
 		if (referenceRelation != null) referenceRelation.delete();
 
 		Relation replacementRelation = getReplacementRelation(contextNode);
 		if (replacementRelation != null) replacementRelation.delete();
 
-		contextNode.setRelation(XDIDictionaryConstants.XRI_S_REF, referenceContextNodeXri);
+		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_REF, referencecontextNodeAddress);
 	}
 
 	public static Iterator<Relation> getIncomingReferenceRelations(ContextNode contextNode) {
 
-		Iterator<Relation> referenceRelations = contextNode.getIncomingRelations(XDIDictionaryConstants.XRI_S_REF);
+		Iterator<Relation> referenceRelations = contextNode.getIncomingRelations(XDIDictionaryConstants.XDI_ADD_REF);
 
 		List<Iterator<? extends Relation>> iterators = new ArrayList<Iterator<? extends Relation>> ();
 		iterators.add(referenceRelations);
@@ -120,7 +120,7 @@ public static Iterator<ContextNode> getIncomingReferenceContextNodes(ContextNode
 
 	public static Relation getReplacementRelation(ContextNode contextNode) {
 
-		return contextNode.getRelation(XDIDictionaryConstants.XRI_S_REP);
+		return contextNode.getRelation(XDIDictionaryConstants.XDI_ADD_REP);
 	}
 
 	public static ContextNode getReplacementContextNode(ContextNode contextNode) {
@@ -139,23 +139,23 @@ public static void setReplacementContextNode(ContextNode contextNode, ContextNod
 		Relation replacementRelation = getReplacementRelation(contextNode);
 		if (replacementRelation != null) replacementRelation.delete();
 
-		contextNode.setRelation(XDIDictionaryConstants.XRI_S_REP, replacementContextNode);
+		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_REP, replacementContextNode);
 	}
 
-	public static void setReplacementContextNode(ContextNode contextNode, XDI3Segment replacementContextNodeXri) {
+	public static void setReplacementContextNode(ContextNode contextNode, XDIAddress replacementcontextNodeAddress) {
 
 		Relation referenceRelation = getReferenceRelation(contextNode);
 		if (referenceRelation != null) referenceRelation.delete();
 
 		Relation replacementRelation = getReplacementRelation(contextNode);
 		if (replacementRelation != null) replacementRelation.delete();
 
-		contextNode.setRelation(XDIDictionaryConstants.XRI_S_REP, replacementContextNodeXri);
+		contextNode.setRelation(XDIDictionaryConstants.XDI_ADD_REP, replacementcontextNodeAddress);
 	}
 
 	public static Iterator<Relation> getIncomingReplacementRelations(ContextNode contextNode) {
 
-		Iterator<Relation> replacementRelations = contextNode.getIncomingRelations(XDIDictionaryConstants.XRI_S_REP);
+		Iterator<Relation> replacementRelations = contextNode.getIncomingRelations(XDIDictionaryConstants.XDI_ADD_REP);
 
 		List<Iterator<? extends Relation>> iterators = new ArrayList<Iterator<? extends Relation>> ();
 		iterators.add(replacementRelations);
@@ -181,7 +181,7 @@ public static Iterator<Relation> getAllReferenceAndReplacementRelations(ContextN
 			@Override
 			public boolean select(Relation relation) {
 
-				return relation.getArcXri().equals(XDIDictionaryConstants.XRI_S_REF) || relation.getArcXri().equals(XDIDictionaryConstants.XRI_S_REP);
+				return relation.getArc().equals(XDIDictionaryConstants.XDI_ADD_REF) || relation.getArc().equals(XDIDictionaryConstants.XDI_ADD_REP);
 			}
 		};
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fequivalence%2FEquivalence.java
986fb47156f7f50e0c3890392ea456024e44059a
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fkeys%2FKeys.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fkeys%2FKeys.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/keys/Keys.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
		return getPublicKey(xdiContext, XDIAuthenticationConstants.XDI_ADD_MSG_SIG_KEYPAIR_PUBLIC_KEY);
		return getPublicKey(xdiContext, XDIAuthenticationConstants.XDI_ADD_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY);
		return getPrivateKey(xdiContext, XDIAuthenticationConstants.XDI_ADD_MSG_SIG_KEYPAIR_PRIVATE_KEY);
		return getPrivateKey(xdiContext, XDIAuthenticationConstants.XDI_ADD_MSG_ENCRYPT_KEYPAIR_PRIVATE_KEY);
		return getSecretKey(xdiContext, XDIAuthenticationConstants.XDI_ADD_MSG_SIG_KEYPAIR_PUBLIC_KEY);
		return getSecretKey(xdiContext, XDIAuthenticationConstants.XDI_ADD_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY);
	public static PublicKey getPublicKey(XdiContext<?> xdiContext, XDIAddress publicKeyRelativeAddress) throws GeneralSecurityException {
	public static PrivateKey getPrivateKey(XdiContext<?> xdiContext, XDIAddress privateKeyRelativeAddress) throws GeneralSecurityException {
	public static SecretKey getSecretKey(XdiContext<?> xdiContext, XDIAddress secretKeyRelativeAddress) throws GeneralSecurityException {
	public static String getKeyAlgorithm(XDIAddress dataTypeXri) {
		XDIArc keyAlgorithmXri = dataTypeXri.getNumArcs() > 0 ? dataTypeXri.getArc(0) : null;
	public static Integer getKeyLength(XDIAddress dataTypeXri) {
		XDIArc keyLengthXri = dataTypeXri.getNumArcs() > 1 ? dataTypeXri.getArc(1) : null;

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
		return getPublicKey(xdiContext, XDIAuthenticationConstants.XRI_S_MSG_SIG_KEYPAIR_PUBLIC_KEY);
		return getPublicKey(xdiContext, XDIAuthenticationConstants.XRI_S_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY);
		return getPrivateKey(xdiContext, XDIAuthenticationConstants.XRI_S_MSG_SIG_KEYPAIR_PRIVATE_KEY);
		return getPrivateKey(xdiContext, XDIAuthenticationConstants.XRI_S_MSG_ENCRYPT_KEYPAIR_PRIVATE_KEY);
		return getSecretKey(xdiContext, XDIAuthenticationConstants.XRI_S_MSG_SIG_KEYPAIR_PUBLIC_KEY);
		return getSecretKey(xdiContext, XDIAuthenticationConstants.XRI_S_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY);
	public static PublicKey getPublicKey(XdiContext<?> xdiContext, XDI3Segment publicKeyRelativeAddress) throws GeneralSecurityException {
	public static PrivateKey getPrivateKey(XdiContext<?> xdiContext, XDI3Segment privateKeyRelativeAddress) throws GeneralSecurityException {
	public static SecretKey getSecretKey(XdiContext<?> xdiContext, XDI3Segment secretKeyRelativeAddress) throws GeneralSecurityException {
	public static String getKeyAlgorithm(XDI3Segment dataTypeXri) {
		XDI3SubSegment keyAlgorithmXri = dataTypeXri.getNumSubSegments() > 0 ? dataTypeXri.getSubSegment(0) : null;
	public static Integer getKeyLength(XDI3Segment dataTypeXri) {
		XDI3SubSegment keyLengthXri = dataTypeXri.getNumSubSegments() > 1 ? dataTypeXri.getSubSegment(1) : null;

@@ -18,8 +18,8 @@
 import xdi2.core.features.nodetypes.XdiAttribute;
 import xdi2.core.features.nodetypes.XdiContext;
 import xdi2.core.features.nodetypes.XdiValue;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 
 public class Keys {
 
@@ -32,7 +32,7 @@ private Keys() { }
 	 */
 	public static PublicKey getSignaturePublicKey(XdiContext<?> xdiContext) throws GeneralSecurityException {
 
-		return getPublicKey(xdiContext, XDIAuthenticationConstants.XRI_S_MSG_SIG_KEYPAIR_PUBLIC_KEY);
+		return getPublicKey(xdiContext, XDIAuthenticationConstants.XDI_ADD_MSG_SIG_KEYPAIR_PUBLIC_KEY);
 	}
 
 	/**
@@ -42,7 +42,7 @@ public static PublicKey getSignaturePublicKey(XdiContext<?> xdiContext) throws G
 	 */
 	public static PublicKey getEncryptionPublicKey(XdiContext<?> xdiContext) throws GeneralSecurityException {
 
-		return getPublicKey(xdiContext, XDIAuthenticationConstants.XRI_S_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY);
+		return getPublicKey(xdiContext, XDIAuthenticationConstants.XDI_ADD_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY);
 	}
 
 	/**
@@ -52,7 +52,7 @@ public static PublicKey getEncryptionPublicKey(XdiContext<?> xdiContext) throws
 	 */
 	public static PrivateKey getSignaturePrivateKey(XdiContext<?> xdiContext) throws GeneralSecurityException {
 
-		return getPrivateKey(xdiContext, XDIAuthenticationConstants.XRI_S_MSG_SIG_KEYPAIR_PRIVATE_KEY);
+		return getPrivateKey(xdiContext, XDIAuthenticationConstants.XDI_ADD_MSG_SIG_KEYPAIR_PRIVATE_KEY);
 	}
 
 	/**
@@ -62,7 +62,7 @@ public static PrivateKey getSignaturePrivateKey(XdiContext<?> xdiContext) throws
 	 */
 	public static PrivateKey getEncryptionPrivateKey(XdiContext<?> xdiContext) throws GeneralSecurityException {
 
-		return getPrivateKey(xdiContext, XDIAuthenticationConstants.XRI_S_MSG_ENCRYPT_KEYPAIR_PRIVATE_KEY);
+		return getPrivateKey(xdiContext, XDIAuthenticationConstants.XDI_ADD_MSG_ENCRYPT_KEYPAIR_PRIVATE_KEY);
 	}
 
 	/**
@@ -72,7 +72,7 @@ public static PrivateKey getEncryptionPrivateKey(XdiContext<?> xdiContext) throw
 	 */
 	public static SecretKey getSignatureSecretKey(XdiContext<?> xdiContext) throws GeneralSecurityException {
 
-		return getSecretKey(xdiContext, XDIAuthenticationConstants.XRI_S_MSG_SIG_KEYPAIR_PUBLIC_KEY);
+		return getSecretKey(xdiContext, XDIAuthenticationConstants.XDI_ADD_MSG_SIG_KEYPAIR_PUBLIC_KEY);
 	}
 
 	/**
@@ -82,15 +82,15 @@ public static SecretKey getSignatureSecretKey(XdiContext<?> xdiContext) throws G
 	 */
 	public static SecretKey getEncryptionSecretKey(XdiContext<?> xdiContext) throws GeneralSecurityException {
 
-		return getSecretKey(xdiContext, XDIAuthenticationConstants.XRI_S_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY);
+		return getSecretKey(xdiContext, XDIAuthenticationConstants.XDI_ADD_MSG_ENCRYPT_KEYPAIR_PUBLIC_KEY);
 	}
 
 	/**
 	 * Given a context, get a public key.
 	 * @param graph The graph.
 	 * @return A public key.
 	 */
-	public static PublicKey getPublicKey(XdiContext<?> xdiContext, XDI3Segment publicKeyRelativeAddress) throws GeneralSecurityException {
+	public static PublicKey getPublicKey(XdiContext<?> xdiContext, XDIAddress publicKeyRelativeAddress) throws GeneralSecurityException {
 
 		// find public key
 
@@ -113,7 +113,7 @@ public static PublicKey getPublicKey(XdiContext<?> xdiContext, XDI3Segment publi
 	 * @param graph The graph.
 	 * @return A private key.
 	 */
-	public static PrivateKey getPrivateKey(XdiContext<?> xdiContext, XDI3Segment privateKeyRelativeAddress) throws GeneralSecurityException {
+	public static PrivateKey getPrivateKey(XdiContext<?> xdiContext, XDIAddress privateKeyRelativeAddress) throws GeneralSecurityException {
 
 		// find private key
 
@@ -136,7 +136,7 @@ public static PrivateKey getPrivateKey(XdiContext<?> xdiContext, XDI3Segment pri
 	 * @param graph The graph.
 	 * @return A secret key.
 	 */
-	public static SecretKey getSecretKey(XdiContext<?> xdiContext, XDI3Segment secretKeyRelativeAddress) throws GeneralSecurityException {
+	public static SecretKey getSecretKey(XdiContext<?> xdiContext, XDIAddress secretKeyRelativeAddress) throws GeneralSecurityException {
 
 		// find secret key
 
@@ -187,9 +187,9 @@ public static SecretKey secretKeyFromSecretKeyString(String secretKeyString) thr
 		return new SecretKeySpec(secretKeyBytes, 0, secretKeyBytes.length, "AES");
 	}
 
-	public static String getKeyAlgorithm(XDI3Segment dataTypeXri) {
+	public static String getKeyAlgorithm(XDIAddress dataTypeXri) {
 
-		XDI3SubSegment keyAlgorithmXri = dataTypeXri.getNumSubSegments() > 0 ? dataTypeXri.getSubSegment(0) : null;
+		XDIArc keyAlgorithmXri = dataTypeXri.getNumArcs() > 0 ? dataTypeXri.getArc(0) : null;
 		if (keyAlgorithmXri == null) return null;
 
 		if (! XDIConstants.CS_CLASS_RESERVED.equals(keyAlgorithmXri.getCs())) return null;
@@ -199,9 +199,9 @@ public static String getKeyAlgorithm(XDI3Segment dataTypeXri) {
 		return keyAlgorithmXri.getLiteral();
 	}
 
-	public static Integer getKeyLength(XDI3Segment dataTypeXri) {
+	public static Integer getKeyLength(XDIAddress dataTypeXri) {
 
-		XDI3SubSegment keyLengthXri = dataTypeXri.getNumSubSegments() > 1 ? dataTypeXri.getSubSegment(1) : null;
+		XDIArc keyLengthXri = dataTypeXri.getNumArcs() > 1 ? dataTypeXri.getArc(1) : null;
 		if (keyLengthXri == null) return null;
 
 		if (! XDIConstants.CS_CLASS_RESERVED.equals(keyLengthXri.getCs())) return null;

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fkeys%2FKeys.java
a3833de0fee3a52a77278e13752e1d0524e61b6d
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FGenericLinkContract.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FGenericLinkContract.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/GenericLinkContract.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.util.AddressUtil;
			if (! ((XdiEntitySingleton) xdiEntity).getArc().equals(XDILinkContractConstants.XDI_ARC_DO)) return false;
			if (! ((XdiEntityMember) xdiEntity).getXdiCollection().getArc().equals(XDILinkContractConstants.XDI_ARC_EC_DO)) return false;
	public static XDIAddress createGenericLinkContractXri(XDIAddress authorizingAuthority, XDIAddress requestingAuthority, XDIAddress templateAuthorityAndId) {
		List<XDIArc> genericLinkContractarcs = new ArrayList<XDIArc> ();
		XDIArc linkContractInnerRootarc = XdiInnerRoot.createInnerRootarc(
		genericLinkContractarcs.add(linkContractInnerRootarc);
			genericLinkContractarcs.addAll(templateAuthorityAndId.getArcs());
		genericLinkContractarcs.add(XDILinkContractConstants.XDI_ARC_DO);
		return XDIAddress.fromComponents(genericLinkContractarcs);
	public static GenericLinkContract findGenericLinkContract(Graph graph, XDIAddress authorizingAuthority, XDIAddress requestingAuthority, XDIAddress templateAuthorityAndId, boolean create) {
		XDIAddress genericLinkContractXri = createGenericLinkContractXri(authorizingAuthority, requestingAuthority, templateAuthorityAndId);
	public static XDIAddress getAuthorizingAuthority(XDIAddress xri) {
		XDIArc linkContractInnerRootarc = xri.getFirstArc();
		if (! XdiInnerRoot.isInnerRootarc(linkContractInnerRootarc)) return null;
		return XdiInnerRoot.getSubjectOfInnerRootXri(linkContractInnerRootarc);
	public static XDIAddress getRequestingAuthority(XDIAddress xri) {
		XDIArc linkContractInnerRootarc = xri.getFirstArc();
		if (! XdiInnerRoot.isInnerRootarc(linkContractInnerRootarc)) return null;
		return XdiInnerRoot.getPredicateOfInnerRootXri(linkContractInnerRootarc);
	public static XDIAddress getTemplateAuthorityAndId(XDIAddress xri) {
		int index = AddressUtil.indexOfXri(xri, XDILinkContractConstants.XDI_ARC_DO);
		if (index < 0) index = AddressUtil.indexOfXri(xri, XdiEntityCollection.createarc(XDILinkContractConstants.XDI_ARC_DO));
		return AddressUtil.subXri(xri, 1, index);
	public XDIAddress getAuthorizingAuthority() {
		return getAuthorizingAuthority(this.getContextNode().getAddress());
	public XDIAddress getRequestingAuthority() {
		return getRequestingAuthority(this.getContextNode().getAddress());
	public XDIAddress getTemplateAuthorityAndId() {
		return getTemplateAuthorityAndId(this.getContextNode().getAddress());

import xdi2.core.util.XDI3Util;
import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
			if (! ((XdiEntitySingleton) xdiEntity).getArcXri().equals(XDILinkContractConstants.XRI_SS_DO)) return false;
			if (! ((XdiEntityMember) xdiEntity).getXdiCollection().getArcXri().equals(XDILinkContractConstants.XRI_SS_EC_DO)) return false;
	public static XDI3Segment createGenericLinkContractXri(XDI3Segment authorizingAuthority, XDI3Segment requestingAuthority, XDI3Segment templateAuthorityAndId) {
		List<XDI3SubSegment> genericLinkContractArcXris = new ArrayList<XDI3SubSegment> ();
		XDI3SubSegment linkContractInnerRootArcXri = XdiInnerRoot.createInnerRootArcXri(
		genericLinkContractArcXris.add(linkContractInnerRootArcXri);
			genericLinkContractArcXris.addAll(templateAuthorityAndId.getSubSegments());
		genericLinkContractArcXris.add(XDILinkContractConstants.XRI_SS_DO);
		return XDI3Segment.fromComponents(genericLinkContractArcXris);
	public static GenericLinkContract findGenericLinkContract(Graph graph, XDI3Segment authorizingAuthority, XDI3Segment requestingAuthority, XDI3Segment templateAuthorityAndId, boolean create) {
		XDI3Segment genericLinkContractXri = createGenericLinkContractXri(authorizingAuthority, requestingAuthority, templateAuthorityAndId);
	public static XDI3Segment getAuthorizingAuthority(XDI3Segment xri) {
		XDI3SubSegment linkContractInnerRootArcXri = xri.getFirstSubSegment();
		if (! XdiInnerRoot.isInnerRootArcXri(linkContractInnerRootArcXri)) return null;
		return XdiInnerRoot.getSubjectOfInnerRootXri(linkContractInnerRootArcXri);
	public static XDI3Segment getRequestingAuthority(XDI3Segment xri) {
		XDI3SubSegment linkContractInnerRootArcXri = xri.getFirstSubSegment();
		if (! XdiInnerRoot.isInnerRootArcXri(linkContractInnerRootArcXri)) return null;
		return XdiInnerRoot.getPredicateOfInnerRootXri(linkContractInnerRootArcXri);
	public static XDI3Segment getTemplateAuthorityAndId(XDI3Segment xri) {
		int index = XDI3Util.indexOfXri(xri, XDILinkContractConstants.XRI_SS_DO);
		if (index < 0) index = XDI3Util.indexOfXri(xri, XdiEntityCollection.createArcXri(XDILinkContractConstants.XRI_SS_DO));
		return XDI3Util.subXri(xri, 1, index);
	public XDI3Segment getAuthorizingAuthority() {
		return getAuthorizingAuthority(this.getContextNode().getXri());
	public XDI3Segment getRequestingAuthority() {
		return getRequestingAuthority(this.getContextNode().getXri());
	public XDI3Segment getTemplateAuthorityAndId() {
		return getTemplateAuthorityAndId(this.getContextNode().getXri());

@@ -12,9 +12,9 @@
 import xdi2.core.features.nodetypes.XdiEntityMember;
 import xdi2.core.features.nodetypes.XdiEntitySingleton;
 import xdi2.core.features.nodetypes.XdiInnerRoot;
-import xdi2.core.util.XDI3Util;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.util.AddressUtil;
 
 /**
  * An XDI generic link contract, represented as an XDI entity.
@@ -43,15 +43,15 @@ public static boolean isValid(XdiEntity xdiEntity) {
 
 		if (xdiEntity instanceof XdiEntitySingleton) {
 
-			if (! ((XdiEntitySingleton) xdiEntity).getArcXri().equals(XDILinkContractConstants.XRI_SS_DO)) return false;
+			if (! ((XdiEntitySingleton) xdiEntity).getArc().equals(XDILinkContractConstants.XDI_ARC_DO)) return false;
 
 			if (getAuthorizingAuthority(xdiEntity.getXri()) == null) return false;
 			if (getRequestingAuthority(xdiEntity.getXri()) == null) return false;
 
 			return true;
 		} else if (xdiEntity instanceof XdiEntityMember) {
 
-			if (! ((XdiEntityMember) xdiEntity).getXdiCollection().getArcXri().equals(XDILinkContractConstants.XRI_SS_EC_DO)) return false;
+			if (! ((XdiEntityMember) xdiEntity).getXdiCollection().getArc().equals(XDILinkContractConstants.XDI_ARC_EC_DO)) return false;
 
 			if (getAuthorizingAuthority(xdiEntity.getXri()) == null) return false;
 			if (getRequestingAuthority(xdiEntity.getXri()) == null) return false;
@@ -75,36 +75,36 @@ public static GenericLinkContract fromXdiEntity(XdiEntity xdiEntity) {
 		return new GenericLinkContract(xdiEntity);
 	}
 
-	public static XDI3Segment createGenericLinkContractXri(XDI3Segment authorizingAuthority, XDI3Segment requestingAuthority, XDI3Segment templateAuthorityAndId) {
+	public static XDIAddress createGenericLinkContractXri(XDIAddress authorizingAuthority, XDIAddress requestingAuthority, XDIAddress templateAuthorityAndId) {
 
 		if (authorizingAuthority == null) throw new NullPointerException();
 		if (requestingAuthority == null) throw new NullPointerException();
 
-		List<XDI3SubSegment> genericLinkContractArcXris = new ArrayList<XDI3SubSegment> ();
+		List<XDIArc> genericLinkContractarcs = new ArrayList<XDIArc> ();
 
-		XDI3SubSegment linkContractInnerRootArcXri = XdiInnerRoot.createInnerRootArcXri(
+		XDIArc linkContractInnerRootarc = XdiInnerRoot.createInnerRootarc(
 				authorizingAuthority, 
 				requestingAuthority);
 
-		genericLinkContractArcXris.add(linkContractInnerRootArcXri);
+		genericLinkContractarcs.add(linkContractInnerRootarc);
 
 		if (templateAuthorityAndId != null) {
 
-			genericLinkContractArcXris.addAll(templateAuthorityAndId.getSubSegments());
+			genericLinkContractarcs.addAll(templateAuthorityAndId.getArcs());
 		}
 
-		genericLinkContractArcXris.add(XDILinkContractConstants.XRI_SS_DO);
+		genericLinkContractarcs.add(XDILinkContractConstants.XDI_ARC_DO);
 
-		return XDI3Segment.fromComponents(genericLinkContractArcXris);
+		return XDIAddress.fromComponents(genericLinkContractarcs);
 	}
 
 	/**
 	 * Factory method that finds or creates an XDI generic link contract for a graph.
 	 * @return The XDI generic link contract.
 	 */
-	public static GenericLinkContract findGenericLinkContract(Graph graph, XDI3Segment authorizingAuthority, XDI3Segment requestingAuthority, XDI3Segment templateAuthorityAndId, boolean create) {
+	public static GenericLinkContract findGenericLinkContract(Graph graph, XDIAddress authorizingAuthority, XDIAddress requestingAuthority, XDIAddress templateAuthorityAndId, boolean create) {
 
-		XDI3Segment genericLinkContractXri = createGenericLinkContractXri(authorizingAuthority, requestingAuthority, templateAuthorityAndId);
+		XDIAddress genericLinkContractXri = createGenericLinkContractXri(authorizingAuthority, requestingAuthority, templateAuthorityAndId);
 
 		ContextNode genericLinkContractContextNode = create ? graph.setDeepContextNode(genericLinkContractXri) : graph.getDeepContextNode(genericLinkContractXri, true);
 		if (genericLinkContractContextNode == null) return null;
@@ -116,46 +116,46 @@ public static GenericLinkContract findGenericLinkContract(Graph graph, XDI3Segme
 	 * Static methods
 	 */
 
-	public static XDI3Segment getAuthorizingAuthority(XDI3Segment xri) {
+	public static XDIAddress getAuthorizingAuthority(XDIAddress xri) {
 
-		XDI3SubSegment linkContractInnerRootArcXri = xri.getFirstSubSegment();
-		if (! XdiInnerRoot.isInnerRootArcXri(linkContractInnerRootArcXri)) return null;
+		XDIArc linkContractInnerRootarc = xri.getFirstArc();
+		if (! XdiInnerRoot.isInnerRootarc(linkContractInnerRootarc)) return null;
 
-		return XdiInnerRoot.getSubjectOfInnerRootXri(linkContractInnerRootArcXri);
+		return XdiInnerRoot.getSubjectOfInnerRootXri(linkContractInnerRootarc);
 	}
 
-	public static XDI3Segment getRequestingAuthority(XDI3Segment xri) {
+	public static XDIAddress getRequestingAuthority(XDIAddress xri) {
 
-		XDI3SubSegment linkContractInnerRootArcXri = xri.getFirstSubSegment();
-		if (! XdiInnerRoot.isInnerRootArcXri(linkContractInnerRootArcXri)) return null;
+		XDIArc linkContractInnerRootarc = xri.getFirstArc();
+		if (! XdiInnerRoot.isInnerRootarc(linkContractInnerRootarc)) return null;
 
-		return XdiInnerRoot.getPredicateOfInnerRootXri(linkContractInnerRootArcXri);
+		return XdiInnerRoot.getPredicateOfInnerRootXri(linkContractInnerRootarc);
 	}
 
-	public static XDI3Segment getTemplateAuthorityAndId(XDI3Segment xri) {
+	public static XDIAddress getTemplateAuthorityAndId(XDIAddress xri) {
 
-		int index = XDI3Util.indexOfXri(xri, XDILinkContractConstants.XRI_SS_DO);
-		if (index < 0) index = XDI3Util.indexOfXri(xri, XdiEntityCollection.createArcXri(XDILinkContractConstants.XRI_SS_DO));
+		int index = AddressUtil.indexOfXri(xri, XDILinkContractConstants.XDI_ARC_DO);
+		if (index < 0) index = AddressUtil.indexOfXri(xri, XdiEntityCollection.createarc(XDILinkContractConstants.XDI_ARC_DO));
 
-		return XDI3Util.subXri(xri, 1, index);
+		return AddressUtil.subXri(xri, 1, index);
 	}
 
 	/*
 	 * Instance methods
 	 */
 
-	public XDI3Segment getAuthorizingAuthority() {
+	public XDIAddress getAuthorizingAuthority() {
 
-		return getAuthorizingAuthority(this.getContextNode().getXri());
+		return getAuthorizingAuthority(this.getContextNode().getAddress());
 	}
 
-	public XDI3Segment getRequestingAuthority() {
+	public XDIAddress getRequestingAuthority() {
 
-		return getRequestingAuthority(this.getContextNode().getXri());
+		return getRequestingAuthority(this.getContextNode().getAddress());
 	}
 
-	public XDI3Segment getTemplateAuthorityAndId() {
+	public XDIAddress getTemplateAuthorityAndId() {
 
-		return getTemplateAuthorityAndId(this.getContextNode().getXri());
+		return getTemplateAuthorityAndId(this.getContextNode().getAddress());
 	}
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FGenericLinkContract.java
f8484f63a6d03d11dc2e18d2468f8de367a3a6b2
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FGovernorLinkContract.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FGovernorLinkContract.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/GovernorLinkContract.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.util.AddressUtil;
			if (! ((XdiEntitySingleton) xdiEntity).getArc().equals(XDILinkContractConstants.XDI_ARC_DO)) return false;
			if (! ((XdiEntityMember) xdiEntity).getXdiCollection().getArc().equals(XDILinkContractConstants.XDI_ARC_EC_DO)) return false;
	public static XDIAddress createGovernorLinkContractXri(XDIAddress requestingAuthority, XDIAddress templateAuthorityAndId) {
		List<XDIArc> governorLinkContractarcs = new ArrayList<XDIArc> ();
		XDIArc linkContractInnerRootarc = XdiInnerRoot.createInnerRootarc(
				AddressUtil.concatAddresses(templateAuthorityAndId, XDILinkContractConstants.XDI_ARC_DO_VARIABLE));
		governorLinkContractarcs.add(linkContractInnerRootarc);
		governorLinkContractarcs.add(XDILinkContractConstants.XDI_ARC_DO);
		return XDIAddress.fromComponents(governorLinkContractarcs);
	public static GovernorLinkContract findGovernorLinkContract(Graph graph, XDIAddress requestingAuthority, XDIAddress templateAuthorityAndId, boolean create) {
		XDIAddress governorLinkContractXri = createGovernorLinkContractXri(requestingAuthority, templateAuthorityAndId);
	public static XDIAddress getRequestingAuthority(XDIAddress xri) {
		XDIArc linkContractInnerRootarc = xri.getFirstArc();
		if (! XdiInnerRoot.isInnerRootarc(linkContractInnerRootarc)) return null;
		XDIAddress subjectXri = XdiInnerRoot.getSubjectOfInnerRootXri(linkContractInnerRootarc);
		XDIAddress requestingAuthority = subjectXri;
	public static XDIAddress getTemplateAuthorityAndId(XDIAddress xri) {
		XDIArc linkContractInnerRootarc = xri.getFirstArc();
		if (! XdiInnerRoot.isInnerRootarc(linkContractInnerRootarc)) return null;
		XDIAddress predicateXri = XdiInnerRoot.getPredicateOfInnerRootXri(linkContractInnerRootarc);
		if (AddressUtil.endsWith(predicateXri, XDILinkContractConstants.XDI_ADD_DO_VARIABLE) == null) return null;
		XDIAddress templateAuthorityAndId = AddressUtil.parentXri(predicateXri, -1);
	public XDIAddress getRequestingAuthority() {
		return getRequestingAuthority(this.getContextNode().getAddress());
	public XDIAddress getTemplateAuthorityAndId() {
		return getTemplateAuthorityAndId(this.getContextNode().getAddress());

import xdi2.core.util.XDI3Util;
import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
			if (! ((XdiEntitySingleton) xdiEntity).getArcXri().equals(XDILinkContractConstants.XRI_SS_DO)) return false;
			if (! ((XdiEntityMember) xdiEntity).getXdiCollection().getArcXri().equals(XDILinkContractConstants.XRI_SS_EC_DO)) return false;
	public static XDI3Segment createGovernorLinkContractXri(XDI3Segment requestingAuthority, XDI3Segment templateAuthorityAndId) {
		List<XDI3SubSegment> governorLinkContractArcXris = new ArrayList<XDI3SubSegment> ();
		XDI3SubSegment linkContractInnerRootArcXri = XdiInnerRoot.createInnerRootArcXri(
				XDI3Util.concatXris(templateAuthorityAndId, XDILinkContractConstants.XRI_SS_DO_VARIABLE));
		governorLinkContractArcXris.add(linkContractInnerRootArcXri);
		governorLinkContractArcXris.add(XDILinkContractConstants.XRI_SS_DO);
		return XDI3Segment.fromComponents(governorLinkContractArcXris);
	public static GovernorLinkContract findGovernorLinkContract(Graph graph, XDI3Segment requestingAuthority, XDI3Segment templateAuthorityAndId, boolean create) {
		XDI3Segment governorLinkContractXri = createGovernorLinkContractXri(requestingAuthority, templateAuthorityAndId);
	public static XDI3Segment getRequestingAuthority(XDI3Segment xri) {
		XDI3SubSegment linkContractInnerRootArcXri = xri.getFirstSubSegment();
		if (! XdiInnerRoot.isInnerRootArcXri(linkContractInnerRootArcXri)) return null;
		XDI3Segment subjectXri = XdiInnerRoot.getSubjectOfInnerRootXri(linkContractInnerRootArcXri);
		XDI3Segment requestingAuthority = subjectXri;
	public static XDI3Segment getTemplateAuthorityAndId(XDI3Segment xri) {
		XDI3SubSegment linkContractInnerRootArcXri = xri.getFirstSubSegment();
		if (! XdiInnerRoot.isInnerRootArcXri(linkContractInnerRootArcXri)) return null;
		XDI3Segment predicateXri = XdiInnerRoot.getPredicateOfInnerRootXri(linkContractInnerRootArcXri);
		if (XDI3Util.endsWith(predicateXri, XDILinkContractConstants.XRI_S_DO_VARIABLE) == null) return null;
		XDI3Segment templateAuthorityAndId = XDI3Util.parentXri(predicateXri, -1);
	public XDI3Segment getRequestingAuthority() {
		return getRequestingAuthority(this.getContextNode().getXri());
	public XDI3Segment getTemplateAuthorityAndId() {
		return getTemplateAuthorityAndId(this.getContextNode().getXri());

@@ -11,9 +11,9 @@
 import xdi2.core.features.nodetypes.XdiEntityMember;
 import xdi2.core.features.nodetypes.XdiEntitySingleton;
 import xdi2.core.features.nodetypes.XdiInnerRoot;
-import xdi2.core.util.XDI3Util;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.util.AddressUtil;
 
 /**
  * An XDI governor link contract, represented as an XDI entity.
@@ -42,15 +42,15 @@ public static boolean isValid(XdiEntity xdiEntity) {
 
 		if (xdiEntity instanceof XdiEntitySingleton) {
 
-			if (! ((XdiEntitySingleton) xdiEntity).getArcXri().equals(XDILinkContractConstants.XRI_SS_DO)) return false;
+			if (! ((XdiEntitySingleton) xdiEntity).getArc().equals(XDILinkContractConstants.XDI_ARC_DO)) return false;
 
 			if (getRequestingAuthority(xdiEntity.getXri()) == null) return false;
 			if (getTemplateAuthorityAndId(xdiEntity.getXri()) == null) return false;
 
 			return true;
 		} else if (xdiEntity instanceof XdiEntityMember) {
 
-			if (! ((XdiEntityMember) xdiEntity).getXdiCollection().getArcXri().equals(XDILinkContractConstants.XRI_SS_EC_DO)) return false;
+			if (! ((XdiEntityMember) xdiEntity).getXdiCollection().getArc().equals(XDILinkContractConstants.XDI_ARC_EC_DO)) return false;
 
 			if (getRequestingAuthority(xdiEntity.getXri()) == null) return false;
 			if (getTemplateAuthorityAndId(xdiEntity.getXri()) == null) return false;
@@ -74,31 +74,31 @@ public static GovernorLinkContract fromXdiEntity(XdiEntity xdiEntity) {
 		return new GovernorLinkContract(xdiEntity);
 	}
 
-	public static XDI3Segment createGovernorLinkContractXri(XDI3Segment requestingAuthority, XDI3Segment templateAuthorityAndId) {
+	public static XDIAddress createGovernorLinkContractXri(XDIAddress requestingAuthority, XDIAddress templateAuthorityAndId) {
 
 		if (requestingAuthority == null) throw new NullPointerException();
 		if (templateAuthorityAndId == null) throw new NullPointerException();
 
-		List<XDI3SubSegment> governorLinkContractArcXris = new ArrayList<XDI3SubSegment> ();
+		List<XDIArc> governorLinkContractarcs = new ArrayList<XDIArc> ();
 
-		XDI3SubSegment linkContractInnerRootArcXri = XdiInnerRoot.createInnerRootArcXri(
+		XDIArc linkContractInnerRootarc = XdiInnerRoot.createInnerRootarc(
 				requestingAuthority, 
-				XDI3Util.concatXris(templateAuthorityAndId, XDILinkContractConstants.XRI_SS_DO_VARIABLE));
+				AddressUtil.concatAddresses(templateAuthorityAndId, XDILinkContractConstants.XDI_ARC_DO_VARIABLE));
 
-		governorLinkContractArcXris.add(linkContractInnerRootArcXri);
+		governorLinkContractarcs.add(linkContractInnerRootarc);
 
-		governorLinkContractArcXris.add(XDILinkContractConstants.XRI_SS_DO);
+		governorLinkContractarcs.add(XDILinkContractConstants.XDI_ARC_DO);
 
-		return XDI3Segment.fromComponents(governorLinkContractArcXris);
+		return XDIAddress.fromComponents(governorLinkContractarcs);
 	}
 
 	/**
 	 * Factory method that finds or creates an XDI governor link contract for a graph.
 	 * @return The XDI governor link contract.
 	 */
-	public static GovernorLinkContract findGovernorLinkContract(Graph graph, XDI3Segment requestingAuthority, XDI3Segment templateAuthorityAndId, boolean create) {
+	public static GovernorLinkContract findGovernorLinkContract(Graph graph, XDIAddress requestingAuthority, XDIAddress templateAuthorityAndId, boolean create) {
 
-		XDI3Segment governorLinkContractXri = createGovernorLinkContractXri(requestingAuthority, templateAuthorityAndId);
+		XDIAddress governorLinkContractXri = createGovernorLinkContractXri(requestingAuthority, templateAuthorityAndId);
 
 		ContextNode governorLinkContractContextNode = create ? graph.setDeepContextNode(governorLinkContractXri) : graph.getDeepContextNode(governorLinkContractXri, true);
 		if (governorLinkContractContextNode == null) return null;
@@ -110,26 +110,26 @@ public static GovernorLinkContract findGovernorLinkContract(Graph graph, XDI3Seg
 	 * Static methods
 	 */
 
-	public static XDI3Segment getRequestingAuthority(XDI3Segment xri) {
+	public static XDIAddress getRequestingAuthority(XDIAddress xri) {
 
-		XDI3SubSegment linkContractInnerRootArcXri = xri.getFirstSubSegment();
-		if (! XdiInnerRoot.isInnerRootArcXri(linkContractInnerRootArcXri)) return null;
+		XDIArc linkContractInnerRootarc = xri.getFirstArc();
+		if (! XdiInnerRoot.isInnerRootarc(linkContractInnerRootarc)) return null;
 
-		XDI3Segment subjectXri = XdiInnerRoot.getSubjectOfInnerRootXri(linkContractInnerRootArcXri);
-		XDI3Segment requestingAuthority = subjectXri;
+		XDIAddress subjectXri = XdiInnerRoot.getSubjectOfInnerRootXri(linkContractInnerRootarc);
+		XDIAddress requestingAuthority = subjectXri;
 
 		return requestingAuthority;
 	}
 
-	public static XDI3Segment getTemplateAuthorityAndId(XDI3Segment xri) {
+	public static XDIAddress getTemplateAuthorityAndId(XDIAddress xri) {
 
-		XDI3SubSegment linkContractInnerRootArcXri = xri.getFirstSubSegment();
-		if (! XdiInnerRoot.isInnerRootArcXri(linkContractInnerRootArcXri)) return null;
+		XDIArc linkContractInnerRootarc = xri.getFirstArc();
+		if (! XdiInnerRoot.isInnerRootarc(linkContractInnerRootarc)) return null;
 
-		XDI3Segment predicateXri = XdiInnerRoot.getPredicateOfInnerRootXri(linkContractInnerRootArcXri);
-		if (XDI3Util.endsWith(predicateXri, XDILinkContractConstants.XRI_S_DO_VARIABLE) == null) return null;
+		XDIAddress predicateXri = XdiInnerRoot.getPredicateOfInnerRootXri(linkContractInnerRootarc);
+		if (AddressUtil.endsWith(predicateXri, XDILinkContractConstants.XDI_ADD_DO_VARIABLE) == null) return null;
 
-		XDI3Segment templateAuthorityAndId = XDI3Util.parentXri(predicateXri, -1);
+		XDIAddress templateAuthorityAndId = AddressUtil.parentXri(predicateXri, -1);
 
 		return templateAuthorityAndId;
 	}
@@ -138,13 +138,13 @@ public static XDI3Segment getTemplateAuthorityAndId(XDI3Segment xri) {
 	 * Instance methods
 	 */
 
-	public XDI3Segment getRequestingAuthority() {
+	public XDIAddress getRequestingAuthority() {
 
-		return getRequestingAuthority(this.getContextNode().getXri());
+		return getRequestingAuthority(this.getContextNode().getAddress());
 	}
 
-	public XDI3Segment getTemplateAuthorityAndId() {
+	public XDIAddress getTemplateAuthorityAndId() {
 
-		return getTemplateAuthorityAndId(this.getContextNode().getXri());
+		return getTemplateAuthorityAndId(this.getContextNode().getAddress());
 	}
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FGovernorLinkContract.java
aa5c60f5775d786d901c0e4875ea95bf4748ebdc
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FLinkContractBase.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FLinkContractBase.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/LinkContractBase.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIStatement;
import xdi2.core.util.AddressUtil;
import xdi2.core.util.iterators.MappingRelationTargetContextNodeAddressIterator;
import xdi2.core.util.iterators.MappingStatementIterator;
		XdiEntitySingleton xdiEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createarc(XDIPolicyConstants.XDI_ARC_IF), create);
	public void setPermissionTargetAddress(XDIAddress permissionXri, XDIAddress targetAddress) {
		if (this.getContextNode().containsRelation(XDILinkContractConstants.XDI_ADD_ALL, targetAddress)) return;
		if (permissionXri.equals(XDILinkContractConstants.XDI_ADD_ALL)) {
			this.getContextNode().delRelation(XDILinkContractConstants.XDI_ADD_GET, targetAddress);
			this.getContextNode().delRelation(XDILinkContractConstants.XDI_ADD_SET, targetAddress);
			this.getContextNode().delRelation(XDILinkContractConstants.XDI_ADD_SET_DO, targetAddress);
			this.getContextNode().delRelation(XDILinkContractConstants.XDI_ADD_SET_REF, targetAddress);
			this.getContextNode().delRelation(XDILinkContractConstants.XDI_ADD_DEL, targetAddress);
	public void setNegativePermissionTargetAddress(XDIAddress permissionXri, XDIAddress targetAddress) {
		this.setPermissionTargetAddress(AddressUtil.concatAddresses(XDILinkContractConstants.XDI_ADD_NOT, permissionXri), targetAddress);
	public void setPermissionTargetStatement(XDIAddress permissionXri, XDIStatement targetStatementXri) {
	public void setNegativePermissionTargetStatement(XDIAddress permissionXri, XDIStatement targetStatementXri) {
		this.setPermissionTargetStatement(AddressUtil.concatAddresses(XDILinkContractConstants.XDI_ADD_NOT, permissionXri), targetStatementXri);
	public void delPermissionTargetAddress(XDIAddress permissionXri, XDIAddress targetAddress) {
	public void delNegativePermissionTargetAddress(XDIAddress permissionXri, XDIAddress targetAddress) {
		this.delPermissionTargetAddress(AddressUtil.concatAddresses(XDILinkContractConstants.XDI_ADD_NOT, permissionXri), targetAddress);
	public void delPermissionTargetStatement(XDIAddress permissionXri, XDIStatement targetStatementXri) {
	public void delNegativePermissionTargetStatement(XDIAddress permissionXri, XDIStatement targetStatementXri) {
		this.delPermissionTargetStatement(AddressUtil.concatAddresses(XDILinkContractConstants.XDI_ADD_NOT, permissionXri), targetStatementXri);
	public IterableIterator<XDIAddress> getPermissionTargetAddresses(XDIAddress permissionXri) {
		return new MappingRelationTargetContextNodeAddressIterator(
	public IterableIterator<XDIAddress> getNegativePermissionTargetAddresses(XDIAddress permissionXri) {
		return this.getPermissionTargetAddresses(AddressUtil.concatAddresses(XDILinkContractConstants.XDI_ADD_NOT, permissionXri));
	public IterableIterator<XDIStatement> getPermissionTargetStatements(XDIAddress permissionXri) {
		if (xdiInnerRoot == null) return new EmptyIterator<XDIStatement> ();
				new MappingStatementIterator(
	public boolean hasPermissionTargetStatement(XDIAddress permissionXri, XDIStatement targetStatementXri) {
	public boolean hasNegativePermissionTargetStatement(XDIAddress permissionXri, XDIStatement targetStatementXri) {
		return this.hasPermissionTargetStatement(AddressUtil.concatAddresses(XDILinkContractConstants.XDI_ADD_NOT, permissionXri), targetStatementXri);

import xdi2.core.util.XDI3Util;
import xdi2.core.util.iterators.MappingRelationTargetContextNodeXriIterator;
import xdi2.core.util.iterators.MappingStatementXriIterator;
import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
		XdiEntitySingleton xdiEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createArcXri(XDIPolicyConstants.XRI_SS_IF), create);
	public void setPermissionTargetAddress(XDI3Segment permissionXri, XDI3Segment targetAddress) {
		if (this.getContextNode().containsRelation(XDILinkContractConstants.XRI_S_ALL, targetAddress)) return;
		if (permissionXri.equals(XDILinkContractConstants.XRI_S_ALL)) {
			this.getContextNode().delRelation(XDILinkContractConstants.XRI_S_GET, targetAddress);
			this.getContextNode().delRelation(XDILinkContractConstants.XRI_S_SET, targetAddress);
			this.getContextNode().delRelation(XDILinkContractConstants.XRI_S_SET_DO, targetAddress);
			this.getContextNode().delRelation(XDILinkContractConstants.XRI_S_SET_REF, targetAddress);
			this.getContextNode().delRelation(XDILinkContractConstants.XRI_S_DEL, targetAddress);
	public void setNegativePermissionTargetAddress(XDI3Segment permissionXri, XDI3Segment targetAddress) {
		this.setPermissionTargetAddress(XDI3Util.concatXris(XDILinkContractConstants.XRI_S_NOT, permissionXri), targetAddress);
	public void setPermissionTargetStatement(XDI3Segment permissionXri, XDI3Statement targetStatementXri) {
	public void setNegativePermissionTargetStatement(XDI3Segment permissionXri, XDI3Statement targetStatementXri) {
		this.setPermissionTargetStatement(XDI3Util.concatXris(XDILinkContractConstants.XRI_S_NOT, permissionXri), targetStatementXri);
	public void delPermissionTargetAddress(XDI3Segment permissionXri, XDI3Segment targetAddress) {
	public void delNegativePermissionTargetAddress(XDI3Segment permissionXri, XDI3Segment targetAddress) {
		this.delPermissionTargetAddress(XDI3Util.concatXris(XDILinkContractConstants.XRI_S_NOT, permissionXri), targetAddress);
	public void delPermissionTargetStatement(XDI3Segment permissionXri, XDI3Statement targetStatementXri) {
	public void delNegativePermissionTargetStatement(XDI3Segment permissionXri, XDI3Statement targetStatementXri) {
		this.delPermissionTargetStatement(XDI3Util.concatXris(XDILinkContractConstants.XRI_S_NOT, permissionXri), targetStatementXri);
	public IterableIterator<XDI3Segment> getPermissionTargetAddresses(XDI3Segment permissionXri) {
		return new MappingRelationTargetContextNodeXriIterator(
	public IterableIterator<XDI3Segment> getNegativePermissionTargetAddresses(XDI3Segment permissionXri) {
		return this.getPermissionTargetAddresses(XDI3Util.concatXris(XDILinkContractConstants.XRI_S_NOT, permissionXri));
	public IterableIterator<XDI3Statement> getPermissionTargetStatements(XDI3Segment permissionXri) {
		if (xdiInnerRoot == null) return new EmptyIterator<XDI3Statement> ();
				new MappingStatementXriIterator(
	public boolean hasPermissionTargetStatement(XDI3Segment permissionXri, XDI3Statement targetStatementXri) {
	public boolean hasNegativePermissionTargetStatement(XDI3Segment permissionXri, XDI3Statement targetStatementXri) {
		return this.hasPermissionTargetStatement(XDI3Util.concatXris(XDILinkContractConstants.XRI_S_NOT, permissionXri), targetStatementXri);

@@ -13,14 +13,14 @@
 import xdi2.core.features.nodetypes.XdiRoot.MappingAbsoluteToRelativeStatementXriIterator;
 import xdi2.core.features.nodetypes.XdiSubGraph;
 import xdi2.core.features.nodetypes.XdiVariable;
-import xdi2.core.util.XDI3Util;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIStatement;
+import xdi2.core.util.AddressUtil;
 import xdi2.core.util.iterators.EmptyIterator;
 import xdi2.core.util.iterators.IterableIterator;
-import xdi2.core.util.iterators.MappingRelationTargetContextNodeXriIterator;
-import xdi2.core.util.iterators.MappingStatementXriIterator;
+import xdi2.core.util.iterators.MappingRelationTargetContextNodeAddressIterator;
+import xdi2.core.util.iterators.MappingStatementIterator;
 import xdi2.core.util.iterators.SelectingNotImpliedStatementIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
 
 /**
  * The base class for XDI link contracts and XDI link contract templates, represented as an XDI entity or variable.
@@ -90,7 +90,7 @@ public ContextNode getContextNode() {
 	 */
 	public PolicyRoot getPolicyRoot(boolean create) {
 
-		XdiEntitySingleton xdiEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createArcXri(XDIPolicyConstants.XRI_SS_IF), create);
+		XdiEntitySingleton xdiEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createarc(XDIPolicyConstants.XDI_ARC_IF), create);
 		if (xdiEntitySingleton == null) return null;
 
 		return PolicyRoot.fromXdiEntity(xdiEntitySingleton);
@@ -101,36 +101,36 @@ public PolicyRoot getPolicyRoot(boolean create) {
 	 * @param permissionXri The permission XRI.
 	 * @param targetAddress The target context node XRI of the permission.
 	 */
-	public void setPermissionTargetAddress(XDI3Segment permissionXri, XDI3Segment targetAddress) {
+	public void setPermissionTargetAddress(XDIAddress permissionXri, XDIAddress targetAddress) {
 
 		if (permissionXri == null || targetAddress == null) throw new NullPointerException();
 
 		// if an arc to the given target context node exists with $all, then no other permission arc should be created
 
-		if (this.getContextNode().containsRelation(XDILinkContractConstants.XRI_S_ALL, targetAddress)) return;
+		if (this.getContextNode().containsRelation(XDILinkContractConstants.XDI_ADD_ALL, targetAddress)) return;
 
 		// if a $all permission is added to the target node then all other permission arcs should be deleted
 
-		if (permissionXri.equals(XDILinkContractConstants.XRI_S_ALL)) {
+		if (permissionXri.equals(XDILinkContractConstants.XDI_ADD_ALL)) {
 
-			this.getContextNode().delRelation(XDILinkContractConstants.XRI_S_GET, targetAddress);
-			this.getContextNode().delRelation(XDILinkContractConstants.XRI_S_SET, targetAddress);
-			this.getContextNode().delRelation(XDILinkContractConstants.XRI_S_SET_DO, targetAddress);
-			this.getContextNode().delRelation(XDILinkContractConstants.XRI_S_SET_REF, targetAddress);
-			this.getContextNode().delRelation(XDILinkContractConstants.XRI_S_DEL, targetAddress);
+			this.getContextNode().delRelation(XDILinkContractConstants.XDI_ADD_GET, targetAddress);
+			this.getContextNode().delRelation(XDILinkContractConstants.XDI_ADD_SET, targetAddress);
+			this.getContextNode().delRelation(XDILinkContractConstants.XDI_ADD_SET_DO, targetAddress);
+			this.getContextNode().delRelation(XDILinkContractConstants.XDI_ADD_SET_REF, targetAddress);
+			this.getContextNode().delRelation(XDILinkContractConstants.XDI_ADD_DEL, targetAddress);
 		}
 
 		// set the permission arc
 
 		this.getContextNode().setRelation(permissionXri, targetAddress);
 	}
 
-	public void setNegativePermissionTargetAddress(XDI3Segment permissionXri, XDI3Segment targetAddress) {
+	public void setNegativePermissionTargetAddress(XDIAddress permissionXri, XDIAddress targetAddress) {
 
-		this.setPermissionTargetAddress(XDI3Util.concatXris(XDILinkContractConstants.XRI_S_NOT, permissionXri), targetAddress);
+		this.setPermissionTargetAddress(AddressUtil.concatAddresses(XDILinkContractConstants.XDI_ADD_NOT, permissionXri), targetAddress);
 	}
 
-	public void setPermissionTargetStatement(XDI3Segment permissionXri, XDI3Statement targetStatementXri) {
+	public void setPermissionTargetStatement(XDIAddress permissionXri, XDIStatement targetStatementXri) {
 
 		if (permissionXri == null || targetStatementXri == null) throw new NullPointerException();
 
@@ -144,12 +144,12 @@ public void setPermissionTargetStatement(XDI3Segment permissionXri, XDI3Statemen
 		xdiInnerRoot.getContextNode().setStatement(targetStatementXri);
 	}
 
-	public void setNegativePermissionTargetStatement(XDI3Segment permissionXri, XDI3Statement targetStatementXri) {
+	public void setNegativePermissionTargetStatement(XDIAddress permissionXri, XDIStatement targetStatementXri) {
 
-		this.setPermissionTargetStatement(XDI3Util.concatXris(XDILinkContractConstants.XRI_S_NOT, permissionXri), targetStatementXri);
+		this.setPermissionTargetStatement(AddressUtil.concatAddresses(XDILinkContractConstants.XDI_ADD_NOT, permissionXri), targetStatementXri);
 	}
 
-	public void delPermissionTargetAddress(XDI3Segment permissionXri, XDI3Segment targetAddress) {
+	public void delPermissionTargetAddress(XDIAddress permissionXri, XDIAddress targetAddress) {
 
 		if (permissionXri == null || targetAddress == null) throw new NullPointerException();
 
@@ -158,12 +158,12 @@ public void delPermissionTargetAddress(XDI3Segment permissionXri, XDI3Segment ta
 		this.getContextNode().delRelation(permissionXri, targetAddress);
 	}
 
-	public void delNegativePermissionTargetAddress(XDI3Segment permissionXri, XDI3Segment targetAddress) {
+	public void delNegativePermissionTargetAddress(XDIAddress permissionXri, XDIAddress targetAddress) {
 
-		this.delPermissionTargetAddress(XDI3Util.concatXris(XDILinkContractConstants.XRI_S_NOT, permissionXri), targetAddress);
+		this.delPermissionTargetAddress(AddressUtil.concatAddresses(XDILinkContractConstants.XDI_ADD_NOT, permissionXri), targetAddress);
 	}
 
-	public void delPermissionTargetStatement(XDI3Segment permissionXri, XDI3Statement targetStatementXri) {
+	public void delPermissionTargetStatement(XDIAddress permissionXri, XDIStatement targetStatementXri) {
 
 		if (permissionXri == null || targetStatementXri == null) throw new NullPointerException();
 
@@ -178,45 +178,45 @@ public void delPermissionTargetStatement(XDI3Segment permissionXri, XDI3Statemen
 		statement.delete();
 	}
 
-	public void delNegativePermissionTargetStatement(XDI3Segment permissionXri, XDI3Statement targetStatementXri) {
+	public void delNegativePermissionTargetStatement(XDIAddress permissionXri, XDIStatement targetStatementXri) {
 
-		this.delPermissionTargetStatement(XDI3Util.concatXris(XDILinkContractConstants.XRI_S_NOT, permissionXri), targetStatementXri);
+		this.delPermissionTargetStatement(AddressUtil.concatAddresses(XDILinkContractConstants.XDI_ADD_NOT, permissionXri), targetStatementXri);
 	}
 
-	public IterableIterator<XDI3Segment> getPermissionTargetAddresses(XDI3Segment permissionXri) {
+	public IterableIterator<XDIAddress> getPermissionTargetAddresses(XDIAddress permissionXri) {
 
 		if (permissionXri == null) throw new NullPointerException();
 
 		// return the target addresses
 
-		return new MappingRelationTargetContextNodeXriIterator(
+		return new MappingRelationTargetContextNodeAddressIterator(
 						this.getContextNode().getRelations(permissionXri));
 	}
 
-	public IterableIterator<XDI3Segment> getNegativePermissionTargetAddresses(XDI3Segment permissionXri) {
+	public IterableIterator<XDIAddress> getNegativePermissionTargetAddresses(XDIAddress permissionXri) {
 
-		return this.getPermissionTargetAddresses(XDI3Util.concatXris(XDILinkContractConstants.XRI_S_NOT, permissionXri));
+		return this.getPermissionTargetAddresses(AddressUtil.concatAddresses(XDILinkContractConstants.XDI_ADD_NOT, permissionXri));
 	}
 
-	public IterableIterator<XDI3Statement> getPermissionTargetStatements(XDI3Segment permissionXri) {
+	public IterableIterator<XDIStatement> getPermissionTargetStatements(XDIAddress permissionXri) {
 
 		if (permissionXri == null) throw new NullPointerException();
 
 		// find the inner root
 
 		XdiInnerRoot xdiInnerRoot = this.getXdiEntity().getXdiInnerRoot(permissionXri, false);
-		if (xdiInnerRoot == null) return new EmptyIterator<XDI3Statement> ();
+		if (xdiInnerRoot == null) return new EmptyIterator<XDIStatement> ();
 
 		// return the target statements
 
 		return new MappingAbsoluteToRelativeStatementXriIterator(
 				xdiInnerRoot,
-				new MappingStatementXriIterator(
+				new MappingStatementIterator(
 						new SelectingNotImpliedStatementIterator(
 								xdiInnerRoot.getContextNode().getAllStatements())));
 	}
 
-	public boolean hasPermissionTargetStatement(XDI3Segment permissionXri, XDI3Statement targetStatementXri) {
+	public boolean hasPermissionTargetStatement(XDIAddress permissionXri, XDIStatement targetStatementXri) {
 
 		if (permissionXri == null || targetStatementXri == null) throw new NullPointerException();
 
@@ -230,9 +230,9 @@ public boolean hasPermissionTargetStatement(XDI3Segment permissionXri, XDI3State
 		return xdiInnerRoot.getContextNode().containsStatement(targetStatementXri);
 	}
 
-	public boolean hasNegativePermissionTargetStatement(XDI3Segment permissionXri, XDI3Statement targetStatementXri) {
+	public boolean hasNegativePermissionTargetStatement(XDIAddress permissionXri, XDIStatement targetStatementXri) {
 
-		return this.hasPermissionTargetStatement(XDI3Util.concatXris(XDILinkContractConstants.XRI_S_NOT, permissionXri), targetStatementXri);
+		return this.hasPermissionTargetStatement(AddressUtil.concatAddresses(XDILinkContractConstants.XDI_ADD_NOT, permissionXri), targetStatementXri);
 	}
 
 	/*

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FLinkContractBase.java
c019b704e657ae0dfc88a8825011a68b205172d0
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FLinkContractTemplate.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FLinkContractTemplate.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/LinkContractTemplate.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.util.AddressUtil;
		if (! xdiVariable.getArc().equals(XDILinkContractConstants.XDI_ARC_DO_VARIABLE)) return false;
	public static XDIAddress createLinkContractTemplateXri(XDIAddress templateAuthorityAndId) {
		List<XDIArc> linkContractTemplatearcs = new ArrayList<XDIArc> ();
		linkContractTemplatearcs.addAll(templateAuthorityAndId.getArcs());
		linkContractTemplatearcs.add(XDILinkContractConstants.XDI_ARC_DO_VARIABLE);
		return XDIAddress.fromComponents(linkContractTemplatearcs);
	public static LinkContractTemplate findLinkContractTemplate(Graph graph, XDIAddress templateAuthorityAndId, boolean create) {
		XDIAddress linkContractTemplateXri = createLinkContractTemplateXri(templateAuthorityAndId);
	public static XDIAddress getTemplateAuthorityAndId(XDIAddress xri) {
		int index = AddressUtil.indexOfXri(xri, XDILinkContractConstants.XDI_ARC_DO_VARIABLE);
		return AddressUtil.subXri(xri, 0, index);
	public XDIAddress getTemplateAuthorityAndId() {
		return getTemplateAuthorityAndId(this.getContextNode().getAddress());

import xdi2.core.util.XDI3Util;
import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
		if (! xdiVariable.getArcXri().equals(XDILinkContractConstants.XRI_SS_DO_VARIABLE)) return false;
	public static XDI3Segment createLinkContractTemplateXri(XDI3Segment templateAuthorityAndId) {
		List<XDI3SubSegment> linkContractTemplateArcXris = new ArrayList<XDI3SubSegment> ();
		linkContractTemplateArcXris.addAll(templateAuthorityAndId.getSubSegments());
		linkContractTemplateArcXris.add(XDILinkContractConstants.XRI_SS_DO_VARIABLE);
		return XDI3Segment.fromComponents(linkContractTemplateArcXris);
	public static LinkContractTemplate findLinkContractTemplate(Graph graph, XDI3Segment templateAuthorityAndId, boolean create) {
		XDI3Segment linkContractTemplateXri = createLinkContractTemplateXri(templateAuthorityAndId);
	public static XDI3Segment getTemplateAuthorityAndId(XDI3Segment xri) {
		int index = XDI3Util.indexOfXri(xri, XDILinkContractConstants.XRI_SS_DO_VARIABLE);
		return XDI3Util.subXri(xri, 0, index);
	public XDI3Segment getTemplateAuthorityAndId() {
		return getTemplateAuthorityAndId(this.getContextNode().getXri());

@@ -7,9 +7,9 @@
 import xdi2.core.Graph;
 import xdi2.core.constants.XDILinkContractConstants;
 import xdi2.core.features.nodetypes.XdiVariable;
-import xdi2.core.util.XDI3Util;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.util.AddressUtil;
 
 /**
  * An XDI link contract template, represented as an XDI variable.
@@ -36,7 +36,7 @@ protected LinkContractTemplate(XdiVariable xdiVariable) {
 	 */
 	public static boolean isValid(XdiVariable xdiVariable) {
 
-		if (! xdiVariable.getArcXri().equals(XDILinkContractConstants.XRI_SS_DO_VARIABLE)) return false;
+		if (! xdiVariable.getArc().equals(XDILinkContractConstants.XDI_ARC_DO_VARIABLE)) return false;
 
 		if (getTemplateAuthorityAndId(xdiVariable.getXri()) == null) return false;
 
@@ -55,26 +55,26 @@ public static LinkContractTemplate fromXdiVariable(XdiVariable xdiVariable) {
 		return new LinkContractTemplate(xdiVariable);
 	}
 
-	public static XDI3Segment createLinkContractTemplateXri(XDI3Segment templateAuthorityAndId) {
+	public static XDIAddress createLinkContractTemplateXri(XDIAddress templateAuthorityAndId) {
 
 		if (templateAuthorityAndId == null) throw new NullPointerException();
 		
-		List<XDI3SubSegment> linkContractTemplateArcXris = new ArrayList<XDI3SubSegment> ();
+		List<XDIArc> linkContractTemplatearcs = new ArrayList<XDIArc> ();
 
-		linkContractTemplateArcXris.addAll(templateAuthorityAndId.getSubSegments());
+		linkContractTemplatearcs.addAll(templateAuthorityAndId.getArcs());
 
-		linkContractTemplateArcXris.add(XDILinkContractConstants.XRI_SS_DO_VARIABLE);
+		linkContractTemplatearcs.add(XDILinkContractConstants.XDI_ARC_DO_VARIABLE);
 
-		return XDI3Segment.fromComponents(linkContractTemplateArcXris);
+		return XDIAddress.fromComponents(linkContractTemplatearcs);
 	}
 
 	/**
 	 * Factory method that finds or creates an XDI link contract template for a graph.
 	 * @return The XDI link contract template.
 	 */
-	public static LinkContractTemplate findLinkContractTemplate(Graph graph, XDI3Segment templateAuthorityAndId, boolean create) {
+	public static LinkContractTemplate findLinkContractTemplate(Graph graph, XDIAddress templateAuthorityAndId, boolean create) {
 
-		XDI3Segment linkContractTemplateXri = createLinkContractTemplateXri(templateAuthorityAndId);
+		XDIAddress linkContractTemplateXri = createLinkContractTemplateXri(templateAuthorityAndId);
 
 		ContextNode linkContractTemplateContextNode = create ? graph.setDeepContextNode(linkContractTemplateXri) : graph.getDeepContextNode(linkContractTemplateXri, true);
 		if (linkContractTemplateContextNode == null) return null;
@@ -86,12 +86,12 @@ public static LinkContractTemplate findLinkContractTemplate(Graph graph, XDI3Seg
 	 * Static methods
 	 */
 
-	public static XDI3Segment getTemplateAuthorityAndId(XDI3Segment xri) {
+	public static XDIAddress getTemplateAuthorityAndId(XDIAddress xri) {
 
-		int index = XDI3Util.indexOfXri(xri, XDILinkContractConstants.XRI_SS_DO_VARIABLE);
+		int index = AddressUtil.indexOfXri(xri, XDILinkContractConstants.XDI_ARC_DO_VARIABLE);
 		if (index < 0) return null;
 
-		return XDI3Util.subXri(xri, 0, index);
+		return AddressUtil.subXri(xri, 0, index);
 	}
 
 	/*
@@ -103,8 +103,8 @@ public GenericLinkContract instantiate() {
 		throw new RuntimeException("Not implemented.");
 	}
 
-	public XDI3Segment getTemplateAuthorityAndId() {
+	public XDIAddress getTemplateAuthorityAndId() {
 
-		return getTemplateAuthorityAndId(this.getContextNode().getXri());
+		return getTemplateAuthorityAndId(this.getContextNode().getAddress());
 	}
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FLinkContractTemplate.java
92ccc2f5c884e3e7edcdbca16e994a1a4167c6df
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FLinkContracts.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FLinkContracts.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/LinkContracts.java
		ContextNode linkContractContextNode = create ? contextNode.setDeepContextNode(XDILinkContractConstants.XDI_ADD_DO) : contextNode.getDeepContextNode(XDILinkContractConstants.XDI_ADD_DO, true);

		ContextNode linkContractContextNode = create ? contextNode.setDeepContextNode(XDILinkContractConstants.XRI_S_DO) : contextNode.getDeepContextNode(XDILinkContractConstants.XRI_S_DO, true);

@@ -35,7 +35,7 @@ public static Iterator<LinkContract> getAllLinkContracts(Graph graph) {
 	 */
 	public static LinkContract getLinkContract(ContextNode contextNode, boolean create) {
 
-		ContextNode linkContractContextNode = create ? contextNode.setDeepContextNode(XDILinkContractConstants.XRI_S_DO) : contextNode.getDeepContextNode(XDILinkContractConstants.XRI_S_DO, true);
+		ContextNode linkContractContextNode = create ? contextNode.setDeepContextNode(XDILinkContractConstants.XDI_ADD_DO) : contextNode.getDeepContextNode(XDILinkContractConstants.XDI_ADD_DO, true);
 		if (linkContractContextNode == null) return null;
 
 		XdiEntitySingleton xdiEntitySingleton = XdiEntitySingleton.fromContextNode(linkContractContextNode);

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FLinkContracts.java
b7ced25a5272f272ffb727863c49b28c89b3fde6
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FPublicLinkContract.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FPublicLinkContract.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/PublicLinkContract.java
import xdi2.core.syntax.XDIAddress;
			if (! XDILinkContractConstants.XDI_ADD_PUBLIC.equals(GenericLinkContract.getRequestingAuthority(xdiEntity.getXri()))) return false;
	public static XDIAddress createPublicLinkContractXri(XDIAddress ownerXri) {
		return GenericLinkContract.createGenericLinkContractXri(ownerXri, XDILinkContractConstants.XDI_ADD_PUBLIC, null);
		XDIAddress ownerXri = GraphUtil.getOwnerXri(graph);
		GenericLinkContract genericLinkContract = GenericLinkContract.findGenericLinkContract(graph, ownerXri, XDILinkContractConstants.XDI_ADD_PUBLIC, null, true);

import xdi2.core.xri3.XDI3Segment;
			if (! XDILinkContractConstants.XRI_S_PUBLIC.equals(GenericLinkContract.getRequestingAuthority(xdiEntity.getXri()))) return false;
	public static XDI3Segment createPublicLinkContractXri(XDI3Segment ownerXri) {
		return GenericLinkContract.createGenericLinkContractXri(ownerXri, XDILinkContractConstants.XRI_S_PUBLIC, null);
		XDI3Segment ownerXri = GraphUtil.getOwnerXri(graph);
		GenericLinkContract genericLinkContract = GenericLinkContract.findGenericLinkContract(graph, ownerXri, XDILinkContractConstants.XRI_S_PUBLIC, null, true);

@@ -5,8 +5,8 @@
 import xdi2.core.features.nodetypes.XdiEntity;
 import xdi2.core.features.nodetypes.XdiEntityMember;
 import xdi2.core.features.nodetypes.XdiEntitySingleton;
+import xdi2.core.syntax.XDIAddress;
 import xdi2.core.util.GraphUtil;
-import xdi2.core.xri3.XDI3Segment;
 
 /**
  * An XDI public link contract, represented as an XDI entity.
@@ -41,7 +41,7 @@ public static boolean isValid(XdiEntity xdiEntity) {
 			if (GenericLinkContract.getRequestingAuthority(xdiEntity.getXri()) == null) return false;
 			if (GenericLinkContract.getTemplateAuthorityAndId(xdiEntity.getXri()) != null) return false;
 
-			if (! XDILinkContractConstants.XRI_S_PUBLIC.equals(GenericLinkContract.getRequestingAuthority(xdiEntity.getXri()))) return false;
+			if (! XDILinkContractConstants.XDI_ADD_PUBLIC.equals(GenericLinkContract.getRequestingAuthority(xdiEntity.getXri()))) return false;
 
 			return true;
 		} else if (xdiEntity instanceof XdiEntityMember) {
@@ -65,9 +65,9 @@ public static PublicLinkContract fromXdiEntity(XdiEntity xdiEntity) {
 		return new PublicLinkContract(xdiEntity);
 	}
 
-	public static XDI3Segment createPublicLinkContractXri(XDI3Segment ownerXri) {
+	public static XDIAddress createPublicLinkContractXri(XDIAddress ownerXri) {
 
-		return GenericLinkContract.createGenericLinkContractXri(ownerXri, XDILinkContractConstants.XRI_S_PUBLIC, null);
+		return GenericLinkContract.createGenericLinkContractXri(ownerXri, XDILinkContractConstants.XDI_ADD_PUBLIC, null);
 	}
 
 	/**
@@ -76,10 +76,10 @@ public static XDI3Segment createPublicLinkContractXri(XDI3Segment ownerXri) {
 	 */
 	public static PublicLinkContract findPublicLinkContract(Graph graph, boolean create) {
 
-		XDI3Segment ownerXri = GraphUtil.getOwnerXri(graph);
+		XDIAddress ownerXri = GraphUtil.getOwnerXri(graph);
 		if (ownerXri == null) return null;
 
-		GenericLinkContract genericLinkContract = GenericLinkContract.findGenericLinkContract(graph, ownerXri, XDILinkContractConstants.XRI_S_PUBLIC, null, true);
+		GenericLinkContract genericLinkContract = GenericLinkContract.findGenericLinkContract(graph, ownerXri, XDILinkContractConstants.XDI_ADD_PUBLIC, null, true);
 		if (genericLinkContract == null) return null;
 
 		return fromXdiEntity(genericLinkContract.getXdiEntity());

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FPublicLinkContract.java
04b3ac6d580cc33d4c0dafa74490aa71d8072395
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FRootLinkContract.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FRootLinkContract.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/RootLinkContract.java
import xdi2.core.syntax.XDIAddress;
	public static XDIAddress createRootLinkContractXri(XDIAddress ownerXri) {
		XDIAddress ownerXri = GraphUtil.getOwnerXri(graph);

import xdi2.core.xri3.XDI3Segment;
	public static XDI3Segment createRootLinkContractXri(XDI3Segment ownerXri) {
		XDI3Segment ownerXri = GraphUtil.getOwnerXri(graph);

@@ -4,8 +4,8 @@
 import xdi2.core.features.nodetypes.XdiEntity;
 import xdi2.core.features.nodetypes.XdiEntityMember;
 import xdi2.core.features.nodetypes.XdiEntitySingleton;
+import xdi2.core.syntax.XDIAddress;
 import xdi2.core.util.GraphUtil;
-import xdi2.core.xri3.XDI3Segment;
 
 /**
  * An XDI root link contract, represented as an XDI entity.
@@ -64,7 +64,7 @@ public static RootLinkContract fromXdiEntity(XdiEntity xdiEntity) {
 		return new RootLinkContract(xdiEntity);
 	}
 
-	public static XDI3Segment createRootLinkContractXri(XDI3Segment ownerXri) {
+	public static XDIAddress createRootLinkContractXri(XDIAddress ownerXri) {
 
 		return GenericLinkContract.createGenericLinkContractXri(ownerXri, ownerXri, null);
 	}
@@ -75,7 +75,7 @@ public static XDI3Segment createRootLinkContractXri(XDI3Segment ownerXri) {
 	 */
 	public static RootLinkContract findRootLinkContract(Graph graph, boolean create) {
 
-		XDI3Segment ownerXri = GraphUtil.getOwnerXri(graph);
+		XDIAddress ownerXri = GraphUtil.getOwnerXri(graph);
 		if (ownerXri == null) return null;
 
 		GenericLinkContract genericLinkContract = GenericLinkContract.findGenericLinkContract(graph, ownerXri, ownerXri, null, create);

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2FRootLinkContract.java
3d9b4f7340ab7ef7ad9e0d2f49237e195ed0bfdc
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FCondition.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FCondition.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/condition/Condition.java
import xdi2.core.syntax.XDIStatement;
	private XDIStatement statementXri;
	protected Condition(XDIStatement statementXri) {
	public static boolean isValid(XDIStatement statement) {
	public static Condition fromStatement(XDIStatement statement) {
	public XDIStatement getStatementXri() {

import xdi2.core.xri3.XDI3Statement;
	private XDI3Statement statementXri;
	protected Condition(XDI3Statement statementXri) {
	public static boolean isValid(XDI3Statement statement) {
	public static Condition fromStatement(XDI3Statement statement) {
	public XDI3Statement getStatementXri() {

@@ -6,7 +6,7 @@
 import org.slf4j.LoggerFactory;
 
 import xdi2.core.features.linkcontracts.evaluation.PolicyEvaluationContext;
-import xdi2.core.xri3.XDI3Statement;
+import xdi2.core.syntax.XDIStatement;
 
 /**
  * An XDI condition, represented as a statement.
@@ -19,9 +19,9 @@ public abstract class Condition implements Serializable, Comparable<Condition> {
 
 	private static final Logger log = LoggerFactory.getLogger(Condition.class);
 
-	private XDI3Statement statementXri;
+	private XDIStatement statementXri;
 
-	protected Condition(XDI3Statement statementXri) {
+	protected Condition(XDIStatement statementXri) {
 
 		if (statementXri == null) throw new NullPointerException();
 
@@ -37,7 +37,7 @@ protected Condition(XDI3Statement statementXri) {
 	 * @param statement The statement to check.
 	 * @return True if the statement is a valid XDI condition.
 	 */
-	public static boolean isValid(XDI3Statement statement) {
+	public static boolean isValid(XDIStatement statement) {
 
 		return
 				EqualsCondition.isValid(statement) ||
@@ -53,7 +53,7 @@ public static boolean isValid(XDI3Statement statement) {
 	 * @param statement The statement that is an XDI condition.
 	 * @return The XDI condition.
 	 */
-	public static Condition fromStatement(XDI3Statement statement) {
+	public static Condition fromStatement(XDIStatement statement) {
 
 		if (EqualsCondition.isValid(statement)) return EqualsCondition.fromStatement(statement);
 		if (MatchesCondition.isValid(statement)) return MatchesCondition.fromStatement(statement);
@@ -85,7 +85,7 @@ public static Condition castCondition(Condition condition) {
 	 * Returns the underlying statement to which this XDI condition is bound.
 	 * @return A statement that represents the XDI condition.
 	 */
-	public XDI3Statement getStatementXri() {
+	public XDIStatement getStatementXri() {
 
 		return this.statementXri;
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FCondition.java
2089e31714ed05f4fe84d4ccbff3bf000ec543dc
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FEqualsCondition.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FEqualsCondition.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/condition/EqualsCondition.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIStatement;
	protected EqualsCondition(XDIStatement statement) {
	public static boolean isValid(XDIStatement statement) {
		if (! XDIPolicyConstants.XDI_ADD_EQUALS.equals(statement.getRelationAddress())) return false;
	public static EqualsCondition fromStatement(XDIStatement statement) {
	public static EqualsCondition fromSubjectAndObject(XDIAddress subject, XDIAddress object) {
		return fromStatement(XDIStatement.fromRelationComponents(subject, XDIPolicyConstants.XDI_ADD_EQUALS, object));
		ContextNode object = policyEvaluationContext.getContextNode((XDIAddress) this.getStatementXri().getObject());

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
	protected EqualsCondition(XDI3Statement statement) {
	public static boolean isValid(XDI3Statement statement) {
		if (! XDIPolicyConstants.XRI_S_EQUALS.equals(statement.getRelationArcXri())) return false;
	public static EqualsCondition fromStatement(XDI3Statement statement) {
	public static EqualsCondition fromSubjectAndObject(XDI3Segment subject, XDI3Segment object) {
		return fromStatement(XDI3Statement.fromRelationComponents(subject, XDIPolicyConstants.XRI_S_EQUALS, object));
		ContextNode object = policyEvaluationContext.getContextNode((XDI3Segment) this.getStatementXri().getObject());

@@ -4,8 +4,8 @@
 import xdi2.core.constants.XDIPolicyConstants;
 import xdi2.core.features.linkcontracts.evaluation.PolicyEvaluationContext;
 import xdi2.core.impl.AbstractLiteral;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIStatement;
 
 /**
  * An XDI $equals condition, represented as a statement.
@@ -16,7 +16,7 @@ public class EqualsCondition extends Condition {
 
 	private static final long serialVersionUID = 613463446651165139L;
 
-	protected EqualsCondition(XDI3Statement statement) {
+	protected EqualsCondition(XDIStatement statement) {
 
 		super(statement);
 	}
@@ -30,11 +30,11 @@ protected EqualsCondition(XDI3Statement statement) {
 	 * @param statement The statement to check.
 	 * @return True if the statement is a valid XDI $equals condition.
 	 */
-	public static boolean isValid(XDI3Statement statement) {
+	public static boolean isValid(XDIStatement statement) {
 
 		if (! statement.isRelationStatement()) return false;
 
-		if (! XDIPolicyConstants.XRI_S_EQUALS.equals(statement.getRelationArcXri())) return false;
+		if (! XDIPolicyConstants.XDI_ADD_EQUALS.equals(statement.getRelationAddress())) return false;
 
 		return true;
 	}
@@ -44,16 +44,16 @@ public static boolean isValid(XDI3Statement statement) {
 	 * @param statement The statement that is an XDI $equals condition.
 	 * @return The XDI $equals condition.
 	 */
-	public static EqualsCondition fromStatement(XDI3Statement statement) {
+	public static EqualsCondition fromStatement(XDIStatement statement) {
 
 		if (! isValid(statement)) return null;
 
 		return new EqualsCondition(statement);
 	}
 
-	public static EqualsCondition fromSubjectAndObject(XDI3Segment subject, XDI3Segment object) {
+	public static EqualsCondition fromSubjectAndObject(XDIAddress subject, XDIAddress object) {
 
-		return fromStatement(XDI3Statement.fromRelationComponents(subject, XDIPolicyConstants.XRI_S_EQUALS, object));
+		return fromStatement(XDIStatement.fromRelationComponents(subject, XDIPolicyConstants.XDI_ADD_EQUALS, object));
 	}
 
 	/*
@@ -64,7 +64,7 @@ public static EqualsCondition fromSubjectAndObject(XDI3Segment subject, XDI3Segm
 	public Boolean evaluateInternal(PolicyEvaluationContext policyEvaluationContext) {
 
 		ContextNode subject = policyEvaluationContext.getContextNode(this.getStatementXri().getSubject());
-		ContextNode object = policyEvaluationContext.getContextNode((XDI3Segment) this.getStatementXri().getObject());
+		ContextNode object = policyEvaluationContext.getContextNode((XDIAddress) this.getStatementXri().getObject());
 
 		if (subject == null || object == null) return Boolean.FALSE;
 

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FEqualsCondition.java
010316348f3f11e8293d1c147f47ac973a44f8fe
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FGenericCondition.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FGenericCondition.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/condition/GenericCondition.java
import xdi2.core.syntax.XDIStatement;
	protected GenericCondition(XDIStatement statementXri) {
	public static boolean isValid(XDIStatement statement) {
	public static GenericCondition fromStatement(XDIStatement statement) {

import xdi2.core.xri3.XDI3Statement;
	protected GenericCondition(XDI3Statement statementXri) {
	public static boolean isValid(XDI3Statement statement) {
	public static GenericCondition fromStatement(XDI3Statement statement) {

@@ -2,7 +2,7 @@
 
 import xdi2.core.Statement;
 import xdi2.core.features.linkcontracts.evaluation.PolicyEvaluationContext;
-import xdi2.core.xri3.XDI3Statement;
+import xdi2.core.syntax.XDIStatement;
 
 /**
  * An XDI generic condition, represented as a statement.
@@ -13,7 +13,7 @@ public class GenericCondition extends Condition {
 
 	private static final long serialVersionUID = 3812888725775095575L;
 
-	protected GenericCondition(XDI3Statement statementXri) {
+	protected GenericCondition(XDIStatement statementXri) {
 
 		super(statementXri);
 	}
@@ -27,7 +27,7 @@ protected GenericCondition(XDI3Statement statementXri) {
 	 * @param statement The statement to check.
 	 * @return True if the statement is a valid XDI generic condition.
 	 */
-	public static boolean isValid(XDI3Statement statement) {
+	public static boolean isValid(XDIStatement statement) {
 
 		return true;
 	}
@@ -37,7 +37,7 @@ public static boolean isValid(XDI3Statement statement) {
 	 * @param statement The statement that is an XDI generic condition.
 	 * @return The XDI generic condition.
 	 */
-	public static GenericCondition fromStatement(XDI3Statement statement) {
+	public static GenericCondition fromStatement(XDIStatement statement) {
 
 		if (! isValid(statement)) return null;
 

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FGenericCondition.java
a4f5fcbb2a0debb6b0059b50e6ad80c043050c03
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FGreaterCondition.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FGreaterCondition.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/condition/GreaterCondition.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIStatement;
	protected GreaterCondition(XDIStatement statement) {
	public static boolean isValid(XDIStatement statement) {
		if (! XDIPolicyConstants.XDI_ADD_GREATER.equals(statement.getRelationAddress())) return false;
	public static GreaterCondition fromStatement(XDIStatement statement) {
	public static GreaterCondition fromSubjectAndObject(XDIAddress subject, XDIAddress object) {
		return fromStatement(XDIStatement.fromRelationComponents(subject, XDIPolicyConstants.XDI_ADD_GREATER, object));
		ContextNode object = policyEvaluationContext.getContextNode((XDIAddress) this.getStatementXri().getObject());

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
	protected GreaterCondition(XDI3Statement statement) {
	public static boolean isValid(XDI3Statement statement) {
		if (! XDIPolicyConstants.XRI_S_GREATER.equals(statement.getRelationArcXri())) return false;
	public static GreaterCondition fromStatement(XDI3Statement statement) {
	public static GreaterCondition fromSubjectAndObject(XDI3Segment subject, XDI3Segment object) {
		return fromStatement(XDI3Statement.fromRelationComponents(subject, XDIPolicyConstants.XRI_S_GREATER, object));
		ContextNode object = policyEvaluationContext.getContextNode((XDI3Segment) this.getStatementXri().getObject());

@@ -4,8 +4,8 @@
 import xdi2.core.constants.XDIPolicyConstants;
 import xdi2.core.features.linkcontracts.evaluation.PolicyEvaluationContext;
 import xdi2.core.impl.AbstractLiteral;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIStatement;
 
 /**
  * An XDI $greater condition, represented as a statement.
@@ -16,7 +16,7 @@ public class GreaterCondition extends Condition {
 
 	private static final long serialVersionUID = 2302071980940540935L;
 
-	protected GreaterCondition(XDI3Statement statement) {
+	protected GreaterCondition(XDIStatement statement) {
 
 		super(statement);
 	}
@@ -30,11 +30,11 @@ protected GreaterCondition(XDI3Statement statement) {
 	 * @param statement The statement to check.
 	 * @return True if the statement is a valid XDI $greater condition.
 	 */
-	public static boolean isValid(XDI3Statement statement) {
+	public static boolean isValid(XDIStatement statement) {
 
 		if (! statement.isRelationStatement()) return false;
 
-		if (! XDIPolicyConstants.XRI_S_GREATER.equals(statement.getRelationArcXri())) return false;
+		if (! XDIPolicyConstants.XDI_ADD_GREATER.equals(statement.getRelationAddress())) return false;
 
 		return true;
 	}
@@ -44,16 +44,16 @@ public static boolean isValid(XDI3Statement statement) {
 	 * @param statement The statement that is an XDI $greater condition.
 	 * @return The XDI $greater condition.
 	 */
-	public static GreaterCondition fromStatement(XDI3Statement statement) {
+	public static GreaterCondition fromStatement(XDIStatement statement) {
 
 		if (! isValid(statement)) return null;
 
 		return new GreaterCondition(statement);
 	}
 
-	public static GreaterCondition fromSubjectAndObject(XDI3Segment subject, XDI3Segment object) {
+	public static GreaterCondition fromSubjectAndObject(XDIAddress subject, XDIAddress object) {
 
-		return fromStatement(XDI3Statement.fromRelationComponents(subject, XDIPolicyConstants.XRI_S_GREATER, object));
+		return fromStatement(XDIStatement.fromRelationComponents(subject, XDIPolicyConstants.XDI_ADD_GREATER, object));
 	}
 
 	/*
@@ -64,7 +64,7 @@ public static GreaterCondition fromSubjectAndObject(XDI3Segment subject, XDI3Seg
 	public Boolean evaluateInternal(PolicyEvaluationContext policyEvaluationContext) {
 
 		ContextNode subject = policyEvaluationContext.getContextNode(this.getStatementXri().getSubject());
-		ContextNode object = policyEvaluationContext.getContextNode((XDI3Segment) this.getStatementXri().getObject());
+		ContextNode object = policyEvaluationContext.getContextNode((XDIAddress) this.getStatementXri().getObject());
 
 		if (subject == null || object == null) return Boolean.FALSE;
 

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FGreaterCondition.java
400c938905eed7767dd94db4836332751da77be5
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FIsCondition.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FIsCondition.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/condition/IsCondition.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIStatement;
	protected IsCondition(XDIStatement statement) {
	public static boolean isValid(XDIStatement statement) {
		if (! XDIPolicyConstants.XDI_ADD_IS.equals(statement.getRelationAddress())) return false;
	public static IsCondition fromStatement(XDIStatement statement) {
	public static IsCondition fromSubjectAndObject(XDIAddress subject, XDIAddress object) {
		return fromStatement(XDIStatement.fromRelationComponents(subject, XDIPolicyConstants.XDI_ADD_IS, object));
		XDIAddress subject = policyEvaluationContext.resolveXri(this.getStatementXri().getSubject());
		XDIAddress object = policyEvaluationContext.resolveXri((XDIAddress) this.getStatementXri().getObject());

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
	protected IsCondition(XDI3Statement statement) {
	public static boolean isValid(XDI3Statement statement) {
		if (! XDIPolicyConstants.XRI_S_IS.equals(statement.getRelationArcXri())) return false;
	public static IsCondition fromStatement(XDI3Statement statement) {
	public static IsCondition fromSubjectAndObject(XDI3Segment subject, XDI3Segment object) {
		return fromStatement(XDI3Statement.fromRelationComponents(subject, XDIPolicyConstants.XRI_S_IS, object));
		XDI3Segment subject = policyEvaluationContext.resolveXri(this.getStatementXri().getSubject());
		XDI3Segment object = policyEvaluationContext.resolveXri((XDI3Segment) this.getStatementXri().getObject());

@@ -2,8 +2,8 @@
 
 import xdi2.core.constants.XDIPolicyConstants;
 import xdi2.core.features.linkcontracts.evaluation.PolicyEvaluationContext;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIStatement;
 
 /**
  * An XDI $is condition, represented as a statement.
@@ -14,7 +14,7 @@ public class IsCondition extends Condition {
 
 	private static final long serialVersionUID = 7506322819724395818L;
 
-	protected IsCondition(XDI3Statement statement) {
+	protected IsCondition(XDIStatement statement) {
 
 		super(statement);
 	}
@@ -28,11 +28,11 @@ protected IsCondition(XDI3Statement statement) {
 	 * @param statement The statement to check.
 	 * @return True if the statement is a valid XDI $is condition.
 	 */
-	public static boolean isValid(XDI3Statement statement) {
+	public static boolean isValid(XDIStatement statement) {
 
 		if (! statement.isRelationStatement()) return false;
 
-		if (! XDIPolicyConstants.XRI_S_IS.equals(statement.getRelationArcXri())) return false;
+		if (! XDIPolicyConstants.XDI_ADD_IS.equals(statement.getRelationAddress())) return false;
 
 		return true;
 	}
@@ -42,16 +42,16 @@ public static boolean isValid(XDI3Statement statement) {
 	 * @param statement The statement that is an XDI $is condition.
 	 * @return The XDI $is condition.
 	 */
-	public static IsCondition fromStatement(XDI3Statement statement) {
+	public static IsCondition fromStatement(XDIStatement statement) {
 
 		if (! isValid(statement)) return null;
 
 		return new IsCondition(statement);
 	}
 
-	public static IsCondition fromSubjectAndObject(XDI3Segment subject, XDI3Segment object) {
+	public static IsCondition fromSubjectAndObject(XDIAddress subject, XDIAddress object) {
 
-		return fromStatement(XDI3Statement.fromRelationComponents(subject, XDIPolicyConstants.XRI_S_IS, object));
+		return fromStatement(XDIStatement.fromRelationComponents(subject, XDIPolicyConstants.XDI_ADD_IS, object));
 	}
 
 	/*
@@ -63,8 +63,8 @@ public Boolean evaluateInternal(PolicyEvaluationContext policyEvaluationContext)
 
 		// check if subject XRI and object XRI are the same
 
-		XDI3Segment subject = policyEvaluationContext.resolveXri(this.getStatementXri().getSubject());
-		XDI3Segment object = policyEvaluationContext.resolveXri((XDI3Segment) this.getStatementXri().getObject());
+		XDIAddress subject = policyEvaluationContext.resolveXri(this.getStatementXri().getSubject());
+		XDIAddress object = policyEvaluationContext.resolveXri((XDIAddress) this.getStatementXri().getObject());
 
 		if (subject == null || object == null) return Boolean.FALSE;
 		

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FIsCondition.java
2a9243a4287a29d442debcd5a2d4464cad75d8f1
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FLesserCondition.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FLesserCondition.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/condition/LesserCondition.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIStatement;
	protected LesserCondition(XDIStatement statement) {
	public static boolean isValid(XDIStatement statement) {
		if (! XDIPolicyConstants.XDI_ADD_LESSER.equals(statement.getRelationAddress())) return false;
	public static LesserCondition fromStatement(XDIStatement statement) {
	public static LesserCondition fromSubjectAndObject(XDIAddress subject, XDIAddress object) {
		return fromStatement(XDIStatement.fromRelationComponents(subject, XDIPolicyConstants.XDI_ADD_LESSER, object));
		ContextNode object = policyEvaluationContext.getContextNode((XDIAddress) this.getStatementXri().getObject());

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
	protected LesserCondition(XDI3Statement statement) {
	public static boolean isValid(XDI3Statement statement) {
		if (! XDIPolicyConstants.XRI_S_LESSER.equals(statement.getRelationArcXri())) return false;
	public static LesserCondition fromStatement(XDI3Statement statement) {
	public static LesserCondition fromSubjectAndObject(XDI3Segment subject, XDI3Segment object) {
		return fromStatement(XDI3Statement.fromRelationComponents(subject, XDIPolicyConstants.XRI_S_LESSER, object));
		ContextNode object = policyEvaluationContext.getContextNode((XDI3Segment) this.getStatementXri().getObject());

@@ -4,8 +4,8 @@
 import xdi2.core.constants.XDIPolicyConstants;
 import xdi2.core.features.linkcontracts.evaluation.PolicyEvaluationContext;
 import xdi2.core.impl.AbstractLiteral;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIStatement;
 
 /**
  * An XDI $lesser condition, represented as a statement.
@@ -16,7 +16,7 @@ public class LesserCondition extends Condition {
 
 	private static final long serialVersionUID = -8479583948559334331L;
 
-	protected LesserCondition(XDI3Statement statement) {
+	protected LesserCondition(XDIStatement statement) {
 
 		super(statement);
 	}
@@ -30,11 +30,11 @@ protected LesserCondition(XDI3Statement statement) {
 	 * @param statement The statement to check.
 	 * @return True if the statement is a valid XDI $lesser condition.
 	 */
-	public static boolean isValid(XDI3Statement statement) {
+	public static boolean isValid(XDIStatement statement) {
 
 		if (! statement.isRelationStatement()) return false;
 
-		if (! XDIPolicyConstants.XRI_S_LESSER.equals(statement.getRelationArcXri())) return false;
+		if (! XDIPolicyConstants.XDI_ADD_LESSER.equals(statement.getRelationAddress())) return false;
 
 		return true;
 	}
@@ -44,16 +44,16 @@ public static boolean isValid(XDI3Statement statement) {
 	 * @param statement The statement that is an XDI $lesser condition.
 	 * @return The XDI $lesser condition.
 	 */
-	public static LesserCondition fromStatement(XDI3Statement statement) {
+	public static LesserCondition fromStatement(XDIStatement statement) {
 
 		if (! isValid(statement)) return null;
 
 		return new LesserCondition(statement);
 	}
 
-	public static LesserCondition fromSubjectAndObject(XDI3Segment subject, XDI3Segment object) {
+	public static LesserCondition fromSubjectAndObject(XDIAddress subject, XDIAddress object) {
 
-		return fromStatement(XDI3Statement.fromRelationComponents(subject, XDIPolicyConstants.XRI_S_LESSER, object));
+		return fromStatement(XDIStatement.fromRelationComponents(subject, XDIPolicyConstants.XDI_ADD_LESSER, object));
 	}
 
 	/*
@@ -64,7 +64,7 @@ public static LesserCondition fromSubjectAndObject(XDI3Segment subject, XDI3Segm
 	public Boolean evaluateInternal(PolicyEvaluationContext policyEvaluationContext) {
 
 		ContextNode subject = policyEvaluationContext.getContextNode(this.getStatementXri().getSubject());
-		ContextNode object = policyEvaluationContext.getContextNode((XDI3Segment) this.getStatementXri().getObject());
+		ContextNode object = policyEvaluationContext.getContextNode((XDIAddress) this.getStatementXri().getObject());
 
 		if (subject == null || object == null) return Boolean.FALSE;
 

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FLesserCondition.java
13a853e90877031833943043f7dfee7026a817b4
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FMatchesCondition.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FMatchesCondition.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/condition/MatchesCondition.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIStatement;
	protected MatchesCondition(XDIStatement statement) {
	public static boolean isValid(XDIStatement statement) {
		if (! XDIPolicyConstants.XDI_ADD_MATCHES.equals(statement.getRelationAddress())) return false;
	public static MatchesCondition fromStatement(XDIStatement statement) {
	public static MatchesCondition fromSubjectAndObject(XDIAddress subject, XDIAddress object) {
		return fromStatement(XDIStatement.fromRelationComponents(subject, XDIPolicyConstants.XDI_ADD_MATCHES, object));
		ContextNode object = policyEvaluationContext.getContextNode((XDIAddress) this.getStatementXri().getObject());

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
	protected MatchesCondition(XDI3Statement statement) {
	public static boolean isValid(XDI3Statement statement) {
		if (! XDIPolicyConstants.XRI_S_MATCHES.equals(statement.getRelationArcXri())) return false;
	public static MatchesCondition fromStatement(XDI3Statement statement) {
	public static MatchesCondition fromSubjectAndObject(XDI3Segment subject, XDI3Segment object) {
		return fromStatement(XDI3Statement.fromRelationComponents(subject, XDIPolicyConstants.XRI_S_MATCHES, object));
		ContextNode object = policyEvaluationContext.getContextNode((XDI3Segment) this.getStatementXri().getObject());

@@ -5,8 +5,8 @@
 import xdi2.core.ContextNode;
 import xdi2.core.constants.XDIPolicyConstants;
 import xdi2.core.features.linkcontracts.evaluation.PolicyEvaluationContext;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIStatement;
 
 /**
  * An XDI $matches condition, represented as a statement.
@@ -17,7 +17,7 @@ public class MatchesCondition extends Condition {
 
 	private static final long serialVersionUID = -3144452704386786096L;
 
-	protected MatchesCondition(XDI3Statement statement) {
+	protected MatchesCondition(XDIStatement statement) {
 
 		super(statement);
 	}
@@ -31,11 +31,11 @@ protected MatchesCondition(XDI3Statement statement) {
 	 * @param statement The statement to check.
 	 * @return True if the statement is a valid XDI $matches condition.
 	 */
-	public static boolean isValid(XDI3Statement statement) {
+	public static boolean isValid(XDIStatement statement) {
 
 		if (! statement.isRelationStatement()) return false;
 
-		if (! XDIPolicyConstants.XRI_S_MATCHES.equals(statement.getRelationArcXri())) return false;
+		if (! XDIPolicyConstants.XDI_ADD_MATCHES.equals(statement.getRelationAddress())) return false;
 
 		return true;
 	}
@@ -45,16 +45,16 @@ public static boolean isValid(XDI3Statement statement) {
 	 * @param statement The statement that is an XDI $matches condition.
 	 * @return The XDI $matches condition.
 	 */
-	public static MatchesCondition fromStatement(XDI3Statement statement) {
+	public static MatchesCondition fromStatement(XDIStatement statement) {
 
 		if (! isValid(statement)) return null;
 
 		return new MatchesCondition(statement);
 	}
 
-	public static MatchesCondition fromSubjectAndObject(XDI3Segment subject, XDI3Segment object) {
+	public static MatchesCondition fromSubjectAndObject(XDIAddress subject, XDIAddress object) {
 
-		return fromStatement(XDI3Statement.fromRelationComponents(subject, XDIPolicyConstants.XRI_S_MATCHES, object));
+		return fromStatement(XDIStatement.fromRelationComponents(subject, XDIPolicyConstants.XDI_ADD_MATCHES, object));
 	}
 
 	/*
@@ -65,7 +65,7 @@ public static MatchesCondition fromSubjectAndObject(XDI3Segment subject, XDI3Seg
 	public Boolean evaluateInternal(PolicyEvaluationContext policyEvaluationContext) {
 
 		ContextNode subject = policyEvaluationContext.getContextNode(this.getStatementXri().getSubject());
-		ContextNode object = policyEvaluationContext.getContextNode((XDI3Segment) this.getStatementXri().getObject());
+		ContextNode object = policyEvaluationContext.getContextNode((XDIAddress) this.getStatementXri().getObject());
 
 		if (subject == null || object == null) return Boolean.FALSE;
 

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fcondition%2FMatchesCondition.java
48f489f7d4b1a98a2f4ac08c4dba98ed6d9a9c8b
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fevaluation%2FGraphPolicyEvaluationContext.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fevaluation%2FGraphPolicyEvaluationContext.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/evaluation/GraphPolicyEvaluationContext.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIStatement;
	public XDIAddress resolveXri(XDIAddress contextNodeAddress) {
		return contextNodeAddress;
	public ContextNode getContextNode(XDIAddress contextNodeAddress) {
		return this.getGraph().getDeepContextNode(contextNodeAddress, false);
	public Statement getStatement(XDIStatement statementXri) {

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
	public XDI3Segment resolveXri(XDI3Segment contextNodeXri) {
		return contextNodeXri;
	public ContextNode getContextNode(XDI3Segment contextNodeXri) {
		return this.getGraph().getDeepContextNode(contextNodeXri, false);
	public Statement getStatement(XDI3Statement statementXri) {

@@ -3,8 +3,8 @@
 import xdi2.core.ContextNode;
 import xdi2.core.Graph;
 import xdi2.core.Statement;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIStatement;
 
 public class GraphPolicyEvaluationContext implements PolicyEvaluationContext {
 
@@ -16,19 +16,19 @@ public GraphPolicyEvaluationContext(Graph graph) {
 	}
 
 	@Override
-	public XDI3Segment resolveXri(XDI3Segment contextNodeXri) {
+	public XDIAddress resolveXri(XDIAddress contextNodeAddress) {
 
-		return contextNodeXri;
+		return contextNodeAddress;
 	}
 
 	@Override
-	public ContextNode getContextNode(XDI3Segment contextNodeXri) {
+	public ContextNode getContextNode(XDIAddress contextNodeAddress) {
 
-		return this.getGraph().getDeepContextNode(contextNodeXri, false);
+		return this.getGraph().getDeepContextNode(contextNodeAddress, false);
 	}
 
 	@Override
-	public Statement getStatement(XDI3Statement statementXri) {
+	public Statement getStatement(XDIStatement statementXri) {
 
 		return this.getGraph().getStatement(statementXri);
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fevaluation%2FGraphPolicyEvaluationContext.java
173470b3dd90360baa47f50f0b9707efc29846bd
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fevaluation%2FPolicyEvaluationContext.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fevaluation%2FPolicyEvaluationContext.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/evaluation/PolicyEvaluationContext.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIStatement;
	public XDIAddress resolveXri(XDIAddress contextNodeAddress);
	public ContextNode getContextNode(XDIAddress contextNodeAddress);
	public Statement getStatement(XDIStatement statementXri);

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
	public XDI3Segment resolveXri(XDI3Segment contextNodeXri);
	public ContextNode getContextNode(XDI3Segment contextNodeXri);
	public Statement getStatement(XDI3Statement statementXri);

@@ -2,8 +2,8 @@
 
 import xdi2.core.ContextNode;
 import xdi2.core.Statement;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIStatement;
 
 /**
  * This interface provides a context for evaluating an XDI policy.
@@ -12,7 +12,7 @@
  */
 public interface PolicyEvaluationContext {
 
-	public XDI3Segment resolveXri(XDI3Segment contextNodeXri);
-	public ContextNode getContextNode(XDI3Segment contextNodeXri);
-	public Statement getStatement(XDI3Statement statementXri);
+	public XDIAddress resolveXri(XDIAddress contextNodeAddress);
+	public ContextNode getContextNode(XDIAddress contextNodeAddress);
+	public Statement getStatement(XDIStatement statementXri);
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fevaluation%2FPolicyEvaluationContext.java
93f69f7b3a804c78b6e566016a88bad10eb686d1
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Foperator%2FConditionOperator.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Foperator%2FConditionOperator.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/operator/ConditionOperator.java
import xdi2.core.syntax.XDIStatement;
import xdi2.core.util.iterators.MappingStatementIterator;
		return new MappingIterator<XDIStatement, Condition> (
						new MappingStatementIterator(
			public Condition map(XDIStatement statementXri) {

import xdi2.core.util.iterators.MappingStatementXriIterator;
import xdi2.core.xri3.XDI3Statement;
		return new MappingIterator<XDI3Statement, Condition> (
						new MappingStatementXriIterator(
			public Condition map(XDI3Statement statementXri) {

@@ -5,11 +5,11 @@
 import xdi2.core.features.linkcontracts.condition.Condition;
 import xdi2.core.features.nodetypes.XdiInnerRoot;
 import xdi2.core.features.nodetypes.XdiRoot.MappingAbsoluteToRelativeStatementXriIterator;
+import xdi2.core.syntax.XDIStatement;
 import xdi2.core.util.iterators.IterableIterator;
 import xdi2.core.util.iterators.MappingIterator;
-import xdi2.core.util.iterators.MappingStatementXriIterator;
+import xdi2.core.util.iterators.MappingStatementIterator;
 import xdi2.core.util.iterators.SelectingNotImpliedStatementIterator;
-import xdi2.core.xri3.XDI3Statement;
 
 public abstract class ConditionOperator extends Operator {
 
@@ -29,15 +29,15 @@ public IterableIterator<Condition> getConditions() {
 		XdiInnerRoot innerRoot = XdiInnerRoot.fromContextNode(this.getRelation().follow());
 		if (innerRoot == null) throw new Xdi2RuntimeException("Missing condition in operator: " + this.getRelation());
 
-		return new MappingIterator<XDI3Statement, Condition> (
+		return new MappingIterator<XDIStatement, Condition> (
 				new MappingAbsoluteToRelativeStatementXriIterator(
 						innerRoot,
-						new MappingStatementXriIterator(
+						new MappingStatementIterator(
 								new SelectingNotImpliedStatementIterator(
 										innerRoot.getContextNode().getAllStatements())))) {
 
 			@Override
-			public Condition map(XDI3Statement statementXri) {
+			public Condition map(XDIStatement statementXri) {
 
 				return Condition.fromStatement(statementXri);
 			}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Foperator%2FConditionOperator.java
277895d55b7ae8704c9d2d54d368353a6049abb6
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Foperator%2FFalseOperator.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Foperator%2FFalseOperator.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/operator/FalseOperator.java
		if (! XDIConstants.XDI_ADD_FALSE.equals(relation.getArc())) return false;
		XdiInnerRoot xdiInnerRoot = policy.getXdiEntity().getXdiInnerRoot(XDIConstants.XDI_ADD_FALSE, true);

		if (! XDIConstants.XRI_S_FALSE.equals(relation.getArcXri())) return false;
		XdiInnerRoot xdiInnerRoot = policy.getXdiEntity().getXdiInnerRoot(XDIConstants.XRI_S_FALSE, true);

@@ -40,7 +40,7 @@ public static boolean isValid(Relation relation) {
 
 		if (! XdiAbstractEntity.isValid(relation.getContextNode())) return false;
 		if (! Policy.isValid(XdiAbstractEntity.fromContextNode(relation.getContextNode()))) return false;
-		if (! XDIConstants.XRI_S_FALSE.equals(relation.getArcXri())) return false;
+		if (! XDIConstants.XDI_ADD_FALSE.equals(relation.getArc())) return false;
 		if (! XdiInnerRoot.isValid(relation.follow())) return false;
 
 		return true;
@@ -62,7 +62,7 @@ public static FalseOperator createFalseOperator(Policy policy, Condition conditi
 
 		if (policy == null) throw new NullPointerException();
 
-		XdiInnerRoot xdiInnerRoot = policy.getXdiEntity().getXdiInnerRoot(XDIConstants.XRI_S_FALSE, true);
+		XdiInnerRoot xdiInnerRoot = policy.getXdiEntity().getXdiInnerRoot(XDIConstants.XDI_ADD_FALSE, true);
 		xdiInnerRoot.getContextNode().setStatement(condition.getStatementXri());
 
 		return fromRelation(xdiInnerRoot.getPredicateRelation());

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Foperator%2FFalseOperator.java
152ccea571def44ae229e742a9dda762b9a74ada
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Foperator%2FTrueOperator.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Foperator%2FTrueOperator.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/operator/TrueOperator.java
		if (! XDIConstants.XDI_ADD_TRUE.equals(relation.getArc())) return false;
		XdiInnerRoot xdiInnerRoot = policy.getXdiEntity().getXdiInnerRoot(XDIConstants.XDI_ADD_TRUE, true);

		if (! XDIConstants.XRI_S_TRUE.equals(relation.getArcXri())) return false;
		XdiInnerRoot xdiInnerRoot = policy.getXdiEntity().getXdiInnerRoot(XDIConstants.XRI_S_TRUE, true);

@@ -40,7 +40,7 @@ public static boolean isValid(Relation relation) {
 
 		if (! XdiAbstractEntity.isValid(relation.getContextNode())) return false;
 		if (! Policy.isValid(XdiAbstractEntity.fromContextNode(relation.getContextNode()))) return false;
-		if (! XDIConstants.XRI_S_TRUE.equals(relation.getArcXri())) return false;
+		if (! XDIConstants.XDI_ADD_TRUE.equals(relation.getArc())) return false;
 		if (! XdiInnerRoot.isValid(relation.follow())) return false;
 
 		return true;
@@ -62,7 +62,7 @@ public static TrueOperator createTrueOperator(Policy policy, Condition condition
 
 		if (policy == null) throw new NullPointerException();
 
-		XdiInnerRoot xdiInnerRoot = policy.getXdiEntity().getXdiInnerRoot(XDIConstants.XRI_S_TRUE, true);
+		XdiInnerRoot xdiInnerRoot = policy.getXdiEntity().getXdiInnerRoot(XDIConstants.XDI_ADD_TRUE, true);
 		xdiInnerRoot.getContextNode().setStatement(condition.getStatementXri());
 
 		return fromRelation(xdiInnerRoot.getPredicateRelation());

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Foperator%2FTrueOperator.java
f55517545182f672e828fad6b64a256b46399c76
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicy.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicy.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/policy/Policy.java
import xdi2.core.syntax.XDIArc;
	public XDIArc getPolicyXri() {
			return ((XdiEntitySingleton) this.getXdiEntity()).getBasearc();
			return ((XdiEntityMemberUnordered) this.getXdiEntity()).getXdiCollection().getBasearc();
			return ((XdiEntityMemberOrdered) this.getXdiEntity()).getXdiCollection().getBasearc();
			policyAndXdiEntity = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createarc(XDIPolicyConstants.XDI_ARC_AND), true);
			policyAndXdiEntity = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createarc(XDIPolicyConstants.XDI_ARC_AND), true).setXdiMemberUnordered(null);
			policyOrXdiEntity = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createarc(XDIPolicyConstants.XDI_ARC_OR), true);
			policyOrXdiEntity = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createarc(XDIPolicyConstants.XDI_ARC_OR), true).setXdiMemberUnordered(null);
			policyNotXdiEntity = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createarc(XDIPolicyConstants.XDI_ARC_NOT), true);
			policyNotXdiEntity = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createarc(XDIPolicyConstants.XDI_ARC_NOT), true).setXdiMemberUnordered(null);
		XdiEntitySingleton policyAndEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createarc(XDIPolicyConstants.XDI_ARC_AND), false);
		XdiEntitySingleton policyOrEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createarc(XDIPolicyConstants.XDI_ARC_OR), false);
		XdiEntitySingleton policyNotEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createarc(XDIPolicyConstants.XDI_ARC_NOT), false);
		XdiEntityCollection policyAndEntityCollection = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createarc(XDIPolicyConstants.XDI_ARC_AND), false);
		XdiEntityCollection policyOrEntityCollection = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createarc(XDIPolicyConstants.XDI_ARC_OR), false);
		XdiEntityCollection policyNotEntityCollection = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createarc(XDIPolicyConstants.XDI_ARC_NOT), false);

import xdi2.core.xri3.XDI3SubSegment;
	public XDI3SubSegment getPolicyXri() {
			return ((XdiEntitySingleton) this.getXdiEntity()).getBaseArcXri();
			return ((XdiEntityMemberUnordered) this.getXdiEntity()).getXdiCollection().getBaseArcXri();
			return ((XdiEntityMemberOrdered) this.getXdiEntity()).getXdiCollection().getBaseArcXri();
			policyAndXdiEntity = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createArcXri(XDIPolicyConstants.XRI_SS_AND), true);
			policyAndXdiEntity = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createArcXri(XDIPolicyConstants.XRI_SS_AND), true).setXdiMemberUnordered(null);
			policyOrXdiEntity = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createArcXri(XDIPolicyConstants.XRI_SS_OR), true);
			policyOrXdiEntity = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createArcXri(XDIPolicyConstants.XRI_SS_OR), true).setXdiMemberUnordered(null);
			policyNotXdiEntity = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createArcXri(XDIPolicyConstants.XRI_SS_NOT), true);
			policyNotXdiEntity = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createArcXri(XDIPolicyConstants.XRI_SS_NOT), true).setXdiMemberUnordered(null);
		XdiEntitySingleton policyAndEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createArcXri(XDIPolicyConstants.XRI_SS_AND), false);
		XdiEntitySingleton policyOrEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createArcXri(XDIPolicyConstants.XRI_SS_OR), false);
		XdiEntitySingleton policyNotEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createArcXri(XDIPolicyConstants.XRI_SS_NOT), false);
		XdiEntityCollection policyAndEntityCollection = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createArcXri(XDIPolicyConstants.XRI_SS_AND), false);
		XdiEntityCollection policyOrEntityCollection = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createArcXri(XDIPolicyConstants.XRI_SS_OR), false);
		XdiEntityCollection policyNotEntityCollection = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createArcXri(XDIPolicyConstants.XRI_SS_NOT), false);

@@ -19,12 +19,12 @@
 import xdi2.core.features.nodetypes.XdiEntityMemberOrdered;
 import xdi2.core.features.nodetypes.XdiEntityMemberUnordered;
 import xdi2.core.features.nodetypes.XdiEntitySingleton;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.CompositeIterator;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
 import xdi2.core.util.iterators.ReadOnlyIterator;
 import xdi2.core.util.iterators.SingleItemIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 /**
  * An XDI policy, represented as a context node.
@@ -115,14 +115,14 @@ public ContextNode getContextNode() {
 	 * Returns the policy XRI of the XDI policy (e.g. $and, $or).
 	 * @return The policy XRI of the XDI policy.
 	 */
-	public XDI3SubSegment getPolicyXri() {
+	public XDIArc getPolicyXri() {
 
 		if (this.getXdiEntity() instanceof XdiEntitySingleton)
-			return ((XdiEntitySingleton) this.getXdiEntity()).getBaseArcXri();
+			return ((XdiEntitySingleton) this.getXdiEntity()).getBasearc();
 		else if (this.getXdiEntity() instanceof XdiEntityMemberUnordered)
-			return ((XdiEntityMemberUnordered) this.getXdiEntity()).getXdiCollection().getBaseArcXri();
+			return ((XdiEntityMemberUnordered) this.getXdiEntity()).getXdiCollection().getBasearc();
 		else if (this.getXdiEntity() instanceof XdiEntityMemberOrdered)
-			return ((XdiEntityMemberOrdered) this.getXdiEntity()).getXdiCollection().getBaseArcXri();
+			return ((XdiEntityMemberOrdered) this.getXdiEntity()).getXdiCollection().getBasearc();
 
 		return null;
 	}
@@ -135,9 +135,9 @@ public PolicyAnd createAndPolicy(boolean singleton) {
 		XdiEntity policyAndXdiEntity; 
 		
 		if (singleton)
-			policyAndXdiEntity = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createArcXri(XDIPolicyConstants.XRI_SS_AND), true);
+			policyAndXdiEntity = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createarc(XDIPolicyConstants.XDI_ARC_AND), true);
 		else
-			policyAndXdiEntity = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createArcXri(XDIPolicyConstants.XRI_SS_AND), true).setXdiMemberUnordered(null);
+			policyAndXdiEntity = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createarc(XDIPolicyConstants.XDI_ARC_AND), true).setXdiMemberUnordered(null);
 
 		return PolicyAnd.fromXdiEntity(policyAndXdiEntity);
 	}
@@ -150,9 +150,9 @@ public PolicyOr createOrPolicy(boolean singleton) {
 		XdiEntity policyOrXdiEntity; 
 		
 		if (singleton)
-			policyOrXdiEntity = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createArcXri(XDIPolicyConstants.XRI_SS_OR), true);
+			policyOrXdiEntity = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createarc(XDIPolicyConstants.XDI_ARC_OR), true);
 		else
-			policyOrXdiEntity = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createArcXri(XDIPolicyConstants.XRI_SS_OR), true).setXdiMemberUnordered(null);
+			policyOrXdiEntity = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createarc(XDIPolicyConstants.XDI_ARC_OR), true).setXdiMemberUnordered(null);
 
 		return PolicyOr.fromXdiEntity(policyOrXdiEntity);
 	}
@@ -165,9 +165,9 @@ public PolicyNot createNotPolicy(boolean singleton) {
 		XdiEntity policyNotXdiEntity; 
 		
 		if (singleton)
-			policyNotXdiEntity = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createArcXri(XDIPolicyConstants.XRI_SS_NOT), true);
+			policyNotXdiEntity = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createarc(XDIPolicyConstants.XDI_ARC_NOT), true);
 		else
-			policyNotXdiEntity = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createArcXri(XDIPolicyConstants.XRI_SS_NOT), true).setXdiMemberUnordered(null);
+			policyNotXdiEntity = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createarc(XDIPolicyConstants.XDI_ARC_NOT), true).setXdiMemberUnordered(null);
 
 		return PolicyNot.fromXdiEntity(policyNotXdiEntity);
 	}
@@ -181,19 +181,19 @@ public ReadOnlyIterator<Policy> getPolicies() {
 
 		// add policies that are XDI entity singletons
 
-		XdiEntitySingleton policyAndEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createArcXri(XDIPolicyConstants.XRI_SS_AND), false);
-		XdiEntitySingleton policyOrEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createArcXri(XDIPolicyConstants.XRI_SS_OR), false);
-		XdiEntitySingleton policyNotEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createArcXri(XDIPolicyConstants.XRI_SS_NOT), false);
+		XdiEntitySingleton policyAndEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createarc(XDIPolicyConstants.XDI_ARC_AND), false);
+		XdiEntitySingleton policyOrEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createarc(XDIPolicyConstants.XDI_ARC_OR), false);
+		XdiEntitySingleton policyNotEntitySingleton = this.getXdiEntity().getXdiEntitySingleton(XdiEntitySingleton.createarc(XDIPolicyConstants.XDI_ARC_NOT), false);
 
 		if (policyAndEntitySingleton != null) iterators.add(new SingleItemIterator<Policy> (PolicyAnd.fromXdiEntity(policyAndEntitySingleton)));
 		if (policyOrEntitySingleton != null) iterators.add(new SingleItemIterator<Policy> (PolicyOr.fromXdiEntity(policyOrEntitySingleton)));
 		if (policyNotEntitySingleton != null) iterators.add(new SingleItemIterator<Policy> (PolicyNot.fromXdiEntity(policyNotEntitySingleton)));
 
 		// add policies that are XDI entity instances
 
-		XdiEntityCollection policyAndEntityCollection = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createArcXri(XDIPolicyConstants.XRI_SS_AND), false);
-		XdiEntityCollection policyOrEntityCollection = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createArcXri(XDIPolicyConstants.XRI_SS_OR), false);
-		XdiEntityCollection policyNotEntityCollection = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createArcXri(XDIPolicyConstants.XRI_SS_NOT), false);
+		XdiEntityCollection policyAndEntityCollection = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createarc(XDIPolicyConstants.XDI_ARC_AND), false);
+		XdiEntityCollection policyOrEntityCollection = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createarc(XDIPolicyConstants.XDI_ARC_OR), false);
+		XdiEntityCollection policyNotEntityCollection = this.getXdiEntity().getXdiEntityCollection(XdiEntityCollection.createarc(XDIPolicyConstants.XDI_ARC_NOT), false);
 
 		if (policyAndEntityCollection != null) iterators.add(new MappingXdiEntityPolicyAndIterator(policyAndEntityCollection.getXdiMembersDeref()));
 		if (policyOrEntityCollection != null) iterators.add(new MappingXdiEntityPolicyOrIterator(policyOrEntityCollection.getXdiMembersDeref()));

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicy.java
835424599a4a0118fff21af4616ebce5e24d3864
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicyAnd.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicyAnd.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/policy/PolicyAnd.java
			return ((XdiEntitySingleton) xdiEntity).getBasearc().equals(XDIPolicyConstants.XDI_ARC_AND);
			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_AND);
			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_AND);

			return ((XdiEntitySingleton) xdiEntity).getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_AND);
			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_AND);
			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_AND);

@@ -36,11 +36,11 @@ protected PolicyAnd(XdiEntity xdiEntity) {
 	public static boolean isValid(XdiEntity xdiEntity) {
 
 		if (xdiEntity instanceof XdiEntitySingleton)
-			return ((XdiEntitySingleton) xdiEntity).getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_AND);
+			return ((XdiEntitySingleton) xdiEntity).getBasearc().equals(XDIPolicyConstants.XDI_ARC_AND);
 		else if (xdiEntity instanceof XdiEntityMemberUnordered)
-			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_AND);
+			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_AND);
 		else if (xdiEntity instanceof XdiEntityMemberOrdered)
-			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_AND);
+			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_AND);
 
 		return false;
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicyAnd.java
cca93224a044c0a683023c70b57a69be44dfc6f2
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicyNot.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicyNot.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/policy/PolicyNot.java
			return ((XdiEntitySingleton) xdiEntity).getBasearc().equals(XDIPolicyConstants.XDI_ARC_NOT);
			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_NOT);
			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_NOT);

			return ((XdiEntitySingleton) xdiEntity).getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_NOT);
			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_NOT);
			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_NOT);

@@ -36,11 +36,11 @@ protected PolicyNot(XdiEntity xdiEntity) {
 	public static boolean isValid(XdiEntity xdiEntity) {
 
 		if (xdiEntity instanceof XdiEntitySingleton)
-			return ((XdiEntitySingleton) xdiEntity).getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_NOT);
+			return ((XdiEntitySingleton) xdiEntity).getBasearc().equals(XDIPolicyConstants.XDI_ARC_NOT);
 		else if (xdiEntity instanceof XdiEntityMemberUnordered)
-			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_NOT);
+			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_NOT);
 		else if (xdiEntity instanceof XdiEntityMemberOrdered)
-			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_NOT);
+			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_NOT);
 
 		return false;
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicyNot.java
23527c18292c91c31bdbfe1f79eed76def758158
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicyOr.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicyOr.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/policy/PolicyOr.java
			return ((XdiEntitySingleton) xdiEntity).getBasearc().equals(XDIPolicyConstants.XDI_ARC_OR);
			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_OR);
			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_OR);

			return ((XdiEntitySingleton) xdiEntity).getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_OR);
			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_OR);
			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_OR);

@@ -36,11 +36,11 @@ protected PolicyOr(XdiEntity xdiEntity) {
 	public static boolean isValid(XdiEntity xdiEntity) {
 
 		if (xdiEntity instanceof XdiEntitySingleton)
-			return ((XdiEntitySingleton) xdiEntity).getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_OR);
+			return ((XdiEntitySingleton) xdiEntity).getBasearc().equals(XDIPolicyConstants.XDI_ARC_OR);
 		else if (xdiEntity instanceof XdiEntityMemberUnordered)
-			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_OR);
+			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_OR);
 		else if (xdiEntity instanceof XdiEntityMemberOrdered)
-			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_OR);
+			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_OR);
 
 		return false;
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicyOr.java
f0a664b679f2d0b5f1f47037a86fbed50c772254
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicyRoot.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicyRoot.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/policy/PolicyRoot.java
			return ((XdiEntitySingleton) xdiEntity).getBasearc().equals(XDIPolicyConstants.XDI_ARC_IF);
			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_IF);
			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_IF);

			return ((XdiEntitySingleton) xdiEntity).getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_IF);
			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_IF);
			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_IF);

@@ -36,11 +36,11 @@ protected PolicyRoot(XdiEntity xdiEntity) {
 	public static boolean isValid(XdiEntity xdiEntity) {
 
 		if (xdiEntity instanceof XdiEntitySingleton)
-			return ((XdiEntitySingleton) xdiEntity).getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_IF);
+			return ((XdiEntitySingleton) xdiEntity).getBasearc().equals(XDIPolicyConstants.XDI_ARC_IF);
 		else if (xdiEntity instanceof XdiEntityMemberUnordered)
-			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_IF);
+			return ((XdiEntityMemberUnordered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_IF);
 		else if (xdiEntity instanceof XdiEntityMemberOrdered)
-			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBaseArcXri().equals(XDIPolicyConstants.XRI_SS_IF);
+			return ((XdiEntityMemberOrdered) xdiEntity).getXdiCollection().getBasearc().equals(XDIPolicyConstants.XDI_ARC_IF);
 
 		return false;
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicyRoot.java
192bdc27839c366a872fffc7acab0df3950f7614
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicyUtil.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicyUtil.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/linkcontracts/policy/PolicyUtil.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIStatement;
	public static Operator createSenderIsOperator(Policy policy, XDIAddress sender) {
				XDIAddress.create("{$from}"), 
		Condition condition = GenericCondition.fromStatement(XDIStatement.fromLiteralComponents(
				XDIAddress.create("{$msg}" + XDIAuthenticationConstants.XDI_ADD_SECRET_TOKEN_VALID + "&"), 
		Condition condition = GenericCondition.fromStatement(XDIStatement.fromLiteralComponents(
				XDIAddress.create("{$msg}" + XDIAuthenticationConstants.XDI_ADD_SIGNATURE_VALID + "&"), 

Policy policy  XDIAddress sender
core/src/main/java/xdi2/core/features/linkcontracts/policy/PolicyUtil.java
XDIAddress.create("{$from
Operator createSenderIsOperator(Policy policy, XDIAddress sender)
import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
	public static Operator createSenderIsOperator(Policy policy, XDI3Segment sender) {
				XDI3Segment.create("{$from}"), 
		Condition condition = GenericCondition.fromStatement(XDI3Statement.fromLiteralComponents(
				XDI3Segment.create("{$msg}" + XDIAuthenticationConstants.XRI_S_SECRET_TOKEN_VALID + "&"), 
		Condition condition = GenericCondition.fromStatement(XDI3Statement.fromLiteralComponents(
				XDI3Segment.create("{$msg}" + XDIAuthenticationConstants.XRI_S_SIGNATURE_VALID + "&"), 

Policy policy  XDI3Segment sender
core/src/main/java/xdi2/core/features/linkcontracts/policy/PolicyUtil.java
XDI3Segment.create("{$from
Operator createSenderIsOperator(Policy policy, XDI3Segment sender)
@@ -6,8 +6,8 @@
 import xdi2.core.features.linkcontracts.condition.IsCondition;
 import xdi2.core.features.linkcontracts.operator.Operator;
 import xdi2.core.features.linkcontracts.operator.TrueOperator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIStatement;
 
 /**
  * Various utility methods for working with XDI policies.
@@ -22,28 +22,28 @@ private PolicyUtil() { }
 	 * Helper methods to create various XDI policy statements.
 	 */
 
-	public static Operator createSenderIsOperator(Policy policy, XDI3Segment sender) {
+	public static Operator createSenderIsOperator(Policy policy, XDIAddress sender) {
 
 		Condition condition = IsCondition.fromSubjectAndObject(
-				XDI3Segment.create("{$from}"), 
+				XDIAddress.create("{$from}"), 
 				sender);
 
 		return TrueOperator.createTrueOperator(policy, condition);
 	}
 
 	public static Operator createSecretTokenValidOperator(Policy policy) {
 
-		Condition condition = GenericCondition.fromStatement(XDI3Statement.fromLiteralComponents(
-				XDI3Segment.create("{$msg}" + XDIAuthenticationConstants.XRI_S_SECRET_TOKEN_VALID + "&"), 
+		Condition condition = GenericCondition.fromStatement(XDIStatement.fromLiteralComponents(
+				XDIAddress.create("{$msg}" + XDIAuthenticationConstants.XDI_ADD_SECRET_TOKEN_VALID + "&"), 
 				Boolean.TRUE));
 
 		return TrueOperator.createTrueOperator(policy, condition);
 	}
 
 	public static Operator createSignatureValidOperator(Policy policy) {
 
-		Condition condition = GenericCondition.fromStatement(XDI3Statement.fromLiteralComponents(
-				XDI3Segment.create("{$msg}" + XDIAuthenticationConstants.XRI_S_SIGNATURE_VALID + "&"), 
+		Condition condition = GenericCondition.fromStatement(XDIStatement.fromLiteralComponents(
+				XDIAddress.create("{$msg}" + XDIAuthenticationConstants.XDI_ADD_SIGNATURE_VALID + "&"), 
 				Boolean.TRUE));
 
 		return TrueOperator.createTrueOperator(policy, condition);

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Flinkcontracts%2Fpolicy%2FPolicyUtil.java
312fc5a05120e62a15b5e55cf9ba5c2a9e30ef29
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractCollection.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractCollection.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiAbstractCollection.java
import xdi2.core.syntax.XDIArc;
	public static boolean isValidarc(XDIArc arc) {
		return XdiEntityCollection.isValidarc(arc) || 
				XdiAttributeCollection.isValidarc(arc);
	public U setXdiMemberUnordered(XDIArc arc) {
		if (arc == null) arc = XdiAbstractMemberUnordered.createRandomUuidarc(attribute);
		ContextNode memberContextNode = this.getContextNode().setContextNode(arc);
	public U getXdiMemberUnordered(XDIArc arc) {
		ContextNode memberContextNode = this.getContextNode().getContextNode(arc, false);
		XDIArc arc = XdiAbstractMemberOrdered.createarc(Long.toString(index), attribute);
		ContextNode contextNode = this.getContextNode().setContextNode(arc);
		XDIArc arc = XdiAbstractMemberOrdered.createarc(Long.toString(index), attribute);
		ContextNode contextNode = this.getContextNode().getContextNode(arc, false);

import xdi2.core.xri3.XDI3SubSegment;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		return XdiEntityCollection.isValidArcXri(arcXri) || 
				XdiAttributeCollection.isValidArcXri(arcXri);
	public U setXdiMemberUnordered(XDI3SubSegment arcXri) {
		if (arcXri == null) arcXri = XdiAbstractMemberUnordered.createRandomUuidArcXri(attribute);
		ContextNode memberContextNode = this.getContextNode().setContextNode(arcXri);
	public U getXdiMemberUnordered(XDI3SubSegment arcXri) {
		ContextNode memberContextNode = this.getContextNode().getContextNode(arcXri, false);
		XDI3SubSegment arcXri = XdiAbstractMemberOrdered.createArcXri(Long.toString(index), attribute);
		ContextNode contextNode = this.getContextNode().setContextNode(arcXri);
		XDI3SubSegment arcXri = XdiAbstractMemberOrdered.createArcXri(Long.toString(index), attribute);
		ContextNode contextNode = this.getContextNode().getContextNode(arcXri, false);

@@ -9,6 +9,7 @@
 
 import xdi2.core.ContextNode;
 import xdi2.core.features.nodetypes.XdiAbstractMemberUnordered.MappingContextNodeXdiMemberUnorderedIterator;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.CastingIterator;
 import xdi2.core.util.iterators.CompositeIterator;
 import xdi2.core.util.iterators.IteratorCounter;
@@ -17,7 +18,6 @@
 import xdi2.core.util.iterators.NoDuplicatesIterator;
 import xdi2.core.util.iterators.NotNullIterator;
 import xdi2.core.util.iterators.ReadOnlyIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 public abstract class XdiAbstractCollection<EQC extends XdiCollection<EQC, EQI, C, U, O, I>, EQI extends XdiSubGraph<EQI>, C extends XdiCollection<EQC, EQI, C, U, O, I>, U extends XdiMemberUnordered<EQC, EQI, C, U, O, I>, O extends XdiMemberOrdered<EQC, EQI, C, U, O, I>, I extends XdiMember<EQC, EQI, C, U, O, I>> extends XdiAbstractSubGraph<EQC> implements XdiCollection<EQC, EQI, C, U, O, I> {
 
@@ -74,10 +74,10 @@ public static boolean isValid(ContextNode contextNode) {
 	 * Methods for XRIs
 	 */
 
-	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
+	public static boolean isValidarc(XDIArc arc) {
 
-		return XdiEntityCollection.isValidArcXri(arcXri) || 
-				XdiAttributeCollection.isValidArcXri(arcXri);
+		return XdiEntityCollection.isValidarc(arc) || 
+				XdiAttributeCollection.isValidarc(arc);
 	}
 
 	/*
@@ -89,13 +89,13 @@ public static boolean isValidArcXri(XDI3SubSegment arcXri) {
 	 * @return The XDI instance.
 	 */
 	@Override
-	public U setXdiMemberUnordered(XDI3SubSegment arcXri) {
+	public U setXdiMemberUnordered(XDIArc arc) {
 
 		boolean attribute = this.attribute();
 
-		if (arcXri == null) arcXri = XdiAbstractMemberUnordered.createRandomUuidArcXri(attribute);
+		if (arc == null) arc = XdiAbstractMemberUnordered.createRandomUuidarc(attribute);
 
-		ContextNode memberContextNode = this.getContextNode().setContextNode(arcXri);
+		ContextNode memberContextNode = this.getContextNode().setContextNode(arc);
 
 		return XdiAbstractContext.fromContextNode(memberContextNode, this.getU());
 	}
@@ -105,9 +105,9 @@ public U setXdiMemberUnordered(XDI3SubSegment arcXri) {
 	 * @return The XDI instance.
 	 */
 	@Override
-	public U getXdiMemberUnordered(XDI3SubSegment arcXri) {
+	public U getXdiMemberUnordered(XDIArc arc) {
 		
-		ContextNode memberContextNode = this.getContextNode().getContextNode(arcXri, false);
+		ContextNode memberContextNode = this.getContextNode().getContextNode(arc, false);
 		if (memberContextNode == null) return null;
 
 		return XdiAbstractContext.fromContextNode(memberContextNode, this.getU());
@@ -143,9 +143,9 @@ public O setXdiMemberOrdered(long index) {
 
 		if (index < 0) index = this.getXdiMembersOrderedCount();
 
-		XDI3SubSegment arcXri = XdiAbstractMemberOrdered.createArcXri(Long.toString(index), attribute);
+		XDIArc arc = XdiAbstractMemberOrdered.createarc(Long.toString(index), attribute);
 
-		ContextNode contextNode = this.getContextNode().setContextNode(arcXri);
+		ContextNode contextNode = this.getContextNode().setContextNode(arc);
 
 		return XdiAbstractContext.fromContextNode(contextNode, this.getO());
 	}
@@ -159,9 +159,9 @@ public O getXdiMemberOrdered(long index) {
 
 		boolean attribute = this.attribute();
 
-		XDI3SubSegment arcXri = XdiAbstractMemberOrdered.createArcXri(Long.toString(index), attribute);
+		XDIArc arc = XdiAbstractMemberOrdered.createarc(Long.toString(index), attribute);
 
-		ContextNode contextNode = this.getContextNode().getContextNode(arcXri, false);
+		ContextNode contextNode = this.getContextNode().getContextNode(arc, false);
 		if (contextNode == null) return null;
 
 		return XdiAbstractContext.fromContextNode(contextNode, this.getO());

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractCollection.java
0dd56bdab59056d2f3310b5bc619c1ea62ba2831
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractContext.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractContext.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiAbstractContext.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
	 * Returns the "base" arc, without context node type syntax.
	 * @param arc The arc of a context node.
	 * @return The "base" arc.
	public static XDIArc getBasearc(XDIArc arc) {
		if (arc.hasCs()) buffer.append(arc.getCs());
		if (arc.hasLiteral()) buffer.append(arc.getLiteral());
		if (arc.hasXRef()) buffer.append(arc.getXRef());
		return XDIArc.create(buffer.toString());
	public XDIAddress getXri() {
		return this.getContextNode().getAddress();
	public XDIArc getArc() {
		return this.getContextNode().getArc();
	 * Returns the "base" arc, without context node type syntax.
	 * @return The "base" arc.
	public XDIArc getBasearc() {
		return getBasearc(this.getArc());
		return XdiLocalRoot.findLocalRoot(this.getGraph()).getRoot(this.getContextNode().getAddress(), false);
	public XdiInnerRoot getXdiInnerRoot(XDIAddress innerRootPredicateXri, boolean create) {
		XDIAddress innerRootSubjectXri = xdiRoot.absoluteToRelativeXri(this.getContextNode().getAddress());
	public XdiEntityCollection getXdiEntityCollection(XDIArc arc, boolean create) {
		ContextNode entityCollectionContextNode = create ? this.getContextNode().setContextNode(arc) : this.getContextNode().getContextNode(arc, false);
	public XdiEntityCollection getXdiEntityCollection(XDIAddress xri, boolean create) {
	public XdiAttributeCollection getXdiAttributeCollection(XDIArc arc, boolean create) {
		ContextNode attributeCollectionContextNode = create ? this.getContextNode().setContextNode(arc) : this.getContextNode().getContextNode(arc, false);
	public XdiAttributeCollection getXdiAttributeCollection(XDIAddress xri, boolean create) {
	public XdiEntitySingleton getXdiEntitySingleton(XDIArc arc, boolean create) {
		ContextNode entitySingletonContextNode = create ? this.getContextNode().setContextNode(arc) : this.getContextNode().getContextNode(arc, false);
	public XdiEntitySingleton getXdiEntitySingleton(XDIAddress xri, boolean create) {
	public XdiAttributeSingleton getXdiAttributeSingleton(XDIArc arc, boolean create) {
		ContextNode attributeSingletonContextNode = create ? this.getContextNode().setContextNode(arc) : this.getContextNode().getContextNode(arc, false);
	public XdiAttributeSingleton getXdiAttributeSingleton(XDIAddress xri, boolean create) {
	public XdiEntity getXdiEntity(XDIArc arc, boolean create) {
		ContextNode entityContextNode = create ? this.getContextNode().setContextNode(arc) : this.getContextNode().getContextNode(arc, false);
	public XdiEntity getXdiEntity(XDIAddress xri, boolean create) {
	public XdiAttribute getXdiAttribute(XDIArc arc, boolean create) {
		ContextNode attributeContextNode = create ? this.getContextNode().setContextNode(arc) : this.getContextNode().getContextNode(arc, false);
	public XdiAttribute getXdiAttribute(XDIAddress xri, boolean create) {

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
	 * Returns the "base" arc XRI, without context node type syntax.
	 * @param arcXri The arc XRI of a context node.
	 * @return The "base" arc XRI.
	public static XDI3SubSegment getBaseArcXri(XDI3SubSegment arcXri) {
		if (arcXri.hasCs()) buffer.append(arcXri.getCs());
		if (arcXri.hasLiteral()) buffer.append(arcXri.getLiteral());
		if (arcXri.hasXRef()) buffer.append(arcXri.getXRef());
		return XDI3SubSegment.create(buffer.toString());
	public XDI3Segment getXri() {
		return this.getContextNode().getXri();
	public XDI3SubSegment getArcXri() {
		return this.getContextNode().getArcXri();
	 * Returns the "base" arc XRI, without context node type syntax.
	 * @return The "base" arc XRI.
	public XDI3SubSegment getBaseArcXri() {
		return getBaseArcXri(this.getArcXri());
		return XdiLocalRoot.findLocalRoot(this.getGraph()).getRoot(this.getContextNode().getXri(), false);
	public XdiInnerRoot getXdiInnerRoot(XDI3Segment innerRootPredicateXri, boolean create) {
		XDI3Segment innerRootSubjectXri = xdiRoot.absoluteToRelativeXri(this.getContextNode().getXri());
	public XdiEntityCollection getXdiEntityCollection(XDI3SubSegment arcXri, boolean create) {
		ContextNode entityCollectionContextNode = create ? this.getContextNode().setContextNode(arcXri) : this.getContextNode().getContextNode(arcXri, false);
	public XdiEntityCollection getXdiEntityCollection(XDI3Segment xri, boolean create) {
	public XdiAttributeCollection getXdiAttributeCollection(XDI3SubSegment arcXri, boolean create) {
		ContextNode attributeCollectionContextNode = create ? this.getContextNode().setContextNode(arcXri) : this.getContextNode().getContextNode(arcXri, false);
	public XdiAttributeCollection getXdiAttributeCollection(XDI3Segment xri, boolean create) {
	public XdiEntitySingleton getXdiEntitySingleton(XDI3SubSegment arcXri, boolean create) {
		ContextNode entitySingletonContextNode = create ? this.getContextNode().setContextNode(arcXri) : this.getContextNode().getContextNode(arcXri, false);
	public XdiEntitySingleton getXdiEntitySingleton(XDI3Segment xri, boolean create) {
	public XdiAttributeSingleton getXdiAttributeSingleton(XDI3SubSegment arcXri, boolean create) {
		ContextNode attributeSingletonContextNode = create ? this.getContextNode().setContextNode(arcXri) : this.getContextNode().getContextNode(arcXri, false);
	public XdiAttributeSingleton getXdiAttributeSingleton(XDI3Segment xri, boolean create) {
	public XdiEntity getXdiEntity(XDI3SubSegment arcXri, boolean create) {
		ContextNode entityContextNode = create ? this.getContextNode().setContextNode(arcXri) : this.getContextNode().getContextNode(arcXri, false);
	public XdiEntity getXdiEntity(XDI3Segment xri, boolean create) {
	public XdiAttribute getXdiAttribute(XDI3SubSegment arcXri, boolean create) {
		ContextNode attributeContextNode = create ? this.getContextNode().setContextNode(arcXri) : this.getContextNode().getContextNode(arcXri, false);
	public XdiAttribute getXdiAttribute(XDI3Segment xri, boolean create) {

@@ -6,9 +6,9 @@
 import xdi2.core.ContextNode;
 import xdi2.core.Graph;
 import xdi2.core.features.equivalence.Equivalence;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.MappingIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
 
 /**
  * An XDI subgraph according to the multiplicity pattern, represented as a context node.
@@ -75,19 +75,19 @@ public static <T extends XdiContext<?>> T fromContextNode(ContextNode contextNod
 	}
 
 	/**
-	 * Returns the "base" arc XRI, without context node type syntax.
-	 * @param arcXri The arc XRI of a context node.
-	 * @return The "base" arc XRI.
+	 * Returns the "base" arc, without context node type syntax.
+	 * @param arc The arc of a context node.
+	 * @return The "base" arc.
 	 */
-	public static XDI3SubSegment getBaseArcXri(XDI3SubSegment arcXri) {
+	public static XDIArc getBasearc(XDIArc arc) {
 
 		StringBuilder buffer = new StringBuilder();
 
-		if (arcXri.hasCs()) buffer.append(arcXri.getCs());
-		if (arcXri.hasLiteral()) buffer.append(arcXri.getLiteral());
-		if (arcXri.hasXRef()) buffer.append(arcXri.getXRef());
+		if (arc.hasCs()) buffer.append(arc.getCs());
+		if (arc.hasLiteral()) buffer.append(arc.getLiteral());
+		if (arc.hasXRef()) buffer.append(arc.getXRef());
 
-		return XDI3SubSegment.create(buffer.toString());
+		return XDIArc.create(buffer.toString());
 	}
 
 	/*
@@ -107,25 +107,25 @@ public Graph getGraph() {
 	}
 
 	@Override
-	public XDI3Segment getXri() {
+	public XDIAddress getXri() {
 
-		return this.getContextNode().getXri();
+		return this.getContextNode().getAddress();
 	}
 
 	@Override
-	public XDI3SubSegment getArcXri() {
+	public XDIArc getArc() {
 
-		return this.getContextNode().getArcXri();
+		return this.getContextNode().getArc();
 	}
 
 	/**
-	 * Returns the "base" arc XRI, without context node type syntax.
-	 * @return The "base" arc XRI.
+	 * Returns the "base" arc, without context node type syntax.
+	 * @return The "base" arc.
 	 */
 	@Override
-	public XDI3SubSegment getBaseArcXri() {
+	public XDIArc getBasearc() {
 
-		return getBaseArcXri(this.getArcXri());
+		return getBasearc(this.getArc());
 	}
 
 	@Override
@@ -181,7 +181,7 @@ public EQ map(ContextNode identityContextNode) {
 	@Override
 	public XdiRoot findRoot() {
 
-		return XdiLocalRoot.findLocalRoot(this.getGraph()).getRoot(this.getContextNode().getXri(), false);
+		return XdiLocalRoot.findLocalRoot(this.getGraph()).getRoot(this.getContextNode().getAddress(), false);
 	}
 
 	@Override
@@ -191,26 +191,26 @@ public XdiLocalRoot findLocalRoot() {
 	}
 
 	@Override
-	public XdiInnerRoot getXdiInnerRoot(XDI3Segment innerRootPredicateXri, boolean create) {
+	public XdiInnerRoot getXdiInnerRoot(XDIAddress innerRootPredicateXri, boolean create) {
 
 		XdiRoot xdiRoot = this.findRoot();
 
-		XDI3Segment innerRootSubjectXri = xdiRoot.absoluteToRelativeXri(this.getContextNode().getXri());
+		XDIAddress innerRootSubjectXri = xdiRoot.absoluteToRelativeXri(this.getContextNode().getAddress());
 
 		return xdiRoot.getInnerRoot(innerRootSubjectXri, innerRootPredicateXri, create);
 	}
 
 	@Override
-	public XdiEntityCollection getXdiEntityCollection(XDI3SubSegment arcXri, boolean create) {
+	public XdiEntityCollection getXdiEntityCollection(XDIArc arc, boolean create) {
 
-		ContextNode entityCollectionContextNode = create ? this.getContextNode().setContextNode(arcXri) : this.getContextNode().getContextNode(arcXri, false);
+		ContextNode entityCollectionContextNode = create ? this.getContextNode().setContextNode(arc) : this.getContextNode().getContextNode(arc, false);
 		if (entityCollectionContextNode == null) return null;
 
 		return XdiEntityCollection.fromContextNode(entityCollectionContextNode);
 	}
 
 	@Override
-	public XdiEntityCollection getXdiEntityCollection(XDI3Segment xri, boolean create) {
+	public XdiEntityCollection getXdiEntityCollection(XDIAddress xri, boolean create) {
 
 		ContextNode entityCollectionContextNode = create ? this.getContextNode().setDeepContextNode(xri) : this.getContextNode().getDeepContextNode(xri, false);
 		if (entityCollectionContextNode == null) return null;
@@ -219,16 +219,16 @@ public XdiEntityCollection getXdiEntityCollection(XDI3Segment xri, boolean creat
 	}
 
 	@Override
-	public XdiAttributeCollection getXdiAttributeCollection(XDI3SubSegment arcXri, boolean create) {
+	public XdiAttributeCollection getXdiAttributeCollection(XDIArc arc, boolean create) {
 
-		ContextNode attributeCollectionContextNode = create ? this.getContextNode().setContextNode(arcXri) : this.getContextNode().getContextNode(arcXri, false);
+		ContextNode attributeCollectionContextNode = create ? this.getContextNode().setContextNode(arc) : this.getContextNode().getContextNode(arc, false);
 		if (attributeCollectionContextNode == null) return null;
 
 		return XdiAttributeCollection.fromContextNode(attributeCollectionContextNode);
 	}
 
 	@Override
-	public XdiAttributeCollection getXdiAttributeCollection(XDI3Segment xri, boolean create) {
+	public XdiAttributeCollection getXdiAttributeCollection(XDIAddress xri, boolean create) {
 
 		ContextNode attributeCollectionContextNode = create ? this.getContextNode().setDeepContextNode(xri) : this.getContextNode().getDeepContextNode(xri, false);
 		if (attributeCollectionContextNode == null) return null;
@@ -237,16 +237,16 @@ public XdiAttributeCollection getXdiAttributeCollection(XDI3Segment xri, boolean
 	}
 
 	@Override
-	public XdiEntitySingleton getXdiEntitySingleton(XDI3SubSegment arcXri, boolean create) {
+	public XdiEntitySingleton getXdiEntitySingleton(XDIArc arc, boolean create) {
 
-		ContextNode entitySingletonContextNode = create ? this.getContextNode().setContextNode(arcXri) : this.getContextNode().getContextNode(arcXri, false);
+		ContextNode entitySingletonContextNode = create ? this.getContextNode().setContextNode(arc) : this.getContextNode().getContextNode(arc, false);
 		if (entitySingletonContextNode == null) return null;
 
 		return XdiEntitySingleton.fromContextNode(entitySingletonContextNode);
 	}
 
 	@Override
-	public XdiEntitySingleton getXdiEntitySingleton(XDI3Segment xri, boolean create) {
+	public XdiEntitySingleton getXdiEntitySingleton(XDIAddress xri, boolean create) {
 
 		ContextNode entitySingletonContextNode = create ? this.getContextNode().setDeepContextNode(xri) : this.getContextNode().getDeepContextNode(xri, false);
 		if (entitySingletonContextNode == null) return null;
@@ -255,16 +255,16 @@ public XdiEntitySingleton getXdiEntitySingleton(XDI3Segment xri, boolean create)
 	}
 
 	@Override
-	public XdiAttributeSingleton getXdiAttributeSingleton(XDI3SubSegment arcXri, boolean create) {
+	public XdiAttributeSingleton getXdiAttributeSingleton(XDIArc arc, boolean create) {
 
-		ContextNode attributeSingletonContextNode = create ? this.getContextNode().setContextNode(arcXri) : this.getContextNode().getContextNode(arcXri, false);
+		ContextNode attributeSingletonContextNode = create ? this.getContextNode().setContextNode(arc) : this.getContextNode().getContextNode(arc, false);
 		if (attributeSingletonContextNode == null) return null;
 
 		return XdiAttributeSingleton.fromContextNode(attributeSingletonContextNode);
 	}
 
 	@Override
-	public XdiAttributeSingleton getXdiAttributeSingleton(XDI3Segment xri, boolean create) {
+	public XdiAttributeSingleton getXdiAttributeSingleton(XDIAddress xri, boolean create) {
 
 		ContextNode attributeSingletonContextNode = create ? this.getContextNode().setDeepContextNode(xri) : this.getContextNode().getDeepContextNode(xri, false);
 		if (attributeSingletonContextNode == null) return null;
@@ -273,16 +273,16 @@ public XdiAttributeSingleton getXdiAttributeSingleton(XDI3Segment xri, boolean c
 	}
 
 	@Override
-	public XdiEntity getXdiEntity(XDI3SubSegment arcXri, boolean create) {
+	public XdiEntity getXdiEntity(XDIArc arc, boolean create) {
 
-		ContextNode entityContextNode = create ? this.getContextNode().setContextNode(arcXri) : this.getContextNode().getContextNode(arcXri, false);
+		ContextNode entityContextNode = create ? this.getContextNode().setContextNode(arc) : this.getContextNode().getContextNode(arc, false);
 		if (entityContextNode == null) return null;
 
 		return XdiAbstractEntity.fromContextNode(entityContextNode);
 	}
 
 	@Override
-	public XdiEntity getXdiEntity(XDI3Segment xri, boolean create) {
+	public XdiEntity getXdiEntity(XDIAddress xri, boolean create) {
 
 		ContextNode entityContextNode = create ? this.getContextNode().setDeepContextNode(xri) : this.getContextNode().getDeepContextNode(xri, false);
 		if (entityContextNode == null) return null;
@@ -291,16 +291,16 @@ public XdiEntity getXdiEntity(XDI3Segment xri, boolean create) {
 	}
 
 	@Override
-	public XdiAttribute getXdiAttribute(XDI3SubSegment arcXri, boolean create) {
+	public XdiAttribute getXdiAttribute(XDIArc arc, boolean create) {
 
-		ContextNode attributeContextNode = create ? this.getContextNode().setContextNode(arcXri) : this.getContextNode().getContextNode(arcXri, false);
+		ContextNode attributeContextNode = create ? this.getContextNode().setContextNode(arc) : this.getContextNode().getContextNode(arc, false);
 		if (attributeContextNode == null) return null;
 
 		return XdiAbstractAttribute.fromContextNode(attributeContextNode);
 	}
 
 	@Override
-	public XdiAttribute getXdiAttribute(XDI3Segment xri, boolean create) {
+	public XdiAttribute getXdiAttribute(XDIAddress xri, boolean create) {
 
 		ContextNode attributeContextNode = create ? this.getContextNode().setDeepContextNode(xri) : this.getContextNode().getDeepContextNode(xri, false);
 		if (attributeContextNode == null) return null;

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractContext.java
68cfd883c747122b05078b72159c46ca66af0a6b
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractMemberOrdered.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractMemberOrdered.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiAbstractMemberOrdered.java
import xdi2.core.syntax.XDIArc;
	public static XDIArc createarc(String identifier, boolean attribute) {
		return XDIArc.create("" + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(0)) : "") + XDIConstants.CS_MEMBER_ORDERED + identifier + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(1)) : ""));
	public static boolean isValidarc(XDIArc arc, boolean attribute) {
		if (arc == null) return false;
		if (arc.isClassXs()) return false;
		if (attribute && ! arc.isAttributeXs()) return false;
		if (! attribute && arc.isAttributeXs()) return false;
		if (arc.hasXRef()) return false;
		if (! XDIConstants.CS_MEMBER_ORDERED.equals(arc.getCs())) return false;
		if (! arc.hasLiteral()) return false;

import xdi2.core.xri3.XDI3SubSegment;
	public static XDI3SubSegment createArcXri(String identifier, boolean attribute) {
		return XDI3SubSegment.create("" + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(0)) : "") + XDIConstants.CS_MEMBER_ORDERED + identifier + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(1)) : ""));
	public static boolean isValidArcXri(XDI3SubSegment arcXri, boolean attribute) {
		if (arcXri == null) return false;
		if (arcXri.isClassXs()) return false;
		if (attribute && ! arcXri.isAttributeXs()) return false;
		if (! attribute && arcXri.isAttributeXs()) return false;
		if (arcXri.hasXRef()) return false;
		if (! XDIConstants.CS_MEMBER_ORDERED.equals(arcXri.getCs())) return false;
		if (! arcXri.hasLiteral()) return false;

@@ -4,9 +4,9 @@
 
 import xdi2.core.ContextNode;
 import xdi2.core.constants.XDIConstants;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 public abstract class XdiAbstractMemberOrdered<EQC extends XdiCollection<EQC, EQI, C, U, O, I>, EQI extends XdiSubGraph<EQI>, C extends XdiCollection<EQC, EQI, C, U, O, I>, U extends XdiMemberUnordered<EQC, EQI, C, U, O, I>, O extends XdiMemberOrdered<EQC, EQI, C, U, O, I>, I extends XdiMember<EQC, EQI, C, U, O, I>> extends XdiAbstractMember<EQC, EQI, C, U, O, I> implements XdiMemberOrdered<EQC, EQI, C, U, O, I> {
 
@@ -53,23 +53,23 @@ public static boolean isValid(ContextNode contextNode) {
 	 * Methods for XRIs
 	 */
 
-	public static XDI3SubSegment createArcXri(String identifier, boolean attribute) {
+	public static XDIArc createarc(String identifier, boolean attribute) {
 
-		return XDI3SubSegment.create("" + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(0)) : "") + XDIConstants.CS_MEMBER_ORDERED + identifier + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(1)) : ""));
+		return XDIArc.create("" + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(0)) : "") + XDIConstants.CS_MEMBER_ORDERED + identifier + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(1)) : ""));
 	}
 
-	public static boolean isValidArcXri(XDI3SubSegment arcXri, boolean attribute) {
+	public static boolean isValidarc(XDIArc arc, boolean attribute) {
 
-		if (arcXri == null) return false;
+		if (arc == null) return false;
 
-		if (arcXri.isClassXs()) return false;
-		if (attribute && ! arcXri.isAttributeXs()) return false;
-		if (! attribute && arcXri.isAttributeXs()) return false;
-		if (arcXri.hasXRef()) return false;
+		if (arc.isClassXs()) return false;
+		if (attribute && ! arc.isAttributeXs()) return false;
+		if (! attribute && arc.isAttributeXs()) return false;
+		if (arc.hasXRef()) return false;
 
-		if (! XDIConstants.CS_MEMBER_ORDERED.equals(arcXri.getCs())) return false;
+		if (! XDIConstants.CS_MEMBER_ORDERED.equals(arc.getCs())) return false;
 
-		if (! arcXri.hasLiteral()) return false;
+		if (! arc.hasLiteral()) return false;
 
 		return true;
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractMemberOrdered.java
6eed644d396c3ed25b2b4d3e0919c4e64f1798b6
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractMemberUnordered.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractMemberUnordered.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiAbstractMemberUnordered.java
import xdi2.core.syntax.XDIArc;
	public static XDIArc createarc(String identifier, boolean attribute) {
		return XDIArc.create("" + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(0)) : "") + XDIConstants.CS_MEMBER_UNORDERED + identifier + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(1)) : ""));
	public static XDIArc createUuidarc(String uuid, boolean attribute) {
		return createarc(":uuid:" + uuid, attribute);
	public static XDIArc createRandomUuidarc(boolean attribute) {
		return createUuidarc(uuid, attribute);
	public static XDIArc createDigestarc(String string, boolean attribute, String algorithm) {
		return createarc(":" + algorithm.toLowerCase().replace("-", "") + ":" + hex, attribute);
	public static XDIArc createDigestarc(String string, boolean attribute) {
		return createDigestarc(string, attribute, "SHA-512");
	public static boolean isValidarc(XDIArc arc, boolean attribute) {
		if (arc == null) return false;
		if (arc.isClassXs()) return false;
		if (attribute && ! arc.isAttributeXs()) return false;
		if (! attribute && arc.isAttributeXs()) return false;
		if (arc.hasXRef()) return false;
		if (! XDIConstants.CS_MEMBER_UNORDERED.equals(arc.getCs())) return false;
		if (! arc.hasLiteral()) return false;

import xdi2.core.xri3.XDI3SubSegment;
	public static XDI3SubSegment createArcXri(String identifier, boolean attribute) {
		return XDI3SubSegment.create("" + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(0)) : "") + XDIConstants.CS_MEMBER_UNORDERED + identifier + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(1)) : ""));
	public static XDI3SubSegment createUuidArcXri(String uuid, boolean attribute) {
		return createArcXri(":uuid:" + uuid, attribute);
	public static XDI3SubSegment createRandomUuidArcXri(boolean attribute) {
		return createUuidArcXri(uuid, attribute);
	public static XDI3SubSegment createDigestArcXri(String string, boolean attribute, String algorithm) {
		return createArcXri(":" + algorithm.toLowerCase().replace("-", "") + ":" + hex, attribute);
	public static XDI3SubSegment createDigestArcXri(String string, boolean attribute) {
		return createDigestArcXri(string, attribute, "SHA-512");
	public static boolean isValidArcXri(XDI3SubSegment arcXri, boolean attribute) {
		if (arcXri == null) return false;
		if (arcXri.isClassXs()) return false;
		if (attribute && ! arcXri.isAttributeXs()) return false;
		if (! attribute && arcXri.isAttributeXs()) return false;
		if (arcXri.hasXRef()) return false;
		if (! XDIConstants.CS_MEMBER_UNORDERED.equals(arcXri.getCs())) return false;
		if (! arcXri.hasLiteral()) return false;

@@ -9,9 +9,9 @@
 import xdi2.core.ContextNode;
 import xdi2.core.constants.XDIConstants;
 import xdi2.core.exceptions.Xdi2RuntimeException;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 public abstract class XdiAbstractMemberUnordered<EQC extends XdiCollection<EQC, EQI, C, U, O, I>, EQI extends XdiSubGraph<EQI>, C extends XdiCollection<EQC, EQI, C, U, O, I>, U extends XdiMemberUnordered<EQC, EQI, C, U, O, I>, O extends XdiMemberOrdered<EQC, EQI, C, U, O, I>, I extends XdiMember<EQC, EQI, C, U, O, I>> extends XdiAbstractMember<EQC, EQI, C, U, O, I> implements XdiMemberUnordered<EQC, EQI, C, U, O, I> {
 
@@ -58,24 +58,24 @@ public static boolean isValid(ContextNode contextNode) {
 	 * Methods for XRIs
 	 */
 
-	public static XDI3SubSegment createArcXri(String identifier, boolean attribute) {
+	public static XDIArc createarc(String identifier, boolean attribute) {
 
-		return XDI3SubSegment.create("" + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(0)) : "") + XDIConstants.CS_MEMBER_UNORDERED + identifier + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(1)) : ""));
+		return XDIArc.create("" + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(0)) : "") + XDIConstants.CS_MEMBER_UNORDERED + identifier + (attribute ? Character.valueOf(XDIConstants.XS_ATTRIBUTE.charAt(1)) : ""));
 	}
 
-	public static XDI3SubSegment createUuidArcXri(String uuid, boolean attribute) {
+	public static XDIArc createUuidarc(String uuid, boolean attribute) {
 
-		return createArcXri(":uuid:" + uuid, attribute);
+		return createarc(":uuid:" + uuid, attribute);
 	}
 
-	public static XDI3SubSegment createRandomUuidArcXri(boolean attribute) {
+	public static XDIArc createRandomUuidarc(boolean attribute) {
 
 		String uuid = UUID.randomUUID().toString().toLowerCase();
 
-		return createUuidArcXri(uuid, attribute);
+		return createUuidarc(uuid, attribute);
 	}
 
-	public static XDI3SubSegment createDigestArcXri(String string, boolean attribute, String algorithm) {
+	public static XDIArc createDigestarc(String string, boolean attribute, String algorithm) {
 
 		byte[] output;
 
@@ -91,26 +91,26 @@ public static XDI3SubSegment createDigestArcXri(String string, boolean attribute
 
 		String hex = new String(Hex.encodeHex(output));
 
-		return createArcXri(":" + algorithm.toLowerCase().replace("-", "") + ":" + hex, attribute);
+		return createarc(":" + algorithm.toLowerCase().replace("-", "") + ":" + hex, attribute);
 	}
 
-	public static XDI3SubSegment createDigestArcXri(String string, boolean attribute) {
+	public static XDIArc createDigestarc(String string, boolean attribute) {
 
-		return createDigestArcXri(string, attribute, "SHA-512");
+		return createDigestarc(string, attribute, "SHA-512");
 	}
 
-	public static boolean isValidArcXri(XDI3SubSegment arcXri, boolean attribute) {
+	public static boolean isValidarc(XDIArc arc, boolean attribute) {
 
-		if (arcXri == null) return false;
+		if (arc == null) return false;
 
-		if (arcXri.isClassXs()) return false;
-		if (attribute && ! arcXri.isAttributeXs()) return false;
-		if (! attribute && arcXri.isAttributeXs()) return false;
-		if (arcXri.hasXRef()) return false;
+		if (arc.isClassXs()) return false;
+		if (attribute && ! arc.isAttributeXs()) return false;
+		if (! attribute && arc.isAttributeXs()) return false;
+		if (arc.hasXRef()) return false;
 
-		if (! XDIConstants.CS_MEMBER_UNORDERED.equals(arcXri.getCs())) return false;
+		if (! XDIConstants.CS_MEMBER_UNORDERED.equals(arc.getCs())) return false;
 
-		if (! arcXri.hasLiteral()) return false;
+		if (! arc.hasLiteral()) return false;
 
 		return true;
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractMemberUnordered.java
21222483a9287a23387ce4ab9a01f6f9571deff0
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractRoot.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractRoot.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiAbstractRoot.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.syntax.XDIStatement;
import xdi2.core.util.AddressUtil;
	public XdiPeerRoot getPeerRoot(XDIAddress xri, boolean create) {
		XDIArc peerRootarc = XdiPeerRoot.createPeerRootArc(xri);
		ContextNode peerRootContextNode = create ? this.getContextNode().setContextNode(peerRootarc) : this.getContextNode().getContextNode(peerRootarc, false);
	public XdiInnerRoot getInnerRoot(XDIAddress subject, XDIAddress predicate, boolean create) {
		XDIArc innerRootarc = XdiInnerRoot.createInnerRootarc(subject, predicate);
		ContextNode innerRootContextNode = create ? this.getContextNode().setContextNode(innerRootarc) : this.getContextNode().getContextNode(innerRootarc, false);
	public XdiRoot getRoot(XDIAddress xri, boolean create) {
		for (int i=0; i<xri.getNumArcs(); i++) {
			XDIArc subSegment = xri.getArc(i);
			if (XdiPeerRoot.isPeerRootArc(subSegment)) {
			} if (XdiInnerRoot.isInnerRootarc(subSegment)) {
				Relation relation = create ? contextNode.setRelation(XdiInnerRoot.getPredicateOfInnerRootXri(subSegment), innerRootContextNode.getAddress()) : contextNode.getRelation(XdiInnerRoot.getPredicateOfInnerRootXri(subSegment), innerRootContextNode.getAddress());
	public XDIAddress absoluteToRelativeXri(XDIAddress absoluteXri) {
		XDIAddress relativeXri = AddressUtil.removeStartXri(absoluteXri, this.getContextNode().getAddress());
	public XDIAddress relativeToAbsoluteXri(XDIAddress relativeXri) {
		XDIAddress absoluteXri = AddressUtil.concatAddresses(this.getContextNode().getAddress(), relativeXri);
	public XDIStatement absoluteToRelativeStatementXri(XDIStatement absoluteStatementXri) {
		XDIStatement relativeStatementXri = StatementUtil.removeStartAddressStatement(absoluteStatementXri, this.getContextNode().getAddress());
	public XDIStatement relativeToAbsoluteStatementXri(XDIStatement relativeStatementXri) {
		XDIStatement absoluteStatementXri = StatementUtil.concatAddressStatement(this.getContextNode().getAddress(), relativeStatementXri);
	 * @param arc An XDI root XRI.
	public static boolean isRootarc(XDIArc arc) {
		if (log.isTraceEnabled()) log.trace("isRootarc(" + arc + ")");
		if (XdiPeerRoot.isPeerRootArc(arc)) return true;
		if (XdiInnerRoot.isInnerRootarc(arc)) return true;

XDIAddress xri  boolean create
core/src/main/java/xdi2/core/features/nodetypes/XdiAbstractRoot.java
XDIArc peerRootarc = XdiPeerRoot.createPeerRootArc(xri);
		ContextNode peerRootContextNode = create ? this.getContextNode().setContextNode(peerRootarc) : this.getContextNode().getContextNode(peerRootarc, false);
	public XdiInnerRoot getInnerRoot(XDIAddress subject, XDIAddress predicate, boolean create) {
		XDIArc innerRootarc = XdiInnerRoot.createInnerRootarc(subject, predicate);
		ContextNode innerRootContextNode = create ? this.getContextNode().setContextNode(innerRootarc) : this.getContextNode().getContextNode(innerRootarc, false);
	public XdiRoot getRoot(XDIAddress xri, boolean create) {
		for (int i=0; i<xri.getNumArcs(); i++) {
			XDIArc subSegment = xri.getArc(i);
			if (XdiPeerRoot.isPeerRootArc(subSegment)) {
XdiPeerRoot getPeerRoot(XDIAddress xri, boolean create)
import xdi2.core.util.XDI3Util;
import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
import xdi2.core.xri3.XDI3SubSegment;
	public XdiPeerRoot getPeerRoot(XDI3Segment xri, boolean create) {
		XDI3SubSegment peerRootArcXri = XdiPeerRoot.createPeerRootArcXri(xri);
		ContextNode peerRootContextNode = create ? this.getContextNode().setContextNode(peerRootArcXri) : this.getContextNode().getContextNode(peerRootArcXri, false);
	public XdiInnerRoot getInnerRoot(XDI3Segment subject, XDI3Segment predicate, boolean create) {
		XDI3SubSegment innerRootArcXri = XdiInnerRoot.createInnerRootArcXri(subject, predicate);
		ContextNode innerRootContextNode = create ? this.getContextNode().setContextNode(innerRootArcXri) : this.getContextNode().getContextNode(innerRootArcXri, false);
	public XdiRoot getRoot(XDI3Segment xri, boolean create) {
		for (int i=0; i<xri.getNumSubSegments(); i++) {
			XDI3SubSegment subSegment = xri.getSubSegment(i);
			if (XdiPeerRoot.isPeerRootArcXri(subSegment)) {
			} if (XdiInnerRoot.isInnerRootArcXri(subSegment)) {
				Relation relation = create ? contextNode.setRelation(XdiInnerRoot.getPredicateOfInnerRootXri(subSegment), innerRootContextNode.getXri()) : contextNode.getRelation(XdiInnerRoot.getPredicateOfInnerRootXri(subSegment), innerRootContextNode.getXri());
	public XDI3Segment absoluteToRelativeXri(XDI3Segment absoluteXri) {
		XDI3Segment relativeXri = XDI3Util.removeStartXri(absoluteXri, this.getContextNode().getXri());
	public XDI3Segment relativeToAbsoluteXri(XDI3Segment relativeXri) {
		XDI3Segment absoluteXri = XDI3Util.concatXris(this.getContextNode().getXri(), relativeXri);
	public XDI3Statement absoluteToRelativeStatementXri(XDI3Statement absoluteStatementXri) {
		XDI3Statement relativeStatementXri = StatementUtil.removeStartXriStatement(absoluteStatementXri, this.getContextNode().getXri());
	public XDI3Statement relativeToAbsoluteStatementXri(XDI3Statement relativeStatementXri) {
		XDI3Statement absoluteStatementXri = StatementUtil.concatXriStatement(this.getContextNode().getXri(), relativeStatementXri);
	 * @param arcXri An XDI root XRI.
	public static boolean isRootArcXri(XDI3SubSegment arcXri) {
		if (log.isTraceEnabled()) log.trace("isRootArcXri(" + arcXri + ")");
		if (XdiPeerRoot.isPeerRootArcXri(arcXri)) return true;
		if (XdiInnerRoot.isInnerRootArcXri(arcXri)) return true;

XDI3Segment xri  boolean create
core/src/main/java/xdi2/core/features/nodetypes/XdiAbstractRoot.java
XDI3SubSegment peerRootArcXri = XdiPeerRoot.createPeerRootArcXri(xri);
		ContextNode peerRootContextNode = create ? this.getContextNode().setContextNode(peerRootArcXri) : this.getContextNode().getContextNode(peerRootArcXri, false);
	public XdiInnerRoot getInnerRoot(XDI3Segment subject, XDI3Segment predicate, boolean create) {
		XDI3SubSegment innerRootArcXri = XdiInnerRoot.createInnerRootArcXri(subject, predicate);
		ContextNode innerRootContextNode = create ? this.getContextNode().setContextNode(innerRootArcXri) : this.getContextNode().getContextNode(innerRootArcXri, false);
	public XdiRoot getRoot(XDI3Segment xri, boolean create) {
		for (int i=0; i<xri.getNumSubSegments(); i++) {
			XDI3SubSegment subSegment = xri.getSubSegment(i);
			if (XdiPeerRoot.isPeerRootArcXri(subSegment)) {
XdiPeerRoot getPeerRoot(XDI3Segment xri, boolean create)
@@ -5,11 +5,11 @@
 
 import xdi2.core.ContextNode;
 import xdi2.core.Relation;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.syntax.XDIStatement;
 import xdi2.core.util.StatementUtil;
-import xdi2.core.util.XDI3Util;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.util.AddressUtil;
 
 public abstract class XdiAbstractRoot extends XdiAbstractContext<XdiRoot> implements XdiRoot {
 
@@ -62,59 +62,59 @@ public static XdiRoot fromContextNode(ContextNode contextNode) {
 	 */
 
 	@Override
-	public XdiPeerRoot getPeerRoot(XDI3Segment xri, boolean create) {
+	public XdiPeerRoot getPeerRoot(XDIAddress xri, boolean create) {
 
 		if (log.isTraceEnabled()) log.trace("getPeerRoot(" + xri + "," + create + ")");
 
-		XDI3SubSegment peerRootArcXri = XdiPeerRoot.createPeerRootArcXri(xri);
+		XDIArc peerRootarc = XdiPeerRoot.createPeerRootArc(xri);
 
-		ContextNode peerRootContextNode = create ? this.getContextNode().setContextNode(peerRootArcXri) : this.getContextNode().getContextNode(peerRootArcXri, false);
+		ContextNode peerRootContextNode = create ? this.getContextNode().setContextNode(peerRootarc) : this.getContextNode().getContextNode(peerRootarc, false);
 		if (peerRootContextNode == null) return null;
 
 		return new XdiPeerRoot(peerRootContextNode);
 	}
 
 	@Override
-	public XdiInnerRoot getInnerRoot(XDI3Segment subject, XDI3Segment predicate, boolean create) {
+	public XdiInnerRoot getInnerRoot(XDIAddress subject, XDIAddress predicate, boolean create) {
 
 		if (log.isTraceEnabled()) log.trace("getInnerRoot(" + subject + "," + predicate + "," + create + ")");
 
-		XDI3SubSegment innerRootArcXri = XdiInnerRoot.createInnerRootArcXri(subject, predicate);
+		XDIArc innerRootarc = XdiInnerRoot.createInnerRootarc(subject, predicate);
 
-		ContextNode innerRootContextNode = create ? this.getContextNode().setContextNode(innerRootArcXri) : this.getContextNode().getContextNode(innerRootArcXri, false);
+		ContextNode innerRootContextNode = create ? this.getContextNode().setContextNode(innerRootarc) : this.getContextNode().getContextNode(innerRootarc, false);
 		if (innerRootContextNode == null) return null;
 
 		return new XdiInnerRoot(innerRootContextNode);
 	}
 
 	@Override
-	public XdiRoot getRoot(XDI3Segment xri, boolean create) {
+	public XdiRoot getRoot(XDIAddress xri, boolean create) {
 
 		if (log.isTraceEnabled()) log.trace("getRoot(" + xri + "," + create + ")");
 
 		XdiRoot root = this;
 
-		for (int i=0; i<xri.getNumSubSegments(); i++) {
+		for (int i=0; i<xri.getNumArcs(); i++) {
 
-			XDI3SubSegment subSegment = xri.getSubSegment(i);
+			XDIArc subSegment = xri.getArc(i);
 
 			XdiRoot nextRoot;
 
-			if (XdiPeerRoot.isPeerRootArcXri(subSegment)) {
+			if (XdiPeerRoot.isPeerRootArc(subSegment)) {
 
 				ContextNode peerRootContextNode = create ? root.getContextNode().setContextNode(subSegment) : root.getContextNode().getContextNode(subSegment, false);
 				if (peerRootContextNode == null) break;
 
 				nextRoot = new XdiPeerRoot(peerRootContextNode);
-			} if (XdiInnerRoot.isInnerRootArcXri(subSegment)) {
+			} if (XdiInnerRoot.isInnerRootarc(subSegment)) {
 
 				ContextNode innerRootContextNode = create ? root.getContextNode().setContextNode(subSegment) : root.getContextNode().getContextNode(subSegment, false);
 				if (innerRootContextNode == null) break;
 
 				ContextNode contextNode = create ? root.getContextNode().setDeepContextNode(XdiInnerRoot.getSubjectOfInnerRootXri(subSegment)) : root.getContextNode().getDeepContextNode(XdiInnerRoot.getSubjectOfInnerRootXri(subSegment), false);
 				if (contextNode == null) break;
 
-				Relation relation = create ? contextNode.setRelation(XdiInnerRoot.getPredicateOfInnerRootXri(subSegment), innerRootContextNode.getXri()) : contextNode.getRelation(XdiInnerRoot.getPredicateOfInnerRootXri(subSegment), innerRootContextNode.getXri());
+				Relation relation = create ? contextNode.setRelation(XdiInnerRoot.getPredicateOfInnerRootXri(subSegment), innerRootContextNode.getAddress()) : contextNode.getRelation(XdiInnerRoot.getPredicateOfInnerRootXri(subSegment), innerRootContextNode.getAddress());
 				if (relation == null) break;
 
 				nextRoot = new XdiInnerRoot(innerRootContextNode);
@@ -134,39 +134,39 @@ public XdiRoot getRoot(XDI3Segment xri, boolean create) {
 	 */
 
 	@Override
-	public XDI3Segment absoluteToRelativeXri(XDI3Segment absoluteXri) {
+	public XDIAddress absoluteToRelativeXri(XDIAddress absoluteXri) {
 
-		XDI3Segment relativeXri = XDI3Util.removeStartXri(absoluteXri, this.getContextNode().getXri());
+		XDIAddress relativeXri = AddressUtil.removeStartXri(absoluteXri, this.getContextNode().getAddress());
 
 		if (log.isTraceEnabled()) log.trace("absoluteToRelativeXri(" + absoluteXri + " --> " + relativeXri + ")");
 
 		return relativeXri;
 	}
 
 	@Override
-	public XDI3Segment relativeToAbsoluteXri(XDI3Segment relativeXri) {
+	public XDIAddress relativeToAbsoluteXri(XDIAddress relativeXri) {
 
-		XDI3Segment absoluteXri = XDI3Util.concatXris(this.getContextNode().getXri(), relativeXri);
+		XDIAddress absoluteXri = AddressUtil.concatAddresses(this.getContextNode().getAddress(), relativeXri);
 
 		if (log.isTraceEnabled()) log.trace("relativeToAbsoluteXri(" + relativeXri + " --> " + absoluteXri + ")");
 
 		return absoluteXri;
 	}
 
 	@Override
-	public XDI3Statement absoluteToRelativeStatementXri(XDI3Statement absoluteStatementXri) {
+	public XDIStatement absoluteToRelativeStatementXri(XDIStatement absoluteStatementXri) {
 
-		XDI3Statement relativeStatementXri = StatementUtil.removeStartXriStatement(absoluteStatementXri, this.getContextNode().getXri());
+		XDIStatement relativeStatementXri = StatementUtil.removeStartAddressStatement(absoluteStatementXri, this.getContextNode().getAddress());
 
 		if (log.isTraceEnabled()) log.trace("absoluteToRelativeStatementXri(" + absoluteStatementXri + " --> " + relativeStatementXri + ")");
 
 		return relativeStatementXri;
 	}
 
 	@Override
-	public XDI3Statement relativeToAbsoluteStatementXri(XDI3Statement relativeStatementXri) {
+	public XDIStatement relativeToAbsoluteStatementXri(XDIStatement relativeStatementXri) {
 
-		XDI3Statement absoluteStatementXri = StatementUtil.concatXriStatement(this.getContextNode().getXri(), relativeStatementXri);
+		XDIStatement absoluteStatementXri = StatementUtil.concatAddressStatement(this.getContextNode().getAddress(), relativeStatementXri);
 
 		if (log.isTraceEnabled()) log.trace("relativeToAbsoluteStatementXri(" + relativeStatementXri + " --> " + absoluteStatementXri + ")");
 
@@ -179,15 +179,15 @@ public XDI3Statement relativeToAbsoluteStatementXri(XDI3Statement relativeStatem
 
 	/**
 	 * Checks if a given XRI is an XDI root XRI.
-	 * @param arcXri An XDI root XRI.
+	 * @param arc An XDI root XRI.
 	 * @return True, if the XRI is an XDI root XRI.
 	 */
-	public static boolean isRootArcXri(XDI3SubSegment arcXri) {
+	public static boolean isRootarc(XDIArc arc) {
 
-		if (log.isTraceEnabled()) log.trace("isRootArcXri(" + arcXri + ")");
+		if (log.isTraceEnabled()) log.trace("isRootarc(" + arc + ")");
 
-		if (XdiPeerRoot.isPeerRootArcXri(arcXri)) return true;
-		if (XdiInnerRoot.isInnerRootArcXri(arcXri)) return true;
+		if (XdiPeerRoot.isPeerRootArc(arc)) return true;
+		if (XdiInnerRoot.isInnerRootarc(arc)) return true;
 
 		return false;
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractRoot.java
351c3a9a0df3be57e2d708952d753c22cc74e313
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractSingleton.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractSingleton.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiAbstractSingleton.java
import xdi2.core.syntax.XDIArc;
	public static boolean isValidarc(XDIArc arc) {
		return XdiEntitySingleton.isValidarc(arc) || 
				XdiAttributeSingleton.isValidarc(arc);

import xdi2.core.xri3.XDI3SubSegment;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		return XdiEntitySingleton.isValidArcXri(arcXri) || 
				XdiAttributeSingleton.isValidArcXri(arcXri);

@@ -1,7 +1,7 @@
 package xdi2.core.features.nodetypes;
 
 import xdi2.core.ContextNode;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIArc;
 
 public abstract class XdiAbstractSingleton<EQ extends XdiSubGraph<EQ>> extends XdiAbstractSubGraph<EQ> implements XdiSingleton<EQ> {
 
@@ -48,9 +48,9 @@ public static XdiSingleton<?> fromContextNode(ContextNode contextNode) {
 	 * Methods for XRIs
 	 */
 
-	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
+	public static boolean isValidarc(XDIArc arc) {
 
-		return XdiEntitySingleton.isValidArcXri(arcXri) || 
-				XdiAttributeSingleton.isValidArcXri(arcXri);
+		return XdiEntitySingleton.isValidarc(arc) || 
+				XdiAttributeSingleton.isValidarc(arc);
 	}
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAbstractSingleton.java
3703e98011b9bb1fa53d375045e963aacfa82c0c
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAttributeCollection.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAttributeCollection.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiAttributeCollection.java
import xdi2.core.syntax.XDIArc;
		return isValidarc(contextNode.getArc());
	public static XDIArc createarc(XDIArc arc) {
		return XDIArc.create("" + XDIConstants.XS_CLASS.charAt(0) + XDIConstants.XS_ATTRIBUTE.charAt(0) + arc + XDIConstants.XS_ATTRIBUTE.charAt(1) + XDIConstants.XS_CLASS.charAt(1));
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (! arc.isClassXs()) return false;
		if (! arc.isAttributeXs()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
			if (! arc.hasLiteral() && ! arc.hasXRef()) return false;

import xdi2.core.xri3.XDI3SubSegment;
		return isValidArcXri(contextNode.getArcXri());
	public static XDI3SubSegment createArcXri(XDI3SubSegment arcXri) {
		return XDI3SubSegment.create("" + XDIConstants.XS_CLASS.charAt(0) + XDIConstants.XS_ATTRIBUTE.charAt(0) + arcXri + XDIConstants.XS_ATTRIBUTE.charAt(1) + XDIConstants.XS_CLASS.charAt(1));
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (! arcXri.isClassXs()) return false;
		if (! arcXri.isAttributeXs()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
			if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;

@@ -4,9 +4,9 @@
 
 import xdi2.core.ContextNode;
 import xdi2.core.constants.XDIConstants;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 /**
  * An XDI attribute class (context function), represented as a context node.
@@ -35,7 +35,7 @@ public static boolean isValid(ContextNode contextNode) {
 
 		if (contextNode == null) return false;
 
-		return isValidArcXri(contextNode.getArcXri());
+		return isValidarc(contextNode.getArc());
 	}
 
 	/**
@@ -54,21 +54,21 @@ public static XdiAttributeCollection fromContextNode(ContextNode contextNode) {
 	 * Methods for XRIs
 	 */
 
-	public static XDI3SubSegment createArcXri(XDI3SubSegment arcXri) {
+	public static XDIArc createarc(XDIArc arc) {
 
-		return XDI3SubSegment.create("" + XDIConstants.XS_CLASS.charAt(0) + XDIConstants.XS_ATTRIBUTE.charAt(0) + arcXri + XDIConstants.XS_ATTRIBUTE.charAt(1) + XDIConstants.XS_CLASS.charAt(1));
+		return XDIArc.create("" + XDIConstants.XS_CLASS.charAt(0) + XDIConstants.XS_ATTRIBUTE.charAt(0) + arc + XDIConstants.XS_ATTRIBUTE.charAt(1) + XDIConstants.XS_CLASS.charAt(1));
 	}
 
-	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
+	public static boolean isValidarc(XDIArc arc) {
 
-		if (arcXri == null) return false;
+		if (arc == null) return false;
 
-		if (! arcXri.isClassXs()) return false;
-		if (! arcXri.isAttributeXs()) return false;
+		if (! arc.isClassXs()) return false;
+		if (! arc.isAttributeXs()) return false;
 
-		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
+		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
 
-			if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
+			if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
 		} else {
 
 			return false;

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAttributeCollection.java
ffc41c6465fcf0e2b5f4017aa60be6f92ffcf3fd
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAttributeMemberOrdered.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAttributeMemberOrdered.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiAttributeMemberOrdered.java
import xdi2.core.syntax.XDIArc;
				isValidarc(contextNode.getArc()) &&
	public static boolean isValidarc(XDIArc arc) {
		return XdiAbstractMemberOrdered.isValidarc(arc, true);
		XDIArc valuearc = XdiValue.createarc();
		ContextNode valueContextNode = create ? this.getContextNode().setContextNode(valuearc) : this.getContextNode().getContextNode(valuearc, false);

import xdi2.core.xri3.XDI3SubSegment;
				isValidArcXri(contextNode.getArcXri()) &&
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		return XdiAbstractMemberOrdered.isValidArcXri(arcXri, true);
		XDI3SubSegment valueArcXri = XdiValue.createArcXri();
		ContextNode valueContextNode = create ? this.getContextNode().setContextNode(valueArcXri) : this.getContextNode().getContextNode(valueArcXri, false);

@@ -3,9 +3,9 @@
 import java.util.Iterator;
 
 import xdi2.core.ContextNode;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 /**
  * An XDI ordered attribute members (context function), represented as a context node.
@@ -35,7 +35,7 @@ public static boolean isValid(ContextNode contextNode) {
 		if (contextNode == null) return false;
 
 		return
-				isValidArcXri(contextNode.getArcXri()) &&
+				isValidarc(contextNode.getArc()) &&
 				XdiAttributeCollection.isValid(contextNode.getContextNode());
 	}
 
@@ -55,9 +55,9 @@ public static XdiAttributeMemberOrdered fromContextNode(ContextNode contextNode)
 	 * Methods for XRIs
 	 */
 
-	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
+	public static boolean isValidarc(XDIArc arc) {
 
-		return XdiAbstractMemberOrdered.isValidArcXri(arcXri, true);
+		return XdiAbstractMemberOrdered.isValidarc(arc, true);
 	}
 
 	/*
@@ -82,9 +82,9 @@ public XdiAttributeCollection getXdiCollection() {
 	@Override
 	public XdiValue getXdiValue(boolean create) {
 
-		XDI3SubSegment valueArcXri = XdiValue.createArcXri();
+		XDIArc valuearc = XdiValue.createarc();
 
-		ContextNode valueContextNode = create ? this.getContextNode().setContextNode(valueArcXri) : this.getContextNode().getContextNode(valueArcXri, false);
+		ContextNode valueContextNode = create ? this.getContextNode().setContextNode(valuearc) : this.getContextNode().getContextNode(valuearc, false);
 		if (valueContextNode == null) return null;
 
 		return new XdiValue(valueContextNode);

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAttributeMemberOrdered.java
a39508ba4b73df1933985dad71c89cc2cf91fcf4
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAttributeMemberUnordered.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAttributeMemberUnordered.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiAttributeMemberUnordered.java
import xdi2.core.syntax.XDIArc;
				isValidarc(contextNode.getArc(), true) &&
	public static boolean isValidarc(XDIArc arc) {
		return XdiAbstractMemberUnordered.isValidarc(arc, true);
		XDIArc valuearc = XdiValue.createarc();
		ContextNode valueContextNode = create ? this.getContextNode().setContextNode(valuearc) : this.getContextNode().getContextNode(valuearc, false);

import xdi2.core.xri3.XDI3SubSegment;
				isValidArcXri(contextNode.getArcXri(), true) &&
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		return XdiAbstractMemberUnordered.isValidArcXri(arcXri, true);
		XDI3SubSegment valueArcXri = XdiValue.createArcXri();
		ContextNode valueContextNode = create ? this.getContextNode().setContextNode(valueArcXri) : this.getContextNode().getContextNode(valueArcXri, false);

@@ -3,9 +3,9 @@
 import java.util.Iterator;
 
 import xdi2.core.ContextNode;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 /**
  * An XDI unordered attribute member (context function), represented as a context node.
@@ -35,7 +35,7 @@ public static boolean isValid(ContextNode contextNode) {
 		if (contextNode == null) return false;
 
 		return
-				isValidArcXri(contextNode.getArcXri(), true) &&
+				isValidarc(contextNode.getArc(), true) &&
 				XdiAttributeCollection.isValid(contextNode.getContextNode());
 	}
 
@@ -55,9 +55,9 @@ public static XdiAttributeMemberUnordered fromContextNode(ContextNode contextNod
 	 * Methods for XRIs
 	 */
 
-	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
+	public static boolean isValidarc(XDIArc arc) {
 
-		return XdiAbstractMemberUnordered.isValidArcXri(arcXri, true);
+		return XdiAbstractMemberUnordered.isValidarc(arc, true);
 	}
 
 	/*
@@ -82,9 +82,9 @@ public XdiAttributeCollection getXdiCollection() {
 	@Override
 	public XdiValue getXdiValue(boolean create) {
 
-		XDI3SubSegment valueArcXri = XdiValue.createArcXri();
+		XDIArc valuearc = XdiValue.createarc();
 
-		ContextNode valueContextNode = create ? this.getContextNode().setContextNode(valueArcXri) : this.getContextNode().getContextNode(valueArcXri, false);
+		ContextNode valueContextNode = create ? this.getContextNode().setContextNode(valuearc) : this.getContextNode().getContextNode(valuearc, false);
 		if (valueContextNode == null) return null;
 
 		return new XdiValue(valueContextNode);

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAttributeMemberUnordered.java
5aafe3fe4b39664bf9fdaff42245e796979b696f
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAttributeSingleton.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAttributeSingleton.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiAttributeSingleton.java
import xdi2.core.syntax.XDIArc;
		return isValidarc(contextNode.getArc());
		XDIArc valuearc = XdiValue.createarc();
		ContextNode valueContextNode = create ? this.getContextNode().setContextNode(valuearc) : this.getContextNode().getContextNode(valuearc, false);
	public static XDIArc createarc(XDIArc arc) {
		return XDIArc.create("" + XDIConstants.XS_ATTRIBUTE.charAt(0) + arc + XDIConstants.XS_ATTRIBUTE.charAt(1));
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isClassXs()) return false;
		if (! arc.isAttributeXs()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
			if (! arc.hasLiteral() && ! arc.hasXRef()) return false;

import xdi2.core.xri3.XDI3SubSegment;
		return isValidArcXri(contextNode.getArcXri());
		XDI3SubSegment valueArcXri = XdiValue.createArcXri();
		ContextNode valueContextNode = create ? this.getContextNode().setContextNode(valueArcXri) : this.getContextNode().getContextNode(valueArcXri, false);
	public static XDI3SubSegment createArcXri(XDI3SubSegment arcXri) {
		return XDI3SubSegment.create("" + XDIConstants.XS_ATTRIBUTE.charAt(0) + arcXri + XDIConstants.XS_ATTRIBUTE.charAt(1));
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isClassXs()) return false;
		if (! arcXri.isAttributeXs()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
			if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;

@@ -4,9 +4,9 @@
 
 import xdi2.core.ContextNode;
 import xdi2.core.constants.XDIConstants;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 /**
  * An XDI attribute singleton (context function), represented as a context node.
@@ -35,7 +35,7 @@ public static boolean isValid(ContextNode contextNode) {
 
 		if (contextNode == null) return false;
 		
-		return isValidArcXri(contextNode.getArcXri());
+		return isValidarc(contextNode.getArc());
 	}
 
 	/**
@@ -62,9 +62,9 @@ public static XdiAttributeSingleton fromContextNode(ContextNode contextNode) {
 	@Override
 	public XdiValue getXdiValue(boolean create) {
 
-		XDI3SubSegment valueArcXri = XdiValue.createArcXri();
+		XDIArc valuearc = XdiValue.createarc();
 
-		ContextNode valueContextNode = create ? this.getContextNode().setContextNode(valueArcXri) : this.getContextNode().getContextNode(valueArcXri, false);
+		ContextNode valueContextNode = create ? this.getContextNode().setContextNode(valuearc) : this.getContextNode().getContextNode(valuearc, false);
 		if (valueContextNode == null) return null;
 
 		return new XdiValue(valueContextNode);
@@ -74,21 +74,21 @@ public XdiValue getXdiValue(boolean create) {
 	 * Methods for XRIs
 	 */
 
-	public static XDI3SubSegment createArcXri(XDI3SubSegment arcXri) {
+	public static XDIArc createarc(XDIArc arc) {
 
-		return XDI3SubSegment.create("" + XDIConstants.XS_ATTRIBUTE.charAt(0) + arcXri + XDIConstants.XS_ATTRIBUTE.charAt(1));
+		return XDIArc.create("" + XDIConstants.XS_ATTRIBUTE.charAt(0) + arc + XDIConstants.XS_ATTRIBUTE.charAt(1));
 	}
 
-	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
+	public static boolean isValidarc(XDIArc arc) {
 
-		if (arcXri == null) return false;
+		if (arc == null) return false;
 
-		if (arcXri.isClassXs()) return false;
-		if (! arcXri.isAttributeXs()) return false;
+		if (arc.isClassXs()) return false;
+		if (! arc.isAttributeXs()) return false;
 
-		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
+		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
 
-			if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
+			if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
 		} else {
 
 			return false;

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiAttributeSingleton.java
5e50ad1c008c7382098319cc251411661d464abe
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiCollection.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiCollection.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiCollection.java
import xdi2.core.syntax.XDIArc;
	public U setXdiMemberUnordered(XDIArc arc);
	public U getXdiMemberUnordered(XDIArc arc);

import xdi2.core.xri3.XDI3SubSegment;
	public U setXdiMemberUnordered(XDI3SubSegment arcXri);
	public U getXdiMemberUnordered(XDI3SubSegment arcXri);

@@ -1,12 +1,12 @@
 package xdi2.core.features.nodetypes;
 
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.ReadOnlyIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 public interface XdiCollection<EQC extends XdiCollection<EQC, EQI, C, U, O, I>, EQI extends XdiSubGraph<EQI>, C extends XdiCollection<EQC, EQI, C, U, O, I>, U extends XdiMemberUnordered<EQC, EQI, C, U, O, I>, O extends XdiMemberOrdered<EQC, EQI, C, U, O, I>, I extends XdiMember<EQC, EQI, C, U, O, I>> extends XdiSubGraph<EQC> {
 
-	public U setXdiMemberUnordered(XDI3SubSegment arcXri);
-	public U getXdiMemberUnordered(XDI3SubSegment arcXri);
+	public U setXdiMemberUnordered(XDIArc arc);
+	public U getXdiMemberUnordered(XDIArc arc);
 	public ReadOnlyIterator<U> getXdiMembersUnordered();
 	public long getXdiMembersUnorderedCount();
 

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiCollection.java
fe3bb890f30a48faa5f9d88a5095492228dde65c
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiContext.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiContext.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiContext.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
	public XDIArc getArc();
	public XDIAddress getXri();
	public XDIArc getBasearc();
	public XdiInnerRoot getXdiInnerRoot(XDIAddress innerRootPredicateXri, boolean create);
	public XdiEntityCollection getXdiEntityCollection(XDIArc contextNodeArc, boolean create);
	public XdiEntityCollection getXdiEntityCollection(XDIAddress contextNodeAddress, boolean create);
	public XdiAttributeCollection getXdiAttributeCollection(XDIArc contextNodeArc, boolean create);
	public XdiAttributeCollection getXdiAttributeCollection(XDIAddress contextNodeAddress, boolean create);
	public XdiEntitySingleton getXdiEntitySingleton(XDIArc contextNodeArc, boolean create);
	public XdiEntitySingleton getXdiEntitySingleton(XDIAddress contextNodeAddress, boolean create);
	public XdiAttributeSingleton getXdiAttributeSingleton(XDIArc contextNodeArc, boolean create);
	public XdiAttributeSingleton getXdiAttributeSingleton(XDIAddress contextNodeAddress, boolean create);
	public XdiEntity getXdiEntity(XDIArc contextNodeArc, boolean create);
	public XdiEntity getXdiEntity(XDIAddress contextNodeAddress, boolean create);
	public XdiAttribute getXdiAttribute(XDIArc contextNodeArc, boolean create);
	public XdiAttribute getXdiAttribute(XDIAddress contextNodeAddress, boolean create);

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
	public XDI3SubSegment getArcXri();
	public XDI3Segment getXri();
	public XDI3SubSegment getBaseArcXri();
	public XdiInnerRoot getXdiInnerRoot(XDI3Segment innerRootPredicateXri, boolean create);
	public XdiEntityCollection getXdiEntityCollection(XDI3SubSegment contextNodeArcXri, boolean create);
	public XdiEntityCollection getXdiEntityCollection(XDI3Segment contextNodeXri, boolean create);
	public XdiAttributeCollection getXdiAttributeCollection(XDI3SubSegment contextNodeArcXri, boolean create);
	public XdiAttributeCollection getXdiAttributeCollection(XDI3Segment contextNodeXri, boolean create);
	public XdiEntitySingleton getXdiEntitySingleton(XDI3SubSegment contextNodeArcXri, boolean create);
	public XdiEntitySingleton getXdiEntitySingleton(XDI3Segment contextNodeXri, boolean create);
	public XdiAttributeSingleton getXdiAttributeSingleton(XDI3SubSegment contextNodeArcXri, boolean create);
	public XdiAttributeSingleton getXdiAttributeSingleton(XDI3Segment contextNodeXri, boolean create);
	public XdiEntity getXdiEntity(XDI3SubSegment contextNodeArcXri, boolean create);
	public XdiEntity getXdiEntity(XDI3Segment contextNodeXri, boolean create);
	public XdiAttribute getXdiAttribute(XDI3SubSegment contextNodeArcXri, boolean create);
	public XdiAttribute getXdiAttribute(XDI3Segment contextNodeXri, boolean create);

@@ -5,16 +5,16 @@
 
 import xdi2.core.ContextNode;
 import xdi2.core.Graph;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 
 public interface XdiContext<EQ extends XdiContext<EQ>> extends Serializable, Comparable<XdiContext<?>> {
 
 	public ContextNode getContextNode();
 	public Graph getGraph();
-	public XDI3SubSegment getArcXri();
-	public XDI3Segment getXri();
-	public XDI3SubSegment getBaseArcXri();
+	public XDIArc getArc();
+	public XDIAddress getXri();
+	public XDIArc getBasearc();
 
 	public EQ dereference();
 	public EQ getReferenceXdiContext();
@@ -23,17 +23,17 @@ public interface XdiContext<EQ extends XdiContext<EQ>> extends Serializable, Com
 
 	public XdiRoot findRoot();
 	public XdiLocalRoot findLocalRoot();
-	public XdiInnerRoot getXdiInnerRoot(XDI3Segment innerRootPredicateXri, boolean create);
-	public XdiEntityCollection getXdiEntityCollection(XDI3SubSegment contextNodeArcXri, boolean create);
-	public XdiEntityCollection getXdiEntityCollection(XDI3Segment contextNodeXri, boolean create);
-	public XdiAttributeCollection getXdiAttributeCollection(XDI3SubSegment contextNodeArcXri, boolean create);
-	public XdiAttributeCollection getXdiAttributeCollection(XDI3Segment contextNodeXri, boolean create);
-	public XdiEntitySingleton getXdiEntitySingleton(XDI3SubSegment contextNodeArcXri, boolean create);
-	public XdiEntitySingleton getXdiEntitySingleton(XDI3Segment contextNodeXri, boolean create);
-	public XdiAttributeSingleton getXdiAttributeSingleton(XDI3SubSegment contextNodeArcXri, boolean create);
-	public XdiAttributeSingleton getXdiAttributeSingleton(XDI3Segment contextNodeXri, boolean create);
-	public XdiEntity getXdiEntity(XDI3SubSegment contextNodeArcXri, boolean create);
-	public XdiEntity getXdiEntity(XDI3Segment contextNodeXri, boolean create);
-	public XdiAttribute getXdiAttribute(XDI3SubSegment contextNodeArcXri, boolean create);
-	public XdiAttribute getXdiAttribute(XDI3Segment contextNodeXri, boolean create);
+	public XdiInnerRoot getXdiInnerRoot(XDIAddress innerRootPredicateXri, boolean create);
+	public XdiEntityCollection getXdiEntityCollection(XDIArc contextNodeArc, boolean create);
+	public XdiEntityCollection getXdiEntityCollection(XDIAddress contextNodeAddress, boolean create);
+	public XdiAttributeCollection getXdiAttributeCollection(XDIArc contextNodeArc, boolean create);
+	public XdiAttributeCollection getXdiAttributeCollection(XDIAddress contextNodeAddress, boolean create);
+	public XdiEntitySingleton getXdiEntitySingleton(XDIArc contextNodeArc, boolean create);
+	public XdiEntitySingleton getXdiEntitySingleton(XDIAddress contextNodeAddress, boolean create);
+	public XdiAttributeSingleton getXdiAttributeSingleton(XDIArc contextNodeArc, boolean create);
+	public XdiAttributeSingleton getXdiAttributeSingleton(XDIAddress contextNodeAddress, boolean create);
+	public XdiEntity getXdiEntity(XDIArc contextNodeArc, boolean create);
+	public XdiEntity getXdiEntity(XDIAddress contextNodeAddress, boolean create);
+	public XdiAttribute getXdiAttribute(XDIArc contextNodeArc, boolean create);
+	public XdiAttribute getXdiAttribute(XDIAddress contextNodeAddress, boolean create);
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiContext.java
3f36a2b7931d7b6de36ec2e9b18dd07a04d48c31
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiEntityCollection.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiEntityCollection.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiEntityCollection.java
import xdi2.core.syntax.XDIArc;
				isValidarc(contextNode.getArc()) &&
	public static XDIArc createarc(XDIArc arc) {
		return XDIArc.create("" + XDIConstants.XS_CLASS.charAt(0) + arc + XDIConstants.XS_CLASS.charAt(1));
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (! arc.isClassXs()) return false;
		if (arc.isAttributeXs()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
			if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
		} else if (XDIConstants.CS_AUTHORITY_PERSONAL.equals(arc.getCs()) || XDIConstants.CS_AUTHORITY_LEGAL.equals(arc.getCs()) || XDIConstants.CS_AUTHORITY_GENERAL.equals(arc.getCs())) {
			if (arc.hasLiteral() || arc.hasXRef()) return false;

XDIArc arc
core/src/main/java/xdi2/core/features/nodetypes/XdiEntityCollection.java
return XDIArc.create("" + XDIConstants.XS_CLASS.charAt(0) + arc + XDIConstants.XS_CLASS.charAt(1));
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (! arc.isClassXs()) return false;
		if (arc.isAttributeXs()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
			if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
XDIArc createarc(XDIArc arc)
import xdi2.core.xri3.XDI3SubSegment;
				isValidArcXri(contextNode.getArcXri()) &&
	public static XDI3SubSegment createArcXri(XDI3SubSegment arcXri) {
		return XDI3SubSegment.create("" + XDIConstants.XS_CLASS.charAt(0) + arcXri + XDIConstants.XS_CLASS.charAt(1));
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (! arcXri.isClassXs()) return false;
		if (arcXri.isAttributeXs()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
			if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
		} else if (XDIConstants.CS_AUTHORITY_PERSONAL.equals(arcXri.getCs()) || XDIConstants.CS_AUTHORITY_LEGAL.equals(arcXri.getCs()) || XDIConstants.CS_AUTHORITY_GENERAL.equals(arcXri.getCs())) {
			if (arcXri.hasLiteral() || arcXri.hasXRef()) return false;

XDI3SubSegment arcXri
core/src/main/java/xdi2/core/features/nodetypes/XdiEntityCollection.java
return XDI3SubSegment.create("" + XDIConstants.XS_CLASS.charAt(0) + arcXri + XDIConstants.XS_CLASS.charAt(1));
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (! arcXri.isClassXs()) return false;
		if (arcXri.isAttributeXs()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
			if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
XDI3SubSegment createArcXri(XDI3SubSegment arcXri)
@@ -4,9 +4,9 @@
 
 import xdi2.core.ContextNode;
 import xdi2.core.constants.XDIConstants;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 /**
  * An XDI entity class (context function), represented as a context node.
@@ -36,7 +36,7 @@ public static boolean isValid(ContextNode contextNode) {
 		if (contextNode == null) return false;
 
 		return 
-				isValidArcXri(contextNode.getArcXri()) &&
+				isValidarc(contextNode.getArc()) &&
 				( ! XdiAttributeCollection.isValid(contextNode.getContextNode()) && ! XdiAbstractAttribute.isValid(contextNode.getContextNode()) );
 	}
 
@@ -56,24 +56,24 @@ public static XdiEntityCollection fromContextNode(ContextNode contextNode) {
 	 * Methods for XRIs
 	 */
 
-	public static XDI3SubSegment createArcXri(XDI3SubSegment arcXri) {
+	public static XDIArc createarc(XDIArc arc) {
 
-		return XDI3SubSegment.create("" + XDIConstants.XS_CLASS.charAt(0) + arcXri + XDIConstants.XS_CLASS.charAt(1));
+		return XDIArc.create("" + XDIConstants.XS_CLASS.charAt(0) + arc + XDIConstants.XS_CLASS.charAt(1));
 	}
 
-	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
+	public static boolean isValidarc(XDIArc arc) {
 
-		if (arcXri == null) return false;
+		if (arc == null) return false;
 
-		if (! arcXri.isClassXs()) return false;
-		if (arcXri.isAttributeXs()) return false;
+		if (! arc.isClassXs()) return false;
+		if (arc.isAttributeXs()) return false;
 
-		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
+		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
 
-			if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
-		} else if (XDIConstants.CS_AUTHORITY_PERSONAL.equals(arcXri.getCs()) || XDIConstants.CS_AUTHORITY_LEGAL.equals(arcXri.getCs()) || XDIConstants.CS_AUTHORITY_GENERAL.equals(arcXri.getCs())) {
+			if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
+		} else if (XDIConstants.CS_AUTHORITY_PERSONAL.equals(arc.getCs()) || XDIConstants.CS_AUTHORITY_LEGAL.equals(arc.getCs()) || XDIConstants.CS_AUTHORITY_GENERAL.equals(arc.getCs())) {
 
-			if (arcXri.hasLiteral() || arcXri.hasXRef()) return false;
+			if (arc.hasLiteral() || arc.hasXRef()) return false;
 		} else {
 
 			return false;

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiEntityCollection.java
06553258cfb1cef1640e32f5bdeddd1b77e0e5fd
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiEntityMemberOrdered.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiEntityMemberOrdered.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiEntityMemberOrdered.java
import xdi2.core.syntax.XDIArc;
				isValidarc(contextNode.getArc()) &&
	public static boolean isValidarc(XDIArc arc) {
		return XdiAbstractMemberOrdered.isValidarc(arc, false);

import xdi2.core.xri3.XDI3SubSegment;
				isValidArcXri(contextNode.getArcXri()) &&
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		return XdiAbstractMemberOrdered.isValidArcXri(arcXri, false);

@@ -3,9 +3,9 @@
 import java.util.Iterator;
 
 import xdi2.core.ContextNode;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 /**
  * An XDI ordered entity member (context function), represented as a context node.
@@ -35,7 +35,7 @@ public static boolean isValid(ContextNode contextNode) {
 		if (contextNode == null) return false;
 
 		return
-				isValidArcXri(contextNode.getArcXri()) &&
+				isValidarc(contextNode.getArc()) &&
 				XdiEntityCollection.isValid(contextNode.getContextNode());
 	}
 
@@ -55,9 +55,9 @@ public static XdiEntityMemberOrdered fromContextNode(ContextNode contextNode) {
 	 * Methods for XRIs
 	 */
 
-	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
+	public static boolean isValidarc(XDIArc arc) {
 
-		return XdiAbstractMemberOrdered.isValidArcXri(arcXri, false);
+		return XdiAbstractMemberOrdered.isValidarc(arc, false);
 	}
 
 	/*

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiEntityMemberOrdered.java
8502a163ca8707e05168b1fe645628750a2efbb7
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiEntityMemberUnordered.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiEntityMemberUnordered.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiEntityMemberUnordered.java
import xdi2.core.syntax.XDIArc;
				isValidarc(contextNode.getArc(), false) &&
	public static boolean isValidarc(XDIArc arc) {
		return XdiAbstractMemberUnordered.isValidarc(arc, false);

import xdi2.core.xri3.XDI3SubSegment;
				isValidArcXri(contextNode.getArcXri(), false) &&
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		return XdiAbstractMemberUnordered.isValidArcXri(arcXri, false);

@@ -3,9 +3,9 @@
 import java.util.Iterator;
 
 import xdi2.core.ContextNode;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 /**
  * An XDI unordered entity member (context function), represented as a context node.
@@ -35,7 +35,7 @@ public static boolean isValid(ContextNode contextNode) {
 		if (contextNode == null) return false;
 
 		return
-				isValidArcXri(contextNode.getArcXri(), false) &&
+				isValidarc(contextNode.getArc(), false) &&
 				XdiEntityCollection.isValid(contextNode.getContextNode());
 	}
 
@@ -55,9 +55,9 @@ public static XdiEntityMemberUnordered fromContextNode(ContextNode contextNode)
 	 * Methods for XRIs
 	 */
 
-	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
+	public static boolean isValidarc(XDIArc arc) {
 
-		return XdiAbstractMemberUnordered.isValidArcXri(arcXri, false);
+		return XdiAbstractMemberUnordered.isValidarc(arc, false);
 	}
 
 	/*

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiEntityMemberUnordered.java
e347ea6a392432c56f7eb4acf6897c9282a7828e
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiEntitySingleton.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiEntitySingleton.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiEntitySingleton.java
import xdi2.core.syntax.XDIArc;
				isValidarc(contextNode.getArc()) &&
	public static XDIArc createarc(XDIArc arc) {
		return arc;
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isAttributeXs()) return false;
		if (arc.isClassXs()) return false;
		if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
		} else if (XDIConstants.CS_AUTHORITY_PERSONAL.equals(arc.getCs()) || XDIConstants.CS_AUTHORITY_LEGAL.equals(arc.getCs()) || XDIConstants.CS_AUTHORITY_GENERAL.equals(arc.getCs())) {

XDIArc arc
core/src/main/java/xdi2/core/features/nodetypes/XdiEntitySingleton.java
return arc;
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isAttributeXs()) return false;
		if (arc.isClassXs()) return false;
		if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
XDIArc createarc(XDIArc arc)
import xdi2.core.xri3.XDI3SubSegment;
				isValidArcXri(contextNode.getArcXri()) &&
	public static XDI3SubSegment createArcXri(XDI3SubSegment arcXri) {
		return arcXri;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isAttributeXs()) return false;
		if (arcXri.isClassXs()) return false;
		if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
		} else if (XDIConstants.CS_AUTHORITY_PERSONAL.equals(arcXri.getCs()) || XDIConstants.CS_AUTHORITY_LEGAL.equals(arcXri.getCs()) || XDIConstants.CS_AUTHORITY_GENERAL.equals(arcXri.getCs())) {

XDI3SubSegment arcXri
core/src/main/java/xdi2/core/features/nodetypes/XdiEntitySingleton.java
return arcXri;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isAttributeXs()) return false;
		if (arcXri.isClassXs()) return false;
		if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
XDI3SubSegment createArcXri(XDI3SubSegment arcXri)
@@ -4,9 +4,9 @@
 
 import xdi2.core.ContextNode;
 import xdi2.core.constants.XDIConstants;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 /**
  * An XDI entity singleton (context function), represented as a context node.
@@ -36,7 +36,7 @@ public static boolean isValid(ContextNode contextNode) {
 		if (contextNode == null) return false;
 
 		return 
-				isValidArcXri(contextNode.getArcXri()) &&
+				isValidarc(contextNode.getArc()) &&
 				( ! XdiAttributeCollection.isValid(contextNode.getContextNode()) && ! XdiAbstractAttribute.isValid(contextNode.getContextNode()) );
 	}
 
@@ -56,23 +56,23 @@ public static XdiEntitySingleton fromContextNode(ContextNode contextNode) {
 	 * Methods for XRIs
 	 */
 
-	public static XDI3SubSegment createArcXri(XDI3SubSegment arcXri) {
+	public static XDIArc createarc(XDIArc arc) {
 
-		return arcXri;
+		return arc;
 	}
 
-	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
+	public static boolean isValidarc(XDIArc arc) {
 
-		if (arcXri == null) return false;
+		if (arc == null) return false;
 
-		if (arcXri.isAttributeXs()) return false;
-		if (arcXri.isClassXs()) return false;
+		if (arc.isAttributeXs()) return false;
+		if (arc.isClassXs()) return false;
 
-		if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
+		if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
 
-		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
+		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
 
-		} else if (XDIConstants.CS_AUTHORITY_PERSONAL.equals(arcXri.getCs()) || XDIConstants.CS_AUTHORITY_LEGAL.equals(arcXri.getCs()) || XDIConstants.CS_AUTHORITY_GENERAL.equals(arcXri.getCs())) {
+		} else if (XDIConstants.CS_AUTHORITY_PERSONAL.equals(arc.getCs()) || XDIConstants.CS_AUTHORITY_LEGAL.equals(arc.getCs()) || XDIConstants.CS_AUTHORITY_GENERAL.equals(arc.getCs())) {
 
 		} else {
 

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiEntitySingleton.java
4bd97c8d40cd7b94fe344feb035bdd8b8ec127ff
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiInnerRoot.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiInnerRoot.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiInnerRoot.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.syntax.XDIXRef;
				isInnerRootarc(contextNode.getArc()) &&
	public XDIAddress getSubjectOfInnerRoot() {
		return getSubjectOfInnerRootXri(this.getContextNode().getArc());
	public XDIAddress getPredicateOfInnerRoot() {
		return getPredicateOfInnerRootXri(this.getContextNode().getArc());
	public static XDIArc createInnerRootarc(XDIAddress subject, XDIAddress predicate) {
		return XDIArc.fromComponents(null, false, false, null, 
				XDIXRef.fromComponents(XDIConstants.XS_ROOT, null, subject, predicate, null, null));
		XDIAddress subject = XdiInnerRoot.getSubjectOfInnerRootXri(contextNode.getArc());
		XDIAddress predicate = XdiInnerRoot.getPredicateOfInnerRootXri(contextNode.getArc());
		Relation predicateRelation = subjectContextNode.getRelation(predicate, contextNode.getAddress());
	 * @param arc An inner root XRI.
	public static XDIAddress getSubjectOfInnerRootXri(XDIArc arc) {
		if (arc == null) return null;
		if (arc.hasCs()) return null;
		if (arc.isClassXs()) return null;
		if (arc.isAttributeXs()) return null;
		if (! arc.hasXRef()) return null;
		XDIXRef xref = arc.getXRef();
	 * @param arc An inner root XRI.
	public static XDIAddress getPredicateOfInnerRootXri(XDIArc arc) {
		if (arc == null) return null;
		if (arc.hasCs()) return null;
		if (arc.isClassXs()) return null;
		if (arc.isAttributeXs()) return null;
		if (! arc.hasXRef()) return null;
		XDIXRef xref = arc.getXRef();
	 * @param arc An inner root XRI.
	public static boolean isInnerRootarc(XDIArc arc) {
		return getSubjectOfInnerRootXri(arc) != null && getPredicateOfInnerRootXri(arc) != null;

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
import xdi2.core.xri3.XDI3XRef;
				isInnerRootArcXri(contextNode.getArcXri()) &&
	public XDI3Segment getSubjectOfInnerRoot() {
		return getSubjectOfInnerRootXri(this.getContextNode().getArcXri());
	public XDI3Segment getPredicateOfInnerRoot() {
		return getPredicateOfInnerRootXri(this.getContextNode().getArcXri());
	public static XDI3SubSegment createInnerRootArcXri(XDI3Segment subject, XDI3Segment predicate) {
		return XDI3SubSegment.fromComponents(null, false, false, null, 
				XDI3XRef.fromComponents(XDIConstants.XS_ROOT, null, subject, predicate, null, null));
		XDI3Segment subject = XdiInnerRoot.getSubjectOfInnerRootXri(contextNode.getArcXri());
		XDI3Segment predicate = XdiInnerRoot.getPredicateOfInnerRootXri(contextNode.getArcXri());
		Relation predicateRelation = subjectContextNode.getRelation(predicate, contextNode.getXri());
	 * @param arcXri An inner root XRI.
	public static XDI3Segment getSubjectOfInnerRootXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return null;
		if (arcXri.hasCs()) return null;
		if (arcXri.isClassXs()) return null;
		if (arcXri.isAttributeXs()) return null;
		if (! arcXri.hasXRef()) return null;
		XDI3XRef xref = arcXri.getXRef();
	 * @param arcXri An inner root XRI.
	public static XDI3Segment getPredicateOfInnerRootXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return null;
		if (arcXri.hasCs()) return null;
		if (arcXri.isClassXs()) return null;
		if (arcXri.isAttributeXs()) return null;
		if (! arcXri.hasXRef()) return null;
		XDI3XRef xref = arcXri.getXRef();
	 * @param arcXri An inner root XRI.
	public static boolean isInnerRootArcXri(XDI3SubSegment arcXri) {
		return getSubjectOfInnerRootXri(arcXri) != null && getPredicateOfInnerRootXri(arcXri) != null;

@@ -5,11 +5,11 @@
 import xdi2.core.ContextNode;
 import xdi2.core.Relation;
 import xdi2.core.constants.XDIConstants;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.syntax.XDIXRef;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
-import xdi2.core.xri3.XDI3XRef;
 
 /**
  * An XDI inner root, represented as a context node.
@@ -39,7 +39,7 @@ public static boolean isValid(ContextNode contextNode) {
 		if (contextNode == null) return false;
 
 		return
-				isInnerRootArcXri(contextNode.getArcXri()) &&
+				isInnerRootarc(contextNode.getArc()) &&
 				XdiAbstractRoot.isValid(contextNode.getContextNode());
 	}
 
@@ -81,18 +81,18 @@ public Relation getPredicateRelation() {
 	 * Returns the subject XRI of this XDI inner root.
 	 * @return The subject XRI.
 	 */
-	public XDI3Segment getSubjectOfInnerRoot() {
+	public XDIAddress getSubjectOfInnerRoot() {
 
-		return getSubjectOfInnerRootXri(this.getContextNode().getArcXri());
+		return getSubjectOfInnerRootXri(this.getContextNode().getArc());
 	}
 
 	/**
 	 * Returns the predicate XRI of this XDI inner root.
 	 * @return The predicate XRI.
 	 */
-	public XDI3Segment getPredicateOfInnerRoot() {
+	public XDIAddress getPredicateOfInnerRoot() {
 
-		return getPredicateOfInnerRootXri(this.getContextNode().getArcXri());
+		return getPredicateOfInnerRootXri(this.getContextNode().getArc());
 	}
 
 	/*
@@ -105,10 +105,10 @@ public XDI3Segment getPredicateOfInnerRoot() {
 	 * @param predicate A subject XRI.
 	 * @return The inner root XRI of the subject XRI and the predicate XRI.
 	 */
-	public static XDI3SubSegment createInnerRootArcXri(XDI3Segment subject, XDI3Segment predicate) {
+	public static XDIArc createInnerRootarc(XDIAddress subject, XDIAddress predicate) {
 
-		return XDI3SubSegment.fromComponents(null, false, false, null, 
-				XDI3XRef.fromComponents(XDIConstants.XS_ROOT, null, subject, predicate, null, null));
+		return XDIArc.fromComponents(null, false, false, null, 
+				XDIXRef.fromComponents(XDIConstants.XS_ROOT, null, subject, predicate, null, null));
 	}
 
 	/**
@@ -118,7 +118,7 @@ public static XDI3SubSegment createInnerRootArcXri(XDI3Segment subject, XDI3Segm
 	 */
 	public static ContextNode getSubjectContextNode(ContextNode contextNode) {
 
-		XDI3Segment subject = XdiInnerRoot.getSubjectOfInnerRootXri(contextNode.getArcXri());
+		XDIAddress subject = XdiInnerRoot.getSubjectOfInnerRootXri(contextNode.getArc());
 		if (subject == null) return null;
 
 		ContextNode parentContextNode = contextNode.getContextNode();
@@ -137,33 +137,33 @@ public static ContextNode getSubjectContextNode(ContextNode contextNode) {
 	 */
 	public static Relation getPredicateRelation(ContextNode contextNode) {
 
-		XDI3Segment predicate = XdiInnerRoot.getPredicateOfInnerRootXri(contextNode.getArcXri());
+		XDIAddress predicate = XdiInnerRoot.getPredicateOfInnerRootXri(contextNode.getArc());
 		if (predicate == null) return null;
 
 		ContextNode subjectContextNode = getSubjectContextNode(contextNode);
 		if (subjectContextNode == null) return null;
 
-		Relation predicateRelation = subjectContextNode.getRelation(predicate, contextNode.getXri());
+		Relation predicateRelation = subjectContextNode.getRelation(predicate, contextNode.getAddress());
 		if (predicateRelation == null) return null;
 
 		return predicateRelation;
 	}
 
 	/**
 	 * Returns the subject XRI of the inner root XRI.
-	 * @param arcXri An inner root XRI.
+	 * @param arc An inner root XRI.
 	 * @return The subject XRI of the inner root XRI.
 	 */
-	public static XDI3Segment getSubjectOfInnerRootXri(XDI3SubSegment arcXri) {
+	public static XDIAddress getSubjectOfInnerRootXri(XDIArc arc) {
 
-		if (arcXri == null) return null;
+		if (arc == null) return null;
 
-		if (arcXri.hasCs()) return null;
-		if (arcXri.isClassXs()) return null;
-		if (arcXri.isAttributeXs()) return null;
-		if (! arcXri.hasXRef()) return null;
+		if (arc.hasCs()) return null;
+		if (arc.isClassXs()) return null;
+		if (arc.isAttributeXs()) return null;
+		if (! arc.hasXRef()) return null;
 
-		XDI3XRef xref = arcXri.getXRef();
+		XDIXRef xref = arc.getXRef();
 		if (! XDIConstants.XS_ROOT.equals(xref.getXs())) return null;
 		if (! xref.hasPartialSubjectAndPredicate()) return null;
 
@@ -172,19 +172,19 @@ public static XDI3Segment getSubjectOfInnerRootXri(XDI3SubSegment arcXri) {
 
 	/**
 	 * Returns the predicate XRI of the inner root XRI.
-	 * @param arcXri An inner root XRI.
+	 * @param arc An inner root XRI.
 	 * @return The predicate XRI of the inner root XRI.
 	 */
-	public static XDI3Segment getPredicateOfInnerRootXri(XDI3SubSegment arcXri) {
+	public static XDIAddress getPredicateOfInnerRootXri(XDIArc arc) {
 
-		if (arcXri == null) return null;
+		if (arc == null) return null;
 
-		if (arcXri.hasCs()) return null;
-		if (arcXri.isClassXs()) return null;
-		if (arcXri.isAttributeXs()) return null;
-		if (! arcXri.hasXRef()) return null;
+		if (arc.hasCs()) return null;
+		if (arc.isClassXs()) return null;
+		if (arc.isAttributeXs()) return null;
+		if (! arc.hasXRef()) return null;
 
-		XDI3XRef xref = arcXri.getXRef();
+		XDIXRef xref = arc.getXRef();
 		if (! XDIConstants.XS_ROOT.equals(xref.getXs())) return null;
 		if (! xref.hasPartialSubjectAndPredicate()) return null;
 
@@ -193,12 +193,12 @@ public static XDI3Segment getPredicateOfInnerRootXri(XDI3SubSegment arcXri) {
 
 	/**
 	 * Checks if a given XRI is an inner root XRI.
-	 * @param arcXri An inner root XRI.
+	 * @param arc An inner root XRI.
 	 * @return True, if the XRI is an inner root XRI.
 	 */
-	public static boolean isInnerRootArcXri(XDI3SubSegment arcXri) {
+	public static boolean isInnerRootarc(XDIArc arc) {
 
-		return getSubjectOfInnerRootXri(arcXri) != null && getPredicateOfInnerRootXri(arcXri) != null;
+		return getSubjectOfInnerRootXri(arc) != null && getPredicateOfInnerRootXri(arc) != null;
 	}
 
 	/*

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiInnerRoot.java
db5d839831e56d612bd21eed30e1d06ac412e9e4
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiLocalRoot.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiLocalRoot.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiLocalRoot.java
import xdi2.core.syntax.XDIAddress;
	public XdiPeerRoot setSelfPeerRoot(XDIAddress xri) {
		localRootContextNode.delRelations(XDIDictionaryConstants.XDI_ADD_IS_REF);
		localRootContextNode.setRelation(XDIDictionaryConstants.XDI_ADD_IS_REF, selfPeerRootContextNode);
		selfPeerRootContextNode.delRelations(XDIDictionaryConstants.XDI_ADD_REF);
		selfPeerRootContextNode.setRelation(XDIDictionaryConstants.XDI_ADD_REF, localRootContextNode);
		Relation relation = this.getContextNode().getRelation(XDIDictionaryConstants.XDI_ADD_IS_REF);

import xdi2.core.xri3.XDI3Segment;
	public XdiPeerRoot setSelfPeerRoot(XDI3Segment xri) {
		localRootContextNode.delRelations(XDIDictionaryConstants.XRI_S_IS_REF);
		localRootContextNode.setRelation(XDIDictionaryConstants.XRI_S_IS_REF, selfPeerRootContextNode);
		selfPeerRootContextNode.delRelations(XDIDictionaryConstants.XRI_S_REF);
		selfPeerRootContextNode.setRelation(XDIDictionaryConstants.XRI_S_REF, localRootContextNode);
		Relation relation = this.getContextNode().getRelation(XDIDictionaryConstants.XRI_S_IS_REF);

@@ -6,8 +6,8 @@
 import xdi2.core.constants.XDIDictionaryConstants;
 import xdi2.core.features.nodetypes.XdiInnerRoot.MappingContextNodeInnerRootIterator;
 import xdi2.core.features.nodetypes.XdiPeerRoot.MappingContextNodePeerRootIterator;
+import xdi2.core.syntax.XDIAddress;
 import xdi2.core.util.iterators.ReadOnlyIterator;
-import xdi2.core.xri3.XDI3Segment;
 
 /**
  * An XDI local root, represented as a context node.
@@ -67,7 +67,7 @@ public static XdiLocalRoot fromContextNode(ContextNode contextNode) {
 	 * Instance methods
 	 */
 
-	public XdiPeerRoot setSelfPeerRoot(XDI3Segment xri) {
+	public XdiPeerRoot setSelfPeerRoot(XDIAddress xri) {
 
 		XdiPeerRoot selfPeerRoot = this.getSelfPeerRoot();
 		if (selfPeerRoot != null) selfPeerRoot.getContextNode().delete();
@@ -79,18 +79,18 @@ public XdiPeerRoot setSelfPeerRoot(XDI3Segment xri) {
 		ContextNode localRootContextNode = this.getContextNode();
 		ContextNode selfPeerRootContextNode = selfPeerRoot.getContextNode();
 
-		localRootContextNode.delRelations(XDIDictionaryConstants.XRI_S_IS_REF);
-		localRootContextNode.setRelation(XDIDictionaryConstants.XRI_S_IS_REF, selfPeerRootContextNode);
+		localRootContextNode.delRelations(XDIDictionaryConstants.XDI_ADD_IS_REF);
+		localRootContextNode.setRelation(XDIDictionaryConstants.XDI_ADD_IS_REF, selfPeerRootContextNode);
 
-		selfPeerRootContextNode.delRelations(XDIDictionaryConstants.XRI_S_REF);
-		selfPeerRootContextNode.setRelation(XDIDictionaryConstants.XRI_S_REF, localRootContextNode);
+		selfPeerRootContextNode.delRelations(XDIDictionaryConstants.XDI_ADD_REF);
+		selfPeerRootContextNode.setRelation(XDIDictionaryConstants.XDI_ADD_REF, localRootContextNode);
 
 		return selfPeerRoot;
 	}
 
 	public XdiPeerRoot getSelfPeerRoot() {
 
-		Relation relation = this.getContextNode().getRelation(XDIDictionaryConstants.XRI_S_IS_REF);
+		Relation relation = this.getContextNode().getRelation(XDIDictionaryConstants.XDI_ADD_IS_REF);
 		if (relation == null) return null;
 
 		return XdiPeerRoot.fromContextNode(relation.follow());

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiLocalRoot.java
3f795ede994e8d08199e564f553cd6b907e283ca
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiMetaClass.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiMetaClass.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiMetaClass.java
import xdi2.core.syntax.XDIArc;
		return isValidarc(contextNode.getArc());
	public static XDIArc createarc(XDIArc arc) {
		return XDIArc.create("" + XDIConstants.XS_CLASS.charAt(0) + arc + XDIConstants.XS_CLASS.charAt(1));
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (! arc.isClassXs()) return false;
		if (arc.isAttributeXs()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
			if (arc.hasLiteral() || arc.hasXRef()) return false;

import xdi2.core.xri3.XDI3SubSegment;
		return isValidArcXri(contextNode.getArcXri());
	public static XDI3SubSegment createArcXri(XDI3SubSegment arcXri) {
		return XDI3SubSegment.create("" + XDIConstants.XS_CLASS.charAt(0) + arcXri + XDIConstants.XS_CLASS.charAt(1));
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (! arcXri.isClassXs()) return false;
		if (arcXri.isAttributeXs()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
			if (arcXri.hasLiteral() || arcXri.hasXRef()) return false;

@@ -4,9 +4,9 @@
 
 import xdi2.core.ContextNode;
 import xdi2.core.constants.XDIConstants;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 /**
  * An XDI metaclass (context node type).
@@ -35,7 +35,7 @@ public static boolean isValid(ContextNode contextNode) {
 
 		if (contextNode == null) return false;
 
-		return isValidArcXri(contextNode.getArcXri());
+		return isValidarc(contextNode.getArc());
 	}
 
 	/**
@@ -54,21 +54,21 @@ public static XdiMetaClass fromContextNode(ContextNode contextNode) {
 	 * Methods for XRIs
 	 */
 
-	public static XDI3SubSegment createArcXri(XDI3SubSegment arcXri) {
+	public static XDIArc createarc(XDIArc arc) {
 
-		return XDI3SubSegment.create("" + XDIConstants.XS_CLASS.charAt(0) + arcXri + XDIConstants.XS_CLASS.charAt(1));
+		return XDIArc.create("" + XDIConstants.XS_CLASS.charAt(0) + arc + XDIConstants.XS_CLASS.charAt(1));
 	}
 
-	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
+	public static boolean isValidarc(XDIArc arc) {
 
-		if (arcXri == null) return false;
+		if (arc == null) return false;
 
-		if (! arcXri.isClassXs()) return false;
-		if (arcXri.isAttributeXs()) return false;
+		if (! arc.isClassXs()) return false;
+		if (arc.isAttributeXs()) return false;
 
-		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
+		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
 
-			if (arcXri.hasLiteral() || arcXri.hasXRef()) return false;
+			if (arc.hasLiteral() || arc.hasXRef()) return false;
 		} else {
 
 			return false;

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiMetaClass.java
151f0502f57a4ff496d7f1ced047b986953f5111
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiPeerRoot.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiPeerRoot.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiPeerRoot.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.syntax.XDIXRef;
				isPeerRootArc(contextNode.getArc()) &&
	public XDIAddress getAddressOfPeerRoot() {
		return getAddressOfPeerRootArc(this.getContextNode().getArc());
	 * Methods for XDI peer root arcs
	 * Returns the peer root arc of an address.
	 * @param address An address.
	 * @return The peer root arc of the address.
	public static XDIArc createPeerRootArc(XDIAddress address) {
		return XDIArc.create("" + XDIConstants.XS_ROOT.charAt(0) + address + XDIConstants.XS_ROOT.charAt(1));
	 * Returns the address of the peer root arc.
	 * @param arc A peer root arc.
	 * @return The address of the peer root arc.
	public static XDIAddress getAddressOfPeerRootArc(XDIArc arc) {
		if (arc == null) return null;
		if (arc.hasCs()) return null;
		if (arc.isClassXs()) return null;
		if (arc.isAttributeXs()) return null;
		if (! arc.hasXRef()) return null;
		XDIXRef xref = arc.getXRef();
		if (! xref.hasAddress()) return null;
		return xref.getAddress();
	 * Returns the IRI of the peer root arc.
	 * @param arc A peer root arc.
	 * @return The IRI of the peer root arc.
	public static String getIriOfPeerRootArc(XDIArc arc) {
		if (arc == null) return null;
		if (arc.hasCs()) return null;
		if (arc.isClassXs()) return null;
		if (arc.isAttributeXs()) return null;
		if (! arc.hasXRef()) return null;
		XDIXRef xref = arc.getXRef();
	 * Returns the literal of the peer root arc.
	 * @param arc A peer root arc.
	 * @return The literal of the peer root arc.
	public static String getLiteralOfPeerRootArc(XDIArc arc) {
		if (arc == null) return null;
		if (arc.hasCs()) return null;
		if (arc.isClassXs()) return null;
		if (arc.isAttributeXs()) return null;
		if (! arc.hasXRef()) return null;
		XDIXRef xref = arc.getXRef();
	 * Checks if a given arc is a peer root arc.
	 * @param arc A peer root arc.
	 * @return True, if the arc is a peer root arc.
	public static boolean isPeerRootArc(XDIArc arc) {
		return getAddressOfPeerRootArc(arc) != null || getIriOfPeerRootArc(arc) != null || getLiteralOfPeerRootArc(arc) != null;

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
import xdi2.core.xri3.XDI3XRef;
				isPeerRootArcXri(contextNode.getArcXri()) &&
	public XDI3Segment getXriOfPeerRoot() {
		return getXriOfPeerRootArcXri(this.getContextNode().getArcXri());
	 * Methods for XDI peer root XRIs
	 * Returns the peer root XRI of an XRI.
	 * @param xri An XRI.
	 * @return The peer root XRI of the XRI.
	public static XDI3SubSegment createPeerRootArcXri(XDI3Segment xri) {
		return XDI3SubSegment.create("" + XDIConstants.XS_ROOT.charAt(0) + xri + XDIConstants.XS_ROOT.charAt(1));
	 * Returns the XRI of the peer root XRI.
	 * @param arcXri A peer root XRI.
	 * @return The XRI of the peer root XRI.
	public static XDI3Segment getXriOfPeerRootArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return null;
		if (arcXri.hasCs()) return null;
		if (arcXri.isClassXs()) return null;
		if (arcXri.isAttributeXs()) return null;
		if (! arcXri.hasXRef()) return null;
		XDI3XRef xref = arcXri.getXRef();
		if (! xref.hasSegment()) return null;
		return xref.getSegment();
	 * Returns the IRI of the peer root XRI.
	 * @param arcXri A peer root XRI.
	 * @return The IRI of the peer root XRI.
	public static String getIriOfPeerRootArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return null;
		if (arcXri.hasCs()) return null;
		if (arcXri.isClassXs()) return null;
		if (arcXri.isAttributeXs()) return null;
		if (! arcXri.hasXRef()) return null;
		XDI3XRef xref = arcXri.getXRef();
	 * Returns the literal of the peer root XRI.
	 * @param arcXri A peer root XRI.
	 * @return The literal of the peer root XRI.
	public static String getLiteralOfPeerRootArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return null;
		if (arcXri.hasCs()) return null;
		if (arcXri.isClassXs()) return null;
		if (arcXri.isAttributeXs()) return null;
		if (! arcXri.hasXRef()) return null;
		XDI3XRef xref = arcXri.getXRef();
	 * Checks if a given XRI is a peer root XRI.
	 * @param arcXri A peer root XRI.
	 * @return True, if the XRI is a peer root XRI.
	public static boolean isPeerRootArcXri(XDI3SubSegment arcXri) {
		return getXriOfPeerRootArcXri(arcXri) != null || getIriOfPeerRootArcXri(arcXri) != null || getLiteralOfPeerRootArcXri(arcXri) != null;

@@ -5,11 +5,11 @@
 import xdi2.core.ContextNode;
 import xdi2.core.constants.XDIConstants;
 import xdi2.core.features.equivalence.Equivalence;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.syntax.XDIXRef;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
-import xdi2.core.xri3.XDI3XRef;
 
 /**
  * An XDI peer root, represented as a context node.
@@ -39,7 +39,7 @@ public static boolean isValid(ContextNode contextNode) {
 		if (contextNode == null) return false;
 
 		return 
-				isPeerRootArcXri(contextNode.getArcXri()) &&
+				isPeerRootArc(contextNode.getArc()) &&
 				XdiAbstractRoot.isValid(contextNode.getContextNode());
 	}
 
@@ -79,96 +79,96 @@ public boolean isSelfPeerRoot() {
 		return false;
 	}
 
-	public XDI3Segment getXriOfPeerRoot() {
+	public XDIAddress getAddressOfPeerRoot() {
 
-		return getXriOfPeerRootArcXri(this.getContextNode().getArcXri());
+		return getAddressOfPeerRootArc(this.getContextNode().getArc());
 	}
 
 	/*
-	 * Methods for XDI peer root XRIs
+	 * Methods for XDI peer root arcs
 	 */
 
 	/**
-	 * Returns the peer root XRI of an XRI.
-	 * @param xri An XRI.
-	 * @return The peer root XRI of the XRI.
+	 * Returns the peer root arc of an address.
+	 * @param address An address.
+	 * @return The peer root arc of the address.
 	 */
-	public static XDI3SubSegment createPeerRootArcXri(XDI3Segment xri) {
+	public static XDIArc createPeerRootArc(XDIAddress address) {
 
-		return XDI3SubSegment.create("" + XDIConstants.XS_ROOT.charAt(0) + xri + XDIConstants.XS_ROOT.charAt(1));
+		return XDIArc.create("" + XDIConstants.XS_ROOT.charAt(0) + address + XDIConstants.XS_ROOT.charAt(1));
 	}
 
 	/**
-	 * Returns the XRI of the peer root XRI.
-	 * @param arcXri A peer root XRI.
-	 * @return The XRI of the peer root XRI.
+	 * Returns the address of the peer root arc.
+	 * @param arc A peer root arc.
+	 * @return The address of the peer root arc.
 	 */
-	public static XDI3Segment getXriOfPeerRootArcXri(XDI3SubSegment arcXri) {
+	public static XDIAddress getAddressOfPeerRootArc(XDIArc arc) {
 
-		if (arcXri == null) return null;
+		if (arc == null) return null;
 
-		if (arcXri.hasCs()) return null;
-		if (arcXri.isClassXs()) return null;
-		if (arcXri.isAttributeXs()) return null;
-		if (! arcXri.hasXRef()) return null;
+		if (arc.hasCs()) return null;
+		if (arc.isClassXs()) return null;
+		if (arc.isAttributeXs()) return null;
+		if (! arc.hasXRef()) return null;
 
-		XDI3XRef xref = arcXri.getXRef();
+		XDIXRef xref = arc.getXRef();
 		if (! XDIConstants.XS_ROOT.equals(xref.getXs())) return null;
-		if (! xref.hasSegment()) return null;
+		if (! xref.hasAddress()) return null;
 
-		return xref.getSegment();
+		return xref.getAddress();
 	}
 
 	/**
-	 * Returns the IRI of the peer root XRI.
-	 * @param arcXri A peer root XRI.
-	 * @return The IRI of the peer root XRI.
+	 * Returns the IRI of the peer root arc.
+	 * @param arc A peer root arc.
+	 * @return The IRI of the peer root arc.
 	 */
-	public static String getIriOfPeerRootArcXri(XDI3SubSegment arcXri) {
+	public static String getIriOfPeerRootArc(XDIArc arc) {
 
-		if (arcXri == null) return null;
+		if (arc == null) return null;
 
-		if (arcXri.hasCs()) return null;
-		if (arcXri.isClassXs()) return null;
-		if (arcXri.isAttributeXs()) return null;
-		if (! arcXri.hasXRef()) return null;
+		if (arc.hasCs()) return null;
+		if (arc.isClassXs()) return null;
+		if (arc.isAttributeXs()) return null;
+		if (! arc.hasXRef()) return null;
 
-		XDI3XRef xref = arcXri.getXRef();
+		XDIXRef xref = arc.getXRef();
 		if (! XDIConstants.XS_ROOT.equals(xref.getXs())) return null;
 		if (! xref.hasIri()) return null;
 
 		return xref.getIri();
 	}
 
 	/**
-	 * Returns the literal of the peer root XRI.
-	 * @param arcXri A peer root XRI.
-	 * @return The literal of the peer root XRI.
+	 * Returns the literal of the peer root arc.
+	 * @param arc A peer root arc.
+	 * @return The literal of the peer root arc.
 	 */
-	public static String getLiteralOfPeerRootArcXri(XDI3SubSegment arcXri) {
+	public static String getLiteralOfPeerRootArc(XDIArc arc) {
 
-		if (arcXri == null) return null;
+		if (arc == null) return null;
 
-		if (arcXri.hasCs()) return null;
-		if (arcXri.isClassXs()) return null;
-		if (arcXri.isAttributeXs()) return null;
-		if (! arcXri.hasXRef()) return null;
+		if (arc.hasCs()) return null;
+		if (arc.isClassXs()) return null;
+		if (arc.isAttributeXs()) return null;
+		if (! arc.hasXRef()) return null;
 
-		XDI3XRef xref = arcXri.getXRef();
+		XDIXRef xref = arc.getXRef();
 		if (! XDIConstants.XS_ROOT.equals(xref.getXs())) return null;
 		if (! xref.hasLiteral()) return null;
 
 		return xref.getLiteral();
 	}
 
 	/**
-	 * Checks if a given XRI is a peer root XRI.
-	 * @param arcXri A peer root XRI.
-	 * @return True, if the XRI is a peer root XRI.
+	 * Checks if a given arc is a peer root arc.
+	 * @param arc A peer root arc.
+	 * @return True, if the arc is a peer root arc.
 	 */
-	public static boolean isPeerRootArcXri(XDI3SubSegment arcXri) {
+	public static boolean isPeerRootArc(XDIArc arc) {
 
-		return getXriOfPeerRootArcXri(arcXri) != null || getIriOfPeerRootArcXri(arcXri) != null || getLiteralOfPeerRootArcXri(arcXri) != null;
+		return getAddressOfPeerRootArc(arc) != null || getIriOfPeerRootArc(arc) != null || getLiteralOfPeerRootArc(arc) != null;
 	}
 
 	/*

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiPeerRoot.java
0a391ab766986ab01abe8880d8914f2bc7e86500
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiRoot.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiRoot.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiRoot.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIStatement;
	public XdiPeerRoot getPeerRoot(XDIAddress xri, boolean create);
	public XdiInnerRoot getInnerRoot(XDIAddress subject, XDIAddress predicate, boolean create);
	public XdiRoot getRoot(XDIAddress xri, boolean create);
	public XDIAddress absoluteToRelativeXri(XDIAddress xri);
	public XDIAddress relativeToAbsoluteXri(XDIAddress xri);
	public XDIStatement absoluteToRelativeStatementXri(XDIStatement statementXri);
	public XDIStatement relativeToAbsoluteStatementXri(XDIStatement statementXri);
	public static class MappingAbsoluteToRelativeXriIterator extends MappingIterator<XDIAddress, XDIAddress> {
		public MappingAbsoluteToRelativeXriIterator(XdiRoot xdiRoot, Iterator<? extends XDIAddress> iterator) {
		public XDIAddress map(XDIAddress xri) {
	public static class MappingRelativeToAbsoluteXriIterator extends MappingIterator<XDIAddress, XDIAddress> {
		public MappingRelativeToAbsoluteXriIterator(XdiRoot xdiRoot, Iterator<? extends XDIAddress> iterator) {
		public XDIAddress map(XDIAddress xri) {
	public static class MappingAbsoluteToRelativeStatementXriIterator extends MappingIterator<XDIStatement, XDIStatement> {
		public MappingAbsoluteToRelativeStatementXriIterator(XdiRoot xdiRoot, Iterator<? extends XDIStatement> iterator) {
		public XDIStatement map(XDIStatement statementXri) {
	public static class MappingRelativeToAbsoluteStatementXriIterator extends MappingIterator<XDIStatement, XDIStatement> {
		public MappingRelativeToAbsoluteStatementXriIterator(XdiRoot xdiRoot, Iterator<? extends XDIStatement> iterator) {
		public XDIStatement map(XDIStatement statementXri) {

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
	public XdiPeerRoot getPeerRoot(XDI3Segment xri, boolean create);
	public XdiInnerRoot getInnerRoot(XDI3Segment subject, XDI3Segment predicate, boolean create);
	public XdiRoot getRoot(XDI3Segment xri, boolean create);
	public XDI3Segment absoluteToRelativeXri(XDI3Segment xri);
	public XDI3Segment relativeToAbsoluteXri(XDI3Segment xri);
	public XDI3Statement absoluteToRelativeStatementXri(XDI3Statement statementXri);
	public XDI3Statement relativeToAbsoluteStatementXri(XDI3Statement statementXri);
	public static class MappingAbsoluteToRelativeXriIterator extends MappingIterator<XDI3Segment, XDI3Segment> {
		public MappingAbsoluteToRelativeXriIterator(XdiRoot xdiRoot, Iterator<? extends XDI3Segment> iterator) {
		public XDI3Segment map(XDI3Segment xri) {
	public static class MappingRelativeToAbsoluteXriIterator extends MappingIterator<XDI3Segment, XDI3Segment> {
		public MappingRelativeToAbsoluteXriIterator(XdiRoot xdiRoot, Iterator<? extends XDI3Segment> iterator) {
		public XDI3Segment map(XDI3Segment xri) {
	public static class MappingAbsoluteToRelativeStatementXriIterator extends MappingIterator<XDI3Statement, XDI3Statement> {
		public MappingAbsoluteToRelativeStatementXriIterator(XdiRoot xdiRoot, Iterator<? extends XDI3Statement> iterator) {
		public XDI3Statement map(XDI3Statement statementXri) {
	public static class MappingRelativeToAbsoluteStatementXriIterator extends MappingIterator<XDI3Statement, XDI3Statement> {
		public MappingRelativeToAbsoluteStatementXriIterator(XdiRoot xdiRoot, Iterator<? extends XDI3Statement> iterator) {
		public XDI3Statement map(XDI3Statement statementXri) {

@@ -2,9 +2,9 @@
 
 import java.util.Iterator;
 
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIStatement;
 import xdi2.core.util.iterators.MappingIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
 
 public interface XdiRoot extends XdiContext<XdiRoot> {
 
@@ -18,7 +18,7 @@ public interface XdiRoot extends XdiContext<XdiRoot> {
 	 * @param create Whether the XDI peer root should be created, if it does not exist.
 	 * @return The XDI peer root.
 	 */
-	public XdiPeerRoot getPeerRoot(XDI3Segment xri, boolean create);
+	public XdiPeerRoot getPeerRoot(XDIAddress xri, boolean create);
 
 	/**
 	 * Returns an XDI inner root under this XDI root.
@@ -27,99 +27,99 @@ public interface XdiRoot extends XdiContext<XdiRoot> {
 	 * @param create Whether the XDI inner root should be created, if it does not exist.
 	 * @return The XDI inner root.
 	 */
-	public XdiInnerRoot getInnerRoot(XDI3Segment subject, XDI3Segment predicate, boolean create);
+	public XdiInnerRoot getInnerRoot(XDIAddress subject, XDIAddress predicate, boolean create);
 
 	/**
 	 * Returns an XDI root under this XDI root.
 	 * @param xri The XRI contained in the XDI root.
 	 * @param create Whether the XDI root should be created, if it does not exist.
 	 * @return The XDI root.
 	 */
-	public XdiRoot getRoot(XDI3Segment xri, boolean create);
+	public XdiRoot getRoot(XDIAddress xri, boolean create);
 
 	/*
 	 * XRIs and statements relative to this root
 	 */
 
-	public XDI3Segment absoluteToRelativeXri(XDI3Segment xri);
+	public XDIAddress absoluteToRelativeXri(XDIAddress xri);
 
-	public XDI3Segment relativeToAbsoluteXri(XDI3Segment xri);
+	public XDIAddress relativeToAbsoluteXri(XDIAddress xri);
 
-	public XDI3Statement absoluteToRelativeStatementXri(XDI3Statement statementXri);
+	public XDIStatement absoluteToRelativeStatementXri(XDIStatement statementXri);
 
-	public XDI3Statement relativeToAbsoluteStatementXri(XDI3Statement statementXri);
+	public XDIStatement relativeToAbsoluteStatementXri(XDIStatement statementXri);
 
 	/*
 	 * Helper classes
 	 */
 
-	public static class MappingAbsoluteToRelativeXriIterator extends MappingIterator<XDI3Segment, XDI3Segment> {
+	public static class MappingAbsoluteToRelativeXriIterator extends MappingIterator<XDIAddress, XDIAddress> {
 
 		private XdiRoot xdiRoot;
 
-		public MappingAbsoluteToRelativeXriIterator(XdiRoot xdiRoot, Iterator<? extends XDI3Segment> iterator) {
+		public MappingAbsoluteToRelativeXriIterator(XdiRoot xdiRoot, Iterator<? extends XDIAddress> iterator) {
 
 			super(iterator);
 
 			this.xdiRoot = xdiRoot;
 		}
 
 		@Override
-		public XDI3Segment map(XDI3Segment xri) {
+		public XDIAddress map(XDIAddress xri) {
 
 			return this.xdiRoot.absoluteToRelativeXri(xri);
 		}
 	}
 
-	public static class MappingRelativeToAbsoluteXriIterator extends MappingIterator<XDI3Segment, XDI3Segment> {
+	public static class MappingRelativeToAbsoluteXriIterator extends MappingIterator<XDIAddress, XDIAddress> {
 
 		private XdiRoot xdiRoot;
 
-		public MappingRelativeToAbsoluteXriIterator(XdiRoot xdiRoot, Iterator<? extends XDI3Segment> iterator) {
+		public MappingRelativeToAbsoluteXriIterator(XdiRoot xdiRoot, Iterator<? extends XDIAddress> iterator) {
 
 			super(iterator);
 
 			this.xdiRoot = xdiRoot;
 		}
 
 		@Override
-		public XDI3Segment map(XDI3Segment xri) {
+		public XDIAddress map(XDIAddress xri) {
 
 			return this.xdiRoot.relativeToAbsoluteXri(xri);
 		}
 	}
 
-	public static class MappingAbsoluteToRelativeStatementXriIterator extends MappingIterator<XDI3Statement, XDI3Statement> {
+	public static class MappingAbsoluteToRelativeStatementXriIterator extends MappingIterator<XDIStatement, XDIStatement> {
 
 		private XdiRoot xdiRoot;
 
-		public MappingAbsoluteToRelativeStatementXriIterator(XdiRoot xdiRoot, Iterator<? extends XDI3Statement> iterator) {
+		public MappingAbsoluteToRelativeStatementXriIterator(XdiRoot xdiRoot, Iterator<? extends XDIStatement> iterator) {
 
 			super(iterator);
 
 			this.xdiRoot = xdiRoot;
 		}
 
 		@Override
-		public XDI3Statement map(XDI3Statement statementXri) {
+		public XDIStatement map(XDIStatement statementXri) {
 
 			return this.xdiRoot.absoluteToRelativeStatementXri(statementXri);
 		}
 	}
 
-	public static class MappingRelativeToAbsoluteStatementXriIterator extends MappingIterator<XDI3Statement, XDI3Statement> {
+	public static class MappingRelativeToAbsoluteStatementXriIterator extends MappingIterator<XDIStatement, XDIStatement> {
 
 		private XdiRoot xdiRoot;
 
-		public MappingRelativeToAbsoluteStatementXriIterator(XdiRoot xdiRoot, Iterator<? extends XDI3Statement> iterator) {
+		public MappingRelativeToAbsoluteStatementXriIterator(XdiRoot xdiRoot, Iterator<? extends XDIStatement> iterator) {
 
 			super(iterator);
 
 			this.xdiRoot = xdiRoot;
 		}
 
 		@Override
-		public XDI3Statement map(XDI3Statement statementXri) {
+		public XDIStatement map(XDIStatement statementXri) {
 
 			return this.xdiRoot.relativeToAbsoluteStatementXri(statementXri);
 		}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiRoot.java
912023f04edc0bda9d0f84bbafb11969f0490b25
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiValue.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiValue.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiValue.java
import xdi2.core.syntax.XDIArc;
		return isValidarc(contextNode.getArc()) &&
	public static XDIArc createarc() {
		return XDIConstants.XDI_ARC_LITERAL;
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isClassXs()) return false;
		if (arc.isAttributeXs()) return false;
		if (arc.hasLiteral()) return false;
		if (arc.hasXRef()) return false;
		if (! XDIConstants.CS_VALUE.equals(arc.getCs())) return false;

import xdi2.core.xri3.XDI3SubSegment;
		return isValidArcXri(contextNode.getArcXri()) &&
	public static XDI3SubSegment createArcXri() {
		return XDIConstants.XRI_SS_LITERAL;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isClassXs()) return false;
		if (arcXri.isAttributeXs()) return false;
		if (arcXri.hasLiteral()) return false;
		if (arcXri.hasXRef()) return false;
		if (! XDIConstants.CS_VALUE.equals(arcXri.getCs())) return false;

@@ -5,9 +5,9 @@
 import xdi2.core.ContextNode;
 import xdi2.core.Literal;
 import xdi2.core.constants.XDIConstants;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 /**
  * An XDI value (context function), represented as a context node.
@@ -36,7 +36,7 @@ public static boolean isValid(ContextNode contextNode) {
 
 		if (contextNode == null) return false;
 
-		return isValidArcXri(contextNode.getArcXri()) &&
+		return isValidarc(contextNode.getArc()) &&
 				XdiAbstractAttribute.isValid(contextNode.getContextNode());
 	}
 
@@ -104,21 +104,21 @@ public Literal getLiteralBoolean(Boolean literalData) {
 	 * Methods for XRIs
 	 */
 
-	public static XDI3SubSegment createArcXri() {
+	public static XDIArc createarc() {
 
-		return XDIConstants.XRI_SS_LITERAL;
+		return XDIConstants.XDI_ARC_LITERAL;
 	}
 
-	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
+	public static boolean isValidarc(XDIArc arc) {
 
-		if (arcXri == null) return false;
+		if (arc == null) return false;
 
-		if (arcXri.isClassXs()) return false;
-		if (arcXri.isAttributeXs()) return false;
-		if (arcXri.hasLiteral()) return false;
-		if (arcXri.hasXRef()) return false;
+		if (arc.isClassXs()) return false;
+		if (arc.isAttributeXs()) return false;
+		if (arc.hasLiteral()) return false;
+		if (arc.hasXRef()) return false;
 
-		if (! XDIConstants.CS_VALUE.equals(arcXri.getCs())) return false;
+		if (! XDIConstants.CS_VALUE.equals(arc.getCs())) return false;
 
 		return true;
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiValue.java
0f8395791ec093671610bacdf892f019985671bb
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiVariable.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiVariable.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/nodetypes/XdiVariable.java
import xdi2.core.syntax.XDIArc;
		return isValidarc(contextNode.getArc());
	 * @param arc An XDI variable XRI.
	public static boolean isValidarc(XDIArc arc) {
		return VariableUtil.isVariable(arc);

import xdi2.core.xri3.XDI3SubSegment;
		return isValidArcXri(contextNode.getArcXri());
	 * @param arcXri An XDI variable XRI.
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		return VariableUtil.isVariable(arcXri);

@@ -3,10 +3,10 @@
 import java.util.Iterator;
 
 import xdi2.core.ContextNode;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.VariableUtil;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
-import xdi2.core.xri3.XDI3SubSegment;
 
 /**
  * An XDI variable (context function), represented as a context node.
@@ -35,7 +35,7 @@ public static boolean isValid(ContextNode contextNode) {
 
 		if (contextNode == null) return false;
 
-		return isValidArcXri(contextNode.getArcXri());
+		return isValidarc(contextNode.getArc());
 	}
 
 	/**
@@ -56,12 +56,12 @@ public static XdiVariable fromContextNode(ContextNode contextNode) {
 
 	/**
 	 * Checks if a given XRI is an XDI variable XRI.
-	 * @param arcXri An XDI variable XRI.
+	 * @param arc An XDI variable XRI.
 	 * @return True, if the XRI is an XDI variable XRI.
 	 */
-	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
+	public static boolean isValidarc(XDIArc arc) {
 
-		return VariableUtil.isVariable(arcXri);
+		return VariableUtil.isVariable(arc);
 	}
 
 	/*

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fnodetypes%2FXdiVariable.java
7d4fad599fbfb51a5f42b0bea2d5f630cb4312a2
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fsecrettokens%2FSecretTokens.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fsecrettokens%2FSecretTokens.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/secrettokens/SecretTokens.java
		XdiAttribute localSaltAndDigestSecretTokenXdiAttribute = xdiContext.getXdiAttribute(XDIAuthenticationConstants.XDI_ADD_DIGEST_SECRET_TOKEN, false);

		XdiAttribute localSaltAndDigestSecretTokenXdiAttribute = xdiContext.getXdiAttribute(XDIAuthenticationConstants.XRI_S_DIGEST_SECRET_TOKEN, false);

@@ -28,7 +28,7 @@ public static String getLocalSaltAndDigestSecretToken(XdiContext<?> xdiContext)
 
 		// find local salt and digest secret token
 
-		XdiAttribute localSaltAndDigestSecretTokenXdiAttribute = xdiContext.getXdiAttribute(XDIAuthenticationConstants.XRI_S_DIGEST_SECRET_TOKEN, false);
+		XdiAttribute localSaltAndDigestSecretTokenXdiAttribute = xdiContext.getXdiAttribute(XDIAuthenticationConstants.XDI_ADD_DIGEST_SECRET_TOKEN, false);
 		localSaltAndDigestSecretTokenXdiAttribute = localSaltAndDigestSecretTokenXdiAttribute == null ? null : localSaltAndDigestSecretTokenXdiAttribute.dereference();
 
 		XdiValue localSaltAndDigestSecretTokenXdiValue = localSaltAndDigestSecretTokenXdiAttribute == null ? null : localSaltAndDigestSecretTokenXdiAttribute.getXdiValue(false);

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fsecrettokens%2FSecretTokens.java
9dc6b19205f284ae3e9d75a15854617cd92b8be4
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fsignatures%2FKeyPairSignature.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fsignatures%2FKeyPairSignature.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/signatures/KeyPairSignature.java
			if (! ((XdiAttributeSingleton) xdiAttribute).getBasearc().equals(XdiAbstractContext.getBasearc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE))) return false;
			if (! ((XdiAttributeMember) xdiAttribute).getXdiCollection().getBasearc().equals(XdiAbstractContext.getBasearc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE))) return false;

			if (! ((XdiAttributeSingleton) xdiAttribute).getBaseArcXri().equals(XdiAbstractContext.getBaseArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE))) return false;
			if (! ((XdiAttributeMember) xdiAttribute).getXdiCollection().getBaseArcXri().equals(XdiAbstractContext.getBaseArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE))) return false;

@@ -47,10 +47,10 @@ public static boolean isValid(XdiAttribute xdiAttribute) {
 
 		if (xdiAttribute instanceof XdiAttributeSingleton) {
 
-			if (! ((XdiAttributeSingleton) xdiAttribute).getBaseArcXri().equals(XdiAbstractContext.getBaseArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE))) return false;
+			if (! ((XdiAttributeSingleton) xdiAttribute).getBasearc().equals(XdiAbstractContext.getBasearc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE))) return false;
 		} else if (xdiAttribute instanceof XdiAttributeMember) {
 
-			if (! ((XdiAttributeMember) xdiAttribute).getXdiCollection().getBaseArcXri().equals(XdiAbstractContext.getBaseArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE))) return false;
+			if (! ((XdiAttributeMember) xdiAttribute).getXdiCollection().getBasearc().equals(XdiAbstractContext.getBasearc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE))) return false;
 		} else {
 
 			return false;

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fsignatures%2FKeyPairSignature.java
735fb3b5e713f1ed03dc1e755b1f1025c7ba5bc4
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fsignatures%2FSignatures.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fsignatures%2FSignatures.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/signatures/Signatures.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
			signatureXdiAttribute = XdiAbstractContext.fromContextNode(contextNode).getXdiAttributeSingleton(XdiAttributeSingleton.createarc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE), true);
			signatureXdiAttribute = XdiAbstractContext.fromContextNode(contextNode).getXdiAttributeCollection(XdiAttributeCollection.createarc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE), true).setXdiMemberUnordered(null);
		XDIAddress dataTypeXri = getDataTypeXri(digestAlgorithm, digestLength, keyAlgorithm, keyLength);
		XdiAttributeSingleton signatureAttributeSingleton = xdiContext.getXdiAttributeSingleton(XdiAttributeSingleton.createarc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE), false);
		XdiAttributeCollection signatureAttributeCollection = xdiContext.getXdiAttributeCollection(XdiAttributeCollection.createarc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE), false);
		if (log.isDebugEnabled()) log.debug("Normalized context node " + contextNode.getAddress() + ": " + string);
		XDIAddress dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
	public static String getDigestAlgorithm(XDIAddress dataTypeXri) {
		XDIArc digestAlgorithmXri = dataTypeXri.getNumArcs() > 0 ? dataTypeXri.getArc(0) : null;
		XDIAddress dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
	public static Integer getDigestLength(XDIAddress dataTypeXri) {
		XDIArc digestLengthXri = dataTypeXri.getNumArcs() > 1 ? dataTypeXri.getArc(1) : null;
		XDIAddress dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
	public static String getKeyAlgorithm(XDIAddress dataTypeXri) {
		XDIArc keyAlgorithmXri = dataTypeXri.getNumArcs() > 2 ? dataTypeXri.getArc(2) : null;
		XDIAddress dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
	public static Integer getKeyLength(XDIAddress dataTypeXri) {
		XDIArc keyLengthXri = dataTypeXri.getNumArcs() > 3 ? dataTypeXri.getArc(3) : null;
	public static XDIAddress getDataTypeXri(String digestAlgorithm, int digestLength, String keyAlgorithm, int keyLength) {
		return XDIAddress.create(builder.toString());

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
			signatureXdiAttribute = XdiAbstractContext.fromContextNode(contextNode).getXdiAttributeSingleton(XdiAttributeSingleton.createArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE), true);
			signatureXdiAttribute = XdiAbstractContext.fromContextNode(contextNode).getXdiAttributeCollection(XdiAttributeCollection.createArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE), true).setXdiMemberUnordered(null);
		XDI3Segment dataTypeXri = getDataTypeXri(digestAlgorithm, digestLength, keyAlgorithm, keyLength);
		XdiAttributeSingleton signatureAttributeSingleton = xdiContext.getXdiAttributeSingleton(XdiAttributeSingleton.createArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE), false);
		XdiAttributeCollection signatureAttributeCollection = xdiContext.getXdiAttributeCollection(XdiAttributeCollection.createArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE), false);
		if (log.isDebugEnabled()) log.debug("Normalized context node " + contextNode.getXri() + ": " + string);
		XDI3Segment dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
	public static String getDigestAlgorithm(XDI3Segment dataTypeXri) {
		XDI3SubSegment digestAlgorithmXri = dataTypeXri.getNumSubSegments() > 0 ? dataTypeXri.getSubSegment(0) : null;
		XDI3Segment dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
	public static Integer getDigestLength(XDI3Segment dataTypeXri) {
		XDI3SubSegment digestLengthXri = dataTypeXri.getNumSubSegments() > 1 ? dataTypeXri.getSubSegment(1) : null;
		XDI3Segment dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
	public static String getKeyAlgorithm(XDI3Segment dataTypeXri) {
		XDI3SubSegment keyAlgorithmXri = dataTypeXri.getNumSubSegments() > 2 ? dataTypeXri.getSubSegment(2) : null;
		XDI3Segment dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
	public static Integer getKeyLength(XDI3Segment dataTypeXri) {
		XDI3SubSegment keyLengthXri = dataTypeXri.getNumSubSegments() > 3 ? dataTypeXri.getSubSegment(3) : null;
	public static XDI3Segment getDataTypeXri(String digestAlgorithm, int digestLength, String keyAlgorithm, int keyLength) {
		return XDI3Segment.create(builder.toString());

@@ -27,14 +27,14 @@
 import xdi2.core.impl.memory.MemoryGraphFactory;
 import xdi2.core.io.XDIWriterRegistry;
 import xdi2.core.io.writers.XDIJSONWriter;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.CopyUtil;
 import xdi2.core.util.iterators.CompositeIterator;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
 import xdi2.core.util.iterators.ReadOnlyIterator;
 import xdi2.core.util.iterators.SingleItemIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
 
 public class Signatures {
 
@@ -64,11 +64,11 @@ private Signatures() { }
 		XdiAttribute signatureXdiAttribute;
 
 		if (singleton)
-			signatureXdiAttribute = XdiAbstractContext.fromContextNode(contextNode).getXdiAttributeSingleton(XdiAttributeSingleton.createArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE), true);
+			signatureXdiAttribute = XdiAbstractContext.fromContextNode(contextNode).getXdiAttributeSingleton(XdiAttributeSingleton.createarc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE), true);
 		else
-			signatureXdiAttribute = XdiAbstractContext.fromContextNode(contextNode).getXdiAttributeCollection(XdiAttributeCollection.createArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE), true).setXdiMemberUnordered(null);
+			signatureXdiAttribute = XdiAbstractContext.fromContextNode(contextNode).getXdiAttributeCollection(XdiAttributeCollection.createarc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE), true).setXdiMemberUnordered(null);
 
-		XDI3Segment dataTypeXri = getDataTypeXri(digestAlgorithm, digestLength, keyAlgorithm, keyLength);
+		XDIAddress dataTypeXri = getDataTypeXri(digestAlgorithm, digestLength, keyAlgorithm, keyLength);
 		DataTypes.setDataType(signatureXdiAttribute.getContextNode(), dataTypeXri);
 
 		return Signature.fromXdiAttribute(signatureXdiAttribute);
@@ -85,13 +85,13 @@ private Signatures() { }
 
 		// add signature that is an XDI attribute singleton
 
-		XdiAttributeSingleton signatureAttributeSingleton = xdiContext.getXdiAttributeSingleton(XdiAttributeSingleton.createArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE), false);
+		XdiAttributeSingleton signatureAttributeSingleton = xdiContext.getXdiAttributeSingleton(XdiAttributeSingleton.createarc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE), false);
 
 		if (signatureAttributeSingleton != null) iterators.add(new SingleItemIterator<Signature<?, ?>> (Signature.fromXdiAttribute(signatureAttributeSingleton)));
 
 		// add signatures that are XDI attribute instances
 
-		XdiAttributeCollection signatureAttributeCollection = xdiContext.getXdiAttributeCollection(XdiAttributeCollection.createArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE), false);
+		XdiAttributeCollection signatureAttributeCollection = xdiContext.getXdiAttributeCollection(XdiAttributeCollection.createarc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE), false);
 
 		if (signatureAttributeCollection != null) iterators.add(new MappingXdiAttributeSignatureIterator(signatureAttributeCollection.getXdiMembersDeref()));
 
@@ -136,21 +136,21 @@ public static String getNormalizedSerialization(ContextNode contextNode) {
 			graph.close();
 		}
 
-		if (log.isDebugEnabled()) log.debug("Normalized context node " + contextNode.getXri() + ": " + string);
+		if (log.isDebugEnabled()) log.debug("Normalized context node " + contextNode.getAddress() + ": " + string);
 
 		return string;
 	}
 
 	public static String getDigestAlgorithm(XdiAttribute xdiAttribute) {
 
-		XDI3Segment dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
+		XDIAddress dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
 
 		return dataTypeXri == null ? null : getDigestAlgorithm(dataTypeXri);
 	}
 
-	public static String getDigestAlgorithm(XDI3Segment dataTypeXri) {
+	public static String getDigestAlgorithm(XDIAddress dataTypeXri) {
 
-		XDI3SubSegment digestAlgorithmXri = dataTypeXri.getNumSubSegments() > 0 ? dataTypeXri.getSubSegment(0) : null;
+		XDIArc digestAlgorithmXri = dataTypeXri.getNumArcs() > 0 ? dataTypeXri.getArc(0) : null;
 		if (digestAlgorithmXri == null) return null;
 
 		if (! XDIConstants.CS_CLASS_RESERVED.equals(digestAlgorithmXri.getCs())) return null;
@@ -162,14 +162,14 @@ public static String getDigestAlgorithm(XDI3Segment dataTypeXri) {
 
 	public static Integer getDigestLength(XdiAttribute xdiAttribute) {
 
-		XDI3Segment dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
+		XDIAddress dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
 
 		return dataTypeXri == null ? null : getDigestLength(dataTypeXri);
 	}
 
-	public static Integer getDigestLength(XDI3Segment dataTypeXri) {
+	public static Integer getDigestLength(XDIAddress dataTypeXri) {
 
-		XDI3SubSegment digestLengthXri = dataTypeXri.getNumSubSegments() > 1 ? dataTypeXri.getSubSegment(1) : null;
+		XDIArc digestLengthXri = dataTypeXri.getNumArcs() > 1 ? dataTypeXri.getArc(1) : null;
 		if (digestLengthXri == null) return null;
 
 		if (! XDIConstants.CS_CLASS_RESERVED.equals(digestLengthXri.getCs())) return null;
@@ -181,14 +181,14 @@ public static Integer getDigestLength(XDI3Segment dataTypeXri) {
 
 	public static String getKeyAlgorithm(XdiAttribute xdiAttribute) {
 
-		XDI3Segment dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
+		XDIAddress dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
 
 		return dataTypeXri == null ? null : getKeyAlgorithm(dataTypeXri);
 	}
 
-	public static String getKeyAlgorithm(XDI3Segment dataTypeXri) {
+	public static String getKeyAlgorithm(XDIAddress dataTypeXri) {
 
-		XDI3SubSegment keyAlgorithmXri = dataTypeXri.getNumSubSegments() > 2 ? dataTypeXri.getSubSegment(2) : null;
+		XDIArc keyAlgorithmXri = dataTypeXri.getNumArcs() > 2 ? dataTypeXri.getArc(2) : null;
 		if (keyAlgorithmXri == null) return null;
 
 		if (! XDIConstants.CS_CLASS_RESERVED.equals(keyAlgorithmXri.getCs())) return null;
@@ -200,14 +200,14 @@ public static String getKeyAlgorithm(XDI3Segment dataTypeXri) {
 
 	public static Integer getKeyLength(XdiAttribute xdiAttribute) {
 
-		XDI3Segment dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
+		XDIAddress dataTypeXri = DataTypes.getDataType(xdiAttribute.getContextNode());
 
 		return dataTypeXri == null ? null : getKeyLength(dataTypeXri);
 	}
 
-	public static Integer getKeyLength(XDI3Segment dataTypeXri) {
+	public static Integer getKeyLength(XDIAddress dataTypeXri) {
 
-		XDI3SubSegment keyLengthXri = dataTypeXri.getNumSubSegments() > 3 ? dataTypeXri.getSubSegment(3) : null;
+		XDIArc keyLengthXri = dataTypeXri.getNumArcs() > 3 ? dataTypeXri.getArc(3) : null;
 		if (keyLengthXri == null) return null;
 
 		if (! XDIConstants.CS_CLASS_RESERVED.equals(keyLengthXri.getCs())) return null;
@@ -217,7 +217,7 @@ public static Integer getKeyLength(XDI3Segment dataTypeXri) {
 		return Integer.valueOf(keyLengthXri.getLiteral());
 	}
 
-	public static XDI3Segment getDataTypeXri(String digestAlgorithm, int digestLength, String keyAlgorithm, int keyLength) {
+	public static XDIAddress getDataTypeXri(String digestAlgorithm, int digestLength, String keyAlgorithm, int keyLength) {
 
 		StringBuilder builder = new StringBuilder();
 
@@ -226,7 +226,7 @@ public static XDI3Segment getDataTypeXri(String digestAlgorithm, int digestLengt
 		builder.append(XDIConstants.CS_CLASS_RESERVED + keyAlgorithm.toLowerCase());
 		builder.append(XDIConstants.CS_CLASS_RESERVED + Integer.toString(keyLength));
 
-		return XDI3Segment.create(builder.toString());
+		return XDIAddress.create(builder.toString());
 	}
 
 	/*

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fsignatures%2FSignatures.java
f69c0593ac73df75073e4d7e91a92809c8165b48
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fsignatures%2FSymmetricKeySignature.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fsignatures%2FSymmetricKeySignature.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/signatures/SymmetricKeySignature.java
			if (! ((XdiAttributeSingleton) xdiAttribute).getBasearc().equals(XdiAbstractContext.getBasearc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE))) return false;
			if (! ((XdiAttributeMember) xdiAttribute).getXdiCollection().getBasearc().equals(XdiAbstractContext.getBasearc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE))) return false;

			if (! ((XdiAttributeSingleton) xdiAttribute).getBaseArcXri().equals(XdiAbstractContext.getBaseArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE))) return false;
			if (! ((XdiAttributeMember) xdiAttribute).getXdiCollection().getBaseArcXri().equals(XdiAbstractContext.getBaseArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE))) return false;

@@ -48,10 +48,10 @@ public static boolean isValid(XdiAttribute xdiAttribute) {
 
 		if (xdiAttribute instanceof XdiAttributeSingleton) {
 
-			if (! ((XdiAttributeSingleton) xdiAttribute).getBaseArcXri().equals(XdiAbstractContext.getBaseArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE))) return false;
+			if (! ((XdiAttributeSingleton) xdiAttribute).getBasearc().equals(XdiAbstractContext.getBasearc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE))) return false;
 		} else if (xdiAttribute instanceof XdiAttributeMember) {
 
-			if (! ((XdiAttributeMember) xdiAttribute).getXdiCollection().getBaseArcXri().equals(XdiAbstractContext.getBaseArcXri(XDIAuthenticationConstants.XRI_SS_SIGNATURE))) return false;
+			if (! ((XdiAttributeMember) xdiAttribute).getXdiCollection().getBasearc().equals(XdiAbstractContext.getBasearc(XDIAuthenticationConstants.XDI_ARC_SIGNATURE))) return false;
 		} else {
 
 			return false;

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Fsignatures%2FSymmetricKeySignature.java
41b2d12106853f65b160dd20644ca82dc1e2b422
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Ftimestamps%2FTimestamps.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Ftimestamps%2FTimestamps.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/features/timestamps/Timestamps.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.util.AddressUtil;
	public static Date getContextNodeTimestamp(ContextNode contextNode, XDIAddress modifier) {
		XDIAddress timestampXri = modifier == null ? XDITimestampsConstants.XDI_ADD_AS_T : AddressUtil.concatAddresses(modifier, XDITimestampsConstants.XDI_ARC_AS_T);
	public static void setContextNodeTimestamp(ContextNode contextNode, XDIAddress modifierXri, Date timestamp) {
		XDIAddress timestampXri = modifierXri == null ? XDITimestampsConstants.XDI_ADD_AS_T : AddressUtil.concatAddresses(modifierXri, XDITimestampsConstants.XDI_ARC_AS_T);

import xdi2.core.util.XDI3Util;
import xdi2.core.xri3.XDI3Segment;
	public static Date getContextNodeTimestamp(ContextNode contextNode, XDI3Segment modifier) {
		XDI3Segment timestampXri = modifier == null ? XDITimestampsConstants.XRI_S_AS_T : XDI3Util.concatXris(modifier, XDITimestampsConstants.XRI_SS_AS_T);
	public static void setContextNodeTimestamp(ContextNode contextNode, XDI3Segment modifierXri, Date timestamp) {
		XDI3Segment timestampXri = modifierXri == null ? XDITimestampsConstants.XRI_S_AS_T : XDI3Util.concatXris(modifierXri, XDITimestampsConstants.XRI_SS_AS_T);

@@ -13,8 +13,8 @@
 import xdi2.core.features.nodetypes.XdiAbstractContext;
 import xdi2.core.features.nodetypes.XdiAttributeSingleton;
 import xdi2.core.features.nodetypes.XdiValue;
-import xdi2.core.util.XDI3Util;
-import xdi2.core.xri3.XDI3Segment;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.util.AddressUtil;
 
 public class Timestamps {
 
@@ -60,9 +60,9 @@ public static Date stringToTimestamp(String string) {
 	/**
 	 * Get the timestamp associated with a context node.
 	 */
-	public static Date getContextNodeTimestamp(ContextNode contextNode, XDI3Segment modifier) {
+	public static Date getContextNodeTimestamp(ContextNode contextNode, XDIAddress modifier) {
 
-		XDI3Segment timestampXri = modifier == null ? XDITimestampsConstants.XRI_S_AS_T : XDI3Util.concatXris(modifier, XDITimestampsConstants.XRI_SS_AS_T);
+		XDIAddress timestampXri = modifier == null ? XDITimestampsConstants.XDI_ADD_AS_T : AddressUtil.concatAddresses(modifier, XDITimestampsConstants.XDI_ARC_AS_T);
 
 		XdiAttributeSingleton xdiAttributeSingleton = XdiAbstractContext.fromContextNode(contextNode).getXdiAttributeSingleton(timestampXri, false);
 		if (xdiAttributeSingleton == null) return null;
@@ -85,9 +85,9 @@ public static Date getContextNodeTimestamp(ContextNode contextNode) {
 	/**
 	 * Set the timestamp associated with a context node.
 	 */
-	public static void setContextNodeTimestamp(ContextNode contextNode, XDI3Segment modifierXri, Date timestamp) {
+	public static void setContextNodeTimestamp(ContextNode contextNode, XDIAddress modifierXri, Date timestamp) {
 
-		XDI3Segment timestampXri = modifierXri == null ? XDITimestampsConstants.XRI_S_AS_T : XDI3Util.concatXris(modifierXri, XDITimestampsConstants.XRI_SS_AS_T);
+		XDIAddress timestampXri = modifierXri == null ? XDITimestampsConstants.XDI_ADD_AS_T : AddressUtil.concatAddresses(modifierXri, XDITimestampsConstants.XDI_ARC_AS_T);
 
 		String literalData = timestampToString(timestamp);
 

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Ffeatures%2Ftimestamps%2FTimestamps.java
388e2a27e3f29a6f81f41cf9524151a38bc66ef6
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FAbstractContextNode.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FAbstractContextNode.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/AbstractContextNode.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.syntax.XDIStatement;
import xdi2.core.util.AddressUtil;
	private XDIAddress xri;
			this.getContextNode().delContextNode(this.getArc());
	public XDIAddress getAddress() {
				this.xri = XDIConstants.XDI_ADD_ROOT;
				this.xri = AddressUtil.concatAddresses(this.getContextNode().getAddress(), this.getArc());
	//	public ContextNode setContextNode(XDIArc contextNodeArc);
	public ContextNode setDeepContextNode(XDIAddress relativecontextNodeAddress) {
		if (relativecontextNodeAddress == null) return this;
		if (XDIConstants.XDI_ADD_ROOT.equals(relativecontextNodeAddress)) return this;
		for (XDIArc contextNodeArc : relativecontextNodeAddress.getArcs()) {
			contextNode = contextNode.setContextNode(contextNodeArc);
	public ContextNode getContextNode(XDIArc relativecontextNodeAddress, boolean subgraph) {
			if (contextNode.getArc().equals(relativecontextNodeAddress)) return contextNode;
	public ContextNode getContextNode(XDIArc contextNodeArc) {
		return this.getContextNode(contextNodeArc, false);
	public ContextNode getDeepContextNode(XDIAddress relativecontextNodeAddress, boolean subgraph) {
		if (XDIConstants.XDI_ADD_ROOT.equals(relativecontextNodeAddress)) return this;
		for (XDIArc contextNodeArc : relativecontextNodeAddress.getArcs()) {
			contextNode = contextNode.getContextNode(contextNodeArc, subgraph);
	public ContextNode getDeepContextNode(XDIAddress relativecontextNodeAddress) {
		return this.getDeepContextNode(relativecontextNodeAddress, false);
	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDIAddress relativecontextNodeAddress) {
		ContextNode contextNode = this.getDeepContextNode(relativecontextNodeAddress, false);
	public boolean containsContextNode(XDIArc contextNodeArc) {
		return this.getContextNode(contextNodeArc, false) != null;
	public Relation setRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
		ContextNode targetContextNode = this.setRelationSetTargetContextNode(targetContextNodeAddress);
		Relation relation = this.setRelation(arc, targetContextNode);
	public Relation setDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress) {
		ContextNode contextNode = this.setDeepContextNode(relativecontextNodeAddress);
		return contextNode.setRelation(arc, targetContextNodeAddress);
	//	public Relation setRelation(XDIAddress arc, ContextNode targetContextNode) {
	public Relation setDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc, ContextNode targetContextNode) {
		ContextNode contextNode = this.setDeepContextNode(relativecontextNodeAddress);
		return contextNode.setRelation(arc, targetContextNode);
	public Relation getRelation(XDIAddress arc, final XDIAddress targetContextNodeAddress) {
		Iterator<Relation> selectingIterator = new SelectingIterator<Relation> (this.getRelations(arc)) {
				return relation.getTargetContextNodeAddress().equals(targetContextNodeAddress);
	public Relation getDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress) {
		ContextNode contextNode = this.getDeepContextNode(relativecontextNodeAddress, false);
		return contextNode.getRelation(arc, targetContextNodeAddress);
	public Relation getRelation(XDIAddress arc) {
		return new IteratorFirstItem<Relation> (this.getRelations(arc)).item();
	public Relation getDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc) {
		ContextNode contextNode = this.getDeepContextNode(relativecontextNodeAddress, false);
		return contextNode.getRelation(arc);
	public ReadOnlyIterator<Relation> getRelations(final XDIAddress arc) {
				return relation.getArc().equals(arc);
	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress relativecontextNodeAddress, XDIAddress arc) {
		ContextNode contextNode = this.getDeepContextNode(relativecontextNodeAddress, false);
		return contextNode.getRelations(arc);
	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress relativecontextNodeAddress) {
		ContextNode contextNode = this.getDeepContextNode(relativecontextNodeAddress, false);
	public ReadOnlyIterator<Relation> getIncomingRelations(final XDIAddress arc) {
				return relation.getArc().equals(arc);
	public boolean containsRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
		return this.getRelation(arc, targetContextNodeAddress) != null;
	public boolean containsRelations(XDIAddress arc) {
		return this.getRelations(arc).hasNext();
	public boolean containsIncomingRelations(XDIAddress arc) {
		return this.getIncomingRelations(arc).hasNext();
	public void delRelations(XDIAddress arc) {
		for (Relation relation : this.getRelations(arc)) relation.delete();
	public long getRelationCount(XDIAddress arc) {
		return new IteratorCounter(this.getRelations(arc)).count();
	public Literal setDeepLiteral(XDIAddress relativecontextNodeAddress, Object literalData) {
		ContextNode contextNode = this.setDeepContextNode(relativecontextNodeAddress);
	public Literal setDeepLiteralString(XDIAddress relativecontextNodeAddress, String literalData) {
		return this.setDeepLiteral(relativecontextNodeAddress, literalData);
	public Literal setDeepLiteralNumber(XDIAddress relativecontextNodeAddress, Double literalData) {
		return this.setDeepLiteral(relativecontextNodeAddress, literalData);
	public Literal setDeepLiteralBoolean(XDIAddress relativecontextNodeAddress, Boolean literalData) {
		return this.setDeepLiteral(relativecontextNodeAddress, literalData);
	public Literal getDeepLiteral(XDIAddress relativecontextNodeAddress, Object literalData) {
		ContextNode contextNode = this.getDeepContextNode(relativecontextNodeAddress, false);
	public Literal getDeepLiteralString(XDIAddress relativecontextNodeAddress, String literalData) {
		return this.getDeepLiteral(relativecontextNodeAddress, literalData);
	public Literal getDeepLiteralNumber(XDIAddress relativecontextNodeAddress, Double literalData) {
		return this.getDeepLiteral(relativecontextNodeAddress, literalData);
	public Literal getDeepLiteralBoolean(XDIAddress relativecontextNodeAddress, Boolean literalData) {
		return this.getDeepLiteral(relativecontextNodeAddress, literalData);
	public Literal getDeepLiteral(XDIAddress relativecontextNodeAddress) {
		ContextNode contextNode = this.getDeepContextNode(relativecontextNodeAddress, false);
	public Statement setStatement(XDIStatement statementXri) {
			ContextNode contextNode = this.setDeepContextNode(statementXri.getTargetContextNodeAddress());
			Relation relation = this.setDeepRelation(statementXri.getContextNodeAddress(), statementXri.getRelationAddress(), statementXri.getTargetContextNodeAddress());
			Literal literal = this.setDeepLiteral(statementXri.getContextNodeAddress(), statementXri.getLiteralData());
	public Statement getStatement(XDIStatement statementXri) {
			ContextNode contextNode = baseContextNode.getContextNode(statementXri.getContextNodeArc(), false);
			Relation relation = baseContextNode.getRelation(statementXri.getRelationAddress(), statementXri.getTargetContextNodeAddress());
	public boolean containsStatement(XDIStatement statementXri) {
	protected void setContextNodeCheckValid(XDIArc arc) throws Xdi2GraphException {
		if (arc == null) throw new NullPointerException();
		if (XDIConstants.XDI_ADD_CONTEXT.equals(arc)) throw new Xdi2GraphException("Invalid context node arc: " + arc);
		if (this.containsRelations(XDIDictionaryConstants.XDI_ADD_REF)) throw new Xdi2GraphException("Cannot add " + arc + " context node to context node " + this.getAddress() + " containing a " + XDIDictionaryConstants.XDI_ADD_REF + " relation.");
		if (this.containsRelations(XDIDictionaryConstants.XDI_ADD_REP)) throw new Xdi2GraphException("Cannot add " + arc + " context node to context node " + this.getAddress() + " containing a " + XDIDictionaryConstants.XDI_ADD_REP + " relation.");
		ContextNode tempContextNode = new BasicContextNode(this.getGraph(), this, arc, null, null, null);
		if (! XdiAbstractContext.isValid(tempContextNode)) throw new Xdi2GraphException("Invalid subgraph: " + arc + " under subgraph " + this.getAddress());
	protected void setRelationCheckValid(XDIAddress arc, XDIAddress targetContextNodeAddress) throws Xdi2GraphException {
		if (arc == null) throw new NullPointerException();
		if (targetContextNodeAddress == null) throw new NullPointerException();
		if (XDIConstants.XDI_ADD_CONTEXT.equals(arc)) throw new Xdi2GraphException("Invalid relation arc: " + arc);
		if (XDIConstants.XDI_ADD_LITERAL.equals(arc)) throw new Xdi2GraphException("Invalid relation arc: " + arc);
			if (XDIDictionaryConstants.XDI_ADD_REF.equals(arc)) {
				if (! this.containsRelation(XDIDictionaryConstants.XDI_ADD_REF, targetContextNodeAddress)) throw new Xdi2GraphException("Cannot add " + arc + "/" + targetContextNodeAddress + " relation to non-empty context node " + this.getAddress() + ".");
				if (this.containsRelations(XDIDictionaryConstants.XDI_ADD_REF)) throw new Xdi2GraphException("Cannot add " + arc + "/" + targetContextNodeAddress + " relation to context node " + this.getAddress() + ", which already contains a $ref.");
			if (XDIDictionaryConstants.XDI_ADD_REP.equals(arc)) {
				if (! this.containsRelation(XDIDictionaryConstants.XDI_ADD_REP, targetContextNodeAddress)) throw new Xdi2GraphException("Cannot add " + arc + "/" + targetContextNodeAddress + " relation to non-empty context node " + this.getAddress() + ".");
				if (this.containsRelations(XDIDictionaryConstants.XDI_ADD_REP)) throw new Xdi2GraphException("Cannot add " + arc + "/" + targetContextNodeAddress + " relation to context node " + this.getAddress() + ", which already contains a $rep.");
		if (this.containsRelations(XDIDictionaryConstants.XDI_ADD_REF)) throw new Xdi2GraphException("Cannot add literal to context node " + this.getAddress() + " containing a " + XDIDictionaryConstants.XDI_ADD_REF + " relation.");
		if (this.containsRelations(XDIDictionaryConstants.XDI_ADD_REP)) throw new Xdi2GraphException("Cannot add literal to context node " + this.getAddress() + " containing a " + XDIDictionaryConstants.XDI_ADD_REP + " relation.");
	protected void setContextNodeSetInnerRoot(XDIArc arc, ContextNode contextNode) {
		if (XdiInnerRoot.isInnerRootarc(arc)) {
			this.setDeepContextNode(XdiInnerRoot.getSubjectOfInnerRootXri(arc)).setRelation(XdiInnerRoot.getPredicateOfInnerRootXri(arc), contextNode);
	protected ContextNode setRelationSetTargetContextNode(XDIAddress targetContextNodeAddress) {
		return this.getGraph().setDeepContextNode(targetContextNodeAddress);
			contextNode.delRelationDelInnerRoot(relation.getArc(), relation.getTargetContextNodeAddress());
	protected void delRelationDelInnerRoot(XDIAddress arc, XDIAddress targetContextNodeAddress) {
		if (XdiInnerRoot.createInnerRootarc(this.getAddress(), arc).equals(targetContextNodeAddress)) {
			this.getGraph().getDeepContextNode(targetContextNodeAddress, false).delete();
		return this.getAddress().toString();
		return this.getAddress().equals(other.getAddress());
		hashCode = (hashCode * 31) + this.getAddress().hashCode();
		return this.getAddress().compareTo(other.getAddress());
		public XDIAddress getSubject() {
			return AbstractContextNode.this.getContextNode().getAddress();
		public XDIArc getObject() {
			return AbstractContextNode.this.getArc();

import xdi2.core.util.XDI3Util;
import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
import xdi2.core.xri3.XDI3SubSegment;
	private XDI3Segment xri;
			this.getContextNode().delContextNode(this.getArcXri());
	public XDI3Segment getXri() {
				this.xri = XDIConstants.XRI_S_ROOT;
				this.xri = XDI3Util.concatXris(this.getContextNode().getXri(), this.getArcXri());
	//	public ContextNode setContextNode(XDI3SubSegment contextNodeArcXri);
	public ContextNode setDeepContextNode(XDI3Segment relativeContextNodeXri) {
		if (relativeContextNodeXri == null) return this;
		if (XDIConstants.XRI_S_ROOT.equals(relativeContextNodeXri)) return this;
		for (XDI3SubSegment contextNodeArcXri : relativeContextNodeXri.getSubSegments()) {
			contextNode = contextNode.setContextNode(contextNodeArcXri);
	public ContextNode getContextNode(XDI3SubSegment relativeContextNodeXri, boolean subgraph) {
			if (contextNode.getArcXri().equals(relativeContextNodeXri)) return contextNode;
	public ContextNode getContextNode(XDI3SubSegment contextNodeArcXri) {
		return this.getContextNode(contextNodeArcXri, false);
	public ContextNode getDeepContextNode(XDI3Segment relativeContextNodeXri, boolean subgraph) {
		if (XDIConstants.XRI_S_ROOT.equals(relativeContextNodeXri)) return this;
		for (XDI3SubSegment contextNodeArcXri : relativeContextNodeXri.getSubSegments()) {
			contextNode = contextNode.getContextNode(contextNodeArcXri, subgraph);
	public ContextNode getDeepContextNode(XDI3Segment relativeContextNodeXri) {
		return this.getDeepContextNode(relativeContextNodeXri, false);
	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDI3Segment relativeContextNodeXri) {
		ContextNode contextNode = this.getDeepContextNode(relativeContextNodeXri, false);
	public boolean containsContextNode(XDI3SubSegment contextNodeArcXri) {
		return this.getContextNode(contextNodeArcXri, false) != null;
	public Relation setRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		ContextNode targetContextNode = this.setRelationSetTargetContextNode(targetContextNodeXri);
		Relation relation = this.setRelation(arcXri, targetContextNode);
	public Relation setDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		ContextNode contextNode = this.setDeepContextNode(relativeContextNodeXri);
		return contextNode.setRelation(arcXri, targetContextNodeXri);
	//	public Relation setRelation(XDI3Segment arcXri, ContextNode targetContextNode) {
	public Relation setDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri, ContextNode targetContextNode) {
		ContextNode contextNode = this.setDeepContextNode(relativeContextNodeXri);
		return contextNode.setRelation(arcXri, targetContextNode);
	public Relation getRelation(XDI3Segment arcXri, final XDI3Segment targetContextNodeXri) {
		Iterator<Relation> selectingIterator = new SelectingIterator<Relation> (this.getRelations(arcXri)) {
				return relation.getTargetContextNodeXri().equals(targetContextNodeXri);
	public Relation getDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		ContextNode contextNode = this.getDeepContextNode(relativeContextNodeXri, false);
		return contextNode.getRelation(arcXri, targetContextNodeXri);
	public Relation getRelation(XDI3Segment arcXri) {
		return new IteratorFirstItem<Relation> (this.getRelations(arcXri)).item();
	public Relation getDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri) {
		ContextNode contextNode = this.getDeepContextNode(relativeContextNodeXri, false);
		return contextNode.getRelation(arcXri);
	public ReadOnlyIterator<Relation> getRelations(final XDI3Segment arcXri) {
				return relation.getArcXri().equals(arcXri);
	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri) {
		ContextNode contextNode = this.getDeepContextNode(relativeContextNodeXri, false);
		return contextNode.getRelations(arcXri);
	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment relativeContextNodeXri) {
		ContextNode contextNode = this.getDeepContextNode(relativeContextNodeXri, false);
	public ReadOnlyIterator<Relation> getIncomingRelations(final XDI3Segment arcXri) {
				return relation.getArcXri().equals(arcXri);
	public boolean containsRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		return this.getRelation(arcXri, targetContextNodeXri) != null;
	public boolean containsRelations(XDI3Segment arcXri) {
		return this.getRelations(arcXri).hasNext();
	public boolean containsIncomingRelations(XDI3Segment arcXri) {
		return this.getIncomingRelations(arcXri).hasNext();
	public void delRelations(XDI3Segment arcXri) {
		for (Relation relation : this.getRelations(arcXri)) relation.delete();
	public long getRelationCount(XDI3Segment arcXri) {
		return new IteratorCounter(this.getRelations(arcXri)).count();
	public Literal setDeepLiteral(XDI3Segment relativeContextNodeXri, Object literalData) {
		ContextNode contextNode = this.setDeepContextNode(relativeContextNodeXri);
	public Literal setDeepLiteralString(XDI3Segment relativeContextNodeXri, String literalData) {
		return this.setDeepLiteral(relativeContextNodeXri, literalData);
	public Literal setDeepLiteralNumber(XDI3Segment relativeContextNodeXri, Double literalData) {
		return this.setDeepLiteral(relativeContextNodeXri, literalData);
	public Literal setDeepLiteralBoolean(XDI3Segment relativeContextNodeXri, Boolean literalData) {
		return this.setDeepLiteral(relativeContextNodeXri, literalData);
	public Literal getDeepLiteral(XDI3Segment relativeContextNodeXri, Object literalData) {
		ContextNode contextNode = this.getDeepContextNode(relativeContextNodeXri, false);
	public Literal getDeepLiteralString(XDI3Segment relativeContextNodeXri, String literalData) {
		return this.getDeepLiteral(relativeContextNodeXri, literalData);
	public Literal getDeepLiteralNumber(XDI3Segment relativeContextNodeXri, Double literalData) {
		return this.getDeepLiteral(relativeContextNodeXri, literalData);
	public Literal getDeepLiteralBoolean(XDI3Segment relativeContextNodeXri, Boolean literalData) {
		return this.getDeepLiteral(relativeContextNodeXri, literalData);
	public Literal getDeepLiteral(XDI3Segment relativeContextNodeXri) {
		ContextNode contextNode = this.getDeepContextNode(relativeContextNodeXri, false);
	public Statement setStatement(XDI3Statement statementXri) {
			ContextNode contextNode = this.setDeepContextNode(statementXri.getTargetContextNodeXri());
			Relation relation = this.setDeepRelation(statementXri.getContextNodeXri(), statementXri.getRelationArcXri(), statementXri.getTargetContextNodeXri());
			Literal literal = this.setDeepLiteral(statementXri.getContextNodeXri(), statementXri.getLiteralData());
	public Statement getStatement(XDI3Statement statementXri) {
			ContextNode contextNode = baseContextNode.getContextNode(statementXri.getContextNodeArcXri(), false);
			Relation relation = baseContextNode.getRelation(statementXri.getRelationArcXri(), statementXri.getTargetContextNodeXri());
	public boolean containsStatement(XDI3Statement statementXri) {
	protected void setContextNodeCheckValid(XDI3SubSegment arcXri) throws Xdi2GraphException {
		if (arcXri == null) throw new NullPointerException();
		if (XDIConstants.XRI_S_CONTEXT.equals(arcXri)) throw new Xdi2GraphException("Invalid context node arc XRI: " + arcXri);
		if (this.containsRelations(XDIDictionaryConstants.XRI_S_REF)) throw new Xdi2GraphException("Cannot add " + arcXri + " context node to context node " + this.getXri() + " containing a " + XDIDictionaryConstants.XRI_S_REF + " relation.");
		if (this.containsRelations(XDIDictionaryConstants.XRI_S_REP)) throw new Xdi2GraphException("Cannot add " + arcXri + " context node to context node " + this.getXri() + " containing a " + XDIDictionaryConstants.XRI_S_REP + " relation.");
		ContextNode tempContextNode = new BasicContextNode(this.getGraph(), this, arcXri, null, null, null);
		if (! XdiAbstractContext.isValid(tempContextNode)) throw new Xdi2GraphException("Invalid subgraph: " + arcXri + " under subgraph " + this.getXri());
	protected void setRelationCheckValid(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) throws Xdi2GraphException {
		if (arcXri == null) throw new NullPointerException();
		if (targetContextNodeXri == null) throw new NullPointerException();
		if (XDIConstants.XRI_S_CONTEXT.equals(arcXri)) throw new Xdi2GraphException("Invalid relation arc XRI: " + arcXri);
		if (XDIConstants.XRI_S_LITERAL.equals(arcXri)) throw new Xdi2GraphException("Invalid relation arc XRI: " + arcXri);
			if (XDIDictionaryConstants.XRI_S_REF.equals(arcXri)) {
				if (! this.containsRelation(XDIDictionaryConstants.XRI_S_REF, targetContextNodeXri)) throw new Xdi2GraphException("Cannot add " + arcXri + "/" + targetContextNodeXri + " relation to non-empty context node " + this.getXri() + ".");
				if (this.containsRelations(XDIDictionaryConstants.XRI_S_REF)) throw new Xdi2GraphException("Cannot add " + arcXri + "/" + targetContextNodeXri + " relation to context node " + this.getXri() + ", which already contains a $ref.");
			if (XDIDictionaryConstants.XRI_S_REP.equals(arcXri)) {
				if (! this.containsRelation(XDIDictionaryConstants.XRI_S_REP, targetContextNodeXri)) throw new Xdi2GraphException("Cannot add " + arcXri + "/" + targetContextNodeXri + " relation to non-empty context node " + this.getXri() + ".");
				if (this.containsRelations(XDIDictionaryConstants.XRI_S_REP)) throw new Xdi2GraphException("Cannot add " + arcXri + "/" + targetContextNodeXri + " relation to context node " + this.getXri() + ", which already contains a $rep.");
		if (this.containsRelations(XDIDictionaryConstants.XRI_S_REF)) throw new Xdi2GraphException("Cannot add literal to context node " + this.getXri() + " containing a " + XDIDictionaryConstants.XRI_S_REF + " relation.");
		if (this.containsRelations(XDIDictionaryConstants.XRI_S_REP)) throw new Xdi2GraphException("Cannot add literal to context node " + this.getXri() + " containing a " + XDIDictionaryConstants.XRI_S_REP + " relation.");
	protected void setContextNodeSetInnerRoot(XDI3SubSegment arcXri, ContextNode contextNode) {
		if (XdiInnerRoot.isInnerRootArcXri(arcXri)) {
			this.setDeepContextNode(XdiInnerRoot.getSubjectOfInnerRootXri(arcXri)).setRelation(XdiInnerRoot.getPredicateOfInnerRootXri(arcXri), contextNode);
	protected ContextNode setRelationSetTargetContextNode(XDI3Segment targetContextNodeXri) {
		return this.getGraph().setDeepContextNode(targetContextNodeXri);
			contextNode.delRelationDelInnerRoot(relation.getArcXri(), relation.getTargetContextNodeXri());
	protected void delRelationDelInnerRoot(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		if (XdiInnerRoot.createInnerRootArcXri(this.getXri(), arcXri).equals(targetContextNodeXri)) {
			this.getGraph().getDeepContextNode(targetContextNodeXri, false).delete();
		return this.getXri().toString();
		return this.getXri().equals(other.getXri());
		hashCode = (hashCode * 31) + this.getXri().hashCode();
		return this.getXri().compareTo(other.getXri());
		public XDI3Segment getSubject() {
			return AbstractContextNode.this.getContextNode().getXri();
		public XDI3SubSegment getObject() {
			return AbstractContextNode.this.getArcXri();

@@ -17,7 +17,10 @@
 import xdi2.core.features.nodetypes.XdiInnerRoot;
 import xdi2.core.features.nodetypes.XdiValue;
 import xdi2.core.impl.AbstractStatement.AbstractContextNodeStatement;
-import xdi2.core.util.XDI3Util;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.syntax.XDIStatement;
+import xdi2.core.util.AddressUtil;
 import xdi2.core.util.iterators.CompositeIterator;
 import xdi2.core.util.iterators.DescendingIterator;
 import xdi2.core.util.iterators.EmptyIterator;
@@ -27,9 +30,6 @@
 import xdi2.core.util.iterators.ReadOnlyIterator;
 import xdi2.core.util.iterators.SelectingIterator;
 import xdi2.core.util.iterators.SingleItemIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
-import xdi2.core.xri3.XDI3SubSegment;
 
 public abstract class AbstractContextNode implements ContextNode {
 
@@ -38,7 +38,7 @@ public abstract class AbstractContextNode implements ContextNode {
 	private Graph graph;
 	private ContextNode contextNode;
 
-	private XDI3Segment xri;
+	private XDIAddress xri;
 
 	public AbstractContextNode(Graph graph, ContextNode contextNode) {
 
@@ -96,7 +96,7 @@ public synchronized void delete() {
 			this.clear();
 		} else {
 
-			this.getContextNode().delContextNode(this.getArcXri());
+			this.getContextNode().delContextNode(this.getArc());
 		}
 	}
 
@@ -115,16 +115,16 @@ public boolean isEmpty() {
 	}
 
 	@Override
-	public XDI3Segment getXri() {
+	public XDIAddress getAddress() {
 
 		if (this.xri == null) {
 
 			if (this.isRootContextNode()) {
 
-				this.xri = XDIConstants.XRI_S_ROOT;
+				this.xri = XDIConstants.XDI_ADD_ROOT;
 			} else {
 
-				this.xri = XDI3Util.concatXris(this.getContextNode().getXri(), this.getArcXri());
+				this.xri = AddressUtil.concatAddresses(this.getContextNode().getAddress(), this.getArc());
 			}
 		}
 
@@ -135,71 +135,71 @@ public XDI3Segment getXri() {
 	 * Methods related to context nodes of this context node
 	 */
 
-	//	public ContextNode setContextNode(XDI3SubSegment contextNodeArcXri);
+	//	public ContextNode setContextNode(XDIArc contextNodeArc);
 
 	@Override
-	public ContextNode setDeepContextNode(XDI3Segment relativeContextNodeXri) {
+	public ContextNode setDeepContextNode(XDIAddress relativecontextNodeAddress) {
 
-		if (relativeContextNodeXri == null) return this;
-		if (XDIConstants.XRI_S_ROOT.equals(relativeContextNodeXri)) return this;
+		if (relativecontextNodeAddress == null) return this;
+		if (XDIConstants.XDI_ADD_ROOT.equals(relativecontextNodeAddress)) return this;
 
 		ContextNode contextNode = this;
 
-		for (XDI3SubSegment contextNodeArcXri : relativeContextNodeXri.getSubSegments()) {
+		for (XDIArc contextNodeArc : relativecontextNodeAddress.getArcs()) {
 
-			contextNode = contextNode.setContextNode(contextNodeArcXri);
+			contextNode = contextNode.setContextNode(contextNodeArc);
 		}
 
 		return contextNode;
 	}
 
 	@Override
-	public ContextNode getContextNode(XDI3SubSegment relativeContextNodeXri, boolean subgraph) {
+	public ContextNode getContextNode(XDIArc relativecontextNodeAddress, boolean subgraph) {
 
 		for (Iterator<ContextNode> contextNodes = this.getContextNodes(); contextNodes.hasNext(); ) {
 
 			ContextNode contextNode = contextNodes.next();
 
-			if (contextNode.getArcXri().equals(relativeContextNodeXri)) return contextNode;
+			if (contextNode.getArc().equals(relativecontextNodeAddress)) return contextNode;
 		}
 
 		return null;
 	}
 
 	@Override
-	public ContextNode getContextNode(XDI3SubSegment contextNodeArcXri) {
+	public ContextNode getContextNode(XDIArc contextNodeArc) {
 
-		return this.getContextNode(contextNodeArcXri, false);
+		return this.getContextNode(contextNodeArc, false);
 	}
 
 	@Override
-	public ContextNode getDeepContextNode(XDI3Segment relativeContextNodeXri, boolean subgraph) {
+	public ContextNode getDeepContextNode(XDIAddress relativecontextNodeAddress, boolean subgraph) {
 
-		if (XDIConstants.XRI_S_ROOT.equals(relativeContextNodeXri)) return this;
+		if (XDIConstants.XDI_ADD_ROOT.equals(relativecontextNodeAddress)) return this;
 
 		ContextNode contextNode = this;
 
-		for (XDI3SubSegment contextNodeArcXri : relativeContextNodeXri.getSubSegments()) {
+		for (XDIArc contextNodeArc : relativecontextNodeAddress.getArcs()) {
 
-			contextNode = contextNode.getContextNode(contextNodeArcXri, subgraph);
+			contextNode = contextNode.getContextNode(contextNodeArc, subgraph);
 			if (contextNode == null) return null;
 		}
 
 		return contextNode;
 	}
 
 	@Override
-	public ContextNode getDeepContextNode(XDI3Segment relativeContextNodeXri) {
+	public ContextNode getDeepContextNode(XDIAddress relativecontextNodeAddress) {
 
-		return this.getDeepContextNode(relativeContextNodeXri, false);
+		return this.getDeepContextNode(relativecontextNodeAddress, false);
 	}
 
 	//	public ReadOnlyIterator<ContextNode> getContextNodes();
 
 	@Override
-	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDI3Segment relativeContextNodeXri) {
+	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDIAddress relativecontextNodeAddress) {
 
-		ContextNode contextNode = this.getDeepContextNode(relativeContextNodeXri, false);
+		ContextNode contextNode = this.getDeepContextNode(relativecontextNodeAddress, false);
 		if (contextNode == null) return new EmptyIterator<ContextNode> ();
 
 		return contextNode.getContextNodes();
@@ -238,9 +238,9 @@ public boolean select(ContextNode contextNode) {
 	}
 
 	@Override
-	public boolean containsContextNode(XDI3SubSegment contextNodeArcXri) {
+	public boolean containsContextNode(XDIArc contextNodeArc) {
 
-		return this.getContextNode(contextNodeArcXri, false) != null;
+		return this.getContextNode(contextNodeArc, false) != null;
 	}
 
 	@Override
@@ -272,122 +272,122 @@ public long getAllContextNodeCount() {
 	 */
 
 	@Override
-	public Relation setRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public Relation setRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
 		// set the target context node
 
-		ContextNode targetContextNode = this.setRelationSetTargetContextNode(targetContextNodeXri);
+		ContextNode targetContextNode = this.setRelationSetTargetContextNode(targetContextNodeAddress);
 
 		// set the relation
 
-		Relation relation = this.setRelation(arcXri, targetContextNode);
+		Relation relation = this.setRelation(arc, targetContextNode);
 
 		// done
 
 		return relation;
 	}
 
 	@Override
-	public Relation setDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public Relation setDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
-		ContextNode contextNode = this.setDeepContextNode(relativeContextNodeXri);
+		ContextNode contextNode = this.setDeepContextNode(relativecontextNodeAddress);
 		if (contextNode == null) return null;
 
-		return contextNode.setRelation(arcXri, targetContextNodeXri);
+		return contextNode.setRelation(arc, targetContextNodeAddress);
 	}
 
-	//	public Relation setRelation(XDI3Segment arcXri, ContextNode targetContextNode) {
+	//	public Relation setRelation(XDIAddress arc, ContextNode targetContextNode) {
 
 	@Override
-	public Relation setDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri, ContextNode targetContextNode) {
+	public Relation setDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc, ContextNode targetContextNode) {
 
-		ContextNode contextNode = this.setDeepContextNode(relativeContextNodeXri);
+		ContextNode contextNode = this.setDeepContextNode(relativecontextNodeAddress);
 		if (contextNode == null) return null;
 
-		return contextNode.setRelation(arcXri, targetContextNode);
+		return contextNode.setRelation(arc, targetContextNode);
 	}
 
 	@Override
-	public Relation getRelation(XDI3Segment arcXri, final XDI3Segment targetContextNodeXri) {
+	public Relation getRelation(XDIAddress arc, final XDIAddress targetContextNodeAddress) {
 
-		Iterator<Relation> selectingIterator = new SelectingIterator<Relation> (this.getRelations(arcXri)) {
+		Iterator<Relation> selectingIterator = new SelectingIterator<Relation> (this.getRelations(arc)) {
 
 			@Override
 			public boolean select(Relation relation) {
 
-				return relation.getTargetContextNodeXri().equals(targetContextNodeXri);
+				return relation.getTargetContextNodeAddress().equals(targetContextNodeAddress);
 			}
 		};
 
 		return new IteratorFirstItem<Relation> (selectingIterator).item();
 	}
 
 	@Override
-	public Relation getDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public Relation getDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
-		ContextNode contextNode = this.getDeepContextNode(relativeContextNodeXri, false);
+		ContextNode contextNode = this.getDeepContextNode(relativecontextNodeAddress, false);
 		if (contextNode == null) return null;
 
-		return contextNode.getRelation(arcXri, targetContextNodeXri);
+		return contextNode.getRelation(arc, targetContextNodeAddress);
 	}
 
 	@Override
-	public Relation getRelation(XDI3Segment arcXri) {
+	public Relation getRelation(XDIAddress arc) {
 
-		return new IteratorFirstItem<Relation> (this.getRelations(arcXri)).item();
+		return new IteratorFirstItem<Relation> (this.getRelations(arc)).item();
 	}
 
 	@Override
-	public Relation getDeepRelation(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri) {
+	public Relation getDeepRelation(XDIAddress relativecontextNodeAddress, XDIAddress arc) {
 
-		ContextNode contextNode = this.getDeepContextNode(relativeContextNodeXri, false);
+		ContextNode contextNode = this.getDeepContextNode(relativecontextNodeAddress, false);
 		if (contextNode == null) return null;
 
-		return contextNode.getRelation(arcXri);
+		return contextNode.getRelation(arc);
 	}
 
 	@Override
-	public ReadOnlyIterator<Relation> getRelations(final XDI3Segment arcXri) {
+	public ReadOnlyIterator<Relation> getRelations(final XDIAddress arc) {
 
 		return new SelectingIterator<Relation> (this.getRelations()) {
 
 			@Override
 			public boolean select(Relation relation) {
 
-				return relation.getArcXri().equals(arcXri);
+				return relation.getArc().equals(arc);
 			}
 		};
 	}
 
 	@Override
-	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment relativeContextNodeXri, XDI3Segment arcXri) {
+	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress relativecontextNodeAddress, XDIAddress arc) {
 
-		ContextNode contextNode = this.getDeepContextNode(relativeContextNodeXri, false);
+		ContextNode contextNode = this.getDeepContextNode(relativecontextNodeAddress, false);
 		if (contextNode == null) return new EmptyIterator<Relation> ();
 
-		return contextNode.getRelations(arcXri);
+		return contextNode.getRelations(arc);
 	}
 
 	//	public ReadOnlyIterator<Relation> getRelations();
 
 	@Override
-	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment relativeContextNodeXri) {
+	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress relativecontextNodeAddress) {
 
-		ContextNode contextNode = this.getDeepContextNode(relativeContextNodeXri, false);
+		ContextNode contextNode = this.getDeepContextNode(relativecontextNodeAddress, false);
 		if (contextNode == null) return null;
 
 		return contextNode.getRelations();
 	}
 
 	@Override
-	public ReadOnlyIterator<Relation> getIncomingRelations(final XDI3Segment arcXri) {
+	public ReadOnlyIterator<Relation> getIncomingRelations(final XDIAddress arc) {
 
 		return new SelectingIterator<Relation> (this.getIncomingRelations()) {
 
 			@Override
 			public boolean select(Relation relation) {
 
-				return relation.getArcXri().equals(arcXri);
+				return relation.getArc().equals(arc);
 			}
 		};
 	}
@@ -447,15 +447,15 @@ public Iterator<Relation> descend(ContextNode contextNode) {
 	}
 
 	@Override
-	public boolean containsRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public boolean containsRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
-		return this.getRelation(arcXri, targetContextNodeXri) != null;
+		return this.getRelation(arc, targetContextNodeAddress) != null;
 	}
 
 	@Override
-	public boolean containsRelations(XDI3Segment arcXri) {
+	public boolean containsRelations(XDIAddress arc) {
 
-		return this.getRelations(arcXri).hasNext();
+		return this.getRelations(arc).hasNext();
 	}
 
 	@Override
@@ -465,9 +465,9 @@ public boolean containsRelations() {
 	}
 
 	@Override
-	public boolean containsIncomingRelations(XDI3Segment arcXri) {
+	public boolean containsIncomingRelations(XDIAddress arc) {
 
-		return this.getIncomingRelations(arcXri).hasNext();
+		return this.getIncomingRelations(arc).hasNext();
 	}
 
 	@Override
@@ -477,9 +477,9 @@ public boolean containsIncomingRelations() {
 	}
 
 	@Override
-	public void delRelations(XDI3Segment arcXri) {
+	public void delRelations(XDIAddress arc) {
 
-		for (Relation relation : this.getRelations(arcXri)) relation.delete();
+		for (Relation relation : this.getRelations(arc)) relation.delete();
 	}
 
 	@Override
@@ -495,9 +495,9 @@ public void delIncomingRelations() {
 	}
 
 	@Override
-	public long getRelationCount(XDI3Segment arcXri) {
+	public long getRelationCount(XDIAddress arc) {
 
-		return new IteratorCounter(this.getRelations(arcXri)).count();
+		return new IteratorCounter(this.getRelations(arc)).count();
 	}
 
 	@Override
@@ -537,30 +537,30 @@ public Literal setLiteralBoolean(Boolean literalData) {
 	}
 
 	@Override
-	public Literal setDeepLiteral(XDI3Segment relativeContextNodeXri, Object literalData) {
+	public Literal setDeepLiteral(XDIAddress relativecontextNodeAddress, Object literalData) {
 
-		ContextNode contextNode = this.setDeepContextNode(relativeContextNodeXri);
+		ContextNode contextNode = this.setDeepContextNode(relativecontextNodeAddress);
 		if (contextNode == null) return null;
 
 		return contextNode.setLiteral(literalData);
 	}
 
 	@Override
-	public Literal setDeepLiteralString(XDI3Segment relativeContextNodeXri, String literalData) {
+	public Literal setDeepLiteralString(XDIAddress relativecontextNodeAddress, String literalData) {
 
-		return this.setDeepLiteral(relativeContextNodeXri, literalData);
+		return this.setDeepLiteral(relativecontextNodeAddress, literalData);
 	}
 
 	@Override
-	public Literal setDeepLiteralNumber(XDI3Segment relativeContextNodeXri, Double literalData) {
+	public Literal setDeepLiteralNumber(XDIAddress relativecontextNodeAddress, Double literalData) {
 
-		return this.setDeepLiteral(relativeContextNodeXri, literalData);
+		return this.setDeepLiteral(relativecontextNodeAddress, literalData);
 	}
 
 	@Override
-	public Literal setDeepLiteralBoolean(XDI3Segment relativeContextNodeXri, Boolean literalData) {
+	public Literal setDeepLiteralBoolean(XDIAddress relativecontextNodeAddress, Boolean literalData) {
 
-		return this.setDeepLiteral(relativeContextNodeXri, literalData);
+		return this.setDeepLiteral(relativecontextNodeAddress, literalData);
 	}
 
 	@Override
@@ -593,38 +593,38 @@ public Literal getLiteralBoolean(Boolean literalData) {
 	}
 
 	@Override
-	public Literal getDeepLiteral(XDI3Segment relativeContextNodeXri, Object literalData) {
+	public Literal getDeepLiteral(XDIAddress relativecontextNodeAddress, Object literalData) {
 
-		ContextNode contextNode = this.getDeepContextNode(relativeContextNodeXri, false);
+		ContextNode contextNode = this.getDeepContextNode(relativecontextNodeAddress, false);
 		if (contextNode == null) return null;
 
 		return contextNode.getLiteral(literalData);
 	}
 
 	@Override
-	public Literal getDeepLiteralString(XDI3Segment relativeContextNodeXri, String literalData) {
+	public Literal getDeepLiteralString(XDIAddress relativecontextNodeAddress, String literalData) {
 
-		return this.getDeepLiteral(relativeContextNodeXri, literalData);
+		return this.getDeepLiteral(relativecontextNodeAddress, literalData);
 	}
 
 	@Override
-	public Literal getDeepLiteralNumber(XDI3Segment relativeContextNodeXri, Double literalData) {
+	public Literal getDeepLiteralNumber(XDIAddress relativecontextNodeAddress, Double literalData) {
 
-		return this.getDeepLiteral(relativeContextNodeXri, literalData);
+		return this.getDeepLiteral(relativecontextNodeAddress, literalData);
 	}
 
 	@Override
-	public Literal getDeepLiteralBoolean(XDI3Segment relativeContextNodeXri, Boolean literalData) {
+	public Literal getDeepLiteralBoolean(XDIAddress relativecontextNodeAddress, Boolean literalData) {
 
-		return this.getDeepLiteral(relativeContextNodeXri, literalData);
+		return this.getDeepLiteral(relativecontextNodeAddress, literalData);
 	}
 
 	//	public Literal getLiteral();
 
 	@Override
-	public Literal getDeepLiteral(XDI3Segment relativeContextNodeXri) {
+	public Literal getDeepLiteral(XDIAddress relativecontextNodeAddress) {
 
-		ContextNode contextNode = this.getDeepContextNode(relativeContextNodeXri, false);
+		ContextNode contextNode = this.getDeepContextNode(relativecontextNodeAddress, false);
 		if (contextNode == null) return null;
 
 		return contextNode.getLiteral();
@@ -704,23 +704,23 @@ public ContextNodeStatement getStatement() {
 	}
 
 	@Override
-	public Statement setStatement(XDI3Statement statementXri) {
+	public Statement setStatement(XDIStatement statementXri) {
 
 		// set the statement
 
 		if (statementXri.isContextNodeStatement()) {
 
-			ContextNode contextNode = this.setDeepContextNode(statementXri.getTargetContextNodeXri());
+			ContextNode contextNode = this.setDeepContextNode(statementXri.getTargetContextNodeAddress());
 
 			return contextNode.getStatement();
 		} else if (statementXri.isRelationStatement()) {
 
-			Relation relation = this.setDeepRelation(statementXri.getContextNodeXri(), statementXri.getRelationArcXri(), statementXri.getTargetContextNodeXri());
+			Relation relation = this.setDeepRelation(statementXri.getContextNodeAddress(), statementXri.getRelationAddress(), statementXri.getTargetContextNodeAddress());
 
 			return relation.getStatement();
 		} else if (statementXri.isLiteralStatement()) {
 
-			Literal literal = this.setDeepLiteral(statementXri.getContextNodeXri(), statementXri.getLiteralData());
+			Literal literal = this.setDeepLiteral(statementXri.getContextNodeAddress(), statementXri.getLiteralData());
 
 			return literal.getStatement();
 		} else {
@@ -730,19 +730,19 @@ public Statement setStatement(XDI3Statement statementXri) {
 	}
 
 	@Override
-	public Statement getStatement(XDI3Statement statementXri) {
+	public Statement getStatement(XDIStatement statementXri) {
 
 		ContextNode baseContextNode = this.getDeepContextNode(statementXri.getSubject(), false);
 		if (baseContextNode == null) return null;
 
 		if (statementXri.isContextNodeStatement()) {
 
-			ContextNode contextNode = baseContextNode.getContextNode(statementXri.getContextNodeArcXri(), false);
+			ContextNode contextNode = baseContextNode.getContextNode(statementXri.getContextNodeArc(), false);
 
 			return contextNode == null ? null : contextNode.getStatement();
 		} else if (statementXri.isRelationStatement()) {
 
-			Relation relation = baseContextNode.getRelation(statementXri.getRelationArcXri(), statementXri.getTargetContextNodeXri());
+			Relation relation = baseContextNode.getRelation(statementXri.getRelationAddress(), statementXri.getTargetContextNodeAddress());
 
 			return relation == null ? null : relation.getStatement();
 		} else if (statementXri.isLiteralStatement()) {
@@ -804,7 +804,7 @@ public Statement map(Relation relation) {
 	}
 
 	@Override
-	public boolean containsStatement(XDI3Statement statementXri) {
+	public boolean containsStatement(XDIStatement statementXri) {
 
 		return this.getStatement(statementXri) != null;
 	}
@@ -823,47 +823,47 @@ public long getAllStatementCount() {
 	 * Checks if a context node can be created.
 	 * Throws an exception, if the context node cannot be created.
 	 */
-	protected void setContextNodeCheckValid(XDI3SubSegment arcXri) throws Xdi2GraphException {
+	protected void setContextNodeCheckValid(XDIArc arc) throws Xdi2GraphException {
 
-		if (arcXri == null) throw new NullPointerException();
+		if (arc == null) throw new NullPointerException();
 
-		if (XDIConstants.XRI_S_CONTEXT.equals(arcXri)) throw new Xdi2GraphException("Invalid context node arc XRI: " + arcXri);
+		if (XDIConstants.XDI_ADD_CONTEXT.equals(arc)) throw new Xdi2GraphException("Invalid context node arc: " + arc);
 
-		if (this.containsRelations(XDIDictionaryConstants.XRI_S_REF)) throw new Xdi2GraphException("Cannot add " + arcXri + " context node to context node " + this.getXri() + " containing a " + XDIDictionaryConstants.XRI_S_REF + " relation.");
-		if (this.containsRelations(XDIDictionaryConstants.XRI_S_REP)) throw new Xdi2GraphException("Cannot add " + arcXri + " context node to context node " + this.getXri() + " containing a " + XDIDictionaryConstants.XRI_S_REP + " relation.");
+		if (this.containsRelations(XDIDictionaryConstants.XDI_ADD_REF)) throw new Xdi2GraphException("Cannot add " + arc + " context node to context node " + this.getAddress() + " containing a " + XDIDictionaryConstants.XDI_ADD_REF + " relation.");
+		if (this.containsRelations(XDIDictionaryConstants.XDI_ADD_REP)) throw new Xdi2GraphException("Cannot add " + arc + " context node to context node " + this.getAddress() + " containing a " + XDIDictionaryConstants.XDI_ADD_REP + " relation.");
 
-		ContextNode tempContextNode = new BasicContextNode(this.getGraph(), this, arcXri, null, null, null);
-		if (! XdiAbstractContext.isValid(tempContextNode)) throw new Xdi2GraphException("Invalid subgraph: " + arcXri + " under subgraph " + this.getXri());
+		ContextNode tempContextNode = new BasicContextNode(this.getGraph(), this, arc, null, null, null);
+		if (! XdiAbstractContext.isValid(tempContextNode)) throw new Xdi2GraphException("Invalid subgraph: " + arc + " under subgraph " + this.getAddress());
 	}
 
 	/**
 	 * Checks if a relation can be created.
 	 * Throws an exception, if the relation cannot be created.
 	 */
-	protected void setRelationCheckValid(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) throws Xdi2GraphException {
+	protected void setRelationCheckValid(XDIAddress arc, XDIAddress targetContextNodeAddress) throws Xdi2GraphException {
 
-		if (arcXri == null) throw new NullPointerException();
-		if (targetContextNodeXri == null) throw new NullPointerException();
+		if (arc == null) throw new NullPointerException();
+		if (targetContextNodeAddress == null) throw new NullPointerException();
 
-		if (XDIConstants.XRI_S_CONTEXT.equals(arcXri)) throw new Xdi2GraphException("Invalid relation arc XRI: " + arcXri);
-		if (XDIConstants.XRI_S_LITERAL.equals(arcXri)) throw new Xdi2GraphException("Invalid relation arc XRI: " + arcXri);
+		if (XDIConstants.XDI_ADD_CONTEXT.equals(arc)) throw new Xdi2GraphException("Invalid relation arc: " + arc);
+		if (XDIConstants.XDI_ADD_LITERAL.equals(arc)) throw new Xdi2GraphException("Invalid relation arc: " + arc);
 
 		if (! this.isEmpty()) {
 
-			if (XDIDictionaryConstants.XRI_S_REF.equals(arcXri)) {
+			if (XDIDictionaryConstants.XDI_ADD_REF.equals(arc)) {
 
-				if (! this.containsRelation(XDIDictionaryConstants.XRI_S_REF, targetContextNodeXri)) throw new Xdi2GraphException("Cannot add " + arcXri + "/" + targetContextNodeXri + " relation to non-empty context node " + this.getXri() + ".");
+				if (! this.containsRelation(XDIDictionaryConstants.XDI_ADD_REF, targetContextNodeAddress)) throw new Xdi2GraphException("Cannot add " + arc + "/" + targetContextNodeAddress + " relation to non-empty context node " + this.getAddress() + ".");
 			} else {
 
-				if (this.containsRelations(XDIDictionaryConstants.XRI_S_REF)) throw new Xdi2GraphException("Cannot add " + arcXri + "/" + targetContextNodeXri + " relation to context node " + this.getXri() + ", which already contains a $ref.");
+				if (this.containsRelations(XDIDictionaryConstants.XDI_ADD_REF)) throw new Xdi2GraphException("Cannot add " + arc + "/" + targetContextNodeAddress + " relation to context node " + this.getAddress() + ", which already contains a $ref.");
 			}
 
-			if (XDIDictionaryConstants.XRI_S_REP.equals(arcXri)) {
+			if (XDIDictionaryConstants.XDI_ADD_REP.equals(arc)) {
 
-				if (! this.containsRelation(XDIDictionaryConstants.XRI_S_REP, targetContextNodeXri)) throw new Xdi2GraphException("Cannot add " + arcXri + "/" + targetContextNodeXri + " relation to non-empty context node " + this.getXri() + ".");
+				if (! this.containsRelation(XDIDictionaryConstants.XDI_ADD_REP, targetContextNodeAddress)) throw new Xdi2GraphException("Cannot add " + arc + "/" + targetContextNodeAddress + " relation to non-empty context node " + this.getAddress() + ".");
 			} else {
 
-				if (this.containsRelations(XDIDictionaryConstants.XRI_S_REP)) throw new Xdi2GraphException("Cannot add " + arcXri + "/" + targetContextNodeXri + " relation to context node " + this.getXri() + ", which already contains a $rep.");
+				if (this.containsRelations(XDIDictionaryConstants.XDI_ADD_REP)) throw new Xdi2GraphException("Cannot add " + arc + "/" + targetContextNodeAddress + " relation to context node " + this.getAddress() + ", which already contains a $rep.");
 			}
 		}
 	}
@@ -878,27 +878,27 @@ protected void setLiteralCheckValid(Object literalData) throws Xdi2GraphExceptio
 
 		if (! AbstractLiteral.isValidLiteralData(literalData)) throw new IllegalArgumentException("Invalid literal data: " + literalData.getClass().getSimpleName());
 
-		if (this.containsRelations(XDIDictionaryConstants.XRI_S_REF)) throw new Xdi2GraphException("Cannot add literal to context node " + this.getXri() + " containing a " + XDIDictionaryConstants.XRI_S_REF + " relation.");
-		if (this.containsRelations(XDIDictionaryConstants.XRI_S_REP)) throw new Xdi2GraphException("Cannot add literal to context node " + this.getXri() + " containing a " + XDIDictionaryConstants.XRI_S_REP + " relation.");
+		if (this.containsRelations(XDIDictionaryConstants.XDI_ADD_REF)) throw new Xdi2GraphException("Cannot add literal to context node " + this.getAddress() + " containing a " + XDIDictionaryConstants.XDI_ADD_REF + " relation.");
+		if (this.containsRelations(XDIDictionaryConstants.XDI_ADD_REP)) throw new Xdi2GraphException("Cannot add literal to context node " + this.getAddress() + " containing a " + XDIDictionaryConstants.XDI_ADD_REP + " relation.");
 	}
 
 	/**
 	 * When a context node is created, check if the inner root subject and predicate have to be created too.
 	 */
-	protected void setContextNodeSetInnerRoot(XDI3SubSegment arcXri, ContextNode contextNode) {
+	protected void setContextNodeSetInnerRoot(XDIArc arc, ContextNode contextNode) {
 
-		if (XdiInnerRoot.isInnerRootArcXri(arcXri)) {
+		if (XdiInnerRoot.isInnerRootarc(arc)) {
 
-			this.setDeepContextNode(XdiInnerRoot.getSubjectOfInnerRootXri(arcXri)).setRelation(XdiInnerRoot.getPredicateOfInnerRootXri(arcXri), contextNode);
+			this.setDeepContextNode(XdiInnerRoot.getSubjectOfInnerRootXri(arc)).setRelation(XdiInnerRoot.getPredicateOfInnerRootXri(arc), contextNode);
 		}
 	}
 
 	/**
 	 * When a relation is created, check if the target context node has to be created too.
 	 */
-	protected ContextNode setRelationSetTargetContextNode(XDI3Segment targetContextNodeXri) {
+	protected ContextNode setRelationSetTargetContextNode(XDIAddress targetContextNodeAddress) {
 
-		return this.getGraph().setDeepContextNode(targetContextNodeXri);
+		return this.getGraph().setDeepContextNode(targetContextNodeAddress);
 	}
 
 	/**
@@ -910,7 +910,7 @@ protected void delContextNodeDelAllInnerRoots() {
 
 			AbstractContextNode contextNode = ((AbstractContextNode) relation.getContextNode());
 
-			contextNode.delRelationDelInnerRoot(relation.getArcXri(), relation.getTargetContextNodeXri());
+			contextNode.delRelationDelInnerRoot(relation.getArc(), relation.getTargetContextNodeAddress());
 		}
 	}
 
@@ -933,11 +933,11 @@ protected void delContextNodeDelAllIncomingRelations() {
 	/**
 	 * When a relation is deleted, its inner root has to be deleted too.
 	 */
-	protected void delRelationDelInnerRoot(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	protected void delRelationDelInnerRoot(XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
-		if (XdiInnerRoot.createInnerRootArcXri(this.getXri(), arcXri).equals(targetContextNodeXri)) {
+		if (XdiInnerRoot.createInnerRootarc(this.getAddress(), arc).equals(targetContextNodeAddress)) {
 
-			this.getGraph().getDeepContextNode(targetContextNodeXri, false).delete();
+			this.getGraph().getDeepContextNode(targetContextNodeAddress, false).delete();
 		}
 	}
 
@@ -948,7 +948,7 @@ protected void delRelationDelInnerRoot(XDI3Segment arcXri, XDI3Segment targetCon
 	@Override
 	public String toString() {
 
-		return this.getXri().toString();
+		return this.getAddress().toString();
 	}
 
 	@Override
@@ -961,15 +961,15 @@ public boolean equals(Object object) {
 
 		// two context nodes are equal if their XRIs are equal
 
-		return this.getXri().equals(other.getXri());
+		return this.getAddress().equals(other.getAddress());
 	}
 
 	@Override
 	public int hashCode() {
 
 		int hashCode = 1;
 
-		hashCode = (hashCode * 31) + this.getXri().hashCode();
+		hashCode = (hashCode * 31) + this.getAddress().hashCode();
 
 		return hashCode;
 	}
@@ -979,7 +979,7 @@ public int compareTo(ContextNode other) {
 
 		if (other == null || other == this) return 0;
 
-		return this.getXri().compareTo(other.getXri());
+		return this.getAddress().compareTo(other.getAddress());
 	}
 
 	/**
@@ -991,15 +991,15 @@ public int compareTo(ContextNode other) {
 		private static final long serialVersionUID = 5008355182847367563L;
 
 		@Override
-		public XDI3Segment getSubject() {
+		public XDIAddress getSubject() {
 
-			return AbstractContextNode.this.getContextNode().getXri();
+			return AbstractContextNode.this.getContextNode().getAddress();
 		}
 
 		@Override
-		public XDI3SubSegment getObject() {
+		public XDIArc getObject() {
 
-			return AbstractContextNode.this.getArcXri();
+			return AbstractContextNode.this.getArc();
 		}
 
 		@Override

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FAbstractContextNode.java
67feec405f736503d254c2cba8422b38687c854b
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FAbstractGraph.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FAbstractGraph.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/AbstractGraph.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIStatement;
	public ContextNode setDeepContextNode(XDIAddress contextNodeAddress) {
		return this.getRootContextNode(false).setDeepContextNode(contextNodeAddress);
	public ContextNode getDeepContextNode(XDIAddress contextNodeAddress, boolean subgraph) {
		if (XDIConstants.XDI_ADD_ROOT.equals(contextNodeAddress)) {
			return this.getRootContextNode(false).getDeepContextNode(contextNodeAddress, subgraph);
	public ContextNode getDeepContextNode(XDIAddress contextNodeAddress) {
		return this.getRootContextNode(false).getDeepContextNode(contextNodeAddress);
	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDIAddress contextNodeAddress) {
		return this.getRootContextNode(false).getDeepContextNodes(contextNodeAddress);
	public Relation setDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress) {
		return this.getRootContextNode(false).setDeepRelation(contextNodeAddress, arc, targetContextNodeAddress);
	public Relation setDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc, ContextNode targetContextNode) {
		return this.getRootContextNode(false).setDeepRelation(contextNodeAddress, arc, targetContextNode);
	public Relation getDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress) {
		return this.getRootContextNode(false).getDeepRelation(contextNodeAddress, arc, targetContextNodeAddress);
	public Relation getDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc) {
		return this.getRootContextNode(false).getDeepRelation(contextNodeAddress, arc);
	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress contextNodeAddress, XDIAddress arc) {
		return this.getRootContextNode(false).getDeepRelations(contextNodeAddress, arc);
	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress contextNodeAddress) {
		return this.getRootContextNode(false).getDeepRelations(contextNodeAddress);
	public Literal setDeepLiteral(XDIAddress contextNodeAddress, Object literalData) {
		return this.getRootContextNode(false).setDeepLiteral(contextNodeAddress, literalData);
	public Literal setDeepLiteralString(XDIAddress contextNodeAddress, String literalData) {
		return this.getRootContextNode(false).setDeepLiteralString(contextNodeAddress, literalData);
	public Literal setDeepLiteralNumber(XDIAddress contextNodeAddress, Double literalData) {
		return this.getRootContextNode(false).setDeepLiteralNumber(contextNodeAddress, literalData);
	public Literal setDeepLiteralBoolean(XDIAddress contextNodeAddress, Boolean literalData) {
		return this.getRootContextNode(false).setDeepLiteralBoolean(contextNodeAddress, literalData);
	public Literal getDeepLiteral(XDIAddress contextNodeAddress, Object literalData) {
		return this.getRootContextNode(false).getDeepLiteral(contextNodeAddress, literalData);
	public Literal getDeepLiteralString(XDIAddress contextNodeAddress, String literalData) {
		return this.getRootContextNode(false).getDeepLiteralString(contextNodeAddress, literalData);
	public Literal getDeepLiteralNumber(XDIAddress contextNodeAddress, Double literalData) {
		return this.getRootContextNode(false).getDeepLiteralNumber(contextNodeAddress, literalData);
	public Literal getDeepLiteralBoolean(XDIAddress contextNodeAddress, Boolean literalData) {
		return this.getRootContextNode(false).getDeepLiteralBoolean(contextNodeAddress, literalData);
	public Literal getDeepLiteral(XDIAddress contextNodeAddress) {
		return this.getRootContextNode(false).getDeepLiteral(contextNodeAddress);
	public Statement setStatement(XDIStatement statementXri) {
	public Statement getStatement(XDIStatement statementXri) {
	public boolean containsStatement(XDIStatement statementXri) {

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
	public ContextNode setDeepContextNode(XDI3Segment contextNodeXri) {
		return this.getRootContextNode(false).setDeepContextNode(contextNodeXri);
	public ContextNode getDeepContextNode(XDI3Segment contextNodeXri, boolean subgraph) {
		if (XDIConstants.XRI_S_ROOT.equals(contextNodeXri)) {
			return this.getRootContextNode(false).getDeepContextNode(contextNodeXri, subgraph);
	public ContextNode getDeepContextNode(XDI3Segment contextNodeXri) {
		return this.getRootContextNode(false).getDeepContextNode(contextNodeXri);
	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDI3Segment contextNodeXri) {
		return this.getRootContextNode(false).getDeepContextNodes(contextNodeXri);
	public Relation setDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		return this.getRootContextNode(false).setDeepRelation(contextNodeXri, arcXri, targetContextNodeXri);
	public Relation setDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri, ContextNode targetContextNode) {
		return this.getRootContextNode(false).setDeepRelation(contextNodeXri, arcXri, targetContextNode);
	public Relation getDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		return this.getRootContextNode(false).getDeepRelation(contextNodeXri, arcXri, targetContextNodeXri);
	public Relation getDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri) {
		return this.getRootContextNode(false).getDeepRelation(contextNodeXri, arcXri);
	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment contextNodeXri, XDI3Segment arcXri) {
		return this.getRootContextNode(false).getDeepRelations(contextNodeXri, arcXri);
	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment contextNodeXri) {
		return this.getRootContextNode(false).getDeepRelations(contextNodeXri);
	public Literal setDeepLiteral(XDI3Segment contextNodeXri, Object literalData) {
		return this.getRootContextNode(false).setDeepLiteral(contextNodeXri, literalData);
	public Literal setDeepLiteralString(XDI3Segment contextNodeXri, String literalData) {
		return this.getRootContextNode(false).setDeepLiteralString(contextNodeXri, literalData);
	public Literal setDeepLiteralNumber(XDI3Segment contextNodeXri, Double literalData) {
		return this.getRootContextNode(false).setDeepLiteralNumber(contextNodeXri, literalData);
	public Literal setDeepLiteralBoolean(XDI3Segment contextNodeXri, Boolean literalData) {
		return this.getRootContextNode(false).setDeepLiteralBoolean(contextNodeXri, literalData);
	public Literal getDeepLiteral(XDI3Segment contextNodeXri, Object literalData) {
		return this.getRootContextNode(false).getDeepLiteral(contextNodeXri, literalData);
	public Literal getDeepLiteralString(XDI3Segment contextNodeXri, String literalData) {
		return this.getRootContextNode(false).getDeepLiteralString(contextNodeXri, literalData);
	public Literal getDeepLiteralNumber(XDI3Segment contextNodeXri, Double literalData) {
		return this.getRootContextNode(false).getDeepLiteralNumber(contextNodeXri, literalData);
	public Literal getDeepLiteralBoolean(XDI3Segment contextNodeXri, Boolean literalData) {
		return this.getRootContextNode(false).getDeepLiteralBoolean(contextNodeXri, literalData);
	public Literal getDeepLiteral(XDI3Segment contextNodeXri) {
		return this.getRootContextNode(false).getDeepLiteral(contextNodeXri);
	public Statement setStatement(XDI3Statement statementXri) {
	public Statement getStatement(XDI3Statement statementXri) {
	public boolean containsStatement(XDI3Statement statementXri) {

@@ -15,9 +15,9 @@
 import xdi2.core.io.MimeType;
 import xdi2.core.io.XDIWriter;
 import xdi2.core.io.XDIWriterRegistry;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIStatement;
 import xdi2.core.util.iterators.ReadOnlyIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
 
 public abstract class AbstractGraph implements Graph {
 
@@ -111,143 +111,143 @@ public String toString(MimeType mimeType) {
 	 */
 
 	@Override
-	public ContextNode setDeepContextNode(XDI3Segment contextNodeXri) {
+	public ContextNode setDeepContextNode(XDIAddress contextNodeAddress) {
 
-		return this.getRootContextNode(false).setDeepContextNode(contextNodeXri);
+		return this.getRootContextNode(false).setDeepContextNode(contextNodeAddress);
 	}
 
 	@Override
-	public ContextNode getDeepContextNode(XDI3Segment contextNodeXri, boolean subgraph) {
+	public ContextNode getDeepContextNode(XDIAddress contextNodeAddress, boolean subgraph) {
 
-		if (XDIConstants.XRI_S_ROOT.equals(contextNodeXri)) {
+		if (XDIConstants.XDI_ADD_ROOT.equals(contextNodeAddress)) {
 
 			return this.getRootContextNode(subgraph);
 		} else {
 
-			return this.getRootContextNode(false).getDeepContextNode(contextNodeXri, subgraph);
+			return this.getRootContextNode(false).getDeepContextNode(contextNodeAddress, subgraph);
 		}
 	}
 
 	@Override
-	public ContextNode getDeepContextNode(XDI3Segment contextNodeXri) {
+	public ContextNode getDeepContextNode(XDIAddress contextNodeAddress) {
 
-		return this.getRootContextNode(false).getDeepContextNode(contextNodeXri);
+		return this.getRootContextNode(false).getDeepContextNode(contextNodeAddress);
 	}
 
 	@Override
-	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDI3Segment contextNodeXri) {
+	public ReadOnlyIterator<ContextNode> getDeepContextNodes(XDIAddress contextNodeAddress) {
 
-		return this.getRootContextNode(false).getDeepContextNodes(contextNodeXri);
+		return this.getRootContextNode(false).getDeepContextNodes(contextNodeAddress);
 	}
 
 	@Override
-	public Relation setDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public Relation setDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
-		return this.getRootContextNode(false).setDeepRelation(contextNodeXri, arcXri, targetContextNodeXri);
+		return this.getRootContextNode(false).setDeepRelation(contextNodeAddress, arc, targetContextNodeAddress);
 	}
 
 	@Override
-	public Relation setDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri, ContextNode targetContextNode) {
+	public Relation setDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc, ContextNode targetContextNode) {
 
-		return this.getRootContextNode(false).setDeepRelation(contextNodeXri, arcXri, targetContextNode);
+		return this.getRootContextNode(false).setDeepRelation(contextNodeAddress, arc, targetContextNode);
 	}
 
 	@Override
-	public Relation getDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public Relation getDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
-		return this.getRootContextNode(false).getDeepRelation(contextNodeXri, arcXri, targetContextNodeXri);
+		return this.getRootContextNode(false).getDeepRelation(contextNodeAddress, arc, targetContextNodeAddress);
 	}
 
 	@Override
-	public Relation getDeepRelation(XDI3Segment contextNodeXri, XDI3Segment arcXri) {
+	public Relation getDeepRelation(XDIAddress contextNodeAddress, XDIAddress arc) {
 
-		return this.getRootContextNode(false).getDeepRelation(contextNodeXri, arcXri);
+		return this.getRootContextNode(false).getDeepRelation(contextNodeAddress, arc);
 	}
 
 	@Override
-	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment contextNodeXri, XDI3Segment arcXri) {
+	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress contextNodeAddress, XDIAddress arc) {
 
-		return this.getRootContextNode(false).getDeepRelations(contextNodeXri, arcXri);
+		return this.getRootContextNode(false).getDeepRelations(contextNodeAddress, arc);
 	}
 
 	@Override
-	public ReadOnlyIterator<Relation> getDeepRelations(XDI3Segment contextNodeXri) {
+	public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress contextNodeAddress) {
 
-		return this.getRootContextNode(false).getDeepRelations(contextNodeXri);
+		return this.getRootContextNode(false).getDeepRelations(contextNodeAddress);
 	}
 
 	@Override
-	public Literal setDeepLiteral(XDI3Segment contextNodeXri, Object literalData) {
+	public Literal setDeepLiteral(XDIAddress contextNodeAddress, Object literalData) {
 
-		return this.getRootContextNode(false).setDeepLiteral(contextNodeXri, literalData);
+		return this.getRootContextNode(false).setDeepLiteral(contextNodeAddress, literalData);
 	}
 
 	@Override
-	public Literal setDeepLiteralString(XDI3Segment contextNodeXri, String literalData) {
+	public Literal setDeepLiteralString(XDIAddress contextNodeAddress, String literalData) {
 
-		return this.getRootContextNode(false).setDeepLiteralString(contextNodeXri, literalData);
+		return this.getRootContextNode(false).setDeepLiteralString(contextNodeAddress, literalData);
 	}
 
 	@Override
-	public Literal setDeepLiteralNumber(XDI3Segment contextNodeXri, Double literalData) {
+	public Literal setDeepLiteralNumber(XDIAddress contextNodeAddress, Double literalData) {
 
-		return this.getRootContextNode(false).setDeepLiteralNumber(contextNodeXri, literalData);
+		return this.getRootContextNode(false).setDeepLiteralNumber(contextNodeAddress, literalData);
 	}
 
 	@Override
-	public Literal setDeepLiteralBoolean(XDI3Segment contextNodeXri, Boolean literalData) {
+	public Literal setDeepLiteralBoolean(XDIAddress contextNodeAddress, Boolean literalData) {
 
-		return this.getRootContextNode(false).setDeepLiteralBoolean(contextNodeXri, literalData);
+		return this.getRootContextNode(false).setDeepLiteralBoolean(contextNodeAddress, literalData);
 	}
 
 	@Override
-	public Literal getDeepLiteral(XDI3Segment contextNodeXri, Object literalData) {
+	public Literal getDeepLiteral(XDIAddress contextNodeAddress, Object literalData) {
 
-		return this.getRootContextNode(false).getDeepLiteral(contextNodeXri, literalData);
+		return this.getRootContextNode(false).getDeepLiteral(contextNodeAddress, literalData);
 	}
 
 	@Override
-	public Literal getDeepLiteralString(XDI3Segment contextNodeXri, String literalData) {
+	public Literal getDeepLiteralString(XDIAddress contextNodeAddress, String literalData) {
 
-		return this.getRootContextNode(false).getDeepLiteralString(contextNodeXri, literalData);
+		return this.getRootContextNode(false).getDeepLiteralString(contextNodeAddress, literalData);
 	}
 
 	@Override
-	public Literal getDeepLiteralNumber(XDI3Segment contextNodeXri, Double literalData) {
+	public Literal getDeepLiteralNumber(XDIAddress contextNodeAddress, Double literalData) {
 
-		return this.getRootContextNode(false).getDeepLiteralNumber(contextNodeXri, literalData);
+		return this.getRootContextNode(false).getDeepLiteralNumber(contextNodeAddress, literalData);
 	}
 
 	@Override
-	public Literal getDeepLiteralBoolean(XDI3Segment contextNodeXri, Boolean literalData) {
+	public Literal getDeepLiteralBoolean(XDIAddress contextNodeAddress, Boolean literalData) {
 
-		return this.getRootContextNode(false).getDeepLiteralBoolean(contextNodeXri, literalData);
+		return this.getRootContextNode(false).getDeepLiteralBoolean(contextNodeAddress, literalData);
 	}
 
 	@Override
-	public Literal getDeepLiteral(XDI3Segment contextNodeXri) {
+	public Literal getDeepLiteral(XDIAddress contextNodeAddress) {
 
-		return this.getRootContextNode(false).getDeepLiteral(contextNodeXri);
+		return this.getRootContextNode(false).getDeepLiteral(contextNodeAddress);
 	}
 
 	/*
 	 * Methods related to statements
 	 */
 
 	@Override
-	public Statement setStatement(XDI3Statement statementXri) {
+	public Statement setStatement(XDIStatement statementXri) {
 
 		return this.getRootContextNode(false).setStatement(statementXri);
 	}
 
 	@Override
-	public Statement getStatement(XDI3Statement statementXri) {
+	public Statement getStatement(XDIStatement statementXri) {
 
 		return this.getRootContextNode(false).getStatement(statementXri);
 	}
 
 	@Override
-	public boolean containsStatement(XDI3Statement statementXri) {
+	public boolean containsStatement(XDIStatement statementXri) {
 
 		return this.getRootContextNode(false).containsStatement(statementXri);
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FAbstractGraph.java
40e40ee166a0bf66a0f8a29778528e65c8a52842
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FAbstractLiteral.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FAbstractLiteral.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/AbstractLiteral.java
import xdi2.core.syntax.XDIAddress;
		hashCode = (hashCode * 31) + this.getContextNode().getAddress().hashCode();
		public XDIAddress getSubject() {
			return AbstractLiteral.this.getContextNode().getAddress();

import xdi2.core.xri3.XDI3Segment;
		hashCode = (hashCode * 31) + this.getContextNode().getXri().hashCode();
		public XDI3Segment getSubject() {
			return AbstractLiteral.this.getContextNode().getXri();

@@ -9,7 +9,7 @@
 import xdi2.core.Statement.LiteralStatement;
 import xdi2.core.exceptions.Xdi2RuntimeException;
 import xdi2.core.impl.AbstractStatement.AbstractLiteralStatement;
-import xdi2.core.xri3.XDI3Segment;
+import xdi2.core.syntax.XDIAddress;
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
@@ -137,7 +137,7 @@ public int hashCode() {
 
 		int hashCode = 1;
 
-		hashCode = (hashCode * 31) + this.getContextNode().getXri().hashCode();
+		hashCode = (hashCode * 31) + this.getContextNode().getAddress().hashCode();
 		hashCode = (hashCode * 31) + this.getLiteralData().hashCode();
 
 		return hashCode;
@@ -265,9 +265,9 @@ public static Object jsonElementToLiteralData(JsonElement jsonElement) {
 		private static final long serialVersionUID = -8290065911553369697L;
 
 		@Override
-		public XDI3Segment getSubject() {
+		public XDIAddress getSubject() {
 
-			return AbstractLiteral.this.getContextNode().getXri();
+			return AbstractLiteral.this.getContextNode().getAddress();
 		}
 
 		@Override

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FAbstractLiteral.java
52a10603232a81a69b332db2c7fc208bb6e435d6
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FAbstractRelation.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FAbstractRelation.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/AbstractRelation.java
import xdi2.core.syntax.XDIAddress;
		this.getContextNode().delRelation(this.getArc(), this.getTargetContextNodeAddress());
		return this.getGraph().getDeepContextNode(this.getTargetContextNodeAddress(), false);
		// two relations are equal if their context nodes, arcs, and target context node XRIs are equal
				this.getArc().equals(other.getArc()) && 
				this.getTargetContextNodeAddress().equals(other.getTargetContextNodeAddress());
		hashCode = (hashCode * 31) + this.getArc().hashCode();
		hashCode = (hashCode * 31) + this.getTargetContextNodeAddress().hashCode();
		if ((compare = this.getArc().compareTo(other.getArc())) != 0) return compare;
		if ((compare = this.getTargetContextNodeAddress().compareTo(other.getTargetContextNodeAddress())) != 0) return compare;
		public XDIAddress getSubject() {
			return AbstractRelation.this.getContextNode().getAddress();
		public XDIAddress getPredicate() {
			return AbstractRelation.this.getArc();
		public XDIAddress getObject() {
			return AbstractRelation.this.getTargetContextNodeAddress();

import xdi2.core.xri3.XDI3Segment;
		this.getContextNode().delRelation(this.getArcXri(), this.getTargetContextNodeXri());
		return this.getGraph().getDeepContextNode(this.getTargetContextNodeXri(), false);
		// two relations are equal if their context nodes, arc XRIs, and target context node XRIs are equal
				this.getArcXri().equals(other.getArcXri()) && 
				this.getTargetContextNodeXri().equals(other.getTargetContextNodeXri());
		hashCode = (hashCode * 31) + this.getArcXri().hashCode();
		hashCode = (hashCode * 31) + this.getTargetContextNodeXri().hashCode();
		if ((compare = this.getArcXri().compareTo(other.getArcXri())) != 0) return compare;
		if ((compare = this.getTargetContextNodeXri().compareTo(other.getTargetContextNodeXri())) != 0) return compare;
		public XDI3Segment getSubject() {
			return AbstractRelation.this.getContextNode().getXri();
		public XDI3Segment getPredicate() {
			return AbstractRelation.this.getArcXri();
		public XDI3Segment getObject() {
			return AbstractRelation.this.getTargetContextNodeXri();

@@ -5,7 +5,7 @@
 import xdi2.core.Relation;
 import xdi2.core.Statement.RelationStatement;
 import xdi2.core.impl.AbstractStatement.AbstractRelationStatement;
-import xdi2.core.xri3.XDI3Segment;
+import xdi2.core.syntax.XDIAddress;
 
 public abstract class AbstractRelation implements Relation {
 
@@ -35,13 +35,13 @@ public ContextNode getContextNode() {
 	@Override
 	public synchronized void delete() {
 
-		this.getContextNode().delRelation(this.getArcXri(), this.getTargetContextNodeXri());
+		this.getContextNode().delRelation(this.getArc(), this.getTargetContextNodeAddress());
 	}
 
 	@Override
 	public ContextNode follow() {
 
-		return this.getGraph().getDeepContextNode(this.getTargetContextNodeXri(), false);
+		return this.getGraph().getDeepContextNode(this.getTargetContextNodeAddress(), false);
 	}
 
 	/*
@@ -72,12 +72,12 @@ public boolean equals(Object object) {
 
 		Relation other = (Relation) object;
 
-		// two relations are equal if their context nodes, arc XRIs, and target context node XRIs are equal
+		// two relations are equal if their context nodes, arcs, and target context node XRIs are equal
 
 		return 
 				this.getContextNode().equals(other.getContextNode()) &&
-				this.getArcXri().equals(other.getArcXri()) && 
-				this.getTargetContextNodeXri().equals(other.getTargetContextNodeXri());
+				this.getArc().equals(other.getArc()) && 
+				this.getTargetContextNodeAddress().equals(other.getTargetContextNodeAddress());
 	}
 
 	@Override
@@ -86,8 +86,8 @@ public int hashCode() {
 		int hashCode = 1;
 
 		hashCode = (hashCode * 31) + this.getContextNode().hashCode();
-		hashCode = (hashCode * 31) + this.getArcXri().hashCode();
-		hashCode = (hashCode * 31) + this.getTargetContextNodeXri().hashCode();
+		hashCode = (hashCode * 31) + this.getArc().hashCode();
+		hashCode = (hashCode * 31) + this.getTargetContextNodeAddress().hashCode();
 
 		return hashCode;
 	}
@@ -100,8 +100,8 @@ public int compareTo(Relation other) {
 		int compare;
 
 		if ((compare = this.getContextNode().compareTo(other.getContextNode())) != 0) return compare;
-		if ((compare = this.getArcXri().compareTo(other.getArcXri())) != 0) return compare;
-		if ((compare = this.getTargetContextNodeXri().compareTo(other.getTargetContextNodeXri())) != 0) return compare;
+		if ((compare = this.getArc().compareTo(other.getArc())) != 0) return compare;
+		if ((compare = this.getTargetContextNodeAddress().compareTo(other.getTargetContextNodeAddress())) != 0) return compare;
 
 		return 0;
 	}
@@ -115,21 +115,21 @@ public int compareTo(Relation other) {
 		private static final long serialVersionUID = 1937380243537401799L;
 
 		@Override
-		public XDI3Segment getSubject() {
+		public XDIAddress getSubject() {
 
-			return AbstractRelation.this.getContextNode().getXri();
+			return AbstractRelation.this.getContextNode().getAddress();
 		}
 
 		@Override
-		public XDI3Segment getPredicate() {
+		public XDIAddress getPredicate() {
 
-			return AbstractRelation.this.getArcXri();
+			return AbstractRelation.this.getArc();
 		}
 
 		@Override
-		public XDI3Segment getObject() {
+		public XDIAddress getObject() {
 
-			return AbstractRelation.this.getTargetContextNodeXri();
+			return AbstractRelation.this.getTargetContextNodeAddress();
 		}
 
 		@Override

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FAbstractRelation.java
cd12f1de1afcd91ad8eca0e7abbea9741eff0aca
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FAbstractStatement.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FAbstractStatement.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/AbstractStatement.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIStatement;
	public XDIStatement getXri() {
			return XDIStatement.fromContextNodeComponents(((ContextNodeStatement) this).getSubject(), ((ContextNodeStatement) this).getObject());
			return XDIStatement.fromRelationComponents(((RelationStatement) this).getSubject(), ((RelationStatement) this).getPredicate(), ((RelationStatement) this).getObject());
			return XDIStatement.fromLiteralComponents(((LiteralStatement) this).getSubject(), ((LiteralStatement) this).getObject());
		public final XDIAddress getPredicate() {
			return XDIConstants.XDI_ADD_CONTEXT;
		public final XDIAddress getPredicate() {
			return XDIConstants.XDI_ADD_LITERAL;

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
	public XDI3Statement getXri() {
			return XDI3Statement.fromContextNodeComponents(((ContextNodeStatement) this).getSubject(), ((ContextNodeStatement) this).getObject());
			return XDI3Statement.fromRelationComponents(((RelationStatement) this).getSubject(), ((RelationStatement) this).getPredicate(), ((RelationStatement) this).getObject());
			return XDI3Statement.fromLiteralComponents(((LiteralStatement) this).getSubject(), ((LiteralStatement) this).getObject());
		public final XDI3Segment getPredicate() {
			return XDIConstants.XRI_S_CONTEXT;
		public final XDI3Segment getPredicate() {
			return XDIConstants.XRI_S_LITERAL;

@@ -7,8 +7,8 @@
 import xdi2.core.Statement;
 import xdi2.core.constants.XDIConstants;
 import xdi2.core.features.nodetypes.XdiInnerRoot;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIStatement;
 
 public abstract class AbstractStatement implements Statement {
 
@@ -50,17 +50,17 @@ public void delete() {
 	}
 
 	@Override
-	public XDI3Statement getXri() {
+	public XDIStatement getXri() {
 
 		if (this instanceof ContextNodeStatement) {
 
-			return XDI3Statement.fromContextNodeComponents(((ContextNodeStatement) this).getSubject(), ((ContextNodeStatement) this).getObject());
+			return XDIStatement.fromContextNodeComponents(((ContextNodeStatement) this).getSubject(), ((ContextNodeStatement) this).getObject());
 		} else if (this instanceof RelationStatement) {
 
-			return XDI3Statement.fromRelationComponents(((RelationStatement) this).getSubject(), ((RelationStatement) this).getPredicate(), ((RelationStatement) this).getObject());
+			return XDIStatement.fromRelationComponents(((RelationStatement) this).getSubject(), ((RelationStatement) this).getPredicate(), ((RelationStatement) this).getObject());
 		} else if (this instanceof LiteralStatement) {
 
-			return XDI3Statement.fromLiteralComponents(((LiteralStatement) this).getSubject(), ((LiteralStatement) this).getObject());
+			return XDIStatement.fromLiteralComponents(((LiteralStatement) this).getSubject(), ((LiteralStatement) this).getObject());
 		}
 
 		throw new IllegalStateException("Invalid statement: " + this.getClass().getSimpleName());
@@ -139,9 +139,9 @@ public static abstract class AbstractContextNodeStatement extends AbstractStatem
 		private static final long serialVersionUID = -7006808512493295364L;
 
 		@Override
-		public final XDI3Segment getPredicate() {
+		public final XDIAddress getPredicate() {
 
-			return XDIConstants.XRI_S_CONTEXT;
+			return XDIConstants.XDI_ADD_CONTEXT;
 		}
 
 		@Override
@@ -167,9 +167,9 @@ public static abstract class AbstractLiteralStatement extends AbstractStatement
 		private static final long serialVersionUID = -7876412291137305476L;
 
 		@Override
-		public final XDI3Segment getPredicate() {
+		public final XDIAddress getPredicate() {
 
-			return XDIConstants.XRI_S_LITERAL;
+			return XDIConstants.XDI_ADD_LITERAL;
 		}
 
 		@Override

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FAbstractStatement.java
30b115a0fb1e121702973d19758ab0d335c948b0
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FBasicContextNode.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FBasicContextNode.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/BasicContextNode.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
	private XDIArc arc;
	public BasicContextNode(Graph graph, ContextNode contextNode, XDIArc arc, Iterable<ContextNode> contextNodes, Iterable<Relation> relations, Literal literal) {
		this.arc = arc;
	public XDIArc getArc() {
		return this.arc;
	public ContextNode setContextNode(XDIArc arc) {
	public void delContextNode(XDIArc arc) {
	public Relation setRelation(XDIAddress arc, ContextNode targetContextNode) {
	public void delRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
	public void delRelations(XDIAddress arc) {

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
	private XDI3SubSegment arcXri;
	public BasicContextNode(Graph graph, ContextNode contextNode, XDI3SubSegment arcXri, Iterable<ContextNode> contextNodes, Iterable<Relation> relations, Literal literal) {
		this.arcXri = arcXri;
	public XDI3SubSegment getArcXri() {
		return this.arcXri;
	public ContextNode setContextNode(XDI3SubSegment arcXri) {
	public void delContextNode(XDI3SubSegment arcXri) {
	public Relation setRelation(XDI3Segment arcXri, ContextNode targetContextNode) {
	public void delRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
	public void delRelations(XDI3Segment arcXri) {

@@ -6,37 +6,37 @@
 import xdi2.core.Graph;
 import xdi2.core.Literal;
 import xdi2.core.Relation;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.ReadOnlyIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
 
 public class BasicContextNode extends AbstractContextNode implements ContextNode {
 
 	private static final long serialVersionUID = -3684616841641336596L;
 
-	private XDI3SubSegment arcXri;
+	private XDIArc arc;
 	private Iterable<ContextNode> contextNodes;
 	private Iterable<Relation> relations;
 	private Literal literal;
 
-	public BasicContextNode(Graph graph, ContextNode contextNode, XDI3SubSegment arcXri, Iterable<ContextNode> contextNodes, Iterable<Relation> relations, Literal literal) {
+	public BasicContextNode(Graph graph, ContextNode contextNode, XDIArc arc, Iterable<ContextNode> contextNodes, Iterable<Relation> relations, Literal literal) {
 
 		super(graph, contextNode);
 
-		this.arcXri = arcXri;
+		this.arc = arc;
 		this.contextNodes = contextNodes == null ? Arrays.asList(new ContextNode[0]) : contextNodes;
 		this.relations = relations == null ? Arrays.asList(new Relation[0]) : relations;
 		this.literal = literal;
 	}
 
 	@Override
-	public XDI3SubSegment getArcXri() {
+	public XDIArc getArc() {
 
-		return this.arcXri;
+		return this.arc;
 	}
 
 	@Override
-	public ContextNode setContextNode(XDI3SubSegment arcXri) {
+	public ContextNode setContextNode(XDIArc arc) {
 
 		throw new UnsupportedOperationException("Not supported.");
 	}
@@ -48,7 +48,7 @@ public ReadOnlyIterator<ContextNode> getContextNodes() {
 	}
 
 	@Override
-	public void delContextNode(XDI3SubSegment arcXri) {
+	public void delContextNode(XDIArc arc) {
 
 		throw new UnsupportedOperationException("Not supported.");
 	}
@@ -60,7 +60,7 @@ public void delContextNodes() {
 	}
 
 	@Override
-	public Relation setRelation(XDI3Segment arcXri, ContextNode targetContextNode) {
+	public Relation setRelation(XDIAddress arc, ContextNode targetContextNode) {
 
 		throw new UnsupportedOperationException("Not supported.");
 	}
@@ -72,13 +72,13 @@ public ReadOnlyIterator<Relation> getRelations() {
 	}
 
 	@Override
-	public void delRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public void delRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
 		throw new UnsupportedOperationException("Not supported.");
 	}
 
 	@Override
-	public void delRelations(XDI3Segment arcXri) {
+	public void delRelations(XDIAddress arc) {
 
 		throw new UnsupportedOperationException("Not supported.");
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FBasicContextNode.java
2a5854dda2b2e98864f38f69695fc421d7481b8c
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FBasicRelation.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FBasicRelation.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/BasicRelation.java
import xdi2.core.syntax.XDIAddress;
	private XDIAddress arc;
	private XDIAddress targetContextNodeAddress;
	public BasicRelation(ContextNode contextNode, XDIAddress arc, XDIAddress targetContextNodeAddress) {
		this.arc = arc;
		this.targetContextNodeAddress = targetContextNodeAddress;
	public BasicRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
		this(new BasicContextNode(new BasicGraph(null, null), null, null, null, null, null), arc, targetContextNodeAddress);
	public XDIAddress getArc() {
		return this.arc;
	public XDIAddress getTargetContextNodeAddress() {
		return this.targetContextNodeAddress;

import xdi2.core.xri3.XDI3Segment;
	private XDI3Segment arcXri;
	private XDI3Segment targetContextNodeXri;
	public BasicRelation(ContextNode contextNode, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		this.arcXri = arcXri;
		this.targetContextNodeXri = targetContextNodeXri;
	public BasicRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		this(new BasicContextNode(new BasicGraph(null, null), null, null, null, null, null), arcXri, targetContextNodeXri);
	public XDI3Segment getArcXri() {
		return this.arcXri;
	public XDI3Segment getTargetContextNodeXri() {
		return this.targetContextNodeXri;

@@ -2,37 +2,37 @@
 
 import xdi2.core.ContextNode;
 import xdi2.core.Relation;
-import xdi2.core.xri3.XDI3Segment;
+import xdi2.core.syntax.XDIAddress;
 
 public class BasicRelation extends AbstractRelation implements Relation {
 
 	private static final long serialVersionUID = -8757473050724884998L;
 
-	private XDI3Segment arcXri;
-	private XDI3Segment targetContextNodeXri;
+	private XDIAddress arc;
+	private XDIAddress targetContextNodeAddress;
 
-	public BasicRelation(ContextNode contextNode, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public BasicRelation(ContextNode contextNode, XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
 		super(contextNode);
 
-		this.arcXri = arcXri;
-		this.targetContextNodeXri = targetContextNodeXri;
+		this.arc = arc;
+		this.targetContextNodeAddress = targetContextNodeAddress;
 	}
 
-	public BasicRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public BasicRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
-		this(new BasicContextNode(new BasicGraph(null, null), null, null, null, null, null), arcXri, targetContextNodeXri);
+		this(new BasicContextNode(new BasicGraph(null, null), null, null, null, null, null), arc, targetContextNodeAddress);
 	}
 
 	@Override
-	public XDI3Segment getArcXri() {
+	public XDIAddress getArc() {
 
-		return this.arcXri;
+		return this.arc;
 	}
 
 	@Override
-	public XDI3Segment getTargetContextNodeXri() {
+	public XDIAddress getTargetContextNodeAddress() {
 
-		return this.targetContextNodeXri;
+		return this.targetContextNodeAddress;
 	}
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2FBasicRelation.java
b4f0848da2c15d7de0c4523906425e4accb7648b
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fjson%2FJSONContextNode.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fjson%2FJSONContextNode.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/json/JSONContextNode.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.util.AddressUtil;
	private XDIArc arc;
	private XDIAddress xri;
	JSONContextNode(JSONGraph graph, JSONContextNode contextNode, XDIArc arc, XDIAddress xri) {
		this.arc = arc;
	public XDIArc getArc() {
		return this.arc;
	public XDIAddress getAddress() {
	public ContextNode setContextNode(XDIArc arc) {
		this.setContextNodeCheckValid(arc);
		((JSONGraph) this.getGraph()).jsonSaveToArray(this.getAddress().toString(), XDIConstants.XDI_ADD_CONTEXT.toString(), new JsonPrimitive(arc.toString()));
		XDIAddress xri = AddressUtil.concatAddresses(this.getAddress(), arc);
		JSONContextNode contextNode = new JSONContextNode((JSONGraph) this.getGraph(), this, arc, xri);
		this.setContextNodeSetInnerRoot(arc, contextNode);
	public ContextNode getContextNode(XDIArc arc, boolean subgraph) {
			jsonObject = ((JSONGraph) this.getGraph()).jsonLoadWithPrefix(this.getAddress().toString()).get(this.getAddress().toString());
			jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getAddress().toString());
		final JsonArray jsonArrayContexts = jsonObject.getAsJsonArray(XDIConstants.XDI_ADD_CONTEXT.toString());
		if (! new IteratorContains<JsonElement> (jsonArrayContexts.iterator(), new JsonPrimitive(arc.toString())).contains()) return null;
		XDIAddress xri = AddressUtil.concatAddresses(this.getAddress(), arc);
		return new JSONContextNode((JSONGraph) JSONContextNode.this.getGraph(), JSONContextNode.this, arc, xri);
	public ContextNode getDeepContextNode(XDIAddress relativecontextNodeAddress, boolean subgraph) {
		if (XDIConstants.XDI_ADD_ROOT.equals(relativecontextNodeAddress)) return this;
		XDIAddress contextNodeAddress = AddressUtil.concatAddresses(this.getAddress(), relativecontextNodeAddress);
		XDIAddress parentcontextNodeAddress = AddressUtil.concatAddresses(this.getAddress(), AddressUtil.parentXri(relativecontextNodeAddress, -1));
		XDIArc arc = relativecontextNodeAddress.getLastArc();
		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(parentcontextNodeAddress.toString());
		final JsonArray jsonArrayContexts = jsonObject.getAsJsonArray(XDIConstants.XDI_ADD_CONTEXT.toString());
		if (! new IteratorContains<JsonElement> (jsonArrayContexts.iterator(), new JsonPrimitive(arc.toString())).contains()) return null;
		for (XDIArc temparc : relativecontextNodeAddress.getArcs()) {
			XDIAddress tempXri = AddressUtil.concatAddresses(contextNode.getAddress(), temparc);
			contextNode = new JSONContextNode((JSONGraph) this.getGraph(), contextNode, temparc, tempXri);
			((JSONGraph) this.getGraph()).jsonLoadWithPrefix(contextNodeAddress.toString());
		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getAddress().toString());
		final JsonArray jsonArrayContexts = jsonObject.getAsJsonArray(XDIConstants.XDI_ADD_CONTEXT.toString());
				XDIArc arc = XDIArc.create(((JsonPrimitive) jsonElement).getAsString());
				XDIAddress xri = AddressUtil.concatAddresses(JSONContextNode.this.getAddress(), arc);
				return new JSONContextNode((JSONGraph) JSONContextNode.this.getGraph(), JSONContextNode.this, arc, xri);
	public void delContextNode(XDIArc arc) {
		ContextNode contextNode = this.getContextNode(arc, true);
		((JSONGraph) this.getGraph()).jsonDelete(contextNode.getAddress().toString());
		((JSONGraph) this.getGraph()).jsonDeleteFromArray(this.getAddress().toString(), XDIConstants.XDI_ADD_CONTEXT.toString(), new JsonPrimitive(arc.toString()));
	public synchronized Relation setRelation(XDIAddress arc, ContextNode targetContextNode) {
		XDIAddress targetContextNodeAddress = targetContextNode.getAddress();
		this.setRelationCheckValid(arc, targetContextNodeAddress);
		((JSONGraph) this.getGraph()).jsonSaveToArray(this.getAddress().toString(), arc.toString(), new JsonPrimitive(targetContextNodeAddress.toString()));
		((JSONGraph) this.getGraph()).jsonSaveToArray(targetContextNodeAddress.toString(), "/" + arc.toString(), new JsonPrimitive(this.getAddress().toString()));
		JSONRelation relation = new JSONRelation(this, arc, targetContextNodeAddress);
		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getAddress().toString());
				final XDIAddress arc = XDIAddress.create(entry.getKey());
				if (XDIConstants.XDI_ADD_CONTEXT.equals(arc)) return null;
				if (XDIConstants.XDI_ADD_LITERAL.equals(arc)) return null;
						XDIAddress targetContextNodeAddress = XDIAddress.create(((JsonPrimitive) jsonElement).getAsString());
						return new JSONRelation(JSONContextNode.this, arc, targetContextNodeAddress);
		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getAddress().toString());
				final XDIAddress arc = XDIAddress.create(entry.getKey().substring(1));
						XDIAddress contextNodeAddress = XDIAddress.create(((JsonPrimitive) jsonElement).getAsString());
						ContextNode contextNode = JSONContextNode.this.getGraph().getDeepContextNode(contextNodeAddress, false);
							log.warn("In context node " + JSONContextNode.this.getAddress() + " found incoming relation " + arc + " from non-existent context node " + contextNodeAddress);
						return new JSONRelation(contextNode, arc, JSONContextNode.this.getAddress());
	public void delRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
		((JSONGraph) this.getGraph()).jsonDeleteFromArray(this.getAddress().toString(), arc.toString(), new JsonPrimitive(targetContextNodeAddress.toString()));
		((JSONGraph) this.getGraph()).jsonDeleteFromArray(targetContextNodeAddress.toString(), "/" + arc.toString(), new JsonPrimitive(this.getAddress().toString()));
		this.delRelationDelInnerRoot(arc, targetContextNodeAddress);
		((JSONGraph) this.getGraph()).jsonSaveToObject(this.getAddress().toString(), XDIConstants.XDI_ARC_LITERAL.toString(), AbstractLiteral.literalDataToJsonElement(literalData));
		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getAddress().toString());
		if (! jsonObject.has(XDIConstants.XDI_ARC_LITERAL.toString())) return null;
		((JSONGraph) this.getGraph()).jsonDeleteFromObject(this.getAddress().toString(), XDIConstants.XDI_ARC_LITERAL.toString());
import xdi2.core.util.XDI3Util;
import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
	private XDI3SubSegment arcXri;
	private XDI3Segment xri;
	JSONContextNode(JSONGraph graph, JSONContextNode contextNode, XDI3SubSegment arcXri, XDI3Segment xri) {
		this.arcXri = arcXri;
	public XDI3SubSegment getArcXri() {
		return this.arcXri;
	public XDI3Segment getXri() {
	public ContextNode setContextNode(XDI3SubSegment arcXri) {
		this.setContextNodeCheckValid(arcXri);
		((JSONGraph) this.getGraph()).jsonSaveToArray(this.getXri().toString(), XDIConstants.XRI_S_CONTEXT.toString(), new JsonPrimitive(arcXri.toString()));
		XDI3Segment xri = XDI3Util.concatXris(this.getXri(), arcXri);
		JSONContextNode contextNode = new JSONContextNode((JSONGraph) this.getGraph(), this, arcXri, xri);
		this.setContextNodeSetInnerRoot(arcXri, contextNode);
	public ContextNode getContextNode(XDI3SubSegment arcXri, boolean subgraph) {
			jsonObject = ((JSONGraph) this.getGraph()).jsonLoadWithPrefix(this.getXri().toString()).get(this.getXri().toString());
			jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getXri().toString());
		final JsonArray jsonArrayContexts = jsonObject.getAsJsonArray(XDIConstants.XRI_S_CONTEXT.toString());
		if (! new IteratorContains<JsonElement> (jsonArrayContexts.iterator(), new JsonPrimitive(arcXri.toString())).contains()) return null;
		XDI3Segment xri = XDI3Util.concatXris(this.getXri(), arcXri);
		return new JSONContextNode((JSONGraph) JSONContextNode.this.getGraph(), JSONContextNode.this, arcXri, xri);
	public ContextNode getDeepContextNode(XDI3Segment relativeContextNodeXri, boolean subgraph) {
		if (XDIConstants.XRI_S_ROOT.equals(relativeContextNodeXri)) return this;
		XDI3Segment contextNodeXri = XDI3Util.concatXris(this.getXri(), relativeContextNodeXri);
		XDI3Segment parentContextNodeXri = XDI3Util.concatXris(this.getXri(), XDI3Util.parentXri(relativeContextNodeXri, -1));
		XDI3SubSegment arcXri = relativeContextNodeXri.getLastSubSegment();
		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(parentContextNodeXri.toString());
		final JsonArray jsonArrayContexts = jsonObject.getAsJsonArray(XDIConstants.XRI_S_CONTEXT.toString());
		if (! new IteratorContains<JsonElement> (jsonArrayContexts.iterator(), new JsonPrimitive(arcXri.toString())).contains()) return null;
		for (XDI3SubSegment tempArcXri : relativeContextNodeXri.getSubSegments()) {
			XDI3Segment tempXri = XDI3Util.concatXris(contextNode.getXri(), tempArcXri);
			contextNode = new JSONContextNode((JSONGraph) this.getGraph(), contextNode, tempArcXri, tempXri);
			((JSONGraph) this.getGraph()).jsonLoadWithPrefix(contextNodeXri.toString());
		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getXri().toString());
		final JsonArray jsonArrayContexts = jsonObject.getAsJsonArray(XDIConstants.XRI_S_CONTEXT.toString());
				XDI3SubSegment arcXri = XDI3SubSegment.create(((JsonPrimitive) jsonElement).getAsString());
				XDI3Segment xri = XDI3Util.concatXris(JSONContextNode.this.getXri(), arcXri);
				return new JSONContextNode((JSONGraph) JSONContextNode.this.getGraph(), JSONContextNode.this, arcXri, xri);
	public void delContextNode(XDI3SubSegment arcXri) {
		ContextNode contextNode = this.getContextNode(arcXri, true);
		((JSONGraph) this.getGraph()).jsonDelete(contextNode.getXri().toString());
		((JSONGraph) this.getGraph()).jsonDeleteFromArray(this.getXri().toString(), XDIConstants.XRI_S_CONTEXT.toString(), new JsonPrimitive(arcXri.toString()));
	public synchronized Relation setRelation(XDI3Segment arcXri, ContextNode targetContextNode) {
		XDI3Segment targetContextNodeXri = targetContextNode.getXri();
		this.setRelationCheckValid(arcXri, targetContextNodeXri);
		((JSONGraph) this.getGraph()).jsonSaveToArray(this.getXri().toString(), arcXri.toString(), new JsonPrimitive(targetContextNodeXri.toString()));
		((JSONGraph) this.getGraph()).jsonSaveToArray(targetContextNodeXri.toString(), "/" + arcXri.toString(), new JsonPrimitive(this.getXri().toString()));
		JSONRelation relation = new JSONRelation(this, arcXri, targetContextNodeXri);
		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getXri().toString());
				final XDI3Segment arcXri = XDI3Segment.create(entry.getKey());
				if (XDIConstants.XRI_S_CONTEXT.equals(arcXri)) return null;
				if (XDIConstants.XRI_S_LITERAL.equals(arcXri)) return null;
						XDI3Segment targetContextNodeXri = XDI3Segment.create(((JsonPrimitive) jsonElement).getAsString());
						return new JSONRelation(JSONContextNode.this, arcXri, targetContextNodeXri);
		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getXri().toString());
				final XDI3Segment arcXri = XDI3Segment.create(entry.getKey().substring(1));
						XDI3Segment contextNodeXri = XDI3Segment.create(((JsonPrimitive) jsonElement).getAsString());
						ContextNode contextNode = JSONContextNode.this.getGraph().getDeepContextNode(contextNodeXri, false);
							log.warn("In context node " + JSONContextNode.this.getXri() + " found incoming relation " + arcXri + " from non-existent context node " + contextNodeXri);
						return new JSONRelation(contextNode, arcXri, JSONContextNode.this.getXri());
	public void delRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		((JSONGraph) this.getGraph()).jsonDeleteFromArray(this.getXri().toString(), arcXri.toString(), new JsonPrimitive(targetContextNodeXri.toString()));
		((JSONGraph) this.getGraph()).jsonDeleteFromArray(targetContextNodeXri.toString(), "/" + arcXri.toString(), new JsonPrimitive(this.getXri().toString()));
		this.delRelationDelInnerRoot(arcXri, targetContextNodeXri);
		((JSONGraph) this.getGraph()).jsonSaveToObject(this.getXri().toString(), XDIConstants.XRI_SS_LITERAL.toString(), AbstractLiteral.literalDataToJsonElement(literalData));
		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getXri().toString());
		if (! jsonObject.has(XDIConstants.XRI_SS_LITERAL.toString())) return null;
		((JSONGraph) this.getGraph()).jsonDeleteFromObject(this.getXri().toString(), XDIConstants.XRI_SS_LITERAL.toString());
@@ -15,16 +15,16 @@
 import xdi2.core.constants.XDIConstants;
 import xdi2.core.impl.AbstractContextNode;
 import xdi2.core.impl.AbstractLiteral;
-import xdi2.core.util.XDI3Util;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.util.AddressUtil;
 import xdi2.core.util.iterators.DescendingIterator;
 import xdi2.core.util.iterators.EmptyIterator;
 import xdi2.core.util.iterators.IteratorContains;
 import xdi2.core.util.iterators.IteratorListMaker;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.NotNullIterator;
 import xdi2.core.util.iterators.ReadOnlyIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
 
 import com.google.gson.JsonArray;
 import com.google.gson.JsonElement;
@@ -37,14 +37,14 @@ public class JSONContextNode extends AbstractContextNode implements ContextNode
 
 	private static final Logger log = LoggerFactory.getLogger(JSONContextNode.class);
 
-	private XDI3SubSegment arcXri;
-	private XDI3Segment xri;
+	private XDIArc arc;
+	private XDIAddress xri;
 
-	JSONContextNode(JSONGraph graph, JSONContextNode contextNode, XDI3SubSegment arcXri, XDI3Segment xri) {
+	JSONContextNode(JSONGraph graph, JSONContextNode contextNode, XDIArc arc, XDIAddress xri) {
 
 		super(graph, contextNode);
 
-		this.arcXri = arcXri;
+		this.arc = arc;
 		this.xri = xri;
 	}
 
@@ -61,13 +61,13 @@ public synchronized void clear() {
 	}
 
 	@Override
-	public XDI3SubSegment getArcXri() {
+	public XDIArc getArc() {
 
-		return this.arcXri;
+		return this.arc;
 	}
 
 	@Override
-	public XDI3Segment getXri() {
+	public XDIAddress getAddress() {
 
 		return this.xri;
 	}
@@ -77,86 +77,86 @@ public XDI3Segment getXri() {
 	 */
 
 	@Override
-	public ContextNode setContextNode(XDI3SubSegment arcXri) {
+	public ContextNode setContextNode(XDIArc arc) {
 
 		// check validity
 
-		this.setContextNodeCheckValid(arcXri);
+		this.setContextNodeCheckValid(arc);
 
 		// set the context node
 
-		((JSONGraph) this.getGraph()).jsonSaveToArray(this.getXri().toString(), XDIConstants.XRI_S_CONTEXT.toString(), new JsonPrimitive(arcXri.toString()));
+		((JSONGraph) this.getGraph()).jsonSaveToArray(this.getAddress().toString(), XDIConstants.XDI_ADD_CONTEXT.toString(), new JsonPrimitive(arc.toString()));
 
-		XDI3Segment xri = XDI3Util.concatXris(this.getXri(), arcXri);
+		XDIAddress xri = AddressUtil.concatAddresses(this.getAddress(), arc);
 
-		JSONContextNode contextNode = new JSONContextNode((JSONGraph) this.getGraph(), this, arcXri, xri);
+		JSONContextNode contextNode = new JSONContextNode((JSONGraph) this.getGraph(), this, arc, xri);
 
 		// set inner root
 
-		this.setContextNodeSetInnerRoot(arcXri, contextNode);
+		this.setContextNodeSetInnerRoot(arc, contextNode);
 
 		// done
 
 		return contextNode;
 	}
 
 	@Override
-	public ContextNode getContextNode(XDI3SubSegment arcXri, boolean subgraph) {
+	public ContextNode getContextNode(XDIArc arc, boolean subgraph) {
 
 		JsonObject jsonObject;
 
 		if (subgraph)
-			jsonObject = ((JSONGraph) this.getGraph()).jsonLoadWithPrefix(this.getXri().toString()).get(this.getXri().toString());
+			jsonObject = ((JSONGraph) this.getGraph()).jsonLoadWithPrefix(this.getAddress().toString()).get(this.getAddress().toString());
 		else
-			jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getXri().toString());
+			jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getAddress().toString());
 
 		if (jsonObject == null) return null;
 
-		final JsonArray jsonArrayContexts = jsonObject.getAsJsonArray(XDIConstants.XRI_S_CONTEXT.toString());
+		final JsonArray jsonArrayContexts = jsonObject.getAsJsonArray(XDIConstants.XDI_ADD_CONTEXT.toString());
 		if (jsonArrayContexts == null) return null;
 		if (jsonArrayContexts.size() < 1) return null;
 
-		if (! new IteratorContains<JsonElement> (jsonArrayContexts.iterator(), new JsonPrimitive(arcXri.toString())).contains()) return null;
+		if (! new IteratorContains<JsonElement> (jsonArrayContexts.iterator(), new JsonPrimitive(arc.toString())).contains()) return null;
 
-		XDI3Segment xri = XDI3Util.concatXris(this.getXri(), arcXri);
+		XDIAddress xri = AddressUtil.concatAddresses(this.getAddress(), arc);
 
-		return new JSONContextNode((JSONGraph) JSONContextNode.this.getGraph(), JSONContextNode.this, arcXri, xri);
+		return new JSONContextNode((JSONGraph) JSONContextNode.this.getGraph(), JSONContextNode.this, arc, xri);
 	}
 
 	@Override
-	public ContextNode getDeepContextNode(XDI3Segment relativeContextNodeXri, boolean subgraph) {
+	public ContextNode getDeepContextNode(XDIAddress relativecontextNodeAddress, boolean subgraph) {
 
-		if (XDIConstants.XRI_S_ROOT.equals(relativeContextNodeXri)) return this;
+		if (XDIConstants.XDI_ADD_ROOT.equals(relativecontextNodeAddress)) return this;
 
-		XDI3Segment contextNodeXri = XDI3Util.concatXris(this.getXri(), relativeContextNodeXri);
+		XDIAddress contextNodeAddress = AddressUtil.concatAddresses(this.getAddress(), relativecontextNodeAddress);
 
-		XDI3Segment parentContextNodeXri = XDI3Util.concatXris(this.getXri(), XDI3Util.parentXri(relativeContextNodeXri, -1));
-		XDI3SubSegment arcXri = relativeContextNodeXri.getLastSubSegment();
+		XDIAddress parentcontextNodeAddress = AddressUtil.concatAddresses(this.getAddress(), AddressUtil.parentXri(relativecontextNodeAddress, -1));
+		XDIArc arc = relativecontextNodeAddress.getLastArc();
 
 		// load the JSON object for the parent context node
 
-		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(parentContextNodeXri.toString());
+		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(parentcontextNodeAddress.toString());
 
-		final JsonArray jsonArrayContexts = jsonObject.getAsJsonArray(XDIConstants.XRI_S_CONTEXT.toString());
+		final JsonArray jsonArrayContexts = jsonObject.getAsJsonArray(XDIConstants.XDI_ADD_CONTEXT.toString());
 		if (jsonArrayContexts == null) return null;
 		if (jsonArrayContexts.size() < 1) return null;
 
-		if (! new IteratorContains<JsonElement> (jsonArrayContexts.iterator(), new JsonPrimitive(arcXri.toString())).contains()) return null;
+		if (! new IteratorContains<JsonElement> (jsonArrayContexts.iterator(), new JsonPrimitive(arc.toString())).contains()) return null;
 
 		JSONContextNode contextNode = this;
 
-		for (XDI3SubSegment tempArcXri : relativeContextNodeXri.getSubSegments()) {
+		for (XDIArc temparc : relativecontextNodeAddress.getArcs()) {
 
-			XDI3Segment tempXri = XDI3Util.concatXris(contextNode.getXri(), tempArcXri);
+			XDIAddress tempXri = AddressUtil.concatAddresses(contextNode.getAddress(), temparc);
 
-			contextNode = new JSONContextNode((JSONGraph) this.getGraph(), contextNode, tempArcXri, tempXri);
+			contextNode = new JSONContextNode((JSONGraph) this.getGraph(), contextNode, temparc, tempXri);
 		}
 
 		// retrieve subgraph?
 
 		if (subgraph) {
 
-			((JSONGraph) this.getGraph()).jsonLoadWithPrefix(contextNodeXri.toString());
+			((JSONGraph) this.getGraph()).jsonLoadWithPrefix(contextNodeAddress.toString());
 		}
 
 		// done
@@ -167,9 +167,9 @@ public ContextNode getDeepContextNode(XDI3Segment relativeContextNodeXri, boolea
 	@Override
 	public ReadOnlyIterator<ContextNode> getContextNodes() {
 
-		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getXri().toString());
+		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getAddress().toString());
 
-		final JsonArray jsonArrayContexts = jsonObject.getAsJsonArray(XDIConstants.XRI_S_CONTEXT.toString());
+		final JsonArray jsonArrayContexts = jsonObject.getAsJsonArray(XDIConstants.XDI_ADD_CONTEXT.toString());
 		if (jsonArrayContexts == null) return new EmptyIterator<ContextNode> ();
 		if (jsonArrayContexts.size() < 1) return new EmptyIterator<ContextNode> ();
 
@@ -180,18 +180,18 @@ public ReadOnlyIterator<ContextNode> getContextNodes() {
 			@Override
 			public ContextNode map(JsonElement jsonElement) {
 
-				XDI3SubSegment arcXri = XDI3SubSegment.create(((JsonPrimitive) jsonElement).getAsString());
-				XDI3Segment xri = XDI3Util.concatXris(JSONContextNode.this.getXri(), arcXri);
+				XDIArc arc = XDIArc.create(((JsonPrimitive) jsonElement).getAsString());
+				XDIAddress xri = AddressUtil.concatAddresses(JSONContextNode.this.getAddress(), arc);
 
-				return new JSONContextNode((JSONGraph) JSONContextNode.this.getGraph(), JSONContextNode.this, arcXri, xri);
+				return new JSONContextNode((JSONGraph) JSONContextNode.this.getGraph(), JSONContextNode.this, arc, xri);
 			}
 		});
 	}
 
 	@Override
-	public void delContextNode(XDI3SubSegment arcXri) {
+	public void delContextNode(XDIArc arc) {
 
-		ContextNode contextNode = this.getContextNode(arcXri, true);
+		ContextNode contextNode = this.getContextNode(arc, true);
 		if (contextNode == null) return;
 
 		// delete all relations and incoming relations
@@ -201,25 +201,25 @@ public void delContextNode(XDI3SubSegment arcXri) {
 
 		// delete this context node
 
-		((JSONGraph) this.getGraph()).jsonDelete(contextNode.getXri().toString());
-		((JSONGraph) this.getGraph()).jsonDeleteFromArray(this.getXri().toString(), XDIConstants.XRI_S_CONTEXT.toString(), new JsonPrimitive(arcXri.toString()));
+		((JSONGraph) this.getGraph()).jsonDelete(contextNode.getAddress().toString());
+		((JSONGraph) this.getGraph()).jsonDeleteFromArray(this.getAddress().toString(), XDIConstants.XDI_ADD_CONTEXT.toString(), new JsonPrimitive(arc.toString()));
 	}
 
 	@Override
-	public synchronized Relation setRelation(XDI3Segment arcXri, ContextNode targetContextNode) {
+	public synchronized Relation setRelation(XDIAddress arc, ContextNode targetContextNode) {
 
-		XDI3Segment targetContextNodeXri = targetContextNode.getXri();
+		XDIAddress targetContextNodeAddress = targetContextNode.getAddress();
 
 		// check validity
 
-		this.setRelationCheckValid(arcXri, targetContextNodeXri);
+		this.setRelationCheckValid(arc, targetContextNodeAddress);
 
 		// set the relation
 
-		((JSONGraph) this.getGraph()).jsonSaveToArray(this.getXri().toString(), arcXri.toString(), new JsonPrimitive(targetContextNodeXri.toString()));
-		((JSONGraph) this.getGraph()).jsonSaveToArray(targetContextNodeXri.toString(), "/" + arcXri.toString(), new JsonPrimitive(this.getXri().toString()));
+		((JSONGraph) this.getGraph()).jsonSaveToArray(this.getAddress().toString(), arc.toString(), new JsonPrimitive(targetContextNodeAddress.toString()));
+		((JSONGraph) this.getGraph()).jsonSaveToArray(targetContextNodeAddress.toString(), "/" + arc.toString(), new JsonPrimitive(this.getAddress().toString()));
 
-		JSONRelation relation = new JSONRelation(this, arcXri, targetContextNodeXri);
+		JSONRelation relation = new JSONRelation(this, arc, targetContextNodeAddress);
 
 		// done
 
@@ -229,7 +229,7 @@ public synchronized Relation setRelation(XDI3Segment arcXri, ContextNode targetC
 	@Override
 	public ReadOnlyIterator<Relation> getRelations() {
 
-		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getXri().toString());
+		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getAddress().toString());
 
 		final Set<Entry<String, JsonElement>> entrySet = new HashSet<Entry<String, JsonElement>> (jsonObject.entrySet());
 
@@ -240,9 +240,9 @@ public Iterator<Relation> descend(Entry<String, JsonElement> entry) {
 
 				if (entry.getKey().startsWith("/")) return null;
 
-				final XDI3Segment arcXri = XDI3Segment.create(entry.getKey());
-				if (XDIConstants.XRI_S_CONTEXT.equals(arcXri)) return null;
-				if (XDIConstants.XRI_S_LITERAL.equals(arcXri)) return null;
+				final XDIAddress arc = XDIAddress.create(entry.getKey());
+				if (XDIConstants.XDI_ADD_CONTEXT.equals(arc)) return null;
+				if (XDIConstants.XDI_ADD_LITERAL.equals(arc)) return null;
 
 				JsonArray jsonArrayRelations = (JsonArray) entry.getValue();
 
@@ -253,9 +253,9 @@ public Iterator<Relation> descend(Entry<String, JsonElement> entry) {
 					@Override
 					public Relation map(JsonElement jsonElement) {
 
-						XDI3Segment targetContextNodeXri = XDI3Segment.create(((JsonPrimitive) jsonElement).getAsString());
+						XDIAddress targetContextNodeAddress = XDIAddress.create(((JsonPrimitive) jsonElement).getAsString());
 
-						return new JSONRelation(JSONContextNode.this, arcXri, targetContextNodeXri);
+						return new JSONRelation(JSONContextNode.this, arc, targetContextNodeAddress);
 					}
 				});
 			}
@@ -265,7 +265,7 @@ public Relation map(JsonElement jsonElement) {
 	@Override
 	public ReadOnlyIterator<Relation> getIncomingRelations() {
 
-		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getXri().toString());
+		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getAddress().toString());
 
 		final Set<Entry<String, JsonElement>> entrySet = new HashSet<Entry<String, JsonElement>> (jsonObject.entrySet());
 
@@ -276,7 +276,7 @@ public Iterator<Relation> descend(Entry<String, JsonElement> entry) {
 
 				if (! entry.getKey().startsWith("/")) return null;
 
-				final XDI3Segment arcXri = XDI3Segment.create(entry.getKey().substring(1));
+				final XDIAddress arc = XDIAddress.create(entry.getKey().substring(1));
 
 				JsonArray jsonArrayIncomingRelations = (JsonArray) entry.getValue();
 
@@ -287,35 +287,35 @@ public Iterator<Relation> descend(Entry<String, JsonElement> entry) {
 					@Override
 					public Relation map(JsonElement jsonElement) {
 
-						XDI3Segment contextNodeXri = XDI3Segment.create(((JsonPrimitive) jsonElement).getAsString());
+						XDIAddress contextNodeAddress = XDIAddress.create(((JsonPrimitive) jsonElement).getAsString());
 
-						ContextNode contextNode = JSONContextNode.this.getGraph().getDeepContextNode(contextNodeXri, false);
+						ContextNode contextNode = JSONContextNode.this.getGraph().getDeepContextNode(contextNodeAddress, false);
 
 						if (contextNode == null) {
 
-							log.warn("In context node " + JSONContextNode.this.getXri() + " found incoming relation " + arcXri + " from non-existent context node " + contextNodeXri);
+							log.warn("In context node " + JSONContextNode.this.getAddress() + " found incoming relation " + arc + " from non-existent context node " + contextNodeAddress);
 
 							return null;
 						}
 
-						return new JSONRelation(contextNode, arcXri, JSONContextNode.this.getXri());
+						return new JSONRelation(contextNode, arc, JSONContextNode.this.getAddress());
 					}
 				});
 			}
 		};
 	}
 
 	@Override
-	public void delRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public void delRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
 		// delete the relation
 
-		((JSONGraph) this.getGraph()).jsonDeleteFromArray(this.getXri().toString(), arcXri.toString(), new JsonPrimitive(targetContextNodeXri.toString()));
-		((JSONGraph) this.getGraph()).jsonDeleteFromArray(targetContextNodeXri.toString(), "/" + arcXri.toString(), new JsonPrimitive(this.getXri().toString()));
+		((JSONGraph) this.getGraph()).jsonDeleteFromArray(this.getAddress().toString(), arc.toString(), new JsonPrimitive(targetContextNodeAddress.toString()));
+		((JSONGraph) this.getGraph()).jsonDeleteFromArray(targetContextNodeAddress.toString(), "/" + arc.toString(), new JsonPrimitive(this.getAddress().toString()));
 
 		// delete inner root
 
-		this.delRelationDelInnerRoot(arcXri, targetContextNodeXri);
+		this.delRelationDelInnerRoot(arc, targetContextNodeAddress);
 	}
 
 	@Override
@@ -327,7 +327,7 @@ public Literal setLiteral(Object literalData) {
 
 		// set the literal
 
-		((JSONGraph) this.getGraph()).jsonSaveToObject(this.getXri().toString(), XDIConstants.XRI_SS_LITERAL.toString(), AbstractLiteral.literalDataToJsonElement(literalData));
+		((JSONGraph) this.getGraph()).jsonSaveToObject(this.getAddress().toString(), XDIConstants.XDI_ARC_LITERAL.toString(), AbstractLiteral.literalDataToJsonElement(literalData));
 
 		JSONLiteral literal = new JSONLiteral(this);
 
@@ -339,16 +339,16 @@ public Literal setLiteral(Object literalData) {
 	@Override
 	public Literal getLiteral() {
 
-		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getXri().toString());
+		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(this.getAddress().toString());
 
-		if (! jsonObject.has(XDIConstants.XRI_SS_LITERAL.toString())) return null;
+		if (! jsonObject.has(XDIConstants.XDI_ARC_LITERAL.toString())) return null;
 
 		return new JSONLiteral(this);
 	}
 
 	@Override
 	public void delLiteral() {
 
-		((JSONGraph) this.getGraph()).jsonDeleteFromObject(this.getXri().toString(), XDIConstants.XRI_SS_LITERAL.toString());
+		((JSONGraph) this.getGraph()).jsonDeleteFromObject(this.getAddress().toString(), XDIConstants.XDI_ARC_LITERAL.toString());
 	}
 }
https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fjson%2FJSONContextNode.java
a2a2eacfc4677ce1d2a98873ee2608bdf5c62ad8
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fjson%2FJSONGraph.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fjson%2FJSONGraph.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/json/JSONGraph.java
		this.jsonRootContextNode = new JSONContextNode(this, null, null, XDIConstants.XDI_ADD_ROOT);
		this.jsonRootContextNode = new JSONContextNode(this, null, null, XDIConstants.XRI_S_ROOT);
@@ -49,7 +49,7 @@ public class JSONGraph extends AbstractGraph implements Graph {
 
 		this.jsonStore = jsonStore;
 
-		this.jsonRootContextNode = new JSONContextNode(this, null, null, XDIConstants.XRI_S_ROOT);
+		this.jsonRootContextNode = new JSONContextNode(this, null, null, XDIConstants.XDI_ADD_ROOT);
 
 		this.jsonObjectsCached = new HashMap<String, JsonObject> ();
 		this.jsonObjectsCachedWithPrefix = new HashSet<String> ();
https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fjson%2FJSONGraph.java
b615bec86579444c47f96681c7ecccc245be469c
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fjson%2FJSONLiteral.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fjson%2FJSONLiteral.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/json/JSONLiteral.java
		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(jsonContextNode.getAddress().toString());
		return AbstractLiteral.jsonElementToLiteralData(jsonObject.get(XDIConstants.XDI_ARC_LITERAL.toString()));
		((JSONGraph) this.getGraph()).jsonSaveToObject(jsonContextNode.getAddress().toString(), XDIConstants.XDI_ARC_LITERAL.toString(), AbstractLiteral.literalDataToJsonElement(literalData));
		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(jsonContextNode.getXri().toString());
		return AbstractLiteral.jsonElementToLiteralData(jsonObject.get(XDIConstants.XRI_SS_LITERAL.toString()));
		((JSONGraph) this.getGraph()).jsonSaveToObject(jsonContextNode.getXri().toString(), XDIConstants.XRI_SS_LITERAL.toString(), AbstractLiteral.literalDataToJsonElement(literalData));
@@ -21,16 +21,16 @@ public Object getLiteralData() {
 
 		JSONContextNode jsonContextNode = (JSONContextNode) this.getContextNode();
 
-		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(jsonContextNode.getXri().toString());
+		JsonObject jsonObject = ((JSONGraph) this.getGraph()).jsonLoad(jsonContextNode.getAddress().toString());
 
-		return AbstractLiteral.jsonElementToLiteralData(jsonObject.get(XDIConstants.XRI_SS_LITERAL.toString()));
+		return AbstractLiteral.jsonElementToLiteralData(jsonObject.get(XDIConstants.XDI_ARC_LITERAL.toString()));
 	}
 
 	@Override
 	public void setLiteralData(Object literalData) {
 
 		JSONContextNode jsonContextNode = (JSONContextNode) this.getContextNode();
 
-		((JSONGraph) this.getGraph()).jsonSaveToObject(jsonContextNode.getXri().toString(), XDIConstants.XRI_SS_LITERAL.toString(), AbstractLiteral.literalDataToJsonElement(literalData));
+		((JSONGraph) this.getGraph()).jsonSaveToObject(jsonContextNode.getAddress().toString(), XDIConstants.XDI_ARC_LITERAL.toString(), AbstractLiteral.literalDataToJsonElement(literalData));
 	}
 }
https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fjson%2FJSONLiteral.java
d63c61a13913ad19554700de35575ec84c315db3
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fjson%2FJSONRelation.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fjson%2FJSONRelation.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/json/JSONRelation.java
import xdi2.core.syntax.XDIAddress;
	private XDIAddress arc;
	private XDIAddress targetContextNodeAddress;
	public JSONRelation(ContextNode contextNode, XDIAddress arc, XDIAddress targetContextNodeAddress) {
		this.arc = arc;
		this.targetContextNodeAddress = targetContextNodeAddress;
	public XDIAddress getArc() {
		return this.arc;
	public XDIAddress getTargetContextNodeAddress() {
		return this.targetContextNodeAddress;
import xdi2.core.xri3.XDI3Segment;
	private XDI3Segment arcXri;
	private XDI3Segment targetContextNodeXri;
	public JSONRelation(ContextNode contextNode, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		this.arcXri = arcXri;
		this.targetContextNodeXri = targetContextNodeXri;
	public XDI3Segment getArcXri() {
		return this.arcXri;
	public XDI3Segment getTargetContextNodeXri() {
		return this.targetContextNodeXri;
@@ -3,32 +3,32 @@
 import xdi2.core.ContextNode;
 import xdi2.core.Relation;
 import xdi2.core.impl.AbstractRelation;
-import xdi2.core.xri3.XDI3Segment;
+import xdi2.core.syntax.XDIAddress;
 
 public class JSONRelation extends AbstractRelation implements Relation {
 
 	private static final long serialVersionUID = 60162590532295669L;
 
-	private XDI3Segment arcXri;
-	private XDI3Segment targetContextNodeXri;
+	private XDIAddress arc;
+	private XDIAddress targetContextNodeAddress;
 
-	public JSONRelation(ContextNode contextNode, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public JSONRelation(ContextNode contextNode, XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
 		super(contextNode);
 
-		this.arcXri = arcXri;
-		this.targetContextNodeXri = targetContextNodeXri;
+		this.arc = arc;
+		this.targetContextNodeAddress = targetContextNodeAddress;
 	}
 
 	@Override
-	public XDI3Segment getArcXri() {
+	public XDIAddress getArc() {
 
-		return this.arcXri;
+		return this.arc;
 	}
 
 	@Override
-	public XDI3Segment getTargetContextNodeXri() {
+	public XDIAddress getTargetContextNodeAddress() {
 
-		return this.targetContextNodeXri;
+		return this.targetContextNodeAddress;
 	}
 }
https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fjson%2FJSONRelation.java
dc3ae5a13936aae95cf14b934465427b1f107632
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fkeyvalue%2FKeyValueContextNode.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fkeyvalue%2FKeyValueContextNode.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/keyvalue/KeyValueContextNode.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
	private XDIArc arc;
	public KeyValueContextNode(KeyValueGraph graph, KeyValueContextNode contextNode, KeyValueStore keyValueStore, String key, XDIArc arc) {
		this.arc = arc;
	public XDIArc getArc() {
		return this.arc;
	public synchronized ContextNode setContextNode(XDIArc arc) {
		this.setContextNodeCheckValid(arc);
		String contextNodeKey = this.getContextNodeKey(arc);
		if (this.keyValueStore.contains(contextNodesKey, arc.toString())) {
			KeyValueContextNode contextNode = new KeyValueContextNode((KeyValueGraph) this.getGraph(), this, this.keyValueStore, contextNodeKey, arc);
		this.keyValueStore.set(contextNodesKey, arc.toString());
		KeyValueContextNode contextNode = new KeyValueContextNode((KeyValueGraph) this.getGraph(), this, this.keyValueStore, contextNodeKey, arc);
		this.setContextNodeSetInnerRoot(arc, contextNode);
				XDIArc arc = XDIArc.create(item);
				String contextNodeKey = KeyValueContextNode.this.getContextNodeKey(arc);
				return new KeyValueContextNode((KeyValueGraph) KeyValueContextNode.this.getGraph(), KeyValueContextNode.this, KeyValueContextNode.this.keyValueStore, contextNodeKey, arc);
	public ContextNode getContextNode(XDIArc arc, boolean subgraph) {
		String contextNodeKey = this.getContextNodeKey(arc);
		if (! this.keyValueStore.contains(contextNodesKey, arc.toString())) return null;
		return new KeyValueContextNode((KeyValueGraph) this.getGraph(), this, this.keyValueStore, contextNodeKey, arc);
	public boolean containsContextNode(XDIArc arc) {
		return this.keyValueStore.contains(contextNodesKey, arc.toString());
	public synchronized void delContextNode(XDIArc arc) {
		ContextNode contextNode = this.getContextNode(arc, true);
		this.keyValueStore.delete(contextNodesKey, arc.toString());
	public synchronized Relation setRelation(XDIAddress arc, ContextNode targetContextNode) {
		XDIAddress targetContextNodeAddress = targetContextNode.getAddress();
		this.setRelationCheckValid(arc, targetContextNodeAddress);
		String relationKey = this.getRelationKey(arc);
		this.keyValueStore.set(relationsKey, arc.toString());
		this.keyValueStore.set(relationKey, targetContextNodeAddress.toString());
		KeyValueRelation relation = new KeyValueRelation(this, this.keyValueStore, relationKey, arc, targetContextNodeAddress);
	public Relation getRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
		String relationKey = this.getRelationKey(arc);
		if (! this.keyValueStore.contains(relationsKey, arc.toString())) return null;
		if (! this.keyValueStore.contains(relationKey, targetContextNodeAddress.toString())) return null;
		return new KeyValueRelation(this, this.keyValueStore, relationKey, arc, targetContextNodeAddress);
	public Relation getRelation(XDIAddress arc) {
		String relationKey = this.getRelationKey(arc);
		if (! this.keyValueStore.contains(relationsKey, arc.toString())) return null;
		XDIAddress relationXri = XDIAddress.create(this.keyValueStore.getOne(relationKey));
		return new KeyValueRelation(this, this.keyValueStore, relationKey, arc, relationXri);
	public ReadOnlyIterator<Relation> getRelations(final XDIAddress arc) {
		final String relationKey = this.getRelationKey(arc);
		if (! this.keyValueStore.contains(relationsKey, arc.toString())) return new EmptyIterator<Relation> ();
				XDIAddress relationXri = XDIAddress.create(relationXriString);
				return new KeyValueRelation(KeyValueContextNode.this, KeyValueContextNode.this.keyValueStore, relationKey, arc, relationXri);
				final XDIAddress arc = XDIAddress.create(item);
				final String relationKey = KeyValueContextNode.this.getRelationKey(arc);
						return new KeyValueRelation(KeyValueContextNode.this, KeyValueContextNode.this.keyValueStore, relationKey, arc, XDIAddress.create(relationXriString));
	public boolean containsRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
		String relationKey = this.getRelationKey(arc);
		return this.keyValueStore.contains(relationsKey, arc.toString()) && this.keyValueStore.contains(relationKey, targetContextNodeAddress.toString());
	public boolean containsRelations(XDIAddress arc) {
		String relationKey = this.getRelationKey(arc);
		return this.keyValueStore.contains(relationsKey, arc.toString()) && this.keyValueStore.contains(relationKey);
	public synchronized void delRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
		String relationKey = this.getRelationKey(arc);
		this.keyValueStore.delete(relationKey, targetContextNodeAddress.toString());
			this.keyValueStore.delete(relationsKey, arc.toString());
		this.delRelationDelInnerRoot(arc, targetContextNodeAddress);
	public synchronized void delRelations(XDIAddress arc) {
		ReadOnlyIterator<Relation> relations = this.getRelations(arc);
		this.keyValueStore.delete(relationsKey, arc.toString());
			this.delRelationDelInnerRoot(relation.getArc(), relation.getTargetContextNodeAddress());
			this.delRelationDelInnerRoot(relation.getArc(), relation.getTargetContextNodeAddress());
				final XDIAddress arc = XDIAddress.create(item);
				final String relationKey = KeyValueContextNode.this.getRelationKey(arc);
	public long getRelationCount(XDIAddress arc) {
		String relationKey = this.getRelationKey(arc);
		if (! this.keyValueStore.contains(relationsKey, arc.toString())) return 0;
	private String getContextNodeKey(XDIArc arc) {
		return (this.isRootContextNode() ? "" : this.key) + arc.toString();
	private String getRelationKey(XDIAddress arc) {
		return (this.isRootContextNode() ? "" : this.key) + "/" + arc.toString();

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
	private XDI3SubSegment arcXri;
	public KeyValueContextNode(KeyValueGraph graph, KeyValueContextNode contextNode, KeyValueStore keyValueStore, String key, XDI3SubSegment arcXri) {
		this.arcXri = arcXri;
	public XDI3SubSegment getArcXri() {
		return this.arcXri;
	public synchronized ContextNode setContextNode(XDI3SubSegment arcXri) {
		this.setContextNodeCheckValid(arcXri);
		String contextNodeKey = this.getContextNodeKey(arcXri);
		if (this.keyValueStore.contains(contextNodesKey, arcXri.toString())) {
			KeyValueContextNode contextNode = new KeyValueContextNode((KeyValueGraph) this.getGraph(), this, this.keyValueStore, contextNodeKey, arcXri);
		this.keyValueStore.set(contextNodesKey, arcXri.toString());
		KeyValueContextNode contextNode = new KeyValueContextNode((KeyValueGraph) this.getGraph(), this, this.keyValueStore, contextNodeKey, arcXri);
		this.setContextNodeSetInnerRoot(arcXri, contextNode);
				XDI3SubSegment arcXri = XDI3SubSegment.create(item);
				String contextNodeKey = KeyValueContextNode.this.getContextNodeKey(arcXri);
				return new KeyValueContextNode((KeyValueGraph) KeyValueContextNode.this.getGraph(), KeyValueContextNode.this, KeyValueContextNode.this.keyValueStore, contextNodeKey, arcXri);
	public ContextNode getContextNode(XDI3SubSegment arcXri, boolean subgraph) {
		String contextNodeKey = this.getContextNodeKey(arcXri);
		if (! this.keyValueStore.contains(contextNodesKey, arcXri.toString())) return null;
		return new KeyValueContextNode((KeyValueGraph) this.getGraph(), this, this.keyValueStore, contextNodeKey, arcXri);
	public boolean containsContextNode(XDI3SubSegment arcXri) {
		return this.keyValueStore.contains(contextNodesKey, arcXri.toString());
	public synchronized void delContextNode(XDI3SubSegment arcXri) {
		ContextNode contextNode = this.getContextNode(arcXri, true);
		this.keyValueStore.delete(contextNodesKey, arcXri.toString());
	public synchronized Relation setRelation(XDI3Segment arcXri, ContextNode targetContextNode) {
		XDI3Segment targetContextNodeXri = targetContextNode.getXri();
		this.setRelationCheckValid(arcXri, targetContextNodeXri);
		String relationKey = this.getRelationKey(arcXri);
		this.keyValueStore.set(relationsKey, arcXri.toString());
		this.keyValueStore.set(relationKey, targetContextNodeXri.toString());
		KeyValueRelation relation = new KeyValueRelation(this, this.keyValueStore, relationKey, arcXri, targetContextNodeXri);
	public Relation getRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		String relationKey = this.getRelationKey(arcXri);
		if (! this.keyValueStore.contains(relationsKey, arcXri.toString())) return null;
		if (! this.keyValueStore.contains(relationKey, targetContextNodeXri.toString())) return null;
		return new KeyValueRelation(this, this.keyValueStore, relationKey, arcXri, targetContextNodeXri);
	public Relation getRelation(XDI3Segment arcXri) {
		String relationKey = this.getRelationKey(arcXri);
		if (! this.keyValueStore.contains(relationsKey, arcXri.toString())) return null;
		XDI3Segment relationXri = XDI3Segment.create(this.keyValueStore.getOne(relationKey));
		return new KeyValueRelation(this, this.keyValueStore, relationKey, arcXri, relationXri);
	public ReadOnlyIterator<Relation> getRelations(final XDI3Segment arcXri) {
		final String relationKey = this.getRelationKey(arcXri);
		if (! this.keyValueStore.contains(relationsKey, arcXri.toString())) return new EmptyIterator<Relation> ();
				XDI3Segment relationXri = XDI3Segment.create(relationXriString);
				return new KeyValueRelation(KeyValueContextNode.this, KeyValueContextNode.this.keyValueStore, relationKey, arcXri, relationXri);
				final XDI3Segment arcXri = XDI3Segment.create(item);
				final String relationKey = KeyValueContextNode.this.getRelationKey(arcXri);
						return new KeyValueRelation(KeyValueContextNode.this, KeyValueContextNode.this.keyValueStore, relationKey, arcXri, XDI3Segment.create(relationXriString));
	public boolean containsRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		String relationKey = this.getRelationKey(arcXri);
		return this.keyValueStore.contains(relationsKey, arcXri.toString()) && this.keyValueStore.contains(relationKey, targetContextNodeXri.toString());
	public boolean containsRelations(XDI3Segment arcXri) {
		String relationKey = this.getRelationKey(arcXri);
		return this.keyValueStore.contains(relationsKey, arcXri.toString()) && this.keyValueStore.contains(relationKey);
	public synchronized void delRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		String relationKey = this.getRelationKey(arcXri);
		this.keyValueStore.delete(relationKey, targetContextNodeXri.toString());
			this.keyValueStore.delete(relationsKey, arcXri.toString());
		this.delRelationDelInnerRoot(arcXri, targetContextNodeXri);
	public synchronized void delRelations(XDI3Segment arcXri) {
		ReadOnlyIterator<Relation> relations = this.getRelations(arcXri);
		this.keyValueStore.delete(relationsKey, arcXri.toString());
			this.delRelationDelInnerRoot(relation.getArcXri(), relation.getTargetContextNodeXri());
			this.delRelationDelInnerRoot(relation.getArcXri(), relation.getTargetContextNodeXri());
				final XDI3Segment arcXri = XDI3Segment.create(item);
				final String relationKey = KeyValueContextNode.this.getRelationKey(arcXri);
	public long getRelationCount(XDI3Segment arcXri) {
		String relationKey = this.getRelationKey(arcXri);
		if (! this.keyValueStore.contains(relationsKey, arcXri.toString())) return 0;
	private String getContextNodeKey(XDI3SubSegment arcXri) {
		return (this.isRootContextNode() ? "" : this.key) + arcXri.toString();
	private String getRelationKey(XDI3Segment arcXri) {
		return (this.isRootContextNode() ? "" : this.key) + "/" + arcXri.toString();

@@ -8,13 +8,13 @@
 import xdi2.core.Relation;
 import xdi2.core.impl.AbstractContextNode;
 import xdi2.core.impl.AbstractLiteral;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.DescendingIterator;
 import xdi2.core.util.iterators.EmptyIterator;
 import xdi2.core.util.iterators.IteratorListMaker;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.ReadOnlyIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
 
 public class KeyValueContextNode extends AbstractContextNode implements ContextNode {
 
@@ -23,16 +23,16 @@ public class KeyValueContextNode extends AbstractContextNode implements ContextN
 	private KeyValueStore keyValueStore;
 	private String key;
 
-	private XDI3SubSegment arcXri;
+	private XDIArc arc;
 
-	public KeyValueContextNode(KeyValueGraph graph, KeyValueContextNode contextNode, KeyValueStore keyValueStore, String key, XDI3SubSegment arcXri) {
+	public KeyValueContextNode(KeyValueGraph graph, KeyValueContextNode contextNode, KeyValueStore keyValueStore, String key, XDIArc arc) {
 
 		super(graph, contextNode);
 
 		this.keyValueStore = keyValueStore;
 		this.key = key;
 
-		this.arcXri = arcXri;
+		this.arc = arc;
 	}
 
 	@Override
@@ -48,43 +48,43 @@ public synchronized void clear() {
 	}
 
 	@Override
-	public XDI3SubSegment getArcXri() {
+	public XDIArc getArc() {
 
-		return this.arcXri;
+		return this.arc;
 	}
 
 	/*
 	 * Methods related to context nodes of this context node
 	 */
 
 	@Override
-	public synchronized ContextNode setContextNode(XDI3SubSegment arcXri) {
+	public synchronized ContextNode setContextNode(XDIArc arc) {
 
 		// check validity
 
-		this.setContextNodeCheckValid(arcXri);
+		this.setContextNodeCheckValid(arc);
 
 		// set the context node
 
 		String contextNodesKey = this.getContextNodesKey();
-		String contextNodeKey = this.getContextNodeKey(arcXri);
+		String contextNodeKey = this.getContextNodeKey(arc);
 
-		if (this.keyValueStore.contains(contextNodesKey, arcXri.toString())) {
+		if (this.keyValueStore.contains(contextNodesKey, arc.toString())) {
 
-			KeyValueContextNode contextNode = new KeyValueContextNode((KeyValueGraph) this.getGraph(), this, this.keyValueStore, contextNodeKey, arcXri);
+			KeyValueContextNode contextNode = new KeyValueContextNode((KeyValueGraph) this.getGraph(), this, this.keyValueStore, contextNodeKey, arc);
 			return contextNode;
 		}
 
-		this.keyValueStore.set(contextNodesKey, arcXri.toString());
+		this.keyValueStore.set(contextNodesKey, arc.toString());
 		this.keyValueStore.delete(contextNodeKey + "/--C");
 		this.keyValueStore.delete(contextNodeKey + "/--R");
 		this.keyValueStore.delete(contextNodeKey + "/--L");
 
-		KeyValueContextNode contextNode = new KeyValueContextNode((KeyValueGraph) this.getGraph(), this, this.keyValueStore, contextNodeKey, arcXri);
+		KeyValueContextNode contextNode = new KeyValueContextNode((KeyValueGraph) this.getGraph(), this, this.keyValueStore, contextNodeKey, arc);
 
 		// set inner root
 
-		this.setContextNodeSetInnerRoot(arcXri, contextNode);
+		this.setContextNodeSetInnerRoot(arc, contextNode);
 
 		// done
 
@@ -101,33 +101,33 @@ public ReadOnlyIterator<ContextNode> getContextNodes() {
 			@Override
 			public ContextNode map(String item) {
 
-				XDI3SubSegment arcXri = XDI3SubSegment.create(item);
-				String contextNodeKey = KeyValueContextNode.this.getContextNodeKey(arcXri);
+				XDIArc arc = XDIArc.create(item);
+				String contextNodeKey = KeyValueContextNode.this.getContextNodeKey(arc);
 
-				return new KeyValueContextNode((KeyValueGraph) KeyValueContextNode.this.getGraph(), KeyValueContextNode.this, KeyValueContextNode.this.keyValueStore, contextNodeKey, arcXri);
+				return new KeyValueContextNode((KeyValueGraph) KeyValueContextNode.this.getGraph(), KeyValueContextNode.this, KeyValueContextNode.this.keyValueStore, contextNodeKey, arc);
 			}
 		}).list();
 
 		return new ReadOnlyIterator<ContextNode> (list.iterator());
 	}
 
 	@Override
-	public ContextNode getContextNode(XDI3SubSegment arcXri, boolean subgraph) {
+	public ContextNode getContextNode(XDIArc arc, boolean subgraph) {
 
 		String contextNodesKey = this.getContextNodesKey();
-		String contextNodeKey = this.getContextNodeKey(arcXri);
+		String contextNodeKey = this.getContextNodeKey(arc);
 
-		if (! this.keyValueStore.contains(contextNodesKey, arcXri.toString())) return null;
+		if (! this.keyValueStore.contains(contextNodesKey, arc.toString())) return null;
 
-		return new KeyValueContextNode((KeyValueGraph) this.getGraph(), this, this.keyValueStore, contextNodeKey, arcXri);
+		return new KeyValueContextNode((KeyValueGraph) this.getGraph(), this, this.keyValueStore, contextNodeKey, arc);
 	}
 
 	@Override
-	public boolean containsContextNode(XDI3SubSegment arcXri) {
+	public boolean containsContextNode(XDIArc arc) {
 
 		String contextNodesKey = this.getContextNodesKey();
 
-		return this.keyValueStore.contains(contextNodesKey, arcXri.toString());
+		return this.keyValueStore.contains(contextNodesKey, arc.toString());
 	}
 
 	@Override
@@ -139,9 +139,9 @@ public boolean containsContextNodes() {
 	}
 
 	@Override
-	public synchronized void delContextNode(XDI3SubSegment arcXri) {
+	public synchronized void delContextNode(XDIArc arc) {
 
-		ContextNode contextNode = this.getContextNode(arcXri, true);
+		ContextNode contextNode = this.getContextNode(arc, true);
 		if (contextNode == null) return;
 
 		// delete all relations and incoming relations
@@ -153,7 +153,7 @@ public synchronized void delContextNode(XDI3SubSegment arcXri) {
 
 		String contextNodesKey = this.getContextNodesKey();
 
-		this.keyValueStore.delete(contextNodesKey, arcXri.toString());
+		this.keyValueStore.delete(contextNodesKey, arc.toString());
 	}
 
 	@Override
@@ -187,72 +187,72 @@ public synchronized long getContextNodeCount() {
 	 */
 
 	@Override
-	public synchronized Relation setRelation(XDI3Segment arcXri, ContextNode targetContextNode) {
+	public synchronized Relation setRelation(XDIAddress arc, ContextNode targetContextNode) {
 
-		XDI3Segment targetContextNodeXri = targetContextNode.getXri();
+		XDIAddress targetContextNodeAddress = targetContextNode.getAddress();
 
 		// check validity
 
-		this.setRelationCheckValid(arcXri, targetContextNodeXri);
+		this.setRelationCheckValid(arc, targetContextNodeAddress);
 
 		// set the relation
 
 		String relationsKey = this.getRelationsKey();
-		String relationKey = this.getRelationKey(arcXri);
+		String relationKey = this.getRelationKey(arc);
 
-		this.keyValueStore.set(relationsKey, arcXri.toString());
-		this.keyValueStore.set(relationKey, targetContextNodeXri.toString());
+		this.keyValueStore.set(relationsKey, arc.toString());
+		this.keyValueStore.set(relationKey, targetContextNodeAddress.toString());
 
-		KeyValueRelation relation = new KeyValueRelation(this, this.keyValueStore, relationKey, arcXri, targetContextNodeXri);
+		KeyValueRelation relation = new KeyValueRelation(this, this.keyValueStore, relationKey, arc, targetContextNodeAddress);
 
 		// done
 
 		return relation;
 	}
 
 	@Override
-	public Relation getRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public Relation getRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
 		String relationsKey = this.getRelationsKey();
-		String relationKey = this.getRelationKey(arcXri);
+		String relationKey = this.getRelationKey(arc);
 
-		if (! this.keyValueStore.contains(relationsKey, arcXri.toString())) return null;
-		if (! this.keyValueStore.contains(relationKey, targetContextNodeXri.toString())) return null;
+		if (! this.keyValueStore.contains(relationsKey, arc.toString())) return null;
+		if (! this.keyValueStore.contains(relationKey, targetContextNodeAddress.toString())) return null;
 
-		return new KeyValueRelation(this, this.keyValueStore, relationKey, arcXri, targetContextNodeXri);
+		return new KeyValueRelation(this, this.keyValueStore, relationKey, arc, targetContextNodeAddress);
 	}
 
 	@Override
-	public Relation getRelation(XDI3Segment arcXri) {
+	public Relation getRelation(XDIAddress arc) {
 
 		String relationsKey = this.getRelationsKey();
-		String relationKey = this.getRelationKey(arcXri);
+		String relationKey = this.getRelationKey(arc);
 
-		if (! this.keyValueStore.contains(relationsKey, arcXri.toString())) return null;
+		if (! this.keyValueStore.contains(relationsKey, arc.toString())) return null;
 		if (! this.keyValueStore.contains(relationKey)) return null;
 
-		XDI3Segment relationXri = XDI3Segment.create(this.keyValueStore.getOne(relationKey));
+		XDIAddress relationXri = XDIAddress.create(this.keyValueStore.getOne(relationKey));
 
-		return new KeyValueRelation(this, this.keyValueStore, relationKey, arcXri, relationXri);
+		return new KeyValueRelation(this, this.keyValueStore, relationKey, arc, relationXri);
 	}
 
 	@Override
-	public ReadOnlyIterator<Relation> getRelations(final XDI3Segment arcXri) {
+	public ReadOnlyIterator<Relation> getRelations(final XDIAddress arc) {
 
 		String relationsKey = this.getRelationsKey();
-		final String relationKey = this.getRelationKey(arcXri);
+		final String relationKey = this.getRelationKey(arc);
 
-		if (! this.keyValueStore.contains(relationsKey, arcXri.toString())) return new EmptyIterator<Relation> ();
+		if (! this.keyValueStore.contains(relationsKey, arc.toString())) return new EmptyIterator<Relation> ();
 		if (! this.keyValueStore.contains(relationKey)) return new EmptyIterator<Relation> ();
 
 		List<Relation> list = new IteratorListMaker<Relation> (new MappingIterator<String, Relation> (this.keyValueStore.getAll(relationKey)) {
 
 			@Override
 			public Relation map(String relationXriString) {
 
-				XDI3Segment relationXri = XDI3Segment.create(relationXriString);
+				XDIAddress relationXri = XDIAddress.create(relationXriString);
 
-				return new KeyValueRelation(KeyValueContextNode.this, KeyValueContextNode.this.keyValueStore, relationKey, arcXri, relationXri);
+				return new KeyValueRelation(KeyValueContextNode.this, KeyValueContextNode.this.keyValueStore, relationKey, arc, relationXri);
 			}
 		}).list();
 
@@ -269,15 +269,15 @@ public ReadOnlyIterator<Relation> getRelations() {
 			@Override
 			public Iterator<Relation> descend(String item) {
 
-				final XDI3Segment arcXri = XDI3Segment.create(item);
-				final String relationKey = KeyValueContextNode.this.getRelationKey(arcXri);
+				final XDIAddress arc = XDIAddress.create(item);
+				final String relationKey = KeyValueContextNode.this.getRelationKey(arc);
 
 				return new MappingIterator<String, Relation> (KeyValueContextNode.this.keyValueStore.getAll(relationKey)) {
 
 					@Override
 					public Relation map(String relationXriString) {
 
-						return new KeyValueRelation(KeyValueContextNode.this, KeyValueContextNode.this.keyValueStore, relationKey, arcXri, XDI3Segment.create(relationXriString));
+						return new KeyValueRelation(KeyValueContextNode.this, KeyValueContextNode.this.keyValueStore, relationKey, arc, XDIAddress.create(relationXriString));
 					}
 				};
 			}
@@ -287,21 +287,21 @@ public Relation map(String relationXriString) {
 	}
 
 	@Override
-	public boolean containsRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public boolean containsRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
 		String relationsKey = this.getRelationsKey();
-		String relationKey = this.getRelationKey(arcXri);
+		String relationKey = this.getRelationKey(arc);
 
-		return this.keyValueStore.contains(relationsKey, arcXri.toString()) && this.keyValueStore.contains(relationKey, targetContextNodeXri.toString());
+		return this.keyValueStore.contains(relationsKey, arc.toString()) && this.keyValueStore.contains(relationKey, targetContextNodeAddress.toString());
 	}
 
 	@Override
-	public boolean containsRelations(XDI3Segment arcXri) {
+	public boolean containsRelations(XDIAddress arc) {
 
 		String relationsKey = this.getRelationsKey();
-		String relationKey = this.getRelationKey(arcXri);
+		String relationKey = this.getRelationKey(arc);
 
-		return this.keyValueStore.contains(relationsKey, arcXri.toString()) && this.keyValueStore.contains(relationKey);
+		return this.keyValueStore.contains(relationsKey, arc.toString()) && this.keyValueStore.contains(relationKey);
 	}
 
 	@Override
@@ -313,41 +313,41 @@ public boolean containsRelations() {
 	}
 
 	@Override
-	public synchronized void delRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public synchronized void delRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
 		// delete the relation
 
 		String relationsKey = this.getRelationsKey();
-		String relationKey = this.getRelationKey(arcXri);
+		String relationKey = this.getRelationKey(arc);
 
-		this.keyValueStore.delete(relationKey, targetContextNodeXri.toString());
+		this.keyValueStore.delete(relationKey, targetContextNodeAddress.toString());
 
 		if (! this.keyValueStore.contains(relationKey)) {
 
-			this.keyValueStore.delete(relationsKey, arcXri.toString());
+			this.keyValueStore.delete(relationsKey, arc.toString());
 		}
 
 		// delete inner root
 
-		this.delRelationDelInnerRoot(arcXri, targetContextNodeXri);
+		this.delRelationDelInnerRoot(arc, targetContextNodeAddress);
 	}
 
 	@Override
-	public synchronized void delRelations(XDI3Segment arcXri) {
+	public synchronized void delRelations(XDIAddress arc) {
 
-		ReadOnlyIterator<Relation> relations = this.getRelations(arcXri);
+		ReadOnlyIterator<Relation> relations = this.getRelations(arc);
 
 		// delete relations
 
 		String relationsKey = this.getRelationsKey();
 
-		this.keyValueStore.delete(relationsKey, arcXri.toString());
+		this.keyValueStore.delete(relationsKey, arc.toString());
 
 		// delete inner roots
 
 		for (Relation relation : relations) {
 
-			this.delRelationDelInnerRoot(relation.getArcXri(), relation.getTargetContextNodeXri());
+			this.delRelationDelInnerRoot(relation.getArc(), relation.getTargetContextNodeAddress());
 		}
 	}
 
@@ -366,7 +366,7 @@ public synchronized void delRelations() {
 
 		for (Relation relation : relations) {
 
-			this.delRelationDelInnerRoot(relation.getArcXri(), relation.getTargetContextNodeXri());
+			this.delRelationDelInnerRoot(relation.getArc(), relation.getTargetContextNodeAddress());
 		}
 	}
 
@@ -380,8 +380,8 @@ public long getRelationCount() {
 			@Override
 			public Long map(String item) {
 
-				final XDI3Segment arcXri = XDI3Segment.create(item);
-				final String relationKey = KeyValueContextNode.this.getRelationKey(arcXri);
+				final XDIAddress arc = XDIAddress.create(item);
+				final String relationKey = KeyValueContextNode.this.getRelationKey(arc);
 
 				return Long.valueOf(KeyValueContextNode.this.keyValueStore.count(relationKey));
 			}
@@ -394,12 +394,12 @@ public Long map(String item) {
 	}
 
 	@Override
-	public long getRelationCount(XDI3Segment arcXri) {
+	public long getRelationCount(XDIAddress arc) {
 
 		String relationsKey = this.getRelationsKey();
-		String relationKey = this.getRelationKey(arcXri);
+		String relationKey = this.getRelationKey(arc);
 
-		if (! this.keyValueStore.contains(relationsKey, arcXri.toString())) return 0;
+		if (! this.keyValueStore.contains(relationsKey, arc.toString())) return 0;
 
 		return this.keyValueStore.count(relationKey);
 	}
@@ -463,19 +463,19 @@ private String getContextNodesKey() {
 		return (this.isRootContextNode() ? "" : this.key) + "/--C";
 	}
 
-	private String getContextNodeKey(XDI3SubSegment arcXri) {
+	private String getContextNodeKey(XDIArc arc) {
 
-		return (this.isRootContextNode() ? "" : this.key) + arcXri.toString();
+		return (this.isRootContextNode() ? "" : this.key) + arc.toString();
 	}
 
 	private String getRelationsKey() {
 
 		return (this.isRootContextNode() ? "" : this.key) + "/--R";
 	}
 
-	private String getRelationKey(XDI3Segment arcXri) {
+	private String getRelationKey(XDIAddress arc) {
 
-		return (this.isRootContextNode() ? "" : this.key) + "/" + arcXri.toString();
+		return (this.isRootContextNode() ? "" : this.key) + "/" + arc.toString();
 	}
 
 	private String getLiteralKey() {

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fkeyvalue%2FKeyValueContextNode.java
0b60028bce14e81f0c27745c723476c630eca913
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fkeyvalue%2FKeyValueRelation.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fkeyvalue%2FKeyValueRelation.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/keyvalue/KeyValueRelation.java
import xdi2.core.syntax.XDIAddress;
	private XDIAddress arc;
	private XDIAddress targetContextNodeAddress;
	KeyValueRelation(KeyValueContextNode contextNode, KeyValueStore keyValueStore, String key, XDIAddress arc, XDIAddress targetContextNodeAddress) {
		this.arc = arc;
		this.targetContextNodeAddress = targetContextNodeAddress;
	public XDIAddress getArc() {
		return this.arc;
	public XDIAddress getTargetContextNodeAddress() {
		return this.targetContextNodeAddress;

import xdi2.core.xri3.XDI3Segment;
	private XDI3Segment arcXri;
	private XDI3Segment targetContextNodeXri;
	KeyValueRelation(KeyValueContextNode contextNode, KeyValueStore keyValueStore, String key, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		this.arcXri = arcXri;
		this.targetContextNodeXri = targetContextNodeXri;
	public XDI3Segment getArcXri() {
		return this.arcXri;
	public XDI3Segment getTargetContextNodeXri() {
		return this.targetContextNodeXri;

@@ -2,7 +2,7 @@
 
 import xdi2.core.Relation;
 import xdi2.core.impl.AbstractRelation;
-import xdi2.core.xri3.XDI3Segment;
+import xdi2.core.syntax.XDIAddress;
 
 public class KeyValueRelation extends AbstractRelation implements Relation {
 
@@ -11,30 +11,30 @@ public class KeyValueRelation extends AbstractRelation implements Relation {
 	private KeyValueStore keyValueStore;
 	private String key;
 
-	private XDI3Segment arcXri;
-	private XDI3Segment targetContextNodeXri;
+	private XDIAddress arc;
+	private XDIAddress targetContextNodeAddress;
 
-	KeyValueRelation(KeyValueContextNode contextNode, KeyValueStore keyValueStore, String key, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	KeyValueRelation(KeyValueContextNode contextNode, KeyValueStore keyValueStore, String key, XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
 		super(contextNode);
 
 		this.keyValueStore = keyValueStore;
 		this.key = key;
 
-		this.arcXri = arcXri;
-		this.targetContextNodeXri = targetContextNodeXri;
+		this.arc = arc;
+		this.targetContextNodeAddress = targetContextNodeAddress;
 	}
 
 	@Override
-	public XDI3Segment getArcXri() {
+	public XDIAddress getArc() {
 
-		return this.arcXri;
+		return this.arc;
 	}
 
 	@Override
-	public XDI3Segment getTargetContextNodeXri() {
+	public XDIAddress getTargetContextNodeAddress() {
 
-		return this.targetContextNodeXri;
+		return this.targetContextNodeAddress;
 	}
 
 	/*

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fkeyvalue%2FKeyValueRelation.java
70a09e1abccb651b3e2b2826e85aff1b851c5c71
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fmemory%2FMemoryContextNode.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fmemory%2FMemoryContextNode.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/memory/MemoryContextNode.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
	private XDIArc arc;
	private Map<XDIArc, MemoryContextNode> contextNodes;
	private Map<XDIAddress, Map<XDIAddress, MemoryRelation>> relations;
	MemoryContextNode(MemoryGraph graph, MemoryContextNode contextNode, XDIArc arc) {
		this.arc = arc;
			this.contextNodes = new TreeMap<XDIArc, MemoryContextNode> ();
			this.relations = new TreeMap<XDIAddress, Map<XDIAddress, MemoryRelation>> ();
			this.contextNodes = new LinkedHashMap<XDIArc, MemoryContextNode> ();
			this.relations = new LinkedHashMap<XDIAddress, Map<XDIAddress, MemoryRelation>> ();
			this.contextNodes = new HashMap<XDIArc, MemoryContextNode> ();
			this.relations = new HashMap<XDIAddress, Map<XDIAddress, MemoryRelation>> ();
	public XDIArc getArc() {
		return this.arc;
	public synchronized ContextNode setContextNode(XDIArc arc) {
		this.setContextNodeCheckValid(arc);
		ContextNode contextNode = this.contextNodes.get(arc);
		contextNode = new MemoryContextNode((MemoryGraph) this.getGraph(), this, arc);
		this.contextNodes.put(arc, (MemoryContextNode) contextNode);
		this.setContextNodeSetInnerRoot(arc, contextNode);
	public ContextNode getContextNode(XDIArc arc, boolean subgraph) {
		return this.contextNodes.get(arc);
	public boolean containsContextNode(XDIArc arc) {
		return this.contextNodes.containsKey(arc);
	public synchronized void delContextNode(XDIArc arc) {
		ContextNode contextNode = this.getContextNode(arc, true);
		this.contextNodes.remove(arc);
	public synchronized Relation setRelation(XDIAddress arc, ContextNode targetContextNode) {
		XDIAddress targetContextNodeAddress = targetContextNode.getAddress();
		this.setRelationCheckValid(arc, targetContextNodeAddress);
		Relation relation = this.getRelation(arc, targetContextNodeAddress);
		Map<XDIAddress, MemoryRelation> relations = this.relations.get(arc);
				relations = new TreeMap<XDIAddress, MemoryRelation> ();
				relations = new LinkedHashMap<XDIAddress, MemoryRelation> ();
				relations = new HashMap<XDIAddress, MemoryRelation> ();
			this.relations.put(arc, relations);
		relation = new MemoryRelation(this, arc, targetContextNodeAddress);
		relations.put(targetContextNodeAddress, (MemoryRelation) relation);
	public Relation getRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
		Map<XDIAddress, MemoryRelation> relations = this.relations.get(arc);
		return relations.get(targetContextNodeAddress);
	public ReadOnlyIterator<Relation> getRelations(XDIAddress arc) {
		Map<XDIAddress, MemoryRelation> relations = this.relations.get(arc);
		for (Entry<XDIAddress, Map<XDIAddress, MemoryRelation>> relations : this.relations.entrySet()) {
	public boolean containsRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
		Map<XDIAddress, MemoryRelation> relations = this.relations.get(arc);
		return relations.containsKey(targetContextNodeAddress);
	public boolean containsRelations(XDIAddress arc) {
		return this.relations.containsKey(arc);
	public synchronized void delRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
		Map<XDIAddress, MemoryRelation> relations = this.relations.get(arc);
		MemoryRelation relation = relations.remove(targetContextNodeAddress);
			this.relations.remove(arc);
		this.delRelationDelInnerRoot(arc, targetContextNodeAddress);
	public synchronized void delRelations(XDIAddress arc) {
		ReadOnlyIterator<Relation> relations = this.getRelations(arc);
		this.relations.remove(arc);
			this.delRelationDelInnerRoot(relation.getArc(), relation.getTargetContextNodeAddress());
			this.delRelationDelInnerRoot(relation.getArc(), relation.getTargetContextNodeAddress());

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
	private XDI3SubSegment arcXri;
	private Map<XDI3SubSegment, MemoryContextNode> contextNodes;
	private Map<XDI3Segment, Map<XDI3Segment, MemoryRelation>> relations;
	MemoryContextNode(MemoryGraph graph, MemoryContextNode contextNode, XDI3SubSegment arcXri) {
		this.arcXri = arcXri;
			this.contextNodes = new TreeMap<XDI3SubSegment, MemoryContextNode> ();
			this.relations = new TreeMap<XDI3Segment, Map<XDI3Segment, MemoryRelation>> ();
			this.contextNodes = new LinkedHashMap<XDI3SubSegment, MemoryContextNode> ();
			this.relations = new LinkedHashMap<XDI3Segment, Map<XDI3Segment, MemoryRelation>> ();
			this.contextNodes = new HashMap<XDI3SubSegment, MemoryContextNode> ();
			this.relations = new HashMap<XDI3Segment, Map<XDI3Segment, MemoryRelation>> ();
	public XDI3SubSegment getArcXri() {
		return this.arcXri;
	public synchronized ContextNode setContextNode(XDI3SubSegment arcXri) {
		this.setContextNodeCheckValid(arcXri);
		ContextNode contextNode = this.contextNodes.get(arcXri);
		contextNode = new MemoryContextNode((MemoryGraph) this.getGraph(), this, arcXri);
		this.contextNodes.put(arcXri, (MemoryContextNode) contextNode);
		this.setContextNodeSetInnerRoot(arcXri, contextNode);
	public ContextNode getContextNode(XDI3SubSegment arcXri, boolean subgraph) {
		return this.contextNodes.get(arcXri);
	public boolean containsContextNode(XDI3SubSegment arcXri) {
		return this.contextNodes.containsKey(arcXri);
	public synchronized void delContextNode(XDI3SubSegment arcXri) {
		ContextNode contextNode = this.getContextNode(arcXri, true);
		this.contextNodes.remove(arcXri);
	public synchronized Relation setRelation(XDI3Segment arcXri, ContextNode targetContextNode) {
		XDI3Segment targetContextNodeXri = targetContextNode.getXri();
		this.setRelationCheckValid(arcXri, targetContextNodeXri);
		Relation relation = this.getRelation(arcXri, targetContextNodeXri);
		Map<XDI3Segment, MemoryRelation> relations = this.relations.get(arcXri);
				relations = new TreeMap<XDI3Segment, MemoryRelation> ();
				relations = new LinkedHashMap<XDI3Segment, MemoryRelation> ();
				relations = new HashMap<XDI3Segment, MemoryRelation> ();
			this.relations.put(arcXri, relations);
		relation = new MemoryRelation(this, arcXri, targetContextNodeXri);
		relations.put(targetContextNodeXri, (MemoryRelation) relation);
	public Relation getRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		Map<XDI3Segment, MemoryRelation> relations = this.relations.get(arcXri);
		return relations.get(targetContextNodeXri);
	public ReadOnlyIterator<Relation> getRelations(XDI3Segment arcXri) {
		Map<XDI3Segment, MemoryRelation> relations = this.relations.get(arcXri);
		for (Entry<XDI3Segment, Map<XDI3Segment, MemoryRelation>> relations : this.relations.entrySet()) {
	public boolean containsRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		Map<XDI3Segment, MemoryRelation> relations = this.relations.get(arcXri);
		return relations.containsKey(targetContextNodeXri);
	public boolean containsRelations(XDI3Segment arcXri) {
		return this.relations.containsKey(arcXri);
	public synchronized void delRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		Map<XDI3Segment, MemoryRelation> relations = this.relations.get(arcXri);
		MemoryRelation relation = relations.remove(targetContextNodeXri);
			this.relations.remove(arcXri);
		this.delRelationDelInnerRoot(arcXri, targetContextNodeXri);
	public synchronized void delRelations(XDI3Segment arcXri) {
		ReadOnlyIterator<Relation> relations = this.getRelations(arcXri);
		this.relations.remove(arcXri);
			this.delRelationDelInnerRoot(relation.getArcXri(), relation.getTargetContextNodeXri());
			this.delRelationDelInnerRoot(relation.getArcXri(), relation.getTargetContextNodeXri());

@@ -12,88 +12,88 @@
 import xdi2.core.Literal;
 import xdi2.core.Relation;
 import xdi2.core.impl.AbstractContextNode;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.EmptyIterator;
 import xdi2.core.util.iterators.ReadOnlyIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
 
 public class MemoryContextNode extends AbstractContextNode implements ContextNode {
 
 	private static final long serialVersionUID = 4930852359817860369L;
 
-	private XDI3SubSegment arcXri;
+	private XDIArc arc;
 
-	private Map<XDI3SubSegment, MemoryContextNode> contextNodes;
-	private Map<XDI3Segment, Map<XDI3Segment, MemoryRelation>> relations;
+	private Map<XDIArc, MemoryContextNode> contextNodes;
+	private Map<XDIAddress, Map<XDIAddress, MemoryRelation>> relations;
 	private MemoryLiteral literal;
 
-	MemoryContextNode(MemoryGraph graph, MemoryContextNode contextNode, XDI3SubSegment arcXri) {
+	MemoryContextNode(MemoryGraph graph, MemoryContextNode contextNode, XDIArc arc) {
 
 		super(graph, contextNode);
 
-		this.arcXri = arcXri;
+		this.arc = arc;
 
 		if (graph.getSortMode() == MemoryGraphFactory.SORTMODE_ALPHA) {
 
-			this.contextNodes = new TreeMap<XDI3SubSegment, MemoryContextNode> ();
-			this.relations = new TreeMap<XDI3Segment, Map<XDI3Segment, MemoryRelation>> ();
+			this.contextNodes = new TreeMap<XDIArc, MemoryContextNode> ();
+			this.relations = new TreeMap<XDIAddress, Map<XDIAddress, MemoryRelation>> ();
 			this.literal = null;
 		} else if (graph.getSortMode() == MemoryGraphFactory.SORTMODE_ORDER) {
 
-			this.contextNodes = new LinkedHashMap<XDI3SubSegment, MemoryContextNode> ();
-			this.relations = new LinkedHashMap<XDI3Segment, Map<XDI3Segment, MemoryRelation>> ();
+			this.contextNodes = new LinkedHashMap<XDIArc, MemoryContextNode> ();
+			this.relations = new LinkedHashMap<XDIAddress, Map<XDIAddress, MemoryRelation>> ();
 			this.literal = null;
 		} else {
 
-			this.contextNodes = new HashMap<XDI3SubSegment, MemoryContextNode> ();
-			this.relations = new HashMap<XDI3Segment, Map<XDI3Segment, MemoryRelation>> ();
+			this.contextNodes = new HashMap<XDIArc, MemoryContextNode> ();
+			this.relations = new HashMap<XDIAddress, Map<XDIAddress, MemoryRelation>> ();
 			this.literal = null;
 		}
 	}
 
 	@Override
-	public XDI3SubSegment getArcXri() {
+	public XDIArc getArc() {
 
-		return this.arcXri;
+		return this.arc;
 	}
 
 	/*
 	 * Methods related to context nodes of this context node
 	 */
 
 	@Override
-	public synchronized ContextNode setContextNode(XDI3SubSegment arcXri) {
+	public synchronized ContextNode setContextNode(XDIArc arc) {
 
 		// check validity
 
-		this.setContextNodeCheckValid(arcXri);
+		this.setContextNodeCheckValid(arc);
 
 		// set the context node
 
-		ContextNode contextNode = this.contextNodes.get(arcXri);
+		ContextNode contextNode = this.contextNodes.get(arc);
 
 		if (contextNode != null) {
 			
 			return contextNode;
 		}
 
-		contextNode = new MemoryContextNode((MemoryGraph) this.getGraph(), this, arcXri);
+		contextNode = new MemoryContextNode((MemoryGraph) this.getGraph(), this, arc);
 
-		this.contextNodes.put(arcXri, (MemoryContextNode) contextNode);
+		this.contextNodes.put(arc, (MemoryContextNode) contextNode);
 
 		// set inner root
 
-		this.setContextNodeSetInnerRoot(arcXri, contextNode);
+		this.setContextNodeSetInnerRoot(arc, contextNode);
 
 		// done
 
 		return contextNode;
 	}
 
 	@Override
-	public ContextNode getContextNode(XDI3SubSegment arcXri, boolean subgraph) {
+	public ContextNode getContextNode(XDIArc arc, boolean subgraph) {
 
-		return this.contextNodes.get(arcXri);
+		return this.contextNodes.get(arc);
 	}
 
 	@Override
@@ -105,9 +105,9 @@ public ReadOnlyIterator<ContextNode> getContextNodes() {
 	}
 
 	@Override
-	public boolean containsContextNode(XDI3SubSegment arcXri) {
+	public boolean containsContextNode(XDIArc arc) {
 
-		return this.contextNodes.containsKey(arcXri);
+		return this.contextNodes.containsKey(arc);
 	}
 
 	@Override
@@ -117,9 +117,9 @@ public boolean containsContextNodes() {
 	}
 
 	@Override
-	public synchronized void delContextNode(XDI3SubSegment arcXri) {
+	public synchronized void delContextNode(XDIArc arc) {
 
-		ContextNode contextNode = this.getContextNode(arcXri, true);
+		ContextNode contextNode = this.getContextNode(arc, true);
 		if (contextNode == null) return;
 
 		// delete all inner roots and incoming relations
@@ -129,7 +129,7 @@ public synchronized void delContextNode(XDI3SubSegment arcXri) {
 
 		// delete this context node
 
-		this.contextNodes.remove(arcXri);
+		this.contextNodes.remove(arc);
 	}
 
 	@Override
@@ -153,58 +153,58 @@ public synchronized void delContextNodes() {
 	 */
 
 	@Override
-	public synchronized Relation setRelation(XDI3Segment arcXri, ContextNode targetContextNode) {
+	public synchronized Relation setRelation(XDIAddress arc, ContextNode targetContextNode) {
 
-		XDI3Segment targetContextNodeXri = targetContextNode.getXri();
+		XDIAddress targetContextNodeAddress = targetContextNode.getAddress();
 		
 		// check validity
 
-		this.setRelationCheckValid(arcXri, targetContextNodeXri);
+		this.setRelationCheckValid(arc, targetContextNodeAddress);
 
 		// set the relation
 
-		Relation relation = this.getRelation(arcXri, targetContextNodeXri);
+		Relation relation = this.getRelation(arc, targetContextNodeAddress);
 		if (relation != null) return relation;
 
-		Map<XDI3Segment, MemoryRelation> relations = this.relations.get(arcXri);
+		Map<XDIAddress, MemoryRelation> relations = this.relations.get(arc);
 		if (relations == null) {
 
 			if (((MemoryGraph) this.getGraph()).getSortMode() == MemoryGraphFactory.SORTMODE_ALPHA) {
 
-				relations = new TreeMap<XDI3Segment, MemoryRelation> ();
+				relations = new TreeMap<XDIAddress, MemoryRelation> ();
 			} else if (((MemoryGraph) this.getGraph()).getSortMode() == MemoryGraphFactory.SORTMODE_ORDER) {
 
-				relations = new LinkedHashMap<XDI3Segment, MemoryRelation> ();
+				relations = new LinkedHashMap<XDIAddress, MemoryRelation> ();
 			} else {
 
-				relations = new HashMap<XDI3Segment, MemoryRelation> ();
+				relations = new HashMap<XDIAddress, MemoryRelation> ();
 			}
 
-			this.relations.put(arcXri, relations);
+			this.relations.put(arc, relations);
 		}
 		
-		relation = new MemoryRelation(this, arcXri, targetContextNodeXri);
+		relation = new MemoryRelation(this, arc, targetContextNodeAddress);
 		
-		relations.put(targetContextNodeXri, (MemoryRelation) relation);
+		relations.put(targetContextNodeAddress, (MemoryRelation) relation);
 
 		// done
 
 		return relation;
 	}
 
 	@Override
-	public Relation getRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public Relation getRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
-		Map<XDI3Segment, MemoryRelation> relations = this.relations.get(arcXri);
+		Map<XDIAddress, MemoryRelation> relations = this.relations.get(arc);
 		if (relations == null) return null;
 
-		return relations.get(targetContextNodeXri);
+		return relations.get(targetContextNodeAddress);
 	}
 
 	@Override
-	public ReadOnlyIterator<Relation> getRelations(XDI3Segment arcXri) {
+	public ReadOnlyIterator<Relation> getRelations(XDIAddress arc) {
 
-		Map<XDI3Segment, MemoryRelation> relations = this.relations.get(arcXri);
+		Map<XDIAddress, MemoryRelation> relations = this.relations.get(arc);
 		if (relations == null) return new EmptyIterator<Relation> ();
 
 		List<Relation> list = new ArrayList<Relation> (relations.values());
@@ -217,7 +217,7 @@ public ReadOnlyIterator<Relation> getRelations() {
 
 		List<Relation> list = new ArrayList<Relation> ();
 
-		for (Entry<XDI3Segment, Map<XDI3Segment, MemoryRelation>> relations : this.relations.entrySet()) {
+		for (Entry<XDIAddress, Map<XDIAddress, MemoryRelation>> relations : this.relations.entrySet()) {
 
 			list.addAll(relations.getValue().values());
 		}
@@ -226,18 +226,18 @@ public ReadOnlyIterator<Relation> getRelations() {
 	}
 
 	@Override
-	public boolean containsRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public boolean containsRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
-		Map<XDI3Segment, MemoryRelation> relations = this.relations.get(arcXri);
+		Map<XDIAddress, MemoryRelation> relations = this.relations.get(arc);
 		if (relations == null) return false;
 
-		return relations.containsKey(targetContextNodeXri);
+		return relations.containsKey(targetContextNodeAddress);
 	}
 
 	@Override
-	public boolean containsRelations(XDI3Segment arcXri) {
+	public boolean containsRelations(XDIAddress arc) {
 
-		return this.relations.containsKey(arcXri);
+		return this.relations.containsKey(arc);
 	}
 
 	@Override
@@ -247,40 +247,40 @@ public boolean containsRelations() {
 	}
 
 	@Override
-	public synchronized void delRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public synchronized void delRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
 		// delete the relation
 
-		Map<XDI3Segment, MemoryRelation> relations = this.relations.get(arcXri);
+		Map<XDIAddress, MemoryRelation> relations = this.relations.get(arc);
 		if (relations == null) return;
 
-		MemoryRelation relation = relations.remove(targetContextNodeXri);
+		MemoryRelation relation = relations.remove(targetContextNodeAddress);
 		if (relation == null) return;
 
 		if (relations.isEmpty()) {
 
-			this.relations.remove(arcXri);
+			this.relations.remove(arc);
 		}
 
 		// delete inner root
 
-		this.delRelationDelInnerRoot(arcXri, targetContextNodeXri);
+		this.delRelationDelInnerRoot(arc, targetContextNodeAddress);
 	}
 
 	@Override
-	public synchronized void delRelations(XDI3Segment arcXri) {
+	public synchronized void delRelations(XDIAddress arc) {
 
-		ReadOnlyIterator<Relation> relations = this.getRelations(arcXri);
+		ReadOnlyIterator<Relation> relations = this.getRelations(arc);
 
 		// delete relations
 
-		this.relations.remove(arcXri);
+		this.relations.remove(arc);
 
 		// delete inner roots
 
 		for (Relation relation : relations) {
 
-			this.delRelationDelInnerRoot(relation.getArcXri(), relation.getTargetContextNodeXri());
+			this.delRelationDelInnerRoot(relation.getArc(), relation.getTargetContextNodeAddress());
 		}
 	}
 
@@ -297,7 +297,7 @@ public synchronized void delRelations() {
 
 		for (Relation relation : relations) {
 
-			this.delRelationDelInnerRoot(relation.getArcXri(), relation.getTargetContextNodeXri());
+			this.delRelationDelInnerRoot(relation.getArc(), relation.getTargetContextNodeAddress());
 		}
 	}
 

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fmemory%2FMemoryContextNode.java
d5a19cf0465a6baaf753080d5a3b149ed7c98e5e
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fmemory%2FMemoryRelation.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fmemory%2FMemoryRelation.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/memory/MemoryRelation.java
import xdi2.core.syntax.XDIAddress;
	private XDIAddress arc;
	private XDIAddress targetContextNodeAddress;
	MemoryRelation(MemoryContextNode contextNode, XDIAddress arc, XDIAddress targetContextNodeAddress) {
		this.arc = arc;
		this.targetContextNodeAddress = targetContextNodeAddress;
	public XDIAddress getArc() {
		return this.arc;
	public XDIAddress getTargetContextNodeAddress() {
		return this.targetContextNodeAddress;

import xdi2.core.xri3.XDI3Segment;
	private XDI3Segment arcXri;
	private XDI3Segment targetContextNodeXri;
	MemoryRelation(MemoryContextNode contextNode, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		this.arcXri = arcXri;
		this.targetContextNodeXri = targetContextNodeXri;
	public XDI3Segment getArcXri() {
		return this.arcXri;
	public XDI3Segment getTargetContextNodeXri() {
		return this.targetContextNodeXri;

@@ -2,32 +2,32 @@
 
 import xdi2.core.Relation;
 import xdi2.core.impl.AbstractRelation;
-import xdi2.core.xri3.XDI3Segment;
+import xdi2.core.syntax.XDIAddress;
 
 public class MemoryRelation extends AbstractRelation implements Relation {
 
 	private static final long serialVersionUID = -2979718490345210876L;
 
-	private XDI3Segment arcXri;
-	private XDI3Segment targetContextNodeXri;
+	private XDIAddress arc;
+	private XDIAddress targetContextNodeAddress;
 
-	MemoryRelation(MemoryContextNode contextNode, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	MemoryRelation(MemoryContextNode contextNode, XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
 		super(contextNode);
 
-		this.arcXri = arcXri;
-		this.targetContextNodeXri = targetContextNodeXri;
+		this.arc = arc;
+		this.targetContextNodeAddress = targetContextNodeAddress;
 	}
 
 	@Override
-	public XDI3Segment getArcXri() {
+	public XDIAddress getArc() {
 
-		return this.arcXri;
+		return this.arc;
 	}
 
 	@Override
-	public XDI3Segment getTargetContextNodeXri() {
+	public XDIAddress getTargetContextNodeAddress() {
 
-		return this.targetContextNodeXri;
+		return this.targetContextNodeAddress;
 	}
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fmemory%2FMemoryRelation.java
1da1d6a32c6249639de06b4a10ecfeaba26ad36f
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fwrapped%2FWrappedContextNode.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fwrapped%2FWrappedContextNode.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/wrapped/WrappedContextNode.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
	public XDIArc getArc() {
		return this.memoryContextNode.getArc();
	public synchronized ContextNode setContextNode(XDIArc arc) {
		MemoryContextNode ret = (MemoryContextNode) this.memoryContextNode.setContextNode(arc);
	public ContextNode getContextNode(XDIArc arc, boolean subgraph) {
		MemoryContextNode ret = (MemoryContextNode) this.memoryContextNode.getContextNode(arc, subgraph);
	public boolean containsContextNode(XDIArc arc) {
		return this.memoryContextNode.containsContextNode(arc);
	public synchronized void delContextNode(XDIArc arc) {
		this.memoryContextNode.delContextNode(arc);
	public synchronized Relation setRelation(XDIAddress arc, ContextNode targetContextNode) {
		MemoryRelation ret = (MemoryRelation) this.memoryContextNode.setRelation(arc, targetContextNode);
	public Relation getRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
		MemoryRelation ret = (MemoryRelation) this.memoryContextNode.getRelation(arc, targetContextNodeAddress);
	public ReadOnlyIterator<Relation> getRelations(XDIAddress arc) {
		ReadOnlyIterator<Relation> ret = this.memoryContextNode.getRelations(arc);
	public boolean containsRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
		return this.memoryContextNode.containsRelation(arc, targetContextNodeAddress);
	public boolean containsRelations(XDIAddress arc) {
		return this.memoryContextNode.containsRelations(arc);
	public synchronized void delRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
		this.memoryContextNode.delRelation(arc, targetContextNodeAddress);
	public synchronized void delRelations(XDIAddress arc) {
		this.memoryContextNode.delRelations(arc);

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
	public XDI3SubSegment getArcXri() {
		return this.memoryContextNode.getArcXri();
	public synchronized ContextNode setContextNode(XDI3SubSegment arcXri) {
		MemoryContextNode ret = (MemoryContextNode) this.memoryContextNode.setContextNode(arcXri);
	public ContextNode getContextNode(XDI3SubSegment arcXri, boolean subgraph) {
		MemoryContextNode ret = (MemoryContextNode) this.memoryContextNode.getContextNode(arcXri, subgraph);
	public boolean containsContextNode(XDI3SubSegment arcXri) {
		return this.memoryContextNode.containsContextNode(arcXri);
	public synchronized void delContextNode(XDI3SubSegment arcXri) {
		this.memoryContextNode.delContextNode(arcXri);
	public synchronized Relation setRelation(XDI3Segment arcXri, ContextNode targetContextNode) {
		MemoryRelation ret = (MemoryRelation) this.memoryContextNode.setRelation(arcXri, targetContextNode);
	public Relation getRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		MemoryRelation ret = (MemoryRelation) this.memoryContextNode.getRelation(arcXri, targetContextNodeXri);
	public ReadOnlyIterator<Relation> getRelations(XDI3Segment arcXri) {
		ReadOnlyIterator<Relation> ret = this.memoryContextNode.getRelations(arcXri);
	public boolean containsRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		return this.memoryContextNode.containsRelation(arcXri, targetContextNodeXri);
	public boolean containsRelations(XDI3Segment arcXri) {
		return this.memoryContextNode.containsRelations(arcXri);
	public synchronized void delRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		this.memoryContextNode.delRelation(arcXri, targetContextNodeXri);
	public synchronized void delRelations(XDI3Segment arcXri) {
		this.memoryContextNode.delRelations(arcXri);

@@ -9,10 +9,10 @@
 import xdi2.core.impl.memory.MemoryContextNode;
 import xdi2.core.impl.memory.MemoryLiteral;
 import xdi2.core.impl.memory.MemoryRelation;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 import xdi2.core.util.iterators.MappingIterator;
 import xdi2.core.util.iterators.ReadOnlyIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
 
 public class WrappedContextNode extends AbstractContextNode implements ContextNode {
 
@@ -28,27 +28,27 @@ public class WrappedContextNode extends AbstractContextNode implements ContextNo
 	}
 
 	@Override
-	public XDI3SubSegment getArcXri() {
+	public XDIArc getArc() {
 
-		return this.memoryContextNode.getArcXri();
+		return this.memoryContextNode.getArc();
 	}
 
 	/*
 	 * Methods related to context nodes of this context node
 	 */
 
 	@Override
-	public synchronized ContextNode setContextNode(XDI3SubSegment arcXri) {
+	public synchronized ContextNode setContextNode(XDIArc arc) {
 
-		MemoryContextNode ret = (MemoryContextNode) this.memoryContextNode.setContextNode(arcXri);
+		MemoryContextNode ret = (MemoryContextNode) this.memoryContextNode.setContextNode(arc);
 
 		return new WrappedContextNode((WrappedGraph) this.getGraph(), this, ret);
 	}
 
 	@Override
-	public ContextNode getContextNode(XDI3SubSegment arcXri, boolean subgraph) {
+	public ContextNode getContextNode(XDIArc arc, boolean subgraph) {
 
-		MemoryContextNode ret = (MemoryContextNode) this.memoryContextNode.getContextNode(arcXri, subgraph);
+		MemoryContextNode ret = (MemoryContextNode) this.memoryContextNode.getContextNode(arc, subgraph);
 
 		return ret == null ? null : new WrappedContextNode((WrappedGraph) this.getGraph(), this, ret);
 	}
@@ -62,9 +62,9 @@ public ReadOnlyIterator<ContextNode> getContextNodes() {
 	}
 
 	@Override
-	public boolean containsContextNode(XDI3SubSegment arcXri) {
+	public boolean containsContextNode(XDIArc arc) {
 
-		return this.memoryContextNode.containsContextNode(arcXri);
+		return this.memoryContextNode.containsContextNode(arc);
 	}
 
 	@Override
@@ -74,9 +74,9 @@ public boolean containsContextNodes() {
 	}
 
 	@Override
-	public synchronized void delContextNode(XDI3SubSegment arcXri) {
+	public synchronized void delContextNode(XDIArc arc) {
 
-		this.memoryContextNode.delContextNode(arcXri);
+		this.memoryContextNode.delContextNode(arc);
 	}
 
 	@Override
@@ -90,25 +90,25 @@ public synchronized void delContextNodes() {
 	 */
 
 	@Override
-	public synchronized Relation setRelation(XDI3Segment arcXri, ContextNode targetContextNode) {
+	public synchronized Relation setRelation(XDIAddress arc, ContextNode targetContextNode) {
 
-		MemoryRelation ret = (MemoryRelation) this.memoryContextNode.setRelation(arcXri, targetContextNode);
+		MemoryRelation ret = (MemoryRelation) this.memoryContextNode.setRelation(arc, targetContextNode);
 
 		return new WrappedRelation(this, ret);
 	}
 
 	@Override
-	public Relation getRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public Relation getRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
-		MemoryRelation ret = (MemoryRelation) this.memoryContextNode.getRelation(arcXri, targetContextNodeXri);
+		MemoryRelation ret = (MemoryRelation) this.memoryContextNode.getRelation(arc, targetContextNodeAddress);
 
 		return ret == null ? null : new WrappedRelation(this, ret);
 	}
 
 	@Override
-	public ReadOnlyIterator<Relation> getRelations(XDI3Segment arcXri) {
+	public ReadOnlyIterator<Relation> getRelations(XDIAddress arc) {
 
-		ReadOnlyIterator<Relation> ret = this.memoryContextNode.getRelations(arcXri);
+		ReadOnlyIterator<Relation> ret = this.memoryContextNode.getRelations(arc);
 
 		return new ReadOnlyIterator<Relation> (new WrappedRelationMappingIterator(ret));
 	}
@@ -122,15 +122,15 @@ public ReadOnlyIterator<Relation> getRelations() {
 	}
 
 	@Override
-	public boolean containsRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public boolean containsRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
-		return this.memoryContextNode.containsRelation(arcXri, targetContextNodeXri);
+		return this.memoryContextNode.containsRelation(arc, targetContextNodeAddress);
 	}
 
 	@Override
-	public boolean containsRelations(XDI3Segment arcXri) {
+	public boolean containsRelations(XDIAddress arc) {
 
-		return this.memoryContextNode.containsRelations(arcXri);
+		return this.memoryContextNode.containsRelations(arc);
 	}
 
 	@Override
@@ -140,15 +140,15 @@ public boolean containsRelations() {
 	}
 
 	@Override
-	public synchronized void delRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public synchronized void delRelation(XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
-		this.memoryContextNode.delRelation(arcXri, targetContextNodeXri);
+		this.memoryContextNode.delRelation(arc, targetContextNodeAddress);
 	}
 
 	@Override
-	public synchronized void delRelations(XDI3Segment arcXri) {
+	public synchronized void delRelations(XDIAddress arc) {
 
-		this.memoryContextNode.delRelations(arcXri);
+		this.memoryContextNode.delRelations(arc);
 	}
 
 	@Override

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fwrapped%2FWrappedContextNode.java
17d40942d193884acdb11e90b53f3e88b501a277
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fwrapped%2FWrappedRelation.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fwrapped%2FWrappedRelation.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/impl/wrapped/WrappedRelation.java
import xdi2.core.syntax.XDIAddress;
	public XDIAddress getArc() {
		return this.memoryRelation.getArc();
	public XDIAddress getTargetContextNodeAddress() {
		return this.memoryRelation.getTargetContextNodeAddress();

import xdi2.core.xri3.XDI3Segment;
	public XDI3Segment getArcXri() {
		return this.memoryRelation.getArcXri();
	public XDI3Segment getTargetContextNodeXri() {
		return this.memoryRelation.getTargetContextNodeXri();

@@ -3,7 +3,7 @@
 import xdi2.core.Relation;
 import xdi2.core.impl.AbstractRelation;
 import xdi2.core.impl.memory.MemoryRelation;
-import xdi2.core.xri3.XDI3Segment;
+import xdi2.core.syntax.XDIAddress;
 
 public class WrappedRelation extends AbstractRelation implements Relation {
 
@@ -19,14 +19,14 @@ public class WrappedRelation extends AbstractRelation implements Relation {
 	}
 
 	@Override
-	public XDI3Segment getArcXri() {
+	public XDIAddress getArc() {
 
-		return this.memoryRelation.getArcXri();
+		return this.memoryRelation.getArc();
 	}
 
 	@Override
-	public XDI3Segment getTargetContextNodeXri() {
+	public XDIAddress getTargetContextNodeAddress() {
 
-		return this.memoryRelation.getTargetContextNodeXri();
+		return this.memoryRelation.getTargetContextNodeAddress();
 	}
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fimpl%2Fwrapped%2FWrappedRelation.java
cfb322432a57866d730e99360c2ce49e03bb1449
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Freaders%2FXDIDisplayReader.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Freaders%2FXDIDisplayReader.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/io/readers/XDIDisplayReader.java
import xdi2.core.syntax.XDIStatement;
			XDIStatement statementXri;
				statementXri = XDIStatement.create(line);

import xdi2.core.xri3.XDI3Statement;
			XDI3Statement statementXri;
				statementXri = XDI3Statement.create(line);

@@ -9,7 +9,7 @@
 import xdi2.core.exceptions.Xdi2ParseException;
 import xdi2.core.io.AbstractXDIReader;
 import xdi2.core.io.MimeType;
-import xdi2.core.xri3.XDI3Statement;
+import xdi2.core.syntax.XDIStatement;
 
 public class XDIDisplayReader extends AbstractXDIReader {
 
@@ -41,11 +41,11 @@ private static void read(Graph graph, BufferedReader bufferedReader) throws IOEx
 			line = line.trim();
 			if (line.isEmpty()) continue;
 
-			XDI3Statement statementXri;
+			XDIStatement statementXri;
 
 			try {
 
-				statementXri = XDI3Statement.create(line);
+				statementXri = XDIStatement.create(line);
 			} catch (Exception ex) {
 
 				throw new Xdi2ParseException("Parser problem at line " + lineNr + ": " + ex.getMessage(), ex);

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Freaders%2FXDIDisplayReader.java
114526be1ced6ea0e19c19bd8e4c25b08e644711
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Freaders%2FXDIJSONReader.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Freaders%2FXDIJSONReader.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/io/readers/XDIJSONReader.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.syntax.XDIStatement;
import xdi2.core.syntax.parser.ParserException;
import xdi2.core.util.AddressUtil;
			if (key.endsWith("/" + XDIConstants.XDI_ADD_CONTEXT.toString())) {
				XDIStatement statementXri = makeStatement(key + "/", state);
				XDIAddress absoluteSubject = root.relativeToAbsoluteXri(statementXri.getSubject());
				XDIAddress relativeSubject = statementRoot.absoluteToRelativeXri(absoluteSubject);
					XDIArc arc = makeXDIArc(((JsonPrimitive) jsonEntryArrayElement).getAsString(), state);
					ContextNode contextNode = baseContextNode.setContextNode(arc);
					if (log.isTraceEnabled()) log.trace("Under " + baseContextNode.getAddress() + ": Set context node " + contextNode.getArc() + " --> " + contextNode.getAddress());
			} else if (key.endsWith("/" + XDIConstants.XDI_ADD_LITERAL.toString())) {
				XDIStatement statementXri = makeStatement(key + "/\"\"", state);
				XDIAddress absoluteSubject = root.relativeToAbsoluteXri(statementXri.getSubject());
				XDIAddress relativeSubject = statementRoot.absoluteToRelativeXri(absoluteSubject);
				if (log.isTraceEnabled()) log.trace("Under " + baseContextNode.getAddress() + ": Set literal --> " + literal.getLiteralData());
				XDIStatement statementXri = makeStatement(key + "/", state);
				XDIAddress arc = statementXri.getPredicate();
				XDIAddress absoluteSubject = root.relativeToAbsoluteXri(statementXri.getSubject());
				XDIAddress relativeSubject = statementRoot.absoluteToRelativeXri(absoluteSubject);
						XDIAddress subject = root.absoluteToRelativeXri(AddressUtil.concatAddresses(root.getContextNode().getAddress(), statementXri.getSubject()));
						XDIAddress predicate = statementXri.getPredicate();
						XDIAddress targetContextNodeAddress = makeXDIAddress(((JsonPrimitive) jsonEntryArrayElement).getAsString(), state);
						Relation relation = baseContextNode.setRelation(arc, targetContextNodeAddress);
						if (log.isTraceEnabled()) log.trace("Under " + baseContextNode.getAddress() + ": Set relation " + relation.getArc() + " --> " + relation.getTargetContextNodeAddress());
	private static XDIStatement makeStatement(String xriString, State state) {
		return XDIStatement.create(xriString);
	private static XDIAddress makeXDIAddress(String xriString, State state) {
		return XDIAddress.create(xriString);
	private static XDIArc makeXDIArc(String xriString, State state) {
		return XDIArc.create(xriString);

import xdi2.core.util.XDI3Util;
import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
import xdi2.core.xri3.XDI3SubSegment;
import xdi2.core.xri3.parser.aparse.ParserException;
			if (key.endsWith("/" + XDIConstants.XRI_S_CONTEXT.toString())) {
				XDI3Statement statementXri = makeStatement(key + "/", state);
				XDI3Segment absoluteSubject = root.relativeToAbsoluteXri(statementXri.getSubject());
				XDI3Segment relativeSubject = statementRoot.absoluteToRelativeXri(absoluteSubject);
					XDI3SubSegment arcXri = makeXDI3SubSegment(((JsonPrimitive) jsonEntryArrayElement).getAsString(), state);
					ContextNode contextNode = baseContextNode.setContextNode(arcXri);
					if (log.isTraceEnabled()) log.trace("Under " + baseContextNode.getXri() + ": Set context node " + contextNode.getArcXri() + " --> " + contextNode.getXri());
			} else if (key.endsWith("/" + XDIConstants.XRI_S_LITERAL.toString())) {
				XDI3Statement statementXri = makeStatement(key + "/\"\"", state);
				XDI3Segment absoluteSubject = root.relativeToAbsoluteXri(statementXri.getSubject());
				XDI3Segment relativeSubject = statementRoot.absoluteToRelativeXri(absoluteSubject);
				if (log.isTraceEnabled()) log.trace("Under " + baseContextNode.getXri() + ": Set literal --> " + literal.getLiteralData());
				XDI3Statement statementXri = makeStatement(key + "/", state);
				XDI3Segment arcXri = statementXri.getPredicate();
				XDI3Segment absoluteSubject = root.relativeToAbsoluteXri(statementXri.getSubject());
				XDI3Segment relativeSubject = statementRoot.absoluteToRelativeXri(absoluteSubject);
						XDI3Segment subject = root.absoluteToRelativeXri(XDI3Util.concatXris(root.getContextNode().getXri(), statementXri.getSubject()));
						XDI3Segment predicate = statementXri.getPredicate();
						XDI3Segment targetContextNodeXri = makeXDI3Segment(((JsonPrimitive) jsonEntryArrayElement).getAsString(), state);
						Relation relation = baseContextNode.setRelation(arcXri, targetContextNodeXri);
						if (log.isTraceEnabled()) log.trace("Under " + baseContextNode.getXri() + ": Set relation " + relation.getArcXri() + " --> " + relation.getTargetContextNodeXri());
	private static XDI3Statement makeStatement(String xriString, State state) {
		return XDI3Statement.create(xriString);
	private static XDI3Segment makeXDI3Segment(String xriString, State state) {
		return XDI3Segment.create(xriString);
	private static XDI3SubSegment makeXDI3SubSegment(String xriString, State state) {
		return XDI3SubSegment.create(xriString);

@@ -22,11 +22,11 @@
 import xdi2.core.impl.AbstractLiteral;
 import xdi2.core.io.AbstractXDIReader;
 import xdi2.core.io.MimeType;
-import xdi2.core.util.XDI3Util;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
-import xdi2.core.xri3.XDI3SubSegment;
-import xdi2.core.xri3.parser.aparse.ParserException;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.syntax.XDIStatement;
+import xdi2.core.syntax.parser.ParserException;
+import xdi2.core.util.AddressUtil;
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
@@ -64,9 +64,9 @@ public void read(XdiRoot root, JsonObject jsonGraphObject, State state) throws I
 			String key = entry.getKey();
 			JsonElement jsonEntryElement = entry.getValue();
 
-			if (key.endsWith("/" + XDIConstants.XRI_S_CONTEXT.toString())) {
+			if (key.endsWith("/" + XDIConstants.XDI_ADD_CONTEXT.toString())) {
 
-				XDI3Statement statementXri = makeStatement(key + "/", state);
+				XDIStatement statementXri = makeStatement(key + "/", state);
 
 				if (! (jsonEntryElement instanceof JsonArray)) throw new Xdi2ParseException("JSON object member must be an array: " + jsonEntryElement);
 
@@ -75,8 +75,8 @@ public void read(XdiRoot root, JsonObject jsonGraphObject, State state) throws I
 				// find the root and the base context node of this statement
 
 				XdiRoot statementRoot = root.getRoot(statementXri.getSubject(), true);
-				XDI3Segment absoluteSubject = root.relativeToAbsoluteXri(statementXri.getSubject());
-				XDI3Segment relativeSubject = statementRoot.absoluteToRelativeXri(absoluteSubject);
+				XDIAddress absoluteSubject = root.relativeToAbsoluteXri(statementXri.getSubject());
+				XDIAddress relativeSubject = statementRoot.absoluteToRelativeXri(absoluteSubject);
 				ContextNode baseContextNode = relativeSubject == null ? statementRoot.getContextNode() : statementRoot.getContextNode().setDeepContextNode(relativeSubject);
 
 				// add context nodes
@@ -85,42 +85,42 @@ public void read(XdiRoot root, JsonObject jsonGraphObject, State state) throws I
 
 					if (! (jsonEntryArrayElement instanceof JsonPrimitive) || ! ((JsonPrimitive) jsonEntryArrayElement).isString()) throw new Xdi2ParseException("JSON array element must be a string: " + jsonEntryArrayElement);
 
-					XDI3SubSegment arcXri = makeXDI3SubSegment(((JsonPrimitive) jsonEntryArrayElement).getAsString(), state);
+					XDIArc arc = makeXDIArc(((JsonPrimitive) jsonEntryArrayElement).getAsString(), state);
 
-					ContextNode contextNode = baseContextNode.setContextNode(arcXri);
-					if (log.isTraceEnabled()) log.trace("Under " + baseContextNode.getXri() + ": Set context node " + contextNode.getArcXri() + " --> " + contextNode.getXri());
+					ContextNode contextNode = baseContextNode.setContextNode(arc);
+					if (log.isTraceEnabled()) log.trace("Under " + baseContextNode.getAddress() + ": Set context node " + contextNode.getArc() + " --> " + contextNode.getAddress());
 				}
-			} else if (key.endsWith("/" + XDIConstants.XRI_S_LITERAL.toString())) {
+			} else if (key.endsWith("/" + XDIConstants.XDI_ADD_LITERAL.toString())) {
 
-				XDI3Statement statementXri = makeStatement(key + "/\"\"", state);
+				XDIStatement statementXri = makeStatement(key + "/\"\"", state);
 
 				Object literalData = AbstractLiteral.jsonElementToLiteralData(jsonEntryElement);
 
 				// find the root and the base context node of this statement
 
 				XdiRoot statementRoot = root.getRoot(statementXri.getSubject(), true);
-				XDI3Segment absoluteSubject = root.relativeToAbsoluteXri(statementXri.getSubject());
-				XDI3Segment relativeSubject = statementRoot.absoluteToRelativeXri(absoluteSubject);
+				XDIAddress absoluteSubject = root.relativeToAbsoluteXri(statementXri.getSubject());
+				XDIAddress relativeSubject = statementRoot.absoluteToRelativeXri(absoluteSubject);
 				ContextNode baseContextNode = relativeSubject == null ? statementRoot.getContextNode() : statementRoot.getContextNode().setDeepContextNode(relativeSubject);
 
 				// add literal
 
 				Literal literal = baseContextNode.setLiteral(literalData);
-				if (log.isTraceEnabled()) log.trace("Under " + baseContextNode.getXri() + ": Set literal --> " + literal.getLiteralData());
+				if (log.isTraceEnabled()) log.trace("Under " + baseContextNode.getAddress() + ": Set literal --> " + literal.getLiteralData());
 			} else {
 
-				XDI3Statement statementXri = makeStatement(key + "/", state);
+				XDIStatement statementXri = makeStatement(key + "/", state);
 
 				if (! (jsonEntryElement instanceof JsonArray)) throw new Xdi2ParseException("JSON object member must be an array: " + jsonEntryElement);
 
-				XDI3Segment arcXri = statementXri.getPredicate();
+				XDIAddress arc = statementXri.getPredicate();
 				JsonArray jsonEntryArray = (JsonArray) jsonEntryElement;
 
 				// find the root and the base context node of this statement
 
 				XdiRoot statementRoot = root.getRoot(statementXri.getSubject(), true);
-				XDI3Segment absoluteSubject = root.relativeToAbsoluteXri(statementXri.getSubject());
-				XDI3Segment relativeSubject = statementRoot.absoluteToRelativeXri(absoluteSubject);
+				XDIAddress absoluteSubject = root.relativeToAbsoluteXri(statementXri.getSubject());
+				XDIAddress relativeSubject = statementRoot.absoluteToRelativeXri(absoluteSubject);
 				ContextNode baseContextNode = relativeSubject == null ? statementRoot.getContextNode() : statementRoot.getContextNode().setDeepContextNode(relativeSubject);
 
 				// add inner root and/or relations
@@ -133,18 +133,18 @@ public void read(XdiRoot root, JsonObject jsonGraphObject, State state) throws I
 
 						root = root.getRoot(statementXri.getSubject(), true);
 
-						XDI3Segment subject = root.absoluteToRelativeXri(XDI3Util.concatXris(root.getContextNode().getXri(), statementXri.getSubject()));
-						XDI3Segment predicate = statementXri.getPredicate();
+						XDIAddress subject = root.absoluteToRelativeXri(AddressUtil.concatAddresses(root.getContextNode().getAddress(), statementXri.getSubject()));
+						XDIAddress predicate = statementXri.getPredicate();
 
 						XdiInnerRoot innerRoot = root.getInnerRoot(subject, predicate, true);
 
 						this.read(innerRoot, (JsonObject) jsonEntryArrayElement, state);
 					} else if (jsonEntryArrayElement instanceof JsonPrimitive && ((JsonPrimitive) jsonEntryArrayElement).isString()) {
 
-						XDI3Segment targetContextNodeXri = makeXDI3Segment(((JsonPrimitive) jsonEntryArrayElement).getAsString(), state);
+						XDIAddress targetContextNodeAddress = makeXDIAddress(((JsonPrimitive) jsonEntryArrayElement).getAsString(), state);
 
-						Relation relation = baseContextNode.setRelation(arcXri, targetContextNodeXri);
-						if (log.isTraceEnabled()) log.trace("Under " + baseContextNode.getXri() + ": Set relation " + relation.getArcXri() + " --> " + relation.getTargetContextNodeXri());
+						Relation relation = baseContextNode.setRelation(arc, targetContextNodeAddress);
+						if (log.isTraceEnabled()) log.trace("Under " + baseContextNode.getAddress() + ": Set relation " + relation.getArc() + " --> " + relation.getTargetContextNodeAddress());
 					} else {
 
 						throw new Xdi2ParseException("JSON array element must be either an object or a string: " + jsonEntryArrayElement);
@@ -187,21 +187,21 @@ private static class State {
 		private String lastXriString;
 	}
 
-	private static XDI3Statement makeStatement(String xriString, State state) {
+	private static XDIStatement makeStatement(String xriString, State state) {
 
 		state.lastXriString = xriString;
-		return XDI3Statement.create(xriString);
+		return XDIStatement.create(xriString);
 	}
 
-	private static XDI3Segment makeXDI3Segment(String xriString, State state) {
+	private static XDIAddress makeXDIAddress(String xriString, State state) {
 
 		state.lastXriString = xriString;
-		return XDI3Segment.create(xriString);
+		return XDIAddress.create(xriString);
 	}
 
-	private static XDI3SubSegment makeXDI3SubSegment(String xriString, State state) {
+	private static XDIArc makeXDIArc(String xriString, State state) {
 
 		state.lastXriString = xriString;
-		return XDI3SubSegment.create(xriString);
+		return XDIArc.create(xriString);
 	}
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Freaders%2FXDIJSONReader.java
5b322130b16d82f55dc7a1f91c86f6f29e667d2c
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Freaders%2FXDIRawJSONReader.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Freaders%2FXDIRawJSONReader.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/io/readers/XDIRawJSONReader.java
import xdi2.core.syntax.XDIArc;
				XDIArc arc = Dictionary.nativeIdentifierToInstanceXri(key);
				XdiEntitySingleton xdiEntitySingleton = xdiContext.getXdiEntitySingleton(XdiEntitySingleton.createarc(arc), true);
				XDIArc arc = Dictionary.nativeIdentifierToInstanceXri(key);
				readJsonArray(xdiContext, arc, (JsonArray) jsonElement);
				XDIArc arc = Dictionary.nativeIdentifierToInstanceXri(key);
				XdiAttributeSingleton xdiAttributeSingleton = xdiContext.getXdiAttributeSingleton(XdiAttributeSingleton.createarc(arc), true);
	private static void readJsonArray(XdiContext<?> xdiContext, XDIArc arc, JsonArray jsonArray) {
		if (arc == null) {
			arc = XDIArc.create("$array");
				XdiEntityCollection xdiEntityCollection = xdiContext.getXdiEntityCollection(XdiEntityCollection.createarc(arc), true);
				XdiEntityCollection xdiEntityCollection = xdiContext.getXdiEntityCollection(XdiEntityCollection.createarc(arc), true);
				XdiAttributeCollection xdiAttributeCollection = xdiContext.getXdiAttributeCollection(XdiAttributeCollection.createarc(arc), true);
	/*	private static XDIArc jsonContentId(JsonElement jsonElement) {
			return XDIArc.create(XDIConstants.CS_BANG + jsonContentId);

import xdi2.core.xri3.XDI3SubSegment;
				XDI3SubSegment arcXri = Dictionary.nativeIdentifierToInstanceXri(key);
				XdiEntitySingleton xdiEntitySingleton = xdiContext.getXdiEntitySingleton(XdiEntitySingleton.createArcXri(arcXri), true);
				XDI3SubSegment arcXri = Dictionary.nativeIdentifierToInstanceXri(key);
				readJsonArray(xdiContext, arcXri, (JsonArray) jsonElement);
				XDI3SubSegment arcXri = Dictionary.nativeIdentifierToInstanceXri(key);
				XdiAttributeSingleton xdiAttributeSingleton = xdiContext.getXdiAttributeSingleton(XdiAttributeSingleton.createArcXri(arcXri), true);
	private static void readJsonArray(XdiContext<?> xdiContext, XDI3SubSegment arcXri, JsonArray jsonArray) {
		if (arcXri == null) {
			arcXri = XDI3SubSegment.create("$array");
				XdiEntityCollection xdiEntityCollection = xdiContext.getXdiEntityCollection(XdiEntityCollection.createArcXri(arcXri), true);
				XdiEntityCollection xdiEntityCollection = xdiContext.getXdiEntityCollection(XdiEntityCollection.createArcXri(arcXri), true);
				XdiAttributeCollection xdiAttributeCollection = xdiContext.getXdiAttributeCollection(XdiAttributeCollection.createArcXri(arcXri), true);
	/*	private static XDI3SubSegment jsonContentId(JsonElement jsonElement) {
			return XDI3SubSegment.create(XDIConstants.CS_BANG + jsonContentId);

@@ -22,7 +22,7 @@
 import xdi2.core.impl.AbstractLiteral;
 import xdi2.core.io.AbstractXDIReader;
 import xdi2.core.io.MimeType;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIArc;
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
@@ -60,31 +60,31 @@ private static void readJsonObject(XdiContext<?> xdiContext, JsonObject jsonObje
 
 			if (jsonElement instanceof JsonObject) {
 
-				XDI3SubSegment arcXri = Dictionary.nativeIdentifierToInstanceXri(key);
+				XDIArc arc = Dictionary.nativeIdentifierToInstanceXri(key);
 
-				XdiEntitySingleton xdiEntitySingleton = xdiContext.getXdiEntitySingleton(XdiEntitySingleton.createArcXri(arcXri), true);
+				XdiEntitySingleton xdiEntitySingleton = xdiContext.getXdiEntitySingleton(XdiEntitySingleton.createarc(arc), true);
 				readJsonObject(xdiEntitySingleton, (JsonObject) jsonElement);
 			} else if (jsonElement instanceof JsonArray) {
 
-				XDI3SubSegment arcXri = Dictionary.nativeIdentifierToInstanceXri(key);
+				XDIArc arc = Dictionary.nativeIdentifierToInstanceXri(key);
 
-				readJsonArray(xdiContext, arcXri, (JsonArray) jsonElement);
+				readJsonArray(xdiContext, arc, (JsonArray) jsonElement);
 			} else if (jsonElement instanceof JsonPrimitive) {
 
-				XDI3SubSegment arcXri = Dictionary.nativeIdentifierToInstanceXri(key);
+				XDIArc arc = Dictionary.nativeIdentifierToInstanceXri(key);
 
-				XdiAttributeSingleton xdiAttributeSingleton = xdiContext.getXdiAttributeSingleton(XdiAttributeSingleton.createArcXri(arcXri), true);
+				XdiAttributeSingleton xdiAttributeSingleton = xdiContext.getXdiAttributeSingleton(XdiAttributeSingleton.createarc(arc), true);
 				XdiValue xdiValue = xdiAttributeSingleton.getXdiValue(true);
 				xdiValue.getContextNode().setLiteral(AbstractLiteral.jsonElementToLiteralData(jsonElement));
 			}
 		}
 	}
 
-	private static void readJsonArray(XdiContext<?> xdiContext, XDI3SubSegment arcXri, JsonArray jsonArray) {
+	private static void readJsonArray(XdiContext<?> xdiContext, XDIArc arc, JsonArray jsonArray) {
 
-		if (arcXri == null) {
+		if (arc == null) {
 
-			arcXri = XDI3SubSegment.create("$array");
+			arc = XDIArc.create("$array");
 		}
 
 		long index = 0;
@@ -93,19 +93,19 @@ private static void readJsonArray(XdiContext<?> xdiContext, XDI3SubSegment arcXr
 
 			if (jsonElement instanceof JsonObject) {
 
-				XdiEntityCollection xdiEntityCollection = xdiContext.getXdiEntityCollection(XdiEntityCollection.createArcXri(arcXri), true);
+				XdiEntityCollection xdiEntityCollection = xdiContext.getXdiEntityCollection(XdiEntityCollection.createarc(arc), true);
 
 				XdiEntityMemberOrdered xdiEntityMember = xdiEntityCollection.setXdiMemberOrdered(index);
 				readJsonObject(xdiEntityMember, (JsonObject) jsonElement);
 			} else if (jsonElement instanceof JsonArray) {
 
-				XdiEntityCollection xdiEntityCollection = xdiContext.getXdiEntityCollection(XdiEntityCollection.createArcXri(arcXri), true);
+				XdiEntityCollection xdiEntityCollection = xdiContext.getXdiEntityCollection(XdiEntityCollection.createarc(arc), true);
 
 				XdiEntityMemberOrdered xdiEntityMember = xdiEntityCollection.setXdiMemberOrdered(index);
 				readJsonArray(xdiEntityMember, null, (JsonArray) jsonElement);
 			} else {
 
-				XdiAttributeCollection xdiAttributeCollection = xdiContext.getXdiAttributeCollection(XdiAttributeCollection.createArcXri(arcXri), true);
+				XdiAttributeCollection xdiAttributeCollection = xdiContext.getXdiAttributeCollection(XdiAttributeCollection.createarc(arc), true);
 
 				XdiAttributeMemberOrdered xdiAttributeMember = xdiAttributeCollection.setXdiMemberOrdered(index);
 				XdiValue xdiValue = xdiAttributeMember.getXdiValue(true);
@@ -116,7 +116,7 @@ private static void readJsonArray(XdiContext<?> xdiContext, XDI3SubSegment arcXr
 		}
 	}
 
-	/*	private static XDI3SubSegment jsonContentId(JsonElement jsonElement) {
+	/*	private static XDIArc jsonContentId(JsonElement jsonElement) {
 
 		try {
 
@@ -131,7 +131,7 @@ private static void readJsonArray(XdiContext<?> xdiContext, XDI3SubSegment arcXr
 			String jsonContentId = new String(Base64.encodeBase64URLSafe(digest.digest()), "UTF-8");
 			if (log.isDebugEnabled()) log.debug("json_content_id: " + jsonContentId);
 
-			return XDI3SubSegment.create(XDIConstants.CS_BANG + jsonContentId);
+			return XDIArc.create(XDIConstants.CS_BANG + jsonContentId);
 		} catch (Exception ex) {
 
 			throw new Xdi2RuntimeException(ex.getMessage(), ex);

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Freaders%2FXDIRawJSONReader.java
7aa5036e984b374fc35b4c3c79717e7c895f4d63
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Fwriters%2FXDIDisplayWriter.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Fwriters%2FXDIDisplayWriter.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/io/writers/XDIDisplayWriter.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.syntax.XDIStatement;
	private void writeStatement(BufferedWriter bufferedWriter, XDIStatement statementXri) throws IOException {
		this.writecontextNodeAddress(bufferedWriter, statementXri.getSubject());
			this.writecontextNodeArc(bufferedWriter, statementXri.getSubject(), (XDIArc) statementXri.getObject());
			this.writecontextNodeAddress(bufferedWriter, (XDIAddress) statementXri.getObject());
	private void writecontextNodeAddress(BufferedWriter bufferedWriter, XDIAddress contextNodeAddress) throws IOException {
			for (XDIArc contextNodeArc : contextNodeAddress.getArcs()) {
				this.writecontextNodeArc(bufferedWriter, contextNode, contextNodeArc);
				if (! XDIConstants.XDI_ADD_ROOT.equals(contextNodeArc)) {
					contextNode = contextNode.setContextNode(contextNodeArc);
			bufferedWriter.write(contextNodeAddress.toString());
	private void writecontextNodeArc(BufferedWriter bufferedWriter, XDIAddress contextNodeAddress, XDIArc contextNodeArc) throws IOException {
		if (! XDIConstants.XDI_ADD_ROOT.equals(contextNodeAddress)) {
			contextNode = contextNode.setDeepContextNode(contextNodeAddress);
		this.writecontextNodeArc(bufferedWriter, contextNode, contextNodeArc);
	private void writecontextNodeArc(BufferedWriter bufferedWriter, ContextNode contextNode, XDIArc contextNodeArc) throws IOException {
		if (! XDIConstants.XDI_ADD_ROOT.equals(contextNodeArc)) {
			contextNode = contextNode.setContextNode(contextNodeArc);
		bufferedWriter.write(contextNodeArc.toString());
	private void writePredicateXri(BufferedWriter bufferedWriter, XDIAddress predicateXri) throws IOException {

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
import xdi2.core.xri3.XDI3SubSegment;
	private void writeStatement(BufferedWriter bufferedWriter, XDI3Statement statementXri) throws IOException {
		this.writeContextNodeXri(bufferedWriter, statementXri.getSubject());
			this.writeContextNodeArcXri(bufferedWriter, statementXri.getSubject(), (XDI3SubSegment) statementXri.getObject());
			this.writeContextNodeXri(bufferedWriter, (XDI3Segment) statementXri.getObject());
	private void writeContextNodeXri(BufferedWriter bufferedWriter, XDI3Segment contextNodeXri) throws IOException {
			for (XDI3SubSegment contextNodeArcXri : contextNodeXri.getSubSegments()) {
				this.writeContextNodeArcXri(bufferedWriter, contextNode, contextNodeArcXri);
				if (! XDIConstants.XRI_S_ROOT.equals(contextNodeArcXri)) {
					contextNode = contextNode.setContextNode(contextNodeArcXri);
			bufferedWriter.write(contextNodeXri.toString());
	private void writeContextNodeArcXri(BufferedWriter bufferedWriter, XDI3Segment contextNodeXri, XDI3SubSegment contextNodeArcXri) throws IOException {
		if (! XDIConstants.XRI_S_ROOT.equals(contextNodeXri)) {
			contextNode = contextNode.setDeepContextNode(contextNodeXri);
		this.writeContextNodeArcXri(bufferedWriter, contextNode, contextNodeArcXri);
	private void writeContextNodeArcXri(BufferedWriter bufferedWriter, ContextNode contextNode, XDI3SubSegment contextNodeArcXri) throws IOException {
		if (! XDIConstants.XRI_S_ROOT.equals(contextNodeArcXri)) {
			contextNode = contextNode.setContextNode(contextNodeArcXri);
		bufferedWriter.write(contextNodeArcXri.toString());
	private void writePredicateXri(BufferedWriter bufferedWriter, XDI3Segment predicateXri) throws IOException {

@@ -25,16 +25,16 @@
 import xdi2.core.io.AbstractXDIWriter;
 import xdi2.core.io.MimeType;
 import xdi2.core.io.XDIWriterRegistry;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.syntax.XDIStatement;
 import xdi2.core.util.CopyUtil;
 import xdi2.core.util.iterators.CompositeIterator;
 import xdi2.core.util.iterators.IterableIterator;
 import xdi2.core.util.iterators.MappingContextNodeStatementIterator;
 import xdi2.core.util.iterators.MappingLiteralStatementIterator;
 import xdi2.core.util.iterators.MappingRelationStatementIterator;
 import xdi2.core.util.iterators.SelectingNotImpliedStatementIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
-import xdi2.core.xri3.XDI3SubSegment;
 
 public class XDIDisplayWriter extends AbstractXDIWriter {
 
@@ -141,21 +141,21 @@ public void write(Graph graph, BufferedWriter bufferedWriter) throws IOException
 		if (orderedGraph != null) orderedGraph.close();
 	}
 
-	private void writeStatement(BufferedWriter bufferedWriter, XDI3Statement statementXri) throws IOException {
+	private void writeStatement(BufferedWriter bufferedWriter, XDIStatement statementXri) throws IOException {
 
 		// write the statement
 
-		this.writeContextNodeXri(bufferedWriter, statementXri.getSubject());
+		this.writecontextNodeAddress(bufferedWriter, statementXri.getSubject());
 		this.writeSeparator(bufferedWriter);
 		this.writePredicateXri(bufferedWriter, statementXri.getPredicate());
 		this.writeSeparator(bufferedWriter);
 
 		if (statementXri.isContextNodeStatement()) {
 
-			this.writeContextNodeArcXri(bufferedWriter, statementXri.getSubject(), (XDI3SubSegment) statementXri.getObject());
+			this.writecontextNodeArc(bufferedWriter, statementXri.getSubject(), (XDIArc) statementXri.getObject());
 		} else if (statementXri.isRelationStatement()) {
 
-			this.writeContextNodeXri(bufferedWriter, (XDI3Segment) statementXri.getObject());
+			this.writecontextNodeAddress(bufferedWriter, (XDIAddress) statementXri.getObject());
 		} else if (statementXri.isLiteralStatement()) {
 
 			this.writeLiteralData(bufferedWriter, statementXri.getObject());
@@ -176,44 +176,44 @@ private void writeSeparator(BufferedWriter bufferedWriter) throws IOException {
 		}
 	}
 
-	private void writeContextNodeXri(BufferedWriter bufferedWriter, XDI3Segment contextNodeXri) throws IOException {
+	private void writecontextNodeAddress(BufferedWriter bufferedWriter, XDIAddress contextNodeAddress) throws IOException {
 
 		if (this.writeHtml) {
 
 			ContextNode contextNode = MemoryGraphFactory.getInstance().openGraph().getRootContextNode(false);
 
-			for (XDI3SubSegment contextNodeArcXri : contextNodeXri.getSubSegments()) {
+			for (XDIArc contextNodeArc : contextNodeAddress.getArcs()) {
 
-				this.writeContextNodeArcXri(bufferedWriter, contextNode, contextNodeArcXri);
+				this.writecontextNodeArc(bufferedWriter, contextNode, contextNodeArc);
 
-				if (! XDIConstants.XRI_S_ROOT.equals(contextNodeArcXri)) {
+				if (! XDIConstants.XDI_ADD_ROOT.equals(contextNodeArc)) {
 
-					contextNode = contextNode.setContextNode(contextNodeArcXri);
+					contextNode = contextNode.setContextNode(contextNodeArc);
 				}
 			}
 		} else {
 
-			bufferedWriter.write(contextNodeXri.toString());
+			bufferedWriter.write(contextNodeAddress.toString());
 		}
 	}
 
-	private void writeContextNodeArcXri(BufferedWriter bufferedWriter, XDI3Segment contextNodeXri, XDI3SubSegment contextNodeArcXri) throws IOException {
+	private void writecontextNodeArc(BufferedWriter bufferedWriter, XDIAddress contextNodeAddress, XDIArc contextNodeArc) throws IOException {
 
 		ContextNode contextNode = MemoryGraphFactory.getInstance().openGraph().getRootContextNode(false);
 
-		if (! XDIConstants.XRI_S_ROOT.equals(contextNodeXri)) {
+		if (! XDIConstants.XDI_ADD_ROOT.equals(contextNodeAddress)) {
 
-			contextNode = contextNode.setDeepContextNode(contextNodeXri);
+			contextNode = contextNode.setDeepContextNode(contextNodeAddress);
 		}
 
-		this.writeContextNodeArcXri(bufferedWriter, contextNode, contextNodeArcXri);
+		this.writecontextNodeArc(bufferedWriter, contextNode, contextNodeArc);
 	}
 
-	private void writeContextNodeArcXri(BufferedWriter bufferedWriter, ContextNode contextNode, XDI3SubSegment contextNodeArcXri) throws IOException {
+	private void writecontextNodeArc(BufferedWriter bufferedWriter, ContextNode contextNode, XDIArc contextNodeArc) throws IOException {
 
-		if (! XDIConstants.XRI_S_ROOT.equals(contextNodeArcXri)) {
+		if (! XDIConstants.XDI_ADD_ROOT.equals(contextNodeArc)) {
 
-			contextNode = contextNode.setContextNode(contextNodeArcXri);
+			contextNode = contextNode.setContextNode(contextNodeArc);
 		}
 
 		String htmlColorString = null;
@@ -226,12 +226,12 @@ private void writeContextNodeArcXri(BufferedWriter bufferedWriter, ContextNode c
 		}
 
 		if (htmlColorString != null) bufferedWriter.write("<span style=\"background-color:" + htmlColorString + "\">");
-		bufferedWriter.write(contextNodeArcXri.toString());
+		bufferedWriter.write(contextNodeArc.toString());
 		if (htmlColorString != null) bufferedWriter.write("</span>");
 	}
 
 	@SuppressWarnings("static-method")
-	private void writePredicateXri(BufferedWriter bufferedWriter, XDI3Segment predicateXri) throws IOException {
+	private void writePredicateXri(BufferedWriter bufferedWriter, XDIAddress predicateXri) throws IOException {
 
 		bufferedWriter.write(predicateXri.toString());
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Fwriters%2FXDIDisplayWriter.java
926497e24cd0ee03281e294cad39fbffbdee37f9
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Fwriters%2FXDIJSONPARSEWriter.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Fwriters%2FXDIJSONPARSEWriter.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/io/writers/XDIJSONPARSEWriter.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.syntax.XDIStatement;
import xdi2.core.syntax.XDIXRef;
			XDIStatement statementXri = statement.getXri();
	private static JsonArray makeGom(XDIStatement statement) {
		if (statement.getObject() instanceof XDIAddress)
			gom.add(makeGom((XDIAddress) statement.getObject()));
		else if (statement.getObject() instanceof XDIArc)
			gom.add(makeGom((XDIArc) statement.getObject()));
	private static JsonElement makeGom(XDIAddress segment) {
		if (segment.getNumArcs() == 1) {
			gom = makeGom(segment.getFirstArc());
			for (int i=0; i<segment.getNumArcs(); i++) ((JsonArray) gom).add(makeGom(segment.getArc(i)));
	private static JsonElement makeGom(XDIArc subSegment) {
	private static JsonElement makeGom(XDIXRef xref) {
		} else if (xref.hasAddress()) {
			return makeGom(xref.getAddress());

XDIStatement statement
core/src/main/java/xdi2/core/io/writers/XDIJSONPARSEWriter.java
if (statement.getObject() instanceof XDIAddress)
			gom.add(makeGom((XDIAddress) statement.getObject()));
		else if (statement.getObject() instanceof XDIArc)
			gom.add(makeGom((XDIArc) statement.getObject()));
	private static JsonElement makeGom(XDIAddress segment) {
		if (segment.getNumArcs() == 1) {
			gom = makeGom(segment.getFirstArc());
			for (int i=0; i<segment.getNumArcs(); i++) ((JsonArray) gom).add(makeGom(segment.getArc(i)));
	private static JsonElement makeGom(XDIArc subSegment) {
	private static JsonElement makeGom(XDIXRef xref) {
JsonArray makeGom(XDIStatement statement)
import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
import xdi2.core.xri3.XDI3SubSegment;
import xdi2.core.xri3.XDI3XRef;
			XDI3Statement statementXri = statement.getXri();
	private static JsonArray makeGom(XDI3Statement statement) {
		if (statement.getObject() instanceof XDI3Segment)
			gom.add(makeGom((XDI3Segment) statement.getObject()));
		else if (statement.getObject() instanceof XDI3SubSegment)
			gom.add(makeGom((XDI3SubSegment) statement.getObject()));
	private static JsonElement makeGom(XDI3Segment segment) {
		if (segment.getNumSubSegments() == 1) {
			gom = makeGom(segment.getFirstSubSegment());
			for (int i=0; i<segment.getNumSubSegments(); i++) ((JsonArray) gom).add(makeGom(segment.getSubSegment(i)));
	private static JsonElement makeGom(XDI3SubSegment subSegment) {
	private static JsonElement makeGom(XDI3XRef xref) {
		} else if (xref.hasSegment()) {
			return makeGom(xref.getSegment());

XDI3Statement statement
core/src/main/java/xdi2/core/io/writers/XDIJSONPARSEWriter.java
if (statement.getObject() instanceof XDI3Segment)
			gom.add(makeGom((XDI3Segment) statement.getObject()));
		else if (statement.getObject() instanceof XDI3SubSegment)
			gom.add(makeGom((XDI3SubSegment) statement.getObject()));
	private static JsonElement makeGom(XDI3Segment segment) {
		if (segment.getNumSubSegments() == 1) {
			gom = makeGom(segment.getFirstSubSegment());
			for (int i=0; i<segment.getNumSubSegments(); i++) ((JsonArray) gom).add(makeGom(segment.getSubSegment(i)));
	private static JsonElement makeGom(XDI3SubSegment subSegment) {
	private static JsonElement makeGom(XDI3XRef xref) {
JsonArray makeGom(XDI3Statement statement)
@@ -18,17 +18,17 @@
 import xdi2.core.io.AbstractXDIWriter;
 import xdi2.core.io.MimeType;
 import xdi2.core.io.XDIWriterRegistry;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.syntax.XDIStatement;
+import xdi2.core.syntax.XDIXRef;
 import xdi2.core.util.CopyUtil;
 import xdi2.core.util.iterators.CompositeIterator;
 import xdi2.core.util.iterators.IterableIterator;
 import xdi2.core.util.iterators.MappingContextNodeStatementIterator;
 import xdi2.core.util.iterators.MappingLiteralStatementIterator;
 import xdi2.core.util.iterators.MappingRelationStatementIterator;
 import xdi2.core.util.iterators.SelectingNotImpliedStatementIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
-import xdi2.core.xri3.XDI3SubSegment;
-import xdi2.core.xri3.XDI3XRef;
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
@@ -125,7 +125,7 @@ private static JsonArray makeGom(IterableIterator<Statement> statements) {
 
 		for (Statement statement : statements) {
 
-			XDI3Statement statementXri = statement.getXri();
+			XDIStatement statementXri = statement.getXri();
 
 			// write the statement
 
@@ -135,41 +135,41 @@ private static JsonArray makeGom(IterableIterator<Statement> statements) {
 		return gom;
 	}
 
-	private static JsonArray makeGom(XDI3Statement statement) {
+	private static JsonArray makeGom(XDIStatement statement) {
 
 		JsonArray gom = new JsonArray();
 
 		gom.add(makeGom(statement.getSubject()));
 		gom.add(makeGom(statement.getPredicate()));
 
-		if (statement.getObject() instanceof XDI3Segment)
-			gom.add(makeGom((XDI3Segment) statement.getObject()));
-		else if (statement.getObject() instanceof XDI3SubSegment)
-			gom.add(makeGom((XDI3SubSegment) statement.getObject()));
+		if (statement.getObject() instanceof XDIAddress)
+			gom.add(makeGom((XDIAddress) statement.getObject()));
+		else if (statement.getObject() instanceof XDIArc)
+			gom.add(makeGom((XDIArc) statement.getObject()));
 		else
 			gom.add(AbstractLiteral.literalDataToJsonElement(statement.getObject()));
 
 		return gom;
 	}
 
-	private static JsonElement makeGom(XDI3Segment segment) {
+	private static JsonElement makeGom(XDIAddress segment) {
 
 		JsonElement gom;
 
-		if (segment.getNumSubSegments() == 1) {
+		if (segment.getNumArcs() == 1) {
 
-			gom = makeGom(segment.getFirstSubSegment());
+			gom = makeGom(segment.getFirstArc());
 		} else {
 
 			gom = new JsonArray();
 
-			for (int i=0; i<segment.getNumSubSegments(); i++) ((JsonArray) gom).add(makeGom(segment.getSubSegment(i)));
+			for (int i=0; i<segment.getNumArcs(); i++) ((JsonArray) gom).add(makeGom(segment.getArc(i)));
 		}
 
 		return gom;
 	}
 
-	private static JsonElement makeGom(XDI3SubSegment subSegment) {
+	private static JsonElement makeGom(XDIArc subSegment) {
 
 		JsonElement gom = null;
 
@@ -215,17 +215,17 @@ private static JsonElement makeGom(XDI3SubSegment subSegment) {
 		return gom;
 	}
 
-	private static JsonElement makeGom(XDI3XRef xref) {
+	private static JsonElement makeGom(XDIXRef xref) {
 
 		if (xref.hasPartialSubjectAndPredicate()) {
 
 			JsonArray gom = new JsonArray();
 			gom.add(makeGom(xref.getPartialSubject()));
 			gom.add(makeGom(xref.getPartialPredicate()));
 			return gom;
-		} else if (xref.hasSegment()) {
+		} else if (xref.hasAddress()) {
 
-			return makeGom(xref.getSegment());
+			return makeGom(xref.getAddress());
 		} else {
 
 			return xref.getValue() == null ? new JsonPrimitive("") : new JsonPrimitive(xref.getValue());

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Fwriters%2FXDIJSONPARSEWriter.java
65873feb41055bd9fafa4e357109e51615d08e16
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Fwriters%2FXDIJSONTREEWriter.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Fwriters%2FXDIJSONTREEWriter.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/io/writers/XDIJSONTREEWriter.java
			if (json.get(innerContextNode.getArc().toString()) == null) {
				if (innerContextNode.getArc().equals(XDIConstants.CS_VALUE.toString()) && innerContextNode.containsLiteral()) {
					json.add(innerContextNode.getArc().toString(), makeJson(innerContextNode, writeImplied));
			JsonArray relationJson = relationsJson.getAsJsonArray(relation.getArc().toString());
			if (relationJson == null) { relationJson = new JsonArray(); relationsJson.add(relation.getArc().toString(), relationJson); }
			relationJson.add(new JsonPrimitive(relation.getTargetContextNodeAddress().toString()));

			if (json.get(innerContextNode.getArcXri().toString()) == null) {
				if (innerContextNode.getArcXri().equals(XDIConstants.CS_VALUE.toString()) && innerContextNode.containsLiteral()) {
					json.add(innerContextNode.getArcXri().toString(), makeJson(innerContextNode, writeImplied));
			JsonArray relationJson = relationsJson.getAsJsonArray(relation.getArcXri().toString());
			if (relationJson == null) { relationJson = new JsonArray(); relationsJson.add(relation.getArcXri().toString(), relationJson); }
			relationJson.add(new JsonPrimitive(relation.getTargetContextNodeXri().toString()));

@@ -99,14 +99,14 @@ private static JsonObject makeJson(ContextNode contextNode, boolean writeImplied
 
 			if (! writeImplied && innerContextNode.getStatement().isImplied() && innerContextNode.isEmpty()) continue;
 
-			if (json.get(innerContextNode.getArcXri().toString()) == null) {
+			if (json.get(innerContextNode.getArc().toString()) == null) {
 
-				if (innerContextNode.getArcXri().equals(XDIConstants.CS_VALUE.toString()) && innerContextNode.containsLiteral()) {
+				if (innerContextNode.getArc().equals(XDIConstants.CS_VALUE.toString()) && innerContextNode.containsLiteral()) {
 
 					json.add(XDIConstants.CS_VALUE.toString(), AbstractLiteral.literalDataToJsonElement(innerContextNode.getLiteral().getLiteralData()));
 				} else {
 
-					json.add(innerContextNode.getArcXri().toString(), makeJson(innerContextNode, writeImplied));
+					json.add(innerContextNode.getArc().toString(), makeJson(innerContextNode, writeImplied));
 				}
 			}
 		}
@@ -120,10 +120,10 @@ private static JsonObject makeJson(ContextNode contextNode, boolean writeImplied
 			JsonObject relationsJson = json.getAsJsonObject("/");
 			if (relationsJson == null) { relationsJson = new JsonObject(); json.add("/", relationsJson); }
 
-			JsonArray relationJson = relationsJson.getAsJsonArray(relation.getArcXri().toString());
-			if (relationJson == null) { relationJson = new JsonArray(); relationsJson.add(relation.getArcXri().toString(), relationJson); }
+			JsonArray relationJson = relationsJson.getAsJsonArray(relation.getArc().toString());
+			if (relationJson == null) { relationJson = new JsonArray(); relationsJson.add(relation.getArc().toString(), relationJson); }
 
-			relationJson.add(new JsonPrimitive(relation.getTargetContextNodeXri().toString()));
+			relationJson.add(new JsonPrimitive(relation.getTargetContextNodeAddress().toString()));
 		}
 
 		// done

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Fwriters%2FXDIJSONTREEWriter.java
e6b731eec7f65b0923acf6d8a100f675c76c9c59
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Fwriters%2FXDIJSONWriter.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Fwriters%2FXDIJSONWriter.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/io/writers/XDIJSONWriter.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.syntax.XDIStatement;
			XDIStatement statementXri = statement.getXri();
	private void putStatementIntoJsonObject(XDIStatement statementXri, JsonObject jsonObject) throws IOException {
	private boolean tryPutStatementIntoInnerJsonObject(XDIStatement statementXri, JsonObject jsonObject) throws IOException {
		XDIArc subjectFirstSubSegment = statementXri.getSubject().getFirstArc();
		XDIAddress innerRootSubject = statementXri.getSubject().getFirstArc().getXRef().getPartialSubject();
		XDIAddress innerRootPredicate = statementXri.getSubject().getFirstArc().getXRef().getPartialPredicate();
		XDIStatement reducedStatementXri = StatementUtil.removeStartAddressStatement(statementXri, XDIAddress.fromComponent(subjectFirstSubSegment));
	private static void addObjectToJsonObject(XDIStatement statementXri, JsonObject jsonObject, String key) {

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
import xdi2.core.xri3.XDI3SubSegment;
			XDI3Statement statementXri = statement.getXri();
	private void putStatementIntoJsonObject(XDI3Statement statementXri, JsonObject jsonObject) throws IOException {
	private boolean tryPutStatementIntoInnerJsonObject(XDI3Statement statementXri, JsonObject jsonObject) throws IOException {
		XDI3SubSegment subjectFirstSubSegment = statementXri.getSubject().getFirstSubSegment();
		XDI3Segment innerRootSubject = statementXri.getSubject().getFirstSubSegment().getXRef().getPartialSubject();
		XDI3Segment innerRootPredicate = statementXri.getSubject().getFirstSubSegment().getXRef().getPartialPredicate();
		XDI3Statement reducedStatementXri = StatementUtil.removeStartXriStatement(statementXri, XDI3Segment.fromComponent(subjectFirstSubSegment));
	private static void addObjectToJsonObject(XDI3Statement statementXri, JsonObject jsonObject, String key) {

@@ -17,6 +17,9 @@
 import xdi2.core.io.AbstractXDIWriter;
 import xdi2.core.io.MimeType;
 import xdi2.core.io.XDIWriterRegistry;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.syntax.XDIStatement;
 import xdi2.core.util.CopyUtil;
 import xdi2.core.util.StatementUtil;
 import xdi2.core.util.iterators.CompositeIterator;
@@ -25,9 +28,6 @@
 import xdi2.core.util.iterators.MappingLiteralStatementIterator;
 import xdi2.core.util.iterators.MappingRelationStatementIterator;
 import xdi2.core.util.iterators.SelectingNotImpliedStatementIterator;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
-import xdi2.core.xri3.XDI3SubSegment;
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
@@ -103,7 +103,7 @@ private void writeInternal(Graph graph, JsonObject jsonObject) throws IOExceptio
 
 		for (Statement statement : statements) {
 
-			XDI3Statement statementXri = statement.getXri();
+			XDIStatement statementXri = statement.getXri();
 
 			// put the statement into the JSON object
 
@@ -134,7 +134,7 @@ public Writer write(Graph graph, Writer writer) throws IOException {
 		return writer;
 	}
 
-	private void putStatementIntoJsonObject(XDI3Statement statementXri, JsonObject jsonObject) throws IOException {
+	private void putStatementIntoJsonObject(XDIStatement statementXri, JsonObject jsonObject) throws IOException {
 
 		// nested JSON object?
 
@@ -147,16 +147,16 @@ private void putStatementIntoJsonObject(XDI3Statement statementXri, JsonObject j
 		addObjectToJsonObject(statementXri, jsonObject, key);
 	}
 
-	private boolean tryPutStatementIntoInnerJsonObject(XDI3Statement statementXri, JsonObject jsonObject) throws IOException {
+	private boolean tryPutStatementIntoInnerJsonObject(XDIStatement statementXri, JsonObject jsonObject) throws IOException {
 
-		XDI3SubSegment subjectFirstSubSegment = statementXri.getSubject().getFirstSubSegment();
+		XDIArc subjectFirstSubSegment = statementXri.getSubject().getFirstArc();
 
 		if (subjectFirstSubSegment == null || (! subjectFirstSubSegment.hasXRef()) || (! subjectFirstSubSegment.getXRef().hasPartialSubjectAndPredicate())) return false;
 
-		XDI3Segment innerRootSubject = statementXri.getSubject().getFirstSubSegment().getXRef().getPartialSubject();
-		XDI3Segment innerRootPredicate = statementXri.getSubject().getFirstSubSegment().getXRef().getPartialPredicate();
+		XDIAddress innerRootSubject = statementXri.getSubject().getFirstArc().getXRef().getPartialSubject();
+		XDIAddress innerRootPredicate = statementXri.getSubject().getFirstArc().getXRef().getPartialPredicate();
 
-		XDI3Statement reducedStatementXri = StatementUtil.removeStartXriStatement(statementXri, XDI3Segment.fromComponent(subjectFirstSubSegment));
+		XDIStatement reducedStatementXri = StatementUtil.removeStartAddressStatement(statementXri, XDIAddress.fromComponent(subjectFirstSubSegment));
 		if (reducedStatementXri == null) return false;
 
 		// find the inner root JSON array
@@ -200,7 +200,7 @@ private static JsonObject findJsonObjectInJsonArray(JsonArray jsonArray) {
 		return null;
 	}
 
-	private static void addObjectToJsonObject(XDI3Statement statementXri, JsonObject jsonObject, String key) {
+	private static void addObjectToJsonObject(XDIStatement statementXri, JsonObject jsonObject, String key) {
 
 		if (statementXri.isLiteralStatement()) {
 

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Fio%2Fwriters%2FXDIJSONWriter.java
68be0a20964c33eb0da5105ca76fe883701b0887
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2FCopyUtil.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2FCopyUtil.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/util/CopyUtil.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
		XDIAddress contextNodeAddress = contextNode.getAddress();
			targetContextNode = targetGraph.setDeepContextNode(contextNodeAddress);
		XDIArc contextNodeArc = contextNode.getArc();
		ContextNode targetInnerContextNode = targetContextNode.setContextNode(contextNodeArc);
		XDIAddress relationcontextNodeAddress = relation.getContextNode().getAddress();
		ContextNode targetContextNode = targetGraph.setDeepContextNode(relationcontextNodeAddress);
		XDIAddress relationcontextNodeAddress = relation.getContextNode().getAddress();
		XDIAddress relationAddress = relation.getArc();
		XDIAddress relationtargetContextNodeAddress = relation.getTargetContextNodeAddress();
		XDIAddress targetContextNodeAddress = targetContextNode.getAddress();
		XdiRoot relationContextNodeXdiRoot = XdiLocalRoot.findLocalRoot(relation.getContextNode().getGraph()).getRoot(relationcontextNodeAddress, false);
		XdiRoot targetContextNodeXdiRoot = XdiLocalRoot.findLocalRoot(targetContextNode.getGraph()).getRoot(targetContextNodeAddress, false);
		XDIAddress relativeRelationcontextNodeAddress = relationContextNodeXdiRoot.absoluteToRelativeXri(relationcontextNodeAddress);
		XDIAddress relativeRelationtargetContextNodeAddress = relationContextNodeXdiRoot.absoluteToRelativeXri(relationtargetContextNodeAddress);
		XDIAddress relativetargetContextNodeAddress = targetContextNodeXdiRoot.absoluteToRelativeXri(targetContextNodeAddress);
		if (relativeRelationtargetContextNodeAddress != null &&
				relativeRelationtargetContextNodeAddress.getNumArcs() == 1 &&
				XdiInnerRoot.isInnerRootarc(relativeRelationtargetContextNodeAddress.getFirstArc()) &&
				XdiInnerRoot.getSubjectOfInnerRootXri(relativeRelationtargetContextNodeAddress.getFirstArc()).equals(relativeRelationcontextNodeAddress) &&
				XdiInnerRoot.getPredicateOfInnerRootXri(relativeRelationtargetContextNodeAddress.getFirstArc()).equals(relationAddress)) {
			if (! targetContextNodeAddress.equals(relationcontextNodeAddress)) {
				relativeRelationtargetContextNodeAddress = XDIAddress.fromComponent(XdiInnerRoot.createInnerRootarc(relativetargetContextNodeAddress, relationAddress));
				relationtargetContextNodeAddress = targetContextNodeXdiRoot.relativeToAbsoluteXri(relativeRelationtargetContextNodeAddress);
			targetRelation = targetContextNode.setRelation(relationAddress, relationtargetContextNodeAddress);
			targetRelation = targetContextNode.setRelation(relationAddress, relationtargetContextNodeAddress);
		XDIAddress literalcontextNodeAddress = literal.getContextNode().getAddress();
		ContextNode targetContextNode = targetGraph.setDeepContextNode(literalcontextNodeAddress);

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
		XDI3Segment contextNodeXri = contextNode.getXri();
			targetContextNode = targetGraph.setDeepContextNode(contextNodeXri);
		XDI3SubSegment contextNodeArcXri = contextNode.getArcXri();
		ContextNode targetInnerContextNode = targetContextNode.setContextNode(contextNodeArcXri);
		XDI3Segment relationContextNodeXri = relation.getContextNode().getXri();
		ContextNode targetContextNode = targetGraph.setDeepContextNode(relationContextNodeXri);
		XDI3Segment relationContextNodeXri = relation.getContextNode().getXri();
		XDI3Segment relationArcXri = relation.getArcXri();
		XDI3Segment relationTargetContextNodeXri = relation.getTargetContextNodeXri();
		XDI3Segment targetContextNodeXri = targetContextNode.getXri();
		XdiRoot relationContextNodeXdiRoot = XdiLocalRoot.findLocalRoot(relation.getContextNode().getGraph()).getRoot(relationContextNodeXri, false);
		XdiRoot targetContextNodeXdiRoot = XdiLocalRoot.findLocalRoot(targetContextNode.getGraph()).getRoot(targetContextNodeXri, false);
		XDI3Segment relativeRelationContextNodeXri = relationContextNodeXdiRoot.absoluteToRelativeXri(relationContextNodeXri);
		XDI3Segment relativeRelationTargetContextNodeXri = relationContextNodeXdiRoot.absoluteToRelativeXri(relationTargetContextNodeXri);
		XDI3Segment relativeTargetContextNodeXri = targetContextNodeXdiRoot.absoluteToRelativeXri(targetContextNodeXri);
		if (relativeRelationTargetContextNodeXri != null &&
				relativeRelationTargetContextNodeXri.getNumSubSegments() == 1 &&
				XdiInnerRoot.isInnerRootArcXri(relativeRelationTargetContextNodeXri.getFirstSubSegment()) &&
				XdiInnerRoot.getSubjectOfInnerRootXri(relativeRelationTargetContextNodeXri.getFirstSubSegment()).equals(relativeRelationContextNodeXri) &&
				XdiInnerRoot.getPredicateOfInnerRootXri(relativeRelationTargetContextNodeXri.getFirstSubSegment()).equals(relationArcXri)) {
			if (! targetContextNodeXri.equals(relationContextNodeXri)) {
				relativeRelationTargetContextNodeXri = XDI3Segment.fromComponent(XdiInnerRoot.createInnerRootArcXri(relativeTargetContextNodeXri, relationArcXri));
				relationTargetContextNodeXri = targetContextNodeXdiRoot.relativeToAbsoluteXri(relativeRelationTargetContextNodeXri);
			targetRelation = targetContextNode.setRelation(relationArcXri, relationTargetContextNodeXri);
			targetRelation = targetContextNode.setRelation(relationArcXri, relationTargetContextNodeXri);
		XDI3Segment literalContextNodeXri = literal.getContextNode().getXri();
		ContextNode targetContextNode = targetGraph.setDeepContextNode(literalContextNodeXri);

@@ -13,8 +13,8 @@
 import xdi2.core.features.nodetypes.XdiInnerRoot;
 import xdi2.core.features.nodetypes.XdiLocalRoot;
 import xdi2.core.features.nodetypes.XdiRoot;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 
 /**
  * Various utility methods for copying statements between graphs.
@@ -63,7 +63,7 @@ public static ContextNode copyContextNode(ContextNode contextNode, Graph targetG
 
 		if ((contextNode = copyStrategy.replaceContextNode(contextNode)) == null) return null;
 
-		XDI3Segment contextNodeXri = contextNode.getXri();
+		XDIAddress contextNodeAddress = contextNode.getAddress();
 
 		ContextNode targetContextNode;
 
@@ -72,7 +72,7 @@ public static ContextNode copyContextNode(ContextNode contextNode, Graph targetG
 			targetContextNode = targetGraph.getRootContextNode(false);
 		} else {
 
-			targetContextNode = targetGraph.setDeepContextNode(contextNodeXri);
+			targetContextNode = targetGraph.setDeepContextNode(contextNodeAddress);
 		}
 
 		copyContextNodeContents(contextNode, targetContextNode, copyStrategy);
@@ -95,9 +95,9 @@ public static ContextNode copyContextNode(ContextNode contextNode, ContextNode t
 
 		if ((contextNode = copyStrategy.replaceContextNode(contextNode)) == null) return null;
 
-		XDI3SubSegment contextNodeArcXri = contextNode.getArcXri();
+		XDIArc contextNodeArc = contextNode.getArc();
 
-		ContextNode targetInnerContextNode = targetContextNode.setContextNode(contextNodeArcXri);
+		ContextNode targetInnerContextNode = targetContextNode.setContextNode(contextNodeArc);
 
 		copyContextNodeContents(contextNode, targetInnerContextNode, copyStrategy);
 
@@ -144,8 +144,8 @@ public static Relation copyRelation(Relation relation, Graph targetGraph, CopySt
 		if (targetGraph == null) throw new NullPointerException();
 		if (copyStrategy == null) copyStrategy = allCopyStrategy;
 
-		XDI3Segment relationContextNodeXri = relation.getContextNode().getXri();
-		ContextNode targetContextNode = targetGraph.setDeepContextNode(relationContextNodeXri);
+		XDIAddress relationcontextNodeAddress = relation.getContextNode().getAddress();
+		ContextNode targetContextNode = targetGraph.setDeepContextNode(relationcontextNodeAddress);
 
 		return copyRelation(relation, targetContextNode, copyStrategy);
 	}
@@ -165,45 +165,45 @@ public static Relation copyRelation(Relation relation, ContextNode targetContext
 
 		if ((relation = copyStrategy.replaceRelation(relation)) == null) return null;
 
-		XDI3Segment relationContextNodeXri = relation.getContextNode().getXri();
-		XDI3Segment relationArcXri = relation.getArcXri();
-		XDI3Segment relationTargetContextNodeXri = relation.getTargetContextNodeXri();
+		XDIAddress relationcontextNodeAddress = relation.getContextNode().getAddress();
+		XDIAddress relationAddress = relation.getArc();
+		XDIAddress relationtargetContextNodeAddress = relation.getTargetContextNodeAddress();
 
-		XDI3Segment targetContextNodeXri = targetContextNode.getXri();
+		XDIAddress targetContextNodeAddress = targetContextNode.getAddress();
 
-		XdiRoot relationContextNodeXdiRoot = XdiLocalRoot.findLocalRoot(relation.getContextNode().getGraph()).getRoot(relationContextNodeXri, false);
-		XdiRoot targetContextNodeXdiRoot = XdiLocalRoot.findLocalRoot(targetContextNode.getGraph()).getRoot(targetContextNodeXri, false);
+		XdiRoot relationContextNodeXdiRoot = XdiLocalRoot.findLocalRoot(relation.getContextNode().getGraph()).getRoot(relationcontextNodeAddress, false);
+		XdiRoot targetContextNodeXdiRoot = XdiLocalRoot.findLocalRoot(targetContextNode.getGraph()).getRoot(targetContextNodeAddress, false);
 
-		XDI3Segment relativeRelationContextNodeXri = relationContextNodeXdiRoot.absoluteToRelativeXri(relationContextNodeXri);
-		XDI3Segment relativeRelationTargetContextNodeXri = relationContextNodeXdiRoot.absoluteToRelativeXri(relationTargetContextNodeXri);
-		XDI3Segment relativeTargetContextNodeXri = targetContextNodeXdiRoot.absoluteToRelativeXri(targetContextNodeXri);
+		XDIAddress relativeRelationcontextNodeAddress = relationContextNodeXdiRoot.absoluteToRelativeXri(relationcontextNodeAddress);
+		XDIAddress relativeRelationtargetContextNodeAddress = relationContextNodeXdiRoot.absoluteToRelativeXri(relationtargetContextNodeAddress);
+		XDIAddress relativetargetContextNodeAddress = targetContextNodeXdiRoot.absoluteToRelativeXri(targetContextNodeAddress);
 
 		Relation targetRelation;
 
 		// check if this relation establishes an inner root
 
-		if (relativeRelationTargetContextNodeXri != null &&
-				relativeRelationTargetContextNodeXri.getNumSubSegments() == 1 &&
-				XdiInnerRoot.isInnerRootArcXri(relativeRelationTargetContextNodeXri.getFirstSubSegment()) &&
-				XdiInnerRoot.getSubjectOfInnerRootXri(relativeRelationTargetContextNodeXri.getFirstSubSegment()).equals(relativeRelationContextNodeXri) &&
-				XdiInnerRoot.getPredicateOfInnerRootXri(relativeRelationTargetContextNodeXri.getFirstSubSegment()).equals(relationArcXri)) {
+		if (relativeRelationtargetContextNodeAddress != null &&
+				relativeRelationtargetContextNodeAddress.getNumArcs() == 1 &&
+				XdiInnerRoot.isInnerRootarc(relativeRelationtargetContextNodeAddress.getFirstArc()) &&
+				XdiInnerRoot.getSubjectOfInnerRootXri(relativeRelationtargetContextNodeAddress.getFirstArc()).equals(relativeRelationcontextNodeAddress) &&
+				XdiInnerRoot.getPredicateOfInnerRootXri(relativeRelationtargetContextNodeAddress.getFirstArc()).equals(relationAddress)) {
 
 			// if the target context node is not the same, we need to adjust the inner root
 
-			if (! targetContextNodeXri.equals(relationContextNodeXri)) {
+			if (! targetContextNodeAddress.equals(relationcontextNodeAddress)) {
 
-				relativeRelationTargetContextNodeXri = XDI3Segment.fromComponent(XdiInnerRoot.createInnerRootArcXri(relativeTargetContextNodeXri, relationArcXri));
-				relationTargetContextNodeXri = targetContextNodeXdiRoot.relativeToAbsoluteXri(relativeRelationTargetContextNodeXri);
+				relativeRelationtargetContextNodeAddress = XDIAddress.fromComponent(XdiInnerRoot.createInnerRootarc(relativetargetContextNodeAddress, relationAddress));
+				relationtargetContextNodeAddress = targetContextNodeXdiRoot.relativeToAbsoluteXri(relativeRelationtargetContextNodeAddress);
 			}
 
-			targetRelation = targetContextNode.setRelation(relationArcXri, relationTargetContextNodeXri);
+			targetRelation = targetContextNode.setRelation(relationAddress, relationtargetContextNodeAddress);
 
 			// also need to copy the contents of the inner root
 
 			copyContextNodeContents(relation.follow(), targetRelation.follow(), copyStrategy);
 		} else {
 
-			targetRelation = targetContextNode.setRelation(relationArcXri, relationTargetContextNodeXri);
+			targetRelation = targetContextNode.setRelation(relationAddress, relationtargetContextNodeAddress);
 		}
 
 		return targetRelation;
@@ -249,8 +249,8 @@ public static Literal copyLiteral(Literal literal, Graph targetGraph, CopyStrate
 		if (targetGraph == null) throw new NullPointerException();
 		if (copyStrategy == null) copyStrategy = allCopyStrategy;
 
-		XDI3Segment literalContextNodeXri = literal.getContextNode().getXri();
-		ContextNode targetContextNode = targetGraph.setDeepContextNode(literalContextNodeXri);
+		XDIAddress literalcontextNodeAddress = literal.getContextNode().getAddress();
+		ContextNode targetContextNode = targetGraph.setDeepContextNode(literalcontextNodeAddress);
 
 		return copyLiteral(literal, targetContextNode, copyStrategy);
 	}

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2FCopyUtil.java
5c17ed7a1d48a20fb4408039d2bb90687ae4950f
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2FGraphUtil.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2FGraphUtil.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/util/GraphUtil.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
	public static XDIArc getOwnerPeerRootXri(Graph graph) {
		return xdiSelfPeerRoot.getArc();
	public static XDIAddress getOwnerXri(Graph graph) {
		XDIArc ownerPeerRootxri = getOwnerPeerRootXri(graph);
		return XdiPeerRoot.getAddressOfPeerRootArc(ownerPeerRootxri);
	public static void setOwnerPeerRootXri(Graph graph, XDIArc ownerPeerRootXri) {
		XDIAddress ownerXri = XdiPeerRoot.getAddressOfPeerRootArc(ownerPeerRootXri);
	public static void setOwnerXri(Graph graph, XDIAddress ownerXri) {
	 * @param contextNodeAddress The XRI of the context node.
	public static ContextNode contextNodeFromComponents(XDIAddress contextNodeAddress) {
		return graph.setDeepContextNode(contextNodeAddress);
	 * @param contextNodeAddress The relation XRI of the context node containing the relation.
	 * @param arc The arc of the relation.
	 * @param targetContextNodeAddress The target context node XRI of the relation.
	public static Relation relationFromComponents(XDIAddress contextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress) {
		return graph.setDeepContextNode(contextNodeAddress).setRelation(arc, targetContextNodeAddress);
	 * @param contextNodeAddress The XRI of the context node containing the literal.
	public static Literal literalFromComponents(XDIAddress contextNodeAddress, Object literalData) {
		return graph.setDeepContextNode(contextNodeAddress).setLiteral(literalData);

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
	public static XDI3SubSegment getOwnerPeerRootXri(Graph graph) {
		return xdiSelfPeerRoot.getArcXri();
	public static XDI3Segment getOwnerXri(Graph graph) {
		XDI3SubSegment ownerPeerRootxri = getOwnerPeerRootXri(graph);
		return XdiPeerRoot.getXriOfPeerRootArcXri(ownerPeerRootxri);
	public static void setOwnerPeerRootXri(Graph graph, XDI3SubSegment ownerPeerRootXri) {
		XDI3Segment ownerXri = XdiPeerRoot.getXriOfPeerRootArcXri(ownerPeerRootXri);
	public static void setOwnerXri(Graph graph, XDI3Segment ownerXri) {
	 * @param contextNodeXri The XRI of the context node.
	public static ContextNode contextNodeFromComponents(XDI3Segment contextNodeXri) {
		return graph.setDeepContextNode(contextNodeXri);
	 * @param contextNodeXri The relation XRI of the context node containing the relation.
	 * @param arcXri The arc XRI of the relation.
	 * @param targetContextNodeXri The target context node XRI of the relation.
	public static Relation relationFromComponents(XDI3Segment contextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
		return graph.setDeepContextNode(contextNodeXri).setRelation(arcXri, targetContextNodeXri);
	 * @param contextNodeXri The XRI of the context node containing the literal.
	public static Literal literalFromComponents(XDI3Segment contextNodeXri, Object literalData) {
		return graph.setDeepContextNode(contextNodeXri).setLiteral(literalData);

@@ -7,8 +7,8 @@
 import xdi2.core.features.nodetypes.XdiLocalRoot;
 import xdi2.core.features.nodetypes.XdiPeerRoot;
 import xdi2.core.impl.memory.MemoryGraphFactory;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 
 /**
  * Various utility methods for working with context nodes, relations and literals.
@@ -19,70 +19,70 @@ public final class GraphUtil {
 
 	private GraphUtil() { }
 
-	public static XDI3SubSegment getOwnerPeerRootXri(Graph graph) {
+	public static XDIArc getOwnerPeerRootXri(Graph graph) {
 
 		XdiPeerRoot xdiSelfPeerRoot = XdiLocalRoot.findLocalRoot(graph).getSelfPeerRoot();
 		if (xdiSelfPeerRoot == null) return null;
 
-		return xdiSelfPeerRoot.getArcXri();
+		return xdiSelfPeerRoot.getArc();
 	}
 
-	public static XDI3Segment getOwnerXri(Graph graph) {
+	public static XDIAddress getOwnerXri(Graph graph) {
 
-		XDI3SubSegment ownerPeerRootxri = getOwnerPeerRootXri(graph);
+		XDIArc ownerPeerRootxri = getOwnerPeerRootXri(graph);
 		if (ownerPeerRootxri == null) return null;
 
-		return XdiPeerRoot.getXriOfPeerRootArcXri(ownerPeerRootxri);
+		return XdiPeerRoot.getAddressOfPeerRootArc(ownerPeerRootxri);
 	}
 
-	public static void setOwnerPeerRootXri(Graph graph, XDI3SubSegment ownerPeerRootXri) {
+	public static void setOwnerPeerRootXri(Graph graph, XDIArc ownerPeerRootXri) {
 
-		XDI3Segment ownerXri = XdiPeerRoot.getXriOfPeerRootArcXri(ownerPeerRootXri);
+		XDIAddress ownerXri = XdiPeerRoot.getAddressOfPeerRootArc(ownerPeerRootXri);
 
 		setOwnerXri(graph, ownerXri);
 	}
 
-	public static void setOwnerXri(Graph graph, XDI3Segment ownerXri) {
+	public static void setOwnerXri(Graph graph, XDIAddress ownerXri) {
 
 		XdiLocalRoot.findLocalRoot(graph).setSelfPeerRoot(ownerXri);
 	}
 
 	/**
 	 * Creates a context node from its components.
-	 * @param contextNodeXri The XRI of the context node.
+	 * @param contextNodeAddress The XRI of the context node.
 	 * @return A context node.
 	 */
-	public static ContextNode contextNodeFromComponents(XDI3Segment contextNodeXri) {
+	public static ContextNode contextNodeFromComponents(XDIAddress contextNodeAddress) {
 
 		Graph graph = MemoryGraphFactory.getInstance().openGraph();
 
-		return graph.setDeepContextNode(contextNodeXri);
+		return graph.setDeepContextNode(contextNodeAddress);
 	}
 
 	/**
 	 * Creates a relation from its components.
-	 * @param contextNodeXri The relation XRI of the context node containing the relation.
-	 * @param arcXri The arc XRI of the relation.
-	 * @param targetContextNodeXri The target context node XRI of the relation.
+	 * @param contextNodeAddress The relation XRI of the context node containing the relation.
+	 * @param arc The arc of the relation.
+	 * @param targetContextNodeAddress The target context node XRI of the relation.
 	 * @return A relation.
 	 */
-	public static Relation relationFromComponents(XDI3Segment contextNodeXri, XDI3Segment arcXri, XDI3Segment targetContextNodeXri) {
+	public static Relation relationFromComponents(XDIAddress contextNodeAddress, XDIAddress arc, XDIAddress targetContextNodeAddress) {
 
 		Graph graph = MemoryGraphFactory.getInstance().openGraph();
 
-		return graph.setDeepContextNode(contextNodeXri).setRelation(arcXri, targetContextNodeXri);
+		return graph.setDeepContextNode(contextNodeAddress).setRelation(arc, targetContextNodeAddress);
 	}
 
 	/**
 	 * Creates a literal from its components.
-	 * @param contextNodeXri The XRI of the context node containing the literal.
+	 * @param contextNodeAddress The XRI of the context node containing the literal.
 	 * @param literalData The literal data of the literal.
 	 * @return A literal.
 	 */
-	public static Literal literalFromComponents(XDI3Segment contextNodeXri, Object literalData) {
+	public static Literal literalFromComponents(XDIAddress contextNodeAddress, Object literalData) {
 
 		Graph graph = MemoryGraphFactory.getInstance().openGraph();
 
-		return graph.setDeepContextNode(contextNodeXri).setLiteral(literalData);
+		return graph.setDeepContextNode(contextNodeAddress).setLiteral(literalData);
 	}
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2FGraphUtil.java
0864e14de4afec1f49887f0a2627c43c814dd27d
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2FStatementUtil.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2FStatementUtil.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/util/StatementUtil.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIStatement;
	 * Removes a start address from a statement.
	public static XDIStatement removeStartAddressStatement(final XDIStatement statement, final XDIAddress start, final boolean variablesInAddress, boolean variablesInStart) {
		if (statement == null) throw new NullPointerException();
		XDIStatement result = null;
			XDIAddress subject;
			XDIAddress predicate;
			subject = AddressUtil.removeStartAddress(statement.getSubject(), start, variablesInAddress, variablesInStart);
			predicate = statement.getPredicate();
			object = statement.getObject();
			{ result = XDIStatement.fromComponents(subject, predicate, object); return result; }
			if (log.isTraceEnabled()) log.trace("removeStartAddressStatement(" + statement + "," + start + "," + variablesInAddress + "," + variablesInStart + ") --> " + result);
	 * Removes a start address from a statement.
	public static XDIStatement removeStartAddressStatement(final XDIStatement statement, final XDIAddress start) {
		return removeStartAddressStatement(statement, start, false, false);
	 * Concats an address and a statement into a new statement.
	public static XDIStatement concatAddressStatement(final XDIAddress address, final XDIStatement statement) {
		if (statement == null) throw new NullPointerException();
		XDIStatement result = null;
			XDIAddress subject;
			XDIAddress predicate;
			subject = AddressUtil.concatAddresses(address, statement.getSubject());
			predicate = statement.getPredicate();
			object = statement.getObject();
			{ result = XDIStatement.fromComponents(subject, predicate, object); return result; }
			if (log.isTraceEnabled()) log.trace("concatAddressStatement(" + address + "," + statement + ") --> " + result);

final XDIStatement statement  final XDIAddress start  final boolean variablesInAddress  boolean variablesInStart
core/src/main/java/xdi2/core/util/StatementUtil.java
if (statement == null) throw new NullPointerException();
		XDIStatement result = null;
			XDIAddress subject;
			XDIAddress predicate;
			subject = AddressUtil.removeStartAddress(statement.getSubject(), start, variablesInAddress, variablesInStart);
			predicate = statement.getPredicate();
			object = statement.getObject();
			{ result = XDIStatement.fromComponents(subject, predicate, object); return result;
XDIStatement removeStartAddressStatement(final XDIStatement statement, final XDIAddress start, final boolean variablesInAddress, boolean variablesInStart)
final XDIStatement statement  final XDIAddress start
core/src/main/java/xdi2/core/util/StatementUtil.java
return removeStartAddressStatement(statement, start, false, false);
	 * Concats an address and a statement into a new statement.
	public static XDIStatement concatAddressStatement(final XDIAddress address, final XDIStatement statement) {
		if (statement == null) throw new NullPointerException();
		XDIStatement result = null;
			XDIAddress subject;
			XDIAddress predicate;
			subject = AddressUtil.concatAddresses(address, statement.getSubject());
			predicate = statement.getPredicate();
			object = statement.getObject();
			{ result = XDIStatement.fromComponents(subject, predicate, object); return result;
XDIStatement removeStartAddressStatement(final XDIStatement statement, final XDIAddress start)
import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3Statement;
	 * Removes a start XRI from a statement.
	public static XDI3Statement removeStartXriStatement(final XDI3Statement statementXri, final XDI3Segment start, final boolean variablesInXri, boolean variablesInStart) {
		if (statementXri == null) throw new NullPointerException();
		XDI3Statement result = null;
			XDI3Segment subject;
			XDI3Segment predicate;
			subject = XDI3Util.removeStartXri(statementXri.getSubject(), start, variablesInXri, variablesInStart);
			predicate = statementXri.getPredicate();
			object = statementXri.getObject();
			{ result = XDI3Statement.fromComponents(subject, predicate, object); return result; }
			if (log.isTraceEnabled()) log.trace("removeStartXriStatement(" + statementXri + "," + start + "," + variablesInXri + "," + variablesInStart + ") --> " + result);
	 * Removes a start XRI from a statement.
	public static XDI3Statement removeStartXriStatement(final XDI3Statement statementXri, final XDI3Segment start) {
		return removeStartXriStatement(statementXri, start, false, false);
	 * Concats an XRI and a statement into a new statement.
	public static XDI3Statement concatXriStatement(final XDI3Segment xri, final XDI3Statement statementXri) {
		if (statementXri == null) throw new NullPointerException();
		XDI3Statement result = null;
			XDI3Segment subject;
			XDI3Segment predicate;
			subject = XDI3Util.concatXris(xri, statementXri.getSubject());
			predicate = statementXri.getPredicate();
			object = statementXri.getObject();
			{ result = XDI3Statement.fromComponents(subject, predicate, object); return result; }
			if (log.isTraceEnabled()) log.trace("concatXriStatement(" + xri + "," + statementXri + ") --> " + result);

final XDI3Statement statementXri  final XDI3Segment start  final boolean variablesInXri  boolean variablesInStart
core/src/main/java/xdi2/core/util/StatementUtil.java
if (statementXri == null) throw new NullPointerException();
		XDI3Statement result = null;
			XDI3Segment subject;
			XDI3Segment predicate;
			subject = XDI3Util.removeStartXri(statementXri.getSubject(), start, variablesInXri, variablesInStart);
			predicate = statementXri.getPredicate();
			object = statementXri.getObject();
			{ result = XDI3Statement.fromComponents(subject, predicate, object); return result;
XDI3Statement removeStartXriStatement(final XDI3Statement statementXri, final XDI3Segment start, final boolean variablesInXri, boolean variablesInStart)
final XDI3Statement statementXri  final XDI3Segment start
core/src/main/java/xdi2/core/util/StatementUtil.java
return removeStartXriStatement(statementXri, start, false, false);
	 * Concats an XRI and a statement into a new statement.
	public static XDI3Statement concatXriStatement(final XDI3Segment xri, final XDI3Statement statementXri) {
		if (statementXri == null) throw new NullPointerException();
		XDI3Statement result = null;
			XDI3Segment subject;
			XDI3Segment predicate;
			subject = XDI3Util.concatXris(xri, statementXri.getSubject());
			predicate = statementXri.getPredicate();
			object = statementXri.getObject();
			{ result = XDI3Statement.fromComponents(subject, predicate, object); return result;
XDI3Statement removeStartXriStatement(final XDI3Statement statementXri, final XDI3Segment start)
@@ -3,8 +3,8 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3Statement;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIStatement;
 
 /**
  * Various utility methods for working with statements.
@@ -18,83 +18,83 @@ public final class StatementUtil {
 	private StatementUtil() { }
 
 	/**
-	 * Removes a start XRI from a statement.
+	 * Removes a start address from a statement.
 	 * E.g. for =a*b*c*d&/&/... and =a*b, this returns *c*d&/&/...
 	 */
-	public static XDI3Statement removeStartXriStatement(final XDI3Statement statementXri, final XDI3Segment start, final boolean variablesInXri, boolean variablesInStart) {
+	public static XDIStatement removeStartAddressStatement(final XDIStatement statement, final XDIAddress start, final boolean variablesInAddress, boolean variablesInStart) {
 
-		if (statementXri == null) throw new NullPointerException();
+		if (statement == null) throw new NullPointerException();
 		if (start == null) throw new NullPointerException();
 
-		XDI3Statement result = null;
+		XDIStatement result = null;
 
 		try {
 
-			XDI3Segment subject;
-			XDI3Segment predicate;
+			XDIAddress subject;
+			XDIAddress predicate;
 			Object object;
 
 			// subject
 
-			subject = XDI3Util.removeStartXri(statementXri.getSubject(), start, variablesInXri, variablesInStart);
+			subject = AddressUtil.removeStartAddress(statement.getSubject(), start, variablesInAddress, variablesInStart);
 			if (subject == null) { result = null; return result; }
 
 			// predicate
 
-			predicate = statementXri.getPredicate();
+			predicate = statement.getPredicate();
 
 			// object
 
-			object = statementXri.getObject();
+			object = statement.getObject();
 
-			{ result = XDI3Statement.fromComponents(subject, predicate, object); return result; }
+			{ result = XDIStatement.fromComponents(subject, predicate, object); return result; }
 		} finally {
 
-			if (log.isTraceEnabled()) log.trace("removeStartXriStatement(" + statementXri + "," + start + "," + variablesInXri + "," + variablesInStart + ") --> " + result);
+			if (log.isTraceEnabled()) log.trace("removeStartAddressStatement(" + statement + "," + start + "," + variablesInAddress + "," + variablesInStart + ") --> " + result);
 		}
 	}
 
 	/**
-	 * Removes a start XRI from a statement.
+	 * Removes a start address from a statement.
 	 * E.g. for =a*b*c*d&/&/... and =a*b, this returns *c*d&/&/...
 	 */
-	public static XDI3Statement removeStartXriStatement(final XDI3Statement statementXri, final XDI3Segment start) {
+	public static XDIStatement removeStartAddressStatement(final XDIStatement statement, final XDIAddress start) {
 
-		return removeStartXriStatement(statementXri, start, false, false);
+		return removeStartAddressStatement(statement, start, false, false);
 	}
 
 	/**
-	 * Concats an XRI and a statement into a new statement.
+	 * Concats an address and a statement into a new statement.
 	 * E.g. for *c*d&/&/... and =a*b, this returns =a*b*c*d&/&/...
 	 */
-	public static XDI3Statement concatXriStatement(final XDI3Segment xri, final XDI3Statement statementXri) {
+	public static XDIStatement concatAddressStatement(final XDIAddress address, final XDIStatement statement) {
 
-		if (statementXri == null) throw new NullPointerException();
+		if (statement == null) throw new NullPointerException();
 
-		XDI3Statement result = null;
+		XDIStatement result = null;
 
 		try {
 
-			XDI3Segment subject;
-			XDI3Segment predicate;
+			XDIAddress subject;
+			XDIAddress predicate;
 			Object object;
 
 			// subject
 
-			subject = XDI3Util.concatXris(xri, statementXri.getSubject());
+			subject = AddressUtil.concatAddresses(address, statement.getSubject());
 
 			// predicate
 
-			predicate = statementXri.getPredicate();
+			predicate = statement.getPredicate();
 
 			// object
 
-			object = statementXri.getObject();
+			object = statement.getObject();
 
-			{ result = XDI3Statement.fromComponents(subject, predicate, object); return result; }
+			{ result = XDIStatement.fromComponents(subject, predicate, object); return result; }
 		} finally {
 
-			if (log.isTraceEnabled()) log.trace("concatXriStatement(" + xri + "," + statementXri + ") --> " + result);
+			if (log.isTraceEnabled()) log.trace("concatAddressStatement(" + address + "," + statement + ") --> " + result);
 		}
 	}
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2FStatementUtil.java
6a300ed807704e8a8ef545e424af30a5a96b3408
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2FVariableUtil.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2FVariableUtil.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/util/VariableUtil.java
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
import xdi2.core.syntax.XDIXRef;
	public static boolean isVariable(XDIArc variable) {
				( variable.getXRef().isEmpty() || variable.getXRef().hasAddress() || variable.getXRef().hasLiteral() );
	public static boolean isVariable(XDIAddress variable) {
		if (variable.getNumArcs() != 1) return false;
		return isVariable(variable.getFirstArc());
	public static List<XDIArc> getSubSegments(XDIArc variable) {
		if (! isVariable(variable)) return new ArrayList<XDIArc> ();
		if (! variable.getXRef().hasAddress()) return new ArrayList<XDIArc> ();
		XDIAddress segment = variable.getXRef().getAddress();
		while (segment.getFirstArc().hasXRef()) {
			segment = segment.getFirstArc().getXRef().getAddress();
			if (segment == null) return new ArrayList<XDIArc> ();
		return segment.getArcs();
	public static String getXs(XDIArc variable) {
		if (! variable.getXRef().hasAddress()) return null;
		XDIXRef xref = variable.getXRef().getAddress().getFirstArc().getXRef();
			if (! xref.hasAddress()) return null;
			xref = xref.getAddress().getFirstArc().getXRef();
	public static boolean isMultiple(XDIArc variable) {
		if (! variable.getXRef().hasAddress()) return false;
		if (! variable.getXRef().getAddress().getFirstArc().hasXRef()) return false;
		if (! XDIConstants.XS_VARIABLE.equals(variable.getXRef().getAddress().getFirstArc().getXRef().getXs())) return false;
	public static boolean matches(XDIArc variable, XDIArc subSegment) {
		List<XDIArc> variableSubSegments = getSubSegments(variable);
			if (! subSegment.getXRef().hasAddress()) {
			subSegment = subSegment.getXRef().getAddress().getFirstArc();
		for (XDIArc variableSubSegment : variableSubSegments) {

import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
import xdi2.core.xri3.XDI3XRef;
	public static boolean isVariable(XDI3SubSegment variable) {
				( variable.getXRef().isEmpty() || variable.getXRef().hasSegment() || variable.getXRef().hasLiteral() );
	public static boolean isVariable(XDI3Segment variable) {
		if (variable.getNumSubSegments() != 1) return false;
		return isVariable(variable.getFirstSubSegment());
	public static List<XDI3SubSegment> getSubSegments(XDI3SubSegment variable) {
		if (! isVariable(variable)) return new ArrayList<XDI3SubSegment> ();
		if (! variable.getXRef().hasSegment()) return new ArrayList<XDI3SubSegment> ();
		XDI3Segment segment = variable.getXRef().getSegment();
		while (segment.getFirstSubSegment().hasXRef()) {
			segment = segment.getFirstSubSegment().getXRef().getSegment();
			if (segment == null) return new ArrayList<XDI3SubSegment> ();
		return segment.getSubSegments();
	public static String getXs(XDI3SubSegment variable) {
		if (! variable.getXRef().hasSegment()) return null;
		XDI3XRef xref = variable.getXRef().getSegment().getFirstSubSegment().getXRef();
			if (! xref.hasSegment()) return null;
			xref = xref.getSegment().getFirstSubSegment().getXRef();
	public static boolean isMultiple(XDI3SubSegment variable) {
		if (! variable.getXRef().hasSegment()) return false;
		if (! variable.getXRef().getSegment().getFirstSubSegment().hasXRef()) return false;
		if (! XDIConstants.XS_VARIABLE.equals(variable.getXRef().getSegment().getFirstSubSegment().getXRef().getXs())) return false;
	public static boolean matches(XDI3SubSegment variable, XDI3SubSegment subSegment) {
		List<XDI3SubSegment> variableSubSegments = getSubSegments(variable);
			if (! subSegment.getXRef().hasSegment()) {
			subSegment = subSegment.getXRef().getSegment().getFirstSubSegment();
		for (XDI3SubSegment variableSubSegment : variableSubSegments) {

@@ -7,9 +7,9 @@
 import org.slf4j.LoggerFactory;
 
 import xdi2.core.constants.XDIConstants;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
-import xdi2.core.xri3.XDI3XRef;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
+import xdi2.core.syntax.XDIXRef;
 
 /**
  * Utility methods for working with variables.
@@ -27,49 +27,49 @@ private VariableUtil() { }
 	 * @param variable The subsegment to check.
 	 * @return True if the subsegment is a valid XDI variable.
 	 */
-	public static boolean isVariable(XDI3SubSegment variable) {
+	public static boolean isVariable(XDIArc variable) {
 
 		return variable.hasXRef() &&
 				XDIConstants.XS_VARIABLE.equals(variable.getXRef().getXs()) &&
-				( variable.getXRef().isEmpty() || variable.getXRef().hasSegment() || variable.getXRef().hasLiteral() );
+				( variable.getXRef().isEmpty() || variable.getXRef().hasAddress() || variable.getXRef().hasLiteral() );
 	}
 
-	public static boolean isVariable(XDI3Segment variable) {
+	public static boolean isVariable(XDIAddress variable) {
 
-		if (variable.getNumSubSegments() != 1) return false;
+		if (variable.getNumArcs() != 1) return false;
 
-		return isVariable(variable.getFirstSubSegment());
+		return isVariable(variable.getFirstArc());
 	}
 
-	public static List<XDI3SubSegment> getSubSegments(XDI3SubSegment variable) {
+	public static List<XDIArc> getSubSegments(XDIArc variable) {
 
-		if (! isVariable(variable)) return new ArrayList<XDI3SubSegment> ();
-		if (! variable.getXRef().hasSegment()) return new ArrayList<XDI3SubSegment> ();
+		if (! isVariable(variable)) return new ArrayList<XDIArc> ();
+		if (! variable.getXRef().hasAddress()) return new ArrayList<XDIArc> ();
 
-		XDI3Segment segment = variable.getXRef().getSegment();
+		XDIAddress segment = variable.getXRef().getAddress();
 
-		while (segment.getFirstSubSegment().hasXRef()) {
+		while (segment.getFirstArc().hasXRef()) {
 
-			segment = segment.getFirstSubSegment().getXRef().getSegment();
-			if (segment == null) return new ArrayList<XDI3SubSegment> ();
+			segment = segment.getFirstArc().getXRef().getAddress();
+			if (segment == null) return new ArrayList<XDIArc> ();
 		}
 
-		return segment.getSubSegments();
+		return segment.getArcs();
 	}
 
-	public static String getXs(XDI3SubSegment variable) {
+	public static String getXs(XDIArc variable) {
 
 		if (! isVariable(variable)) return null;
-		if (! variable.getXRef().hasSegment()) return null;
+		if (! variable.getXRef().hasAddress()) return null;
 
-		XDI3XRef xref = variable.getXRef().getSegment().getFirstSubSegment().getXRef();
+		XDIXRef xref = variable.getXRef().getAddress().getFirstArc().getXRef();
 		if (xref == null) return null;
 
 		if (XDIConstants.XS_VARIABLE.equals(xref.getXs())) {
 
-			if (! xref.hasSegment()) return null;
+			if (! xref.hasAddress()) return null;
 
-			xref = xref.getSegment().getFirstSubSegment().getXRef();
+			xref = xref.getAddress().getFirstArc().getXRef();
 			if (xref == null) return null;
 		}
 
@@ -81,13 +81,13 @@ public static String getXs(XDI3SubSegment variable) {
 	 * @param variable The variable.
 	 * @return True, if the variable matches multiple subsegments.
 	 */
-	public static boolean isMultiple(XDI3SubSegment variable) {
+	public static boolean isMultiple(XDIArc variable) {
 
 		if (! isVariable(variable)) return false;
-		if (! variable.getXRef().hasSegment()) return false;
+		if (! variable.getXRef().hasAddress()) return false;
 
-		if (! variable.getXRef().getSegment().getFirstSubSegment().hasXRef()) return false;
-		if (! XDIConstants.XS_VARIABLE.equals(variable.getXRef().getSegment().getFirstSubSegment().getXRef().getXs())) return false;
+		if (! variable.getXRef().getAddress().getFirstArc().hasXRef()) return false;
+		if (! XDIConstants.XS_VARIABLE.equals(variable.getXRef().getAddress().getFirstArc().getXRef().getXs())) return false;
 
 		return true;
 	}
@@ -98,9 +98,9 @@ public static boolean isMultiple(XDI3SubSegment variable) {
 	 * @param subSegment The subsegment to match the variable against.
 	 * @return True, if the variable matches the subsegment.
 	 */
-	public static boolean matches(XDI3SubSegment variable, XDI3SubSegment subSegment) {
+	public static boolean matches(XDIArc variable, XDIArc subSegment) {
 
-		List<XDI3SubSegment> variableSubSegments = getSubSegments(variable);
+		List<XDIArc> variableSubSegments = getSubSegments(variable);
 		String variableXs = getXs(variable);
 
 		if (log.isTraceEnabled()) log.trace("Matching variable " + variable + " against subsegment " + subSegment + " (variableSubSegments=" + variableSubSegments + ", variableXs=" + variableXs + ")");
@@ -128,13 +128,13 @@ public static boolean matches(XDI3SubSegment variable, XDI3SubSegment subSegment
 				return false;
 			}
 
-			if (! subSegment.getXRef().hasSegment()) {
+			if (! subSegment.getXRef().hasAddress()) {
 
 				if (log.isTraceEnabled()) log.trace("Subsegment has no inner subsegment. No match.");
 				return false;
 			}
 
-			subSegment = subSegment.getXRef().getSegment().getFirstSubSegment();
+			subSegment = subSegment.getXRef().getAddress().getFirstArc();
 		}
 
 		if (variableSubSegments.size() == 0) {
@@ -149,7 +149,7 @@ public static boolean matches(XDI3SubSegment variable, XDI3SubSegment subSegment
 			return false;
 		}
 
-		for (XDI3SubSegment variableSubSegment : variableSubSegments) {
+		for (XDIArc variableSubSegment : variableSubSegments) {
 
 			if (log.isTraceEnabled()) log.trace("Trying to match variable subsegment " + variableSubSegment + ".");
 

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2FVariableUtil.java
cb81021deefc4408d54b028e7bb7850dc2ca1b0a
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2FXRI2Util.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2FXRI2Util.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/util/XRI2Util.java
import xdi2.core.syntax.CloudNumber;
import xdi2.core.syntax.XDIAddress;
import xdi2.core.syntax.XDIArc;
		XDIAddress xri = cloudNumber.getAddress();
		if (xri.getNumArcs() != 2) return null;
		if (! xri.getFirstArc().isClassXs()) return null;
		if (xri.getFirstArc().hasLiteral()) return null;
		if (xri.getFirstArc().hasXRef()) return null;
		char cs = xri.getFirstArc().getCs().charValue();
		if (! XDIConstants.CS_MEMBER_UNORDERED.equals(xri.getLastArc().getCs())) return null;
		if (! xri.getLastArc().hasLiteral()) return null;
		if (xri.getLastArc().hasXRef()) return null;
		if (! xri.getLastArc().getLiteral().startsWith(":uuid")) return null;
		if (xri.getLastArc().getLiteral().length() != 42) return null;
		parts[0] = xri.getLastArc().getLiteral().substring(6, 10);
		parts[1] = xri.getLastArc().getLiteral().substring(10, 14);
		parts[2] = xri.getLastArc().getLiteral().substring(15, 19);
		parts[3] = xri.getLastArc().getLiteral().substring(20, 24);
		if (! parts[0].equals(xri.getLastArc().getLiteral().substring(25, 29))) return null;
		if (! parts[1].equals(xri.getLastArc().getLiteral().substring(30, 34))) return null;
		if (! parts[2].equals(xri.getLastArc().getLiteral().substring(34, 38))) return null;
		if (! parts[3].equals(xri.getLastArc().getLiteral().substring(38, 42))) return null;
	 * Maps an XRI 2.0 service type to an XDI arc.
	public static XDIArc typeToXdiarc(String type) {
		if (log.isTraceEnabled()) log.trace("typeToXdiarc(" + type + ")");
		XDIArc xdiarc = null;
		try { xdiarc = XDIArc.create(type); } catch (Exception ex) { xdiarc = null; }
		if (xdiarc == null) try { xdiarc = XDIArc.create("#(" + type + ")"); } catch (Exception ex) { xdiarc = null; }
		if (xdiarc == null) try { xdiarc = XDIArc.create("#(" + URLEncoder.encode(type, "UTF-8") + ")"); } catch (Exception ex) { xdiarc = null; }
		if (xdiarc == null) return null;
		if (! XdiAttributeSingleton.isValidarc(xdiarc)) xdiarc = XdiAttributeSingleton.createarc(xdiarc);
		return xdiarc;

String type
core/src/main/java/xdi2/core/util/XRI2Util.java
if (log.isTraceEnabled()) log.trace("typeToXdiarc(" + type + ")");
		XDIArc xdiarc = null;
		try { xdiarc = XDIArc.create(type);
XDIArc typeToXdiarc(String type)
import xdi2.core.xri3.CloudNumber;
import xdi2.core.xri3.XDI3Segment;
import xdi2.core.xri3.XDI3SubSegment;
		XDI3Segment xri = cloudNumber.getXri();
		if (xri.getNumSubSegments() != 2) return null;
		if (! xri.getFirstSubSegment().isClassXs()) return null;
		if (xri.getFirstSubSegment().hasLiteral()) return null;
		if (xri.getFirstSubSegment().hasXRef()) return null;
		char cs = xri.getFirstSubSegment().getCs().charValue();
		if (! XDIConstants.CS_MEMBER_UNORDERED.equals(xri.getLastSubSegment().getCs())) return null;
		if (! xri.getLastSubSegment().hasLiteral()) return null;
		if (xri.getLastSubSegment().hasXRef()) return null;
		if (! xri.getLastSubSegment().getLiteral().startsWith(":uuid")) return null;
		if (xri.getLastSubSegment().getLiteral().length() != 42) return null;
		parts[0] = xri.getLastSubSegment().getLiteral().substring(6, 10);
		parts[1] = xri.getLastSubSegment().getLiteral().substring(10, 14);
		parts[2] = xri.getLastSubSegment().getLiteral().substring(15, 19);
		parts[3] = xri.getLastSubSegment().getLiteral().substring(20, 24);
		if (! parts[0].equals(xri.getLastSubSegment().getLiteral().substring(25, 29))) return null;
		if (! parts[1].equals(xri.getLastSubSegment().getLiteral().substring(30, 34))) return null;
		if (! parts[2].equals(xri.getLastSubSegment().getLiteral().substring(34, 38))) return null;
		if (! parts[3].equals(xri.getLastSubSegment().getLiteral().substring(38, 42))) return null;
	 * Maps an XRI 2.0 service type to an XDI arc XRI.
	public static XDI3SubSegment typeToXdiArcXri(String type) {
		if (log.isTraceEnabled()) log.trace("typeToXdiArcXri(" + type + ")");
		XDI3SubSegment xdiArcXri = null;
		try { xdiArcXri = XDI3SubSegment.create(type); } catch (Exception ex) { xdiArcXri = null; }
		if (xdiArcXri == null) try { xdiArcXri = XDI3SubSegment.create("#(" + type + ")"); } catch (Exception ex) { xdiArcXri = null; }
		if (xdiArcXri == null) try { xdiArcXri = XDI3SubSegment.create("#(" + URLEncoder.encode(type, "UTF-8") + ")"); } catch (Exception ex) { xdiArcXri = null; }
		if (xdiArcXri == null) return null;
		if (! XdiAttributeSingleton.isValidArcXri(xdiArcXri)) xdiArcXri = XdiAttributeSingleton.createArcXri(xdiArcXri);
		return xdiArcXri;

String type
core/src/main/java/xdi2/core/util/XRI2Util.java
if (log.isTraceEnabled()) log.trace("typeToXdiArcXri(" + type + ")");
		XDI3SubSegment xdiArcXri = null;
		try { xdiArcXri = XDI3SubSegment.create(type);
XDI3SubSegment typeToXdiArcXri(String type)
@@ -7,9 +7,9 @@
 
 import xdi2.core.constants.XDIConstants;
 import xdi2.core.features.nodetypes.XdiAttributeSingleton;
-import xdi2.core.xri3.CloudNumber;
-import xdi2.core.xri3.XDI3Segment;
-import xdi2.core.xri3.XDI3SubSegment;
+import xdi2.core.syntax.CloudNumber;
+import xdi2.core.syntax.XDIAddress;
+import xdi2.core.syntax.XDIArc;
 
 /**
  * Various utility methods for working with XRI 2.0 syntax.
@@ -71,32 +71,32 @@ public static String cloudNumberToINumber(CloudNumber cloudNumber) {
 
 		if (log.isTraceEnabled()) log.trace("cloudNumberToINumber(" + cloudNumber + ")");
 
-		XDI3Segment xri = cloudNumber.getXri();
+		XDIAddress xri = cloudNumber.getAddress();
 
-		if (xri.getNumSubSegments() != 2) return null;
+		if (xri.getNumArcs() != 2) return null;
 
-		if (! xri.getFirstSubSegment().isClassXs()) return null;
-		if (xri.getFirstSubSegment().hasLiteral()) return null;
-		if (xri.getFirstSubSegment().hasXRef()) return null;
+		if (! xri.getFirstArc().isClassXs()) return null;
+		if (xri.getFirstArc().hasLiteral()) return null;
+		if (xri.getFirstArc().hasXRef()) return null;
 
-		char cs = xri.getFirstSubSegment().getCs().charValue();
+		char cs = xri.getFirstArc().getCs().charValue();
 
-		if (! XDIConstants.CS_MEMBER_UNORDERED.equals(xri.getLastSubSegment().getCs())) return null;
-		if (! xri.getLastSubSegment().hasLiteral()) return null;
-		if (xri.getLastSubSegment().hasXRef()) return null;
-		if (! xri.getLastSubSegment().getLiteral().startsWith(":uuid")) return null;
-		if (xri.getLastSubSegment().getLiteral().length() != 42) return null;
+		if (! XDIConstants.CS_MEMBER_UNORDERED.equals(xri.getLastArc().getCs())) return null;
+		if (! xri.getLastArc().hasLiteral()) return null;
+		if (xri.getLastArc().hasXRef()) return null;
+		if (! xri.getLastArc().getLiteral().startsWith(":uuid")) return null;
+		if (xri.getLastArc().getLiteral().length() != 42) return null;
 
 		String[] parts = new String[4];
-		parts[0] = xri.getLastSubSegment().getLiteral().substring(6, 10);
-		parts[1] = xri.getLastSubSegment().getLiteral().substring(10, 14);
-		parts[2] = xri.getLastSubSegment().getLiteral().substring(15, 19);
-		parts[3] = xri.getLastSubSegment().getLiteral().substring(20, 24);
+		parts[0] = xri.getLastArc().getLiteral().substring(6, 10);
+		parts[1] = xri.getLastArc().getLiteral().substring(10, 14);
+		parts[2] = xri.getLastArc().getLiteral().substring(15, 19);
+		parts[3] = xri.getLastArc().getLiteral().substring(20, 24);
 
-		if (! parts[0].equals(xri.getLastSubSegment().getLiteral().substring(25, 29))) return null;
-		if (! parts[1].equals(xri.getLastSubSegment().getLiteral().substring(30, 34))) return null;
-		if (! parts[2].equals(xri.getLastSubSegment().getLiteral().substring(34, 38))) return null;
-		if (! parts[3].equals(xri.getLastSubSegment().getLiteral().substring(38, 42))) return null;
+		if (! parts[0].equals(xri.getLastArc().getLiteral().substring(25, 29))) return null;
+		if (! parts[1].equals(xri.getLastArc().getLiteral().substring(30, 34))) return null;
+		if (! parts[2].equals(xri.getLastArc().getLiteral().substring(34, 38))) return null;
+		if (! parts[3].equals(xri.getLastArc().getLiteral().substring(38, 42))) return null;
 
 		for (int i=0; i<parts.length; i++) {
 
@@ -121,25 +121,25 @@ public static String cloudNumberToINumber(CloudNumber cloudNumber) {
 	}
 
 	/**
-	 * Maps an XRI 2.0 service type to an XDI arc XRI.
+	 * Maps an XRI 2.0 service type to an XDI arc.
 	 */
-	public static XDI3SubSegment typeToXdiArcXri(String type) {
+	public static XDIArc typeToXdiarc(String type) {
 
-		if (log.isTraceEnabled()) log.trace("typeToXdiArcXri(" + type + ")");
+		if (log.isTraceEnabled()) log.trace("typeToXdiarc(" + type + ")");
 
 		if (type.startsWith("xri://")) type = type.substring(6);
 		type = type.replace('+' , '#');
 
-		XDI3SubSegment xdiArcXri = null;
+		XDIArc xdiarc = null;
 
-		try { xdiArcXri = XDI3SubSegment.create(type); } catch (Exception ex) { xdiArcXri = null; }
-		if (xdiArcXri == null) try { xdiArcXri = XDI3SubSegment.create("#(" + type + ")"); } catch (Exception ex) { xdiArcXri = null; }
-		if (xdiArcXri == null) try { xdiArcXri = XDI3SubSegment.create("#(" + URLEncoder.encode(type, "UTF-8") + ")"); } catch (Exception ex) { xdiArcXri = null; }
+		try { xdiarc = XDIArc.create(type); } catch (Exception ex) { xdiarc = null; }
+		if (xdiarc == null) try { xdiarc = XDIArc.create("#(" + type + ")"); } catch (Exception ex) { xdiarc = null; }
+		if (xdiarc == null) try { xdiarc = XDIArc.create("#(" + URLEncoder.encode(type, "UTF-8") + ")"); } catch (Exception ex) { xdiarc = null; }
 
-		if (xdiArcXri == null) return null;
+		if (xdiarc == null) return null;
 
-		if (! XdiAttributeSingleton.isValidArcXri(xdiArcXri)) xdiArcXri = XdiAttributeSingleton.createArcXri(xdiArcXri);
+		if (! XdiAttributeSingleton.isValidarc(xdiarc)) xdiarc = XdiAttributeSingleton.createarc(xdiarc);
 
-		return xdiArcXri;
+		return xdiarc;
 	}
 }

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2FXRI2Util.java
e86cb41a075d4f04ef1ddc25ecd3679beaf102da
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2Fiterators%2FMappingCloudNameIterator.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2Fiterators%2FMappingCloudNameIterator.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/util/iterators/MappingCloudNameIterator.java
import xdi2.core.syntax.CloudName;
import xdi2.core.syntax.XDIAddress;
public class MappingCloudNameIterator extends MappingIterator<XDIAddress, CloudName> {
	public MappingCloudNameIterator(Iterator<XDIAddress> xris) {
	public CloudName map(XDIAddress xri) {
		CloudName cloudName = CloudName.fromAddress(xri);
		if (cloudName == null) cloudName = CloudName.fromPeerRootArc(xri);

import xdi2.core.xri3.CloudName;
import xdi2.core.xri3.XDI3Segment;
public class MappingCloudNameIterator extends MappingIterator<XDI3Segment, CloudName> {
	public MappingCloudNameIterator(Iterator<XDI3Segment> xris) {
	public CloudName map(XDI3Segment xri) {
		CloudName cloudName = CloudName.fromXri(xri);
		if (cloudName == null) cloudName = CloudName.fromPeerRootXri(xri);

@@ -2,26 +2,26 @@
 
 import java.util.Iterator;
 
-import xdi2.core.xri3.CloudName;
-import xdi2.core.xri3.XDI3Segment;
+import xdi2.core.syntax.CloudName;
+import xdi2.core.syntax.XDIAddress;
 
 /**
  * A MappingIterator that maps XDI segments to Cloud Names.
  * 
  * @author markus
  */
-public class MappingCloudNameIterator extends MappingIterator<XDI3Segment, CloudName> {
+public class MappingCloudNameIterator extends MappingIterator<XDIAddress, CloudName> {
 
-	public MappingCloudNameIterator(Iterator<XDI3Segment> xris) {
+	public MappingCloudNameIterator(Iterator<XDIAddress> xris) {
 
 		super(xris);
 	}
 
 	@Override
-	public CloudName map(XDI3Segment xri) {
+	public CloudName map(XDIAddress xri) {
 
-		CloudName cloudName = CloudName.fromXri(xri);
-		if (cloudName == null) cloudName = CloudName.fromPeerRootXri(xri);
+		CloudName cloudName = CloudName.fromAddress(xri);
+		if (cloudName == null) cloudName = CloudName.fromPeerRootArc(xri);
 		if (cloudName == null) return null;
 		
 		return cloudName;

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2Fiterators%2FMappingCloudNameIterator.java
a24be8096f9d3c37cfb2ac58110e3993a94d7155
modified
https://github.com/projectdanube/xdi2/blob/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2Fiterators%2FMappingCloudNumberIterator.java
https://api.github.com/repos/projectdanube/xdi2/contents/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2Fiterators%2FMappingCloudNumberIterator.java?ref=0ca7982fec30c2bb8204efbbea61428a643d2e9c
core/src/main/java/xdi2/core/util/iterators/MappingCloudNumberIterator.java
import xdi2.core.syntax.CloudNumber;
import xdi2.core.syntax.XDIAddress;
public class MappingCloudNumberIterator extends MappingIterator<XDIAddress, CloudNumber> {
	public MappingCloudNumberIterator(Iterator<XDIAddress> xris) {
	public CloudNumber map(XDIAddress xri) {
		CloudNumber cloudNumber = CloudNumber.fromAddress(xri);
		if (cloudNumber == null) cloudNumber = CloudNumber.fromPeerRootArc(xri);

import xdi2.core.xri3.CloudNumber;
import xdi2.core.xri3.XDI3Segment;
public class MappingCloudNumberIterator extends MappingIterator<XDI3Segment, CloudNumber> {
	public MappingCloudNumberIterator(Iterator<XDI3Segment> xris) {
	public CloudNumber map(XDI3Segment xri) {
		CloudNumber cloudNumber = CloudNumber.fromXri(xri);
		if (cloudNumber == null) cloudNumber = CloudNumber.fromPeerRootXri(xri);

@@ -2,26 +2,26 @@
 
 import java.util.Iterator;
 
-import xdi2.core.xri3.CloudNumber;
-import xdi2.core.xri3.XDI3Segment;
+import xdi2.core.syntax.CloudNumber;
+import xdi2.core.syntax.XDIAddress;
 
 /**
  * A MappingIterator that maps XDI segments to Cloud Numbers.
  * 
  * @author markus
  */
-public class MappingCloudNumberIterator extends MappingIterator<XDI3Segment, CloudNumber> {
+public class MappingCloudNumberIterator extends MappingIterator<XDIAddress, CloudNumber> {
 
-	public MappingCloudNumberIterator(Iterator<XDI3Segment> xris) {
+	public MappingCloudNumberIterator(Iterator<XDIAddress> xris) {
 
 		super(xris);
 	}
 
 	@Override
-	public CloudNumber map(XDI3Segment xri) {
+	public CloudNumber map(XDIAddress xri) {
 
-		CloudNumber cloudNumber = CloudNumber.fromXri(xri);
-		if (cloudNumber == null) cloudNumber = CloudNumber.fromPeerRootXri(xri);
+		CloudNumber cloudNumber = CloudNumber.fromAddress(xri);
+		if (cloudNumber == null) cloudNumber = CloudNumber.fromPeerRootArc(xri);
 		if (cloudNumber == null) return null;
 
 		return cloudNumber;

https://github.com/projectdanube/xdi2/raw/0ca7982fec30c2bb8204efbbea61428a643d2e9c/core%2Fsrc%2Fmain%2Fjava%2Fxdi2%2Fcore%2Futil%2Fiterators%2FMappingCloudNumberIterator.java
346f4adad2fecb468d0713fd30388776cf796ddf
modified
projectdanube$xdi2
XDIArc arc
return arc;
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isAttributeXs()) return false;
		if (arc.isClassXs()) return false;
		if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
XDIArc
XDIArc createarc(XDIArc arc)
XDI3SubSegment arcXri
return arcXri;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isAttributeXs()) return false;
		if (arcXri.isClassXs()) return false;
		if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
XDI3SubSegment
XDI3SubSegment createArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
return arc;
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isAttributeXs()) return false;
		if (arc.isClassXs()) return false;
		if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
XDIArc
XDIArc createarc(XDIArc arc)
XDI3SubSegment arcXri
return arcXri;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isAttributeXs()) return false;
		if (arcXri.isClassXs()) return false;
		if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
XDI3SubSegment
XDI3SubSegment createArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
return arc;
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isAttributeXs()) return false;
		if (arc.isClassXs()) return false;
		if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
XDIArc
XDIArc createarc(XDIArc arc)
XDI3SubSegment arcXri
return arcXri;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isAttributeXs()) return false;
		if (arcXri.isClassXs()) return false;
		if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
XDI3SubSegment
XDI3SubSegment createArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
return arc;
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isAttributeXs()) return false;
		if (arc.isClassXs()) return false;
		if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
XDIArc
XDIArc createarc(XDIArc arc)
XDI3SubSegment arcXri
return arcXri;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isAttributeXs()) return false;
		if (arcXri.isClassXs()) return false;
		if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
XDI3SubSegment
XDI3SubSegment createArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
return arc;
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isAttributeXs()) return false;
		if (arc.isClassXs()) return false;
		if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
XDIArc
XDIArc createarc(XDIArc arc)
XDI3SubSegment arcXri
return arcXri;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isAttributeXs()) return false;
		if (arcXri.isClassXs()) return false;
		if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
XDI3SubSegment
XDI3SubSegment createArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
return arc;
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isAttributeXs()) return false;
		if (arc.isClassXs()) return false;
		if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
XDIArc
XDIArc createarc(XDIArc arc)
XDI3SubSegment arcXri
return arcXri;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isAttributeXs()) return false;
		if (arcXri.isClassXs()) return false;
		if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
XDI3SubSegment
XDI3SubSegment createArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
return arc;
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isAttributeXs()) return false;
		if (arc.isClassXs()) return false;
		if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
XDIArc
XDIArc createarc(XDIArc arc)
XDI3SubSegment arcXri
return arcXri;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isAttributeXs()) return false;
		if (arcXri.isClassXs()) return false;
		if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
XDI3SubSegment
XDI3SubSegment createArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
XDIArc arc
return arc;
	public static boolean isValidarc(XDIArc arc) {
		if (arc == null) return false;
		if (arc.isAttributeXs()) return false;
		if (arc.isClassXs()) return false;
		if (! arc.hasLiteral() && ! arc.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arc.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arc.getCs())) {
XDIArc
XDIArc createarc(XDIArc arc)
XDI3SubSegment arcXri
return arcXri;
	public static boolean isValidArcXri(XDI3SubSegment arcXri) {
		if (arcXri == null) return false;
		if (arcXri.isAttributeXs()) return false;
		if (arcXri.isClassXs()) return false;
		if (! arcXri.hasLiteral() && ! arcXri.hasXRef()) return false;
		if (XDIConstants.CS_CLASS_UNRESERVED.equals(arcXri.getCs()) || XDIConstants.CS_CLASS_RESERVED.equals(arcXri.getCs())) {
XDI3SubSegment
XDI3SubSegment createArcXri(XDI3SubSegment arcXri)
projectdanube$xdi2
String type
if (log.isTraceEnabled()) log.trace("typeToXdiarc(" + type + ")");
		XDIArc xdiarc = null;
		try { xdiarc = XDIArc.create(type);
XDIArc
XDIArc typeToXdiarc(String type)
String type
if (log.isTraceEnabled()) log.trace("typeToXdiArcXri(" + type + ")");
		XDI3SubSegment xdiArcXri = null;
		try { xdiArcXri = XDI3SubSegment.create(type);
XDI3SubSegment
XDI3SubSegment typeToXdiArcXri(String type)