-﻿-- 03 Find Connectivity Matrix of a scenario of a network
+﻿-- 03.1 Find Connectivity Matrix of a scenario of a network
 
 /*
-Use case #3: How are the water system components physically connected? Show directions of flow 
+Use case #3.1: How are the water system components physically connected? Show directions of flow 
 
 
 Users can use such query to understand how the water infrastructure is connected 

 
*/

SELECT  "Instances"."InstanceName" As "LinkInstanceName","ObjectTypes"."NativeObjectName",
"StartNodeInstance"."InstanceName" AS "StartInstanceName","ObjectTypeStartNodeInstance"."NativeObjectName",
"EndNodeInstance"."InstanceName" AS "EndInstanceName",
"ObjectTypeEndNodeInstance"."NativeObjectName" As "ObjectEndInstance"
--,"DataStructures"."DataStructureName"



Left JOIN  "Attributes" As "AttLinkEndInstance"
ON "AttLinkEndInstance"."AttributeID"="ObjectAttEndNodeInstance"."AttributeID"

-- Over 

WHERE  "AttLinkInstance"."NativeAttributeName"='ObjectInstances'
AND "Attributes"."NativeAttributeName"='ObjectInstances'
AND "AttLinkEndInstance"."NativeAttributeName"='ObjectInstances'
AND DataStructureName='WEAP'
AND ScenarioName ='BaseCaseLower'

