Skip to content

Instantly share code, notes, and snippets.

@luanne
Last active December 10, 2015 12:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luanne/4436328 to your computer and use it in GitHub Desktop.
Save luanne/4436328 to your computer and use it in GitHub Desktop.
start c=node:companies(id={id})
match
c<-[:parent_company*0..]-n
with n
match
n-[:defines_business_process]->bp-[:has_cycle]->cm
where
cm.measureDate>={measureStartDate} and cm.measureDate<={measureEndDate}
with cm
match
(cm)-[:cycle_metric]->m-[:metric_activity]->ma-[:metric_unit]->u<-[:alert_for_unit]-(a)
where
a.alertDate=cm.measureDate and a.fromEntityType={type}
with a,ma
match
(r)<-[:for_inspection_result]-a-[:alert_for_inspection]->i
where
(i)<-[:metric_inspection]-(ma)
return a.id as alertId, r.value as resultValue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment