daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pymortar
  2. client = pymortar.Client({})
  3.  
  4. # client.qualify
  5. qualify_resp = client.qualify([
  6.     "SELECT ?meter WHERE { ?meter rdf:type/rdfs:subClassOf* brick:Building_Electric_Meter };",
  7. ])
  8.  
  9. req = pymortar.FetchRequest(
  10.     sites=qualify_resp.sites,
  11.     views=[
  12.       pymortar.View(
  13.         sites=qualify_resp.sites,
  14.         name="meter",
  15.         definition="SELECT ?meter WHERE { ?meter rdf:type/rdfs:subClassOf* brick:Building_Electric_Meter };",
  16.       )
  17.     ],
  18.     dataFrames=[
  19.       pymortar.DataFrame(
  20.         name="meter_data",
  21.         aggregation=pymortar.MEAN,
  22.           window="1h",
  23.           timeseries=[
  24.           pymortar.Timeseries(
  25.             view="meter",
  26.             dataVars=["?meter"],
  27.           )
  28.         ],
  29.       )
  30.     ],
  31.     time=pymortar.TimeParams(
  32.         start="2017-01-01T00:00:00Z",
  33.         end="2018-01-01T00:00:00Z",
  34.     )
  35. )
  36.  
  37. resp = client.fetch(req)
  38. print(resp)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top