Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ibal queries #7

Merged
merged 10 commits into from
Dec 24, 2023
67 changes: 67 additions & 0 deletions queries.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,70 @@ SELECT ?location ?sensor WHERE {
?sensor s223:hasObservationLocation ?location
}
"""

[[nist-example]]
description="Search for all the sensors along the connections and the associated property they're observing."
query="""
SELECT ?segment ?channel ?property_id WHERE {
?segment a s223:Connection .
?channel a/rdfs:subClassOf* s223:Sensor .
?channel s223:observes ?property_id .
}
"""

[[nist-example]]
description="Sensors in AHU1 and what units the properties are measured in"
query="""
SELECT ?channel ?property_id ?unit WHERE {
BIND(IBAL:AHU_1 as ?ahu) {
}
UNION {
?ahu s223:contains ?equipment .
?channel s223:hasObservationLocation ?equipment .
?channel s223:observes ?property_id .
?property_id qudt:hasUnit ?unit .
}
UNION {
?ahu s223:contains ?equipment .
?equipment s223:connectedThrough ?connection .
?channel s223:hasObservationLocation ?connection .
?channel s223:observes ?property_id .
?property_id qudt:hasUnit ?unit .
}
UNION {
?ahu s223:contains ?equipment .
?equipment s223:hasConnectionPoint ?connectionPoint .
?channel s223:hasObservationLocation ?connectionPoint .
?channel s223:observes ?property_id .
?property_id qudt:hasUnit ?unit .
}
}
"""
[[nist-example]]
description="Find the downstream equipment for AHU1."
query="""
SELECT ?connectionDown ?connectionDown2 WHERE {
BIND(IBAL:AHU_1 as ?ahu) {
}
UNION {
?ahu s223:hasConnectionPoint ?connectionPoint .
?connectionPoint a s223:OutletConnectionPoint .
?connectionPoint s223:hasMedium s223:Medium-Air .
?connectionPoint s223:connectsThrough ?segment .
?segment s223:connectsTo ?junction .
?junction s223:connectedTo ?connectionDown .
?connectionDown a s223:TerminalUnit .
}
UNION {
?ahu s223:hasConnectionPoint ?connectionPoint .
?connectionPoint a s223:OutletConnectionPoint .
?connectionPoint s223:hasMedium s223:Medium-Air .
?connectionPoint s223:connectsThrough ?segment .
?segment s223:connectsTo ?junction .
?junction s223:connectedTo ?connectionDown .
?connectionDown a s223:Junction .
?connectionDown s223:connectedTo ?connectionDown2 .
?connectionDown2 a s223:TerminalUnit .
}
}
"""