diff --git a/model/pom.xml b/model/pom.xml
index 73403f1..36c2f69 100644
--- a/model/pom.xml
+++ b/model/pom.xml
@@ -39,6 +39,12 @@
             <artifactId>slf4j-api</artifactId>
             <version>1.7.21</version>
         </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.12</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/model/src/main/java/org/onosproject/yang/model/DataNode.java b/model/src/main/java/org/onosproject/yang/model/DataNode.java
index 257b5de..d927455 100644
--- a/model/src/main/java/org/onosproject/yang/model/DataNode.java
+++ b/model/src/main/java/org/onosproject/yang/model/DataNode.java
@@ -28,7 +28,7 @@
      *
      * @return node schema identifier
      */
-    SchemaIdentifier identifier();
+    SchemaId identifier();
 
     /**
      * Returns the type of node.
diff --git a/model/src/main/java/org/onosproject/yang/model/KeyLeaf.java b/model/src/main/java/org/onosproject/yang/model/KeyLeaf.java
new file mode 100644
index 0000000..6d782e4
--- /dev/null
+++ b/model/src/main/java/org/onosproject/yang/model/KeyLeaf.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.model;
+
+/**
+ * Represents the List's key leaf value.
+ */
+public class KeyLeaf {
+    private SchemaId leafSchema;
+    private Object leafVal;
+
+    private KeyLeaf() {
+
+    }
+
+    /**
+     * Constructs a key leaf with all the identifier and value initialized.
+     *
+     * @param name      name of the leaf
+     * @param nameSpace namespace of leaf
+     * @param leafVal   value of leaf
+     */
+    public KeyLeaf(String name, String nameSpace, Object leafVal) {
+        leafSchema = new SchemaId(name, nameSpace);
+        this.leafVal = leafVal;
+    }
+
+    /**
+     * Returns the node schema schemaId.
+     *
+     * @return node schema schemaId
+     */
+    public SchemaId leafSchema() {
+        return leafSchema;
+    }
+
+    /**
+     * Returns value contained in leaf node.
+     *
+     * @return value contained in leaf node
+     */
+    public Object leafValue() {
+        return leafVal;
+    }
+
+    /**
+     * Returns value as string, for usage in serializers.
+     *
+     * @return string representation of value
+     */
+    public String leafValAsString() {
+        return leafVal.toString();
+    }
+}
diff --git a/model/src/main/java/org/onosproject/yang/model/LeafListKey.java b/model/src/main/java/org/onosproject/yang/model/LeafListKey.java
new file mode 100644
index 0000000..904d6bd
--- /dev/null
+++ b/model/src/main/java/org/onosproject/yang/model/LeafListKey.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.model;
+
+/**
+ * Representation of an entity which identifies a uniquely branching
+ * leaf-list entry corresponding to a multi instance leaf schema.
+ */
+public class LeafListKey extends NodeKey<LeafListKey>
+        implements Comparable<LeafListKey> {
+    private Object val;
+
+    /**
+     * Create object from builder.
+     *
+     * @param builder initialized builder
+     */
+    private LeafListKey(LeafListKeyBuilder builder) {
+        super(builder);
+        val = builder.val;
+    }
+
+    /**
+     * Returns value of node, this is only valid for multi-instance leaf, node.
+     *
+     * @return value maintained in the node
+     */
+    Object value() {
+        return val;
+    }
+
+    /**
+     * Returns value as string, for usage in serializers.
+     *
+     * @return string representation of value
+     */
+    String asString() {
+        return val.toString();
+    }
+
+    public static class LeafListKeyBuilder
+            extends NodeKeyBuilder<LeafListKeyBuilder> {
+
+        private Object val;
+
+        /**
+         * constructor used while constructing the key from scratch.
+         */
+        public LeafListKeyBuilder() {
+
+        }
+
+        /**
+         * Adds the value for for the leaf list node identifier.
+         *
+         * @param val leaf list value
+         */
+        LeafListKeyBuilder value(Object val) {
+            this.val = val;
+            return this;
+        }
+
+        /**
+         * Creates a leaf list entry identifier.
+         *
+         * @return leaf list entry identifier
+         */
+        public LeafListKey build() {
+            return new LeafListKey(this);
+        }
+    }
+}
diff --git a/model/src/main/java/org/onosproject/yang/model/ListKey.java b/model/src/main/java/org/onosproject/yang/model/ListKey.java
new file mode 100644
index 0000000..87107fc
--- /dev/null
+++ b/model/src/main/java/org/onosproject/yang/model/ListKey.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.onosproject.yang.model;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Represents an entity which identifies a unique branching node
+ * corresponding to a multi instance schema definition.
+ */
+public class ListKey extends NodeKey<ListKey> implements Comparable<ListKey> {
+
+    private List<KeyLeaf> keyLeafs;
+
+    /**
+     * Create object from builder.
+     *
+     * @param builder initialized builder
+     */
+    private ListKey(ListKeyBuilder builder) {
+        super(builder);
+        keyLeafs = builder.keyLeafs;
+    }
+
+    /**
+     * Returns the list of key leaf nodes of a multi instance node, which
+     * uniquely identifies the branching node entry corresponding to a multi
+     * instance schema definition.
+     *
+     * @return List of key leaf nodes
+     */
+    List<KeyLeaf> keyLeafs() {
+        return keyLeafs;
+    }
+
+    public int compareTo(ListKey o) {
+        //TODO: implement me
+        return 0;
+    }
+
+    public static class ListKeyBuilder extends NodeKeyBuilder<ListKeyBuilder> {
+        private List<KeyLeaf> keyLeafs = new LinkedList<>();
+
+        /**
+         * used to construct the key from scratch.
+         */
+        public ListKeyBuilder() {
+
+        }
+
+        /**
+         * used to construct a key from an existing node key.
+         *
+         * @param base existing node key
+         */
+        public ListKeyBuilder(NodeKeyBuilder base) {
+            super(base);
+        }
+
+        /**
+         * Adds the key leaf for the list resource.
+         *
+         * @param name      key leaf name
+         * @param nameSpace key laef namespace
+         * @param val       value of key
+         */
+        void addKeyLeaf(String name, String nameSpace, Object val) {
+            KeyLeaf keyLeaf = new KeyLeaf(name, nameSpace, val);
+            keyLeafs.add(keyLeaf);
+        }
+
+        /**
+         * Creates the list key object.
+         *
+         * @return list key
+         */
+        public ListKey build() {
+            return new ListKey(this);
+        }
+    }
+}
diff --git a/model/src/main/java/org/onosproject/yang/model/ModelConstants.java b/model/src/main/java/org/onosproject/yang/model/ModelConstants.java
new file mode 100644
index 0000000..4c24cdd
--- /dev/null
+++ b/model/src/main/java/org/onosproject/yang/model/ModelConstants.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.model;
+
+/**
+ * Constants used in model package.
+ */
+final class ModelConstants {
+    static final String INCOMPLETE_SCHEMA_INFO = "Schema info is not complete";
+    static final String LEAF_IS_TERMINAL = "Leaf must be the terminal node";
+    static final String NON_KEY_LEAF = "Leaf list is not a key of list";
+    static final String NO_KEY_SET = "Resource Identifier is empty";
+}
diff --git a/model/src/main/java/org/onosproject/yang/model/ModelException.java b/model/src/main/java/org/onosproject/yang/model/ModelException.java
new file mode 100644
index 0000000..460991c
--- /dev/null
+++ b/model/src/main/java/org/onosproject/yang/model/ModelException.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.model;
+
+/**
+ * Represents the Model Exception.
+ */
+public class ModelException extends RuntimeException {
+
+    private static final long serialVersionUID = 20161223L;
+
+    /**
+     * Creates a new YANG tool exception with given message.
+     *
+     * @param message the detail of exception in string
+     */
+    public ModelException(String message) {
+        super(message);
+    }
+
+    /**
+     * Creates a new tool exception from given message and cause.
+     *
+     * @param message the detail of exception in string
+     * @param cause   underlying cause of the error
+     */
+    public ModelException(final String message, final Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     * Creates a new tool exception from cause.
+     *
+     * @param cause underlying cause of the error
+     */
+    public ModelException(final Throwable cause) {
+        super(cause);
+    }
+
+}
+
diff --git a/model/src/main/java/org/onosproject/yang/model/MultiInstanceLeafKey.java b/model/src/main/java/org/onosproject/yang/model/MultiInstanceLeafKey.java
deleted file mode 100644
index 8be8bbe..0000000
--- a/model/src/main/java/org/onosproject/yang/model/MultiInstanceLeafKey.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.yang.model;
-
-/**
- * Abstraction of an entity which identifies a uniquely branching leaf
- * corresponding to a multi instance leaf schema.
- */
-public interface MultiInstanceLeafKey extends NodeKey {
-
-    /**
-     * Returns value of node, this is only valid for multi-instance leaf, node.
-     *
-     * @return value maintained in the node
-     */
-    Object value();
-
-    /**
-     * Returns value as string, for usage in serializers.
-     *
-     * @return string representation of value
-     */
-    String asString();
-}
diff --git a/model/src/main/java/org/onosproject/yang/model/MultiInstanceNodeKey.java b/model/src/main/java/org/onosproject/yang/model/MultiInstanceNodeKey.java
deleted file mode 100644
index 5677891..0000000
--- a/model/src/main/java/org/onosproject/yang/model/MultiInstanceNodeKey.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.onosproject.yang.model;
-
-import java.util.List;
-
-/**
- * Abstraction of an entity which identifies a unique branching node
- * corresponding to a multi instance schema definition.
- */
-public interface MultiInstanceNodeKey extends NodeKey {
-
-    /**
-     * Returns the list of key leaf nodes of a multi instance node, which
-     * uniquely identifies the branching node entry corresponding to a multi
-     * instance schema definition.
-     *
-     * @return List of key leaf nodes
-     */
-    List<LeafNode> keyLeafs();
-}
diff --git a/model/src/main/java/org/onosproject/yang/model/NodeKey.java b/model/src/main/java/org/onosproject/yang/model/NodeKey.java
index 1f6dbfe..8e83e49 100644
--- a/model/src/main/java/org/onosproject/yang/model/NodeKey.java
+++ b/model/src/main/java/org/onosproject/yang/model/NodeKey.java
@@ -17,11 +17,25 @@
 
 package org.onosproject.yang.model;
 
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.onosproject.yang.model.ModelConstants.INCOMPLETE_SCHEMA_INFO;
+
 /**
  * Abstraction of an entity which identifies a node uniquely among its
  * siblings.
  */
-public interface NodeKey extends Comparable<NodeKey> {
+public class NodeKey<E extends NodeKey> implements Comparable<E> {
+
+    private SchemaId schemaId;
+
+    /**
+     * Create object from builder.
+     *
+     * @param builder initialized builder
+     */
+    protected NodeKey(NodeKeyBuilder builder) {
+        schemaId = builder.schemaId;
+    }
 
     /**
      * Returns the schema identifier as minimal key required to identify a
@@ -29,5 +43,68 @@
      *
      * @return schema identifier of a key
      */
-    SchemaIdentifier identifier();
+    public SchemaId schemaId() {
+        return schemaId;
+    }
+
+    @Override
+    public int compareTo(NodeKey o) {
+        //TODO: implement me
+        return 0;
+    }
+
+    public static class NodeKeyBuilder<B extends NodeKeyBuilder<B>> {
+        private SchemaId schemaId;
+
+        /**
+         * Create the node key from scratch.
+         */
+        public NodeKeyBuilder() {
+
+        }
+
+        /**
+         * Support the derived object to inherit from existing node key builder.
+         *
+         * @param base existing node key builder
+         */
+        protected NodeKeyBuilder(NodeKeyBuilder base) {
+            checkNotNull(base.schemaId, INCOMPLETE_SCHEMA_INFO);
+            schemaId = base.schemaId;
+        }
+
+        /**
+         * set the schema identifier.
+         *
+         * @param schema schema identifier
+         * @return current builder
+         */
+        public B schemaId(SchemaId schema) {
+            schemaId = schema;
+            return (B) this;
+        }
+
+        /**
+         * set the schema identifier.
+         *
+         * @param name      name of the node
+         * @param nameSpace name space of the node
+         * @return current builder
+         */
+        public B schemaId(String name, String nameSpace) {
+            schemaId = new SchemaId(name, nameSpace);
+            return (B) this;
+        }
+
+        /**
+         * construct the node key.
+         *
+         * @return node key
+         */
+        public NodeKey build() {
+            checkNotNull(schemaId.name(), INCOMPLETE_SCHEMA_INFO);
+            checkNotNull(schemaId.namespace(), INCOMPLETE_SCHEMA_INFO);
+            return new NodeKey(this);
+        }
+    }
 }
diff --git a/model/src/main/java/org/onosproject/yang/model/ResourceId.java b/model/src/main/java/org/onosproject/yang/model/ResourceId.java
new file mode 100644
index 0000000..7f99c8c
--- /dev/null
+++ b/model/src/main/java/org/onosproject/yang/model/ResourceId.java
@@ -0,0 +1,154 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.model;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.onosproject.yang.model.ModelConstants.LEAF_IS_TERMINAL;
+import static org.onosproject.yang.model.ModelConstants.NON_KEY_LEAF;
+import static org.onosproject.yang.model.ModelConstants.NO_KEY_SET;
+
+/**
+ * Representation of an entity which identifies a resource in the logical tree
+ * data store. It is a list of node keys to identify the branch point
+ * hierarchy to reach a resource in the instance tree.
+ */
+
+public class ResourceId {
+    private List<NodeKey> nodeKeyList;
+
+    /**
+     * Create object from builder.
+     *
+     * @param builder initialized builder
+     */
+    private ResourceId(Builder builder) {
+        nodeKeyList = builder.nodeKeyList;
+    }
+
+    /**
+     * Returns the list of node key used to uniquely identify the branch in the
+     * logical tree starting from root.
+     *
+     * @return node key uniquely identifying the branch
+     */
+    public List<NodeKey> nodeKeys() {
+        return nodeKeyList;
+    }
+
+    /**
+     * Retrieves a new resource builder.
+     *
+     * @return resource builder
+     */
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    /**
+     * Builder to construct resource identifier.
+     */
+    public static class Builder {
+
+        private List<NodeKey> nodeKeyList = new LinkedList<>();
+        private NodeKey.NodeKeyBuilder curKeyBuilder = null;
+
+        /**
+         * Adds the descendent node's schema identity.
+         *
+         * @param name      name of descendent node
+         * @param nameSpace name space pf descendent node
+         * @return updated builder pointing to the specified schema location
+         */
+        public Builder addBranchPointSchema(String name, String nameSpace) {
+            if (curKeyBuilder != null) {
+                if (curKeyBuilder instanceof LeafListKey.LeafListKeyBuilder) {
+                    throw new ModelException(LEAF_IS_TERMINAL);
+                }
+                nodeKeyList.add(curKeyBuilder.build());
+            }
+
+            curKeyBuilder = new NodeKey.NodeKeyBuilder();
+            curKeyBuilder.schemaId(name, nameSpace);
+
+            return this;
+        }
+
+        /**
+         * Adds a multi instance attribute's node identity.
+         *
+         * @param name      name of the leaf list
+         * @param nameSpace name space of leaf list
+         * @param val       value of attribute to identify the instance
+         * @return updated builder pointing to the specific attribute
+         * value instance
+         */
+        public Builder addLeafListBranchPoint(String name, String nameSpace,
+                                              Object val) {
+            LeafListKey.LeafListKeyBuilder leafListKeyBuilder;
+            if (curKeyBuilder instanceof LeafListKey.LeafListKeyBuilder) {
+                throw new ModelException(NON_KEY_LEAF);
+            }
+            leafListKeyBuilder = new LeafListKey.LeafListKeyBuilder()
+                    .schemaId(name, nameSpace).value(val);
+
+            curKeyBuilder = leafListKeyBuilder;
+            return this;
+        }
+
+        /**
+         * Adds a multi instance nodes key attribute value to identify
+         * the branch point of instance tree.
+         *
+         * @param name      name of the key attribute
+         * @param nameSpace name space of key attribute
+         * @param val       value of the key leaf, to match in the list entry
+         * @return updated builder with list branching information
+         */
+        public Builder addKeyLeaf(String name, String nameSpace, Object val) {
+            ListKey.ListKeyBuilder listKeyBuilder;
+            if (!(curKeyBuilder instanceof ListKey.ListKeyBuilder)) {
+                if (curKeyBuilder instanceof LeafListKey.LeafListKeyBuilder) {
+                    throw new ModelException(LEAF_IS_TERMINAL);
+                }
+
+                listKeyBuilder = new ListKey.ListKeyBuilder(curKeyBuilder);
+            } else {
+                listKeyBuilder = (ListKey.ListKeyBuilder) curKeyBuilder;
+            }
+
+            listKeyBuilder.addKeyLeaf(name, nameSpace, val);
+            curKeyBuilder = listKeyBuilder;
+            return this;
+        }
+
+        /**
+         * Builds a resource identifier to based on set path information of
+         * the resource.
+         *
+         * @return built resource identifier
+         */
+        public ResourceId build() {
+            if (curKeyBuilder == null) {
+                throw new ModelException(NO_KEY_SET);
+            }
+            nodeKeyList.add(curKeyBuilder.build());
+            return new ResourceId(this);
+        }
+    }
+}
diff --git a/model/src/main/java/org/onosproject/yang/model/ResourceIdentifier.java b/model/src/main/java/org/onosproject/yang/model/ResourceIdentifier.java
deleted file mode 100644
index fb40c48..0000000
--- a/model/src/main/java/org/onosproject/yang/model/ResourceIdentifier.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.yang.model;
-
-/**
- * Abstraction of an entity which identifies a resource in the logical tree
- * data store. It is a recursive approach to locate a resource in the
- * instance tree.
- */
-
- /*-- Assume the below schema
- * container node1{
- *     list node2{
- *         key node3;
- *         leaf node3{
- *             type string;
- *         }
- *         leaf-list node4{
- *             type string
- *         }
- *     }
- * }
- * Assume an instance tree as below
- * node1
- * |----node2
- * |    |----node3
- * |    |    |----"val1"
- * |    |----node4
- * |    |    |----"val2"
- * |    |    |----"val3"
- * |----node2
- * |    |----node3
- * |    |    |----"val4"
- * |    |----node4
- * |    |    |----"val5"
- * |    |    |----"val6"
- * <p>
- *
- * Assume a resource identifier variable a is pointing to node4 with val3,
- * then its value is as follows
- *
- *      //identifies node1
- *      NodeKey containerKey = a.nodeKey();
- *      SchemaIdentifier schemaId = containerKey.identifier();//"node1"
- *
- *      //identifies a specific entry of list node2
- *      MultiInstanceNodeKey listKey;
- *      listKey = (MultiInstanceNodeKey) a.descendentIdentifier().nodeKey();
- *      schemaId = listKey.identifier();//"node2"
- *      List<LeafNode> keyLeaves = listKey.keyLeafs();
- *      LeafNode key = keyLeaves.get(0);
- *      schemaId = key.identifier();//"node3"
- *      String keyVal = key.asString();//"val1"
- *
- *      //identifiers a specific entry of leaf-list node4
- *      MultiInstanceLeafKey leafKey;
- *      leafKey = (MultiInstanceLeafKey) a.descendentIdentifier().
- *              descendentIdentifier().nodeKey();
- *      schemaId = leafKey.identifier();//"node4"
- *      keyVal = leafKey.asString();//val3
- *
- *      ResourceIdentifier termination = a.descendentIdentifier().descendentIdentifier().
- *              descendentIdentifier(); //null
- *
- */
-public interface ResourceIdentifier {
-    /**
-     * Returns the node key used to uniquely identify the branch in the
-     * logical tree.
-     *
-     * @return node key uniquely identifying the branch
-     */
-    NodeKey nodeKey();
-
-    /**
-     * Returns the descendent resource identifier.
-     *
-     * @return descendent resource identifier
-     */
-    ResourceIdentifier descendentIdentifier();
-}
diff --git a/model/src/main/java/org/onosproject/yang/model/SchemaIdentifier.java b/model/src/main/java/org/onosproject/yang/model/SchemaId.java
similarity index 61%
rename from model/src/main/java/org/onosproject/yang/model/SchemaIdentifier.java
rename to model/src/main/java/org/onosproject/yang/model/SchemaId.java
index a180afb..e25f8b4 100644
--- a/model/src/main/java/org/onosproject/yang/model/SchemaIdentifier.java
+++ b/model/src/main/java/org/onosproject/yang/model/SchemaId.java
@@ -16,18 +16,38 @@
 
 package org.onosproject.yang.model;
 
+import static org.onosproject.yang.model.ModelConstants.INCOMPLETE_SCHEMA_INFO;
+
 /**
- * Abstraction of an entity which identifies a schema node in the schema / data
- * tree.
+ * Representation of an entity which identifies a schema node in the schema /
+ * data tree.
  */
-public interface SchemaIdentifier {
+public class SchemaId {
+
+    private String name;
+    private String nameSpace;
+
+    private SchemaId() {
+
+    }
+
+    public SchemaId(String name, String nameSpace) {
+        if (name == null || nameSpace == null) {
+            throw new ModelException(INCOMPLETE_SCHEMA_INFO);
+        }
+        this.name = name;
+        this.nameSpace = nameSpace;
+    }
+
     /**
      * Returns node schema name. This is mandatory to identify node according
      * to schema.
      *
      * @return node name
      */
-    String name();
+    String name() {
+        return name;
+    }
 
     /**
      * Returns node's namespace. This is mandatory serializers must translate
@@ -35,5 +55,7 @@
      *
      * @return node's namespace
      */
-    String namespace();
+    String namespace() {
+        return nameSpace;
+    }
 }
diff --git a/model/src/test/java/org/onosproject/yang/model/ResourceIdTest.java b/model/src/test/java/org/onosproject/yang/model/ResourceIdTest.java
new file mode 100644
index 0000000..7a4bb62
--- /dev/null
+++ b/model/src/test/java/org/onosproject/yang/model/ResourceIdTest.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2016. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+ * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
+ * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
+ * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
+ * Vestibulum commodo. Ut rhoncus gravida arcu.
+ */
+
+package org.onosproject.yang.model;
+
+import org.junit.Test;
+
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Test resource id
+ */
+
+public class ResourceIdTest {
+
+    @Test
+    public void resourceIdConstruction() {
+        String sampleResId = "/card=8/port=5,eth/stats";
+        String[] resourcePath = sampleResId.split("/");
+
+        ResourceId.Builder resBldr = new ResourceId.Builder();
+
+        int i = 0;
+        int j;
+        while (i < resourcePath.length) {
+            if (resourcePath[i].equals("")) {
+                i++;
+                continue;
+            }
+
+            String[] nameValue = resourcePath[i].split("=");
+            resBldr.addBranchPointSchema(nameValue[0], "testNameSpace");
+            if (nameValue.length == 1) {
+                i++;
+                continue;
+            }
+
+            String[] keys = nameValue[1].split(",");
+
+            j = 0;
+            while (j < keys.length) {
+                //TODO: get schema name of key using YANG runtime
+                String keyName = getKeyName(nameValue[0], j);
+                resBldr.addKeyLeaf(keyName, "testNameSpace", keys[j]);
+                j++;
+            }
+            i++;
+        }
+
+        ResourceId res = resBldr.build();
+        List<NodeKey> keys = res.nodeKeys();
+        assertEquals("invalid augmented node created", "card",
+                     keys.get(0).schemaId().name());
+        assertEquals("invalid augmented node created", ListKey.class,
+                     keys.get(0).getClass());
+        ListKey listKey = (ListKey) keys.get(0);
+        assertEquals("invalid augmented node created", "slot",
+                     listKey.keyLeafs().get(0).leafSchema().name());
+    }
+
+    private String getKeyName(String s, int j) {
+        if (s.equals("card")) {
+            return "slot";
+        }
+        if (s.equals("port")) {
+            if (j == 0) {
+                return "portno";
+            }
+        }
+        return "type";
+    }
+
+}
