How do you set events through the UI in Brat? - brat

I'm trying to use events through the UI, I'm not seeing how to properly use them in the documentation. I'm interested in tagging subject predicate and object and then connecting them (since there can be multiple in each sentence). In this case, subject, predicate and object can be any string, so I've defined them as entities.
[entities]
Subject
Predicate
Object
[events]
SPO Arg1:Subject,Arg2:Predicate,Arg3:Object
When I tag a sentence as an SPO I see the error above
"Incomplete: exactly 1 Arg1 argument required for event" along with a few additional errors. What is the correct way to identify an event and the arguments for that event?
Thanks

Ok, figured it out. Select an event, then drag arrows from the event to each of the arguments.

Related

Add Sensorevents to CEP Engine and get a list of all properties

I want to build a CEP-Engine which is dynamic so you can add different event streams. As soon as a new stream is added, Esper should be able to read all the properties of the stream and put it into a list, for example. (For example integer id, long temperature, date timestamp etc.)
Is this possible in Esper?
Would be very grateful for any help
In order to add a stream at runtime you can use create-schema.
create schema MyStream(id int, ...)
For a stream that accepts events that an application sends using EPEventServive#sendEvent you should add the bus and public annotation (or set the equivalent compiler flags).
#public #buseventtype create schema MyStream(id int, ...)
You can now use this stream.
select * from MyStream
You can attach a listener and have it do some logic.
The Esper examples have a lot of detail. The create-schema is used in the "runtimeconfig" example.
Thank you for answering. I'm afraid I didn't make myself clear. I want to be able to add event streams where I don't know beforehand what kind of properties the events have. So I don't know before if there is an integer ID or if there is a date timestamp and which payload might be there. As soon as I add such an unknown event, Esper should examine the stream and return the contained properties of the stream to me.

Add UNKNOWN eventstreams to CEP Engine and get a list of all properties (payload) of this event

I want to be able to add event streams where I don't know beforehand what kind of properties the events have. So I don't know before if there is an integer ID or if there is a date timestamp and which payload might be there. As soon as I add such an unknown event, Esper should examine the stream and return the contained properties of the stream to me.
Thank you very much. That actually helps me a lot. But a function which returns all property names directly does not exist, does it? So I would have to use dynamic parameters (trial and error) until I know which ones exist in the eventstream.
Thank you for your help :)
See similar to Add Sensorevents to CEP Engine and get a list of all properties
In the case that you don't have some or all of the properties, you can add the stream without any properties or with those properties that you know that the events have. Here is how to add a stream where you don't know any properties in advance:
#public #buseventtype create schema MyStream()
You can now use EPEventServive#sendEvent to send events.
You can use this stream in various ways. You can simply select the event.
select * from MyStream
Or you can use the dynamic property names, those with a '?' questionmark appended to them. This can refer to properties that may or may not exist.
select id? as id from MyStream
The "id?" returns an Object-type value. You can use "cast" to make it, for instance, a double-type value to total up.
select id? as id, sum(cast(someNumericProperty?, double)) as total from MyStream where
When the property doesn't exist the "?" expression returns null. There is an "exists" function that returns true when the parameter that is a dynamic property exists.
I don't think the Esper runtime actually knows about any dynamic property until the EPL attempts to use that dynamic property. The runtime doesn't inspect any event for actual properties.
You can add your own user-defined function that determines what the property names may be for your specific event underlying. So when the underlying is a java.util.Map the user-defined function can return "event.keySet()".

Recursive Fetching in Grails self-relationship

I have the following grails domain class, containing a self-relationship.
class Message {
static hasMany = [replies: Message]
Message isReplyTo
User author
String title
String text
Date createdAt
Date lastUpdated
}
I want to write a query that can do two things
If a message is a parent, i.e it is not a reply to any other message, retrieve a list of messages that build a conversation starting with that message.
Message 1
---- Reply 1
---- Reply 2
-------- SubReply 1
Given a message that is a reply, to another message, also build a list same as above, including that parent that the given message (reply) falls under.
I have thought about this but can't quite think of a possible way of doing this, since there is no Conversations domain class that ties message belonging to the same conversation together. So I am hoping that there is some sort recursive query that would help me achieve this.
There are couple ways to handle this type of structure and there's no shortage of examples on the web about this type of tree based relationship.
In the simplest approach; you could have a Parent Child structure where a null parent would signal the top of the tree and a 'null' child would signal the end of that branch. This is a simple and effective structure but, it can be difficult to capture metrics because you'll always have to recursively search the entire thread.
Message{
...
Message parent
Message child
}
This post shows a good recursion in GSP example:
Another pattern for this is materialized path. It's a little trickery to implement but, easy to work once it's in place. Materialized paths are also much easier to collect metrics for like count of reply's and doing breadcrumbs are much easier too.
Message{
...
Message parent
String path //would like something like this: 1/2/3/4
}
For an example search of Materialized path check out google or this post.

How to update value in angular ui typeahead directive if no matching option is found

I've an array of objects containing title and salary which is used in typeahead directive.
I display department name and get entire object as value.
If none of the options match, I want user entered string to be converted to object still. Is there any way to update that?
This answer is pretty late, but I would just use ng-blur (to trap the end of the users input) along with a variable bound to typeahead-no-results. Then test if the variable is true in the method bound to ng-blur, and, if so, make an object out of the String supplied by the user and push it to your data source. Simple example found here.

How do I check for duplicates in event calendar eventkits

I fetched a list of all events and try to match it with my current events about to be added, but it never matches and just add duplicates.
The code I used to fetch is from apple's document. Can anyone help?
http://developer.apple.com/library/ios/#documentation/DataManagement/Conceptual/EventKitProgGuide/ReadingAndWritingEvents.html#//apple_ref/doc/uid/TP40004775-SW1
Code from another tutorial (I scourged the net but couldn't find how to match events. the fetch predicates results title string comparison did not work)
http://neilang.com/entries/using-eventkit-in-ios/
I found out that one can save the eventstore event unique identifier immediately after saving. And with this identifier one can get the events back.

Resources