def makeRandomEvent(self): eventData = JSONObject() eventData.ceID = 123456 eventData.ceType = "Aarhus_Road_Traffic_Event" eventData.ceName = "traffic jam" eventData.ceTime = 1438591234000L eventData.ceCoordinate = "(56.12 10.13)" eventData.ceLevel = 1 eventData.dummy = True return eventData
EventDescription to show Dan what we need and to test the annotation part. You will probably need a pseudo EventGenerator for that. Later, the ResourceManagement API will receive new EventDescriptions and instanciate EventWrapper (or best case we can reuse one instance). There is no need to make the metadata file nor to instanciate an EventWrapper for each REPORT_ID.""" self.eventDescription = eventdescription def getEventDescription(self): return self.eventDescription if __name__ == "__main__": atew = AarhusTrafficEventWrapper() from virtualisation.annotation.genericannotation import GenericAnnotation annotator = GenericAnnotation() eventData = JSONObject() eventData.ceID = 123456 eventData.ceType = "traffic" eventData.ceName = "traffic jam" eventData.ceTime = 1438591234000L eventData.ceCoordinate = "(56.12 10.13)" eventData.ceLevel = 1 print "Incoming event data", eventData.dumps() print g = annotator.annotateEvent(eventData, atew.getEventDescription()) print "Resulting graph", g.serialize(format='n3') print print atew.getEventDescription().dumps()