Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Flow Graphs for Optimal Sensor Placement

To determine the optimal locations for sensor placement in a water treatment plant, we aim to monitor all water flows using the fewest number of sensors. This can be achieved by constructing a flow graph, where:

Nodes represent system components (e.g., equipments, junctions).

Edges represent water flows between these components.

We generate this graph from an RDF-based model of the plant. The graph abstraction implemented here is based on WWTP1, described in the paper “Optimal flow sensor placement on wastewater treatment plants” by Villez et al. (2016). We can identify a minimal set of sensor placements that covers all flows in the system.

Graph Construction Using SPARQL Rules

In the RDF based model, equipments are connected indirectly through multiple steps.

Each connection flows from:

Equipment ->  Outlet Connection point -> Pipe -> Inlet Connection Point -> Equipment

This structure makes it complicated for optimal sensor placement. Therefore we simplify the topology as described by Villez et al. (2016), traversing only the most essential paths that reflect actual flow of material through pipes using SPARQL queries. We follow the connectsFrom and connectsTo relationships, to bypass intermediate nodes like connection points or junctions.

Ensuring Graph Completeness

To make the graph fully closed (i.e., all flows are measured), we introduce a special node called Environment, which represents everything external to the system. This connects all inflows and outflows to a common endpoint. This Prevents unconnected “open ends” where water appears or disappears which enforces flow conservation, and enables accurate modeling for optimal sensor placement.

We use two SPARQL Rules (Pipe Rule and Enviroment Rule) to extract the necessary structure from the RDF model and simplify it into a usable flow graph. These SPARQL rules:

Visual Transformation Overview

Before: Raw RDF Graph

(equipment →Outlet Connection points → pipe → Inlet Connection points → equipment)
Before: RDF Graph

After: Simplified Flow Graph

(direct connections from one equipment to another, and environment closure)
After: Flow Graph

Rule 1: Pipe Rule

Simplifies the topology by removing intermediate connection points and directly links functional components.

PREFIX s223: <http://data.ashrae.org/standard223#>

SELECT ?from ?conn ?to WHERE {
    ?conn s223:connectsFrom ?from .
    ?conn s223:connectsTo ?to .
}

Step-by-step Explanation

Rule 2: Environment Rule

Links unconnected inlets and outlets to the Environment node while preserving flow directionality.

PREFIX s223: <http://data.ashrae.org/standard223#>

SELECT ?from ?conn ?to WHERE {
    {
        ?to_orig rdf:type s223:OutletConnectionPoint .
        ?from s223:hasConnectionPoint ?to_orig .
        FILTER NOT EXISTS {
            ?to_orig s223:connectsThrough ?conn_orig
        }
        BIND("connects_to_env" AS ?conn)
        BIND("Environment" AS ?to)


    }
    UNION 
    {
        ?from_orig rdf:type s223:InletConnectionPoint .
        ?to s223:hasConnectionPoint ?from_orig .
        FILTER NOT EXISTS {
            ?from_orig s223:connectsThrough ?conn_orig
        }
        BIND("connects_to_env" AS ?conn)
        BIND("Environment" AS ?from)
    }
}

Step-by-step Explanation

This will output a simplified RDF graph ready for sensor placement optimization.

References
  1. Villez, K., Vanrolleghem, P. A., & Corominas, L. (2016). Optimal flow sensor placement on wastewater treatment plants. Water Research, 101, 75–83. 10.1016/j.watres.2016.05.068