fromvrdfimportDB, BRICK, AfromrdflibimportNamespaceBLDG=Namespace("urn:bldg#")
db=DB("test.db")
# using logical timestamps here (0, 1, 2, 3, ...). If these are# ommitted it defaults to the current system time.withdb.new_changeset("my-building", 1) ascs:
cs.add((BLDG.vav1, A, BRICK.VAV))
cs.add((BLDG.vav1, BRICK.feeds, BLDG.zone1))
cs.add((BLDG.zone1, A, BRICK.HVAC_Zone))
cs.add((BLDG.zone1, BRICK.hasPart, BLDG.room1))
# WARNING: this is slow for nowwithdb.new_changeset("brick", 1) ascs:
# 'cs' is a rdflib.Graph that supports queries -- updates on it# are buffered in the transaction and cannot be queried until# the transaction is committed (at the end of the context block)cs.load_file(
"https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl"
)
withdb.new_changeset("my-building", 2) ascs:
cs.add((BLDG.vav2, A, BRICK.VAV))
cs.add((BLDG.vav2, BRICK.feeds, BLDG.zone1))
cs.add((BLDG.zone2, A, BRICK.HVAC_Zone))
cs.remove((BLDG.zone1, BRICK.hasPart, BLDG.room1))
withdb.new_changeset("my-building", 3) ascs:
cs.add((BLDG.vav2, A, BRICK.VAV))
cs.add((BLDG.vav2, BRICK.feeds, BLDG.zone1))
cs.add((BLDG.zone2, A, BRICK.HVAC_Zone))
cs.remove((BLDG.zone1, BRICK.hasPart, BLDG.room1))
withdb.new_changeset("my-building", 4) ascs:
cs.remove((BLDG.vav2, BRICK.feeds, BLDG.zone1))
cs.add((BLDG.vav2, BRICK.feeds, BLDG.zone2))
print("LATEST!")
fortindb.latest("my-building"):
print(t)
forlogical_tsinrange(1, 5):
print("LOGICAL TS:", logical_ts)
fortindb.graph_at("my-building", logical_ts):
print(t)
db.close()
Roboflow makes managing, preprocessing, augmenting, and versioning datasets for computer vision seamless. This is the official Roboflow python package that interfaces with the Roboflow API.
Music Demixing Challenge - Starter Kit 👉 Challenge page This repository is the Music Demixing Challenge Submission template and Starter kit! Clone th
ServoProject by Adam Bäckström Getting the most out of your hobby servo Theory The control system of a regular hobby servo looks something like this: