--- nmlbase20110421.rnc	2011-06-16 11:02:32.000000000 -0400
+++ nmlbase20110616.rnc	2011-06-16 10:56:20.000000000 -0400
@@ -24,13 +24,15 @@
     & Relation*
     & Lifetime?
   )
-  | IdReference
+
+NetworkObjectRef =
+  IdReference
 
 Identifier =
-  attribute id { xsd:string }
+  attribute id { xsd:anyURI }
 
 IdReference =
-  attribute idRef { xsd:string }
+  attribute idRef { xsd:anyURI }
 
 Name =
   element name {
@@ -40,17 +42,19 @@
 
 Relation =
   element relation {
-    attribute type { xsd:string }
-    & IdReference*
-    & anyElement*
+    attribute type { xsd:anyURI }
+    & ( BaseNode | BaseLink | BasePort | BaseService | NMLGroup | Container )
   }
 
+# problem: hasPort, hasport, has_port are not equal. Risk is less with URI's.
+# risk of proliferation of types. E.g. Port -hostname-> Node instead of Node -hasport-> Port
+
 Lifetime =
   element lifetime {
     StartTime
     & (EndTime | Duration)?
   }
-
+### May a lifetime be segmented? (thus multiple sets of begin/endtime?)
 
 # #################################################################
 # This sequence allows any element, attribute, or text (regardless 
@@ -78,14 +82,13 @@
 ## ########################
 
 StartTime = 
-  anyElement*
+  element start { xsd:dateTime }
    
 EndTime = 
-  anyElement*
+  element end { xsd:dateTime }
 
 Duration =
-  anyElement*
-
+  element duration { xsd:duration }
 
 ## ########################
 ## Generic location
@@ -106,17 +109,17 @@
   & element shelf { xsd:string }?
   & element latitude { xsd:float }?
   & element longitude { xsd:float }?
-
+### NAME?
 
 ## ########################
 ## Generic link
 ## ########################
 
-BaseLink = element link { BaseLinkContent }
+BaseLink = element link { BaseLinkContent | NetworkObjectRef }
 BaseLinkContent =
   NetworkObject
   & element type { xsd:string }?
-  & element capacity { xsd:string }?
+  & element capacity { xsd:float }?
   & anyElement*
 
 
@@ -124,9 +127,10 @@
 ## Generic port
 ## ########################
 
-BasePort = element port { BasePortContent }
+BasePort = element port { BasePortContent | NetworkObjectRef }
 BasePortContent =
   NetworkObject
+  & element capacity { xsd:float }?
   & anyElement*
 
 
@@ -134,51 +138,57 @@
 ## Generic node
 ## ########################
 
-BaseNode = element node { BaseNodeContent }
+BaseNode = element node { BaseNodeContent | NetworkObjectRef }
 BaseNodeContent =
   NetworkObject
   & element location { LocationContent }?
   & anyElement*
 
-
 ## ########################
 ## Generic service
 ## ########################
 
-BaseService = element service { BaseServiceContent }
-BaseServiceContent =
-  NetworkObject
-  & anyElement*
+BaseService = 
+  AdaptationService
+  | SwitchingService
+
+AdaptationService = anyElement
+SwitchingService = anyElement
 
+# Follows in next version, along with multi-layer stuff
 
 ## ########################
 ## Groups
 ## ########################
 
-Group = 
+NMLGroup = 
   Topology
   | Domain
   | Network
+  | BidirectionalLink
+  | BidirectionalPort
 
 
 ## ########################
 ## Generic topology
 ## ########################
 
-Topology = element topology { BaseTopologyContent }
+Topology = element topology { BaseTopologyContent | NetworkObjectRef }
 BaseTopologyContent =
   NetworkObject
   & BaseLink*
   & BasePort*
   & BaseNode*
+  & NMLGroup*
   & anyElement*
 
+# NML group can contain an NML Group, according to NML schema. Is this OK for RNC?
 
 ## ########################
 ## Generic domain
 ## ########################
 
-Domain = element domain { BaseDomainContent }
+Domain = element domain { BaseDomainContent | NetworkObjectRef }
 BaseDomainContent =
   NetworkObject
   & anyElement*
@@ -188,8 +198,58 @@
 ## Generic network
 ## ########################
 
-Network = element network { BaseNetworkContent }
+Network = element network { BaseNetworkContent | NetworkObjectRef }
 BaseNetworkContent =
   NetworkObject
   & anyElement*
 
+## ########################
+## Bidirectional Link
+## ########################
+
+BidirectionalLink = element bilink { BaseBidirectionalLinkContent | NetworkObjectRef }
+BaseBidirectionalLinkContent =
+  NetworkObject
+  & Link
+  & Link
+
+## ########################
+## Bidirectional Port
+## ########################
+
+BidirectionalPort = element biport { BaseBidirectionalPortContent | NetworkObjectRef }
+BaseBidirectionalPortContent =
+  NetworkObject
+  & Port
+  & Port
+
+## ########################
+## Containers
+## ########################
+
+## A container is a list of items. A list may be unordered (a Bag) or ordered (a Sequence)
+
+Container = 
+  Bag
+  | Sequence
+
+Bag = 
+  element bag { UnorderedItem* }
+
+UnorderedItem = 
+  element * { NetworkObject | NetworkObjectRef }
+
+Sequence = 
+  element list { attribute first { xsd:anyURI } OrderedItem* }
+
+UnorderedItem = 
+  element * { 
+    attribute next { xsd:anyURI }
+    | attribute last { xsd:empty }
+    anyThing 
+  }
+
+## root element
+
+start = Topology
+
