Rostlab / JS16_ProjectA

In this project we will lay the foundations for our system by integrating data from multiple sources into a central database. The database will serve the apps and the visualization tool that will be developed in other projects.
GNU General Public License v3.0
28 stars 14 forks source link

PLOD values in Characters-getById #101

Closed jorjo1 closed 8 years ago

jorjo1 commented 8 years ago

Hello, for the representation of the character profile and ranking page we need exact value of the PLOD for each character. Could you fellows please implement this soon?

https://got-api.bruck.me/doc/#api-Characters-GetById

e.g. https://got-api.bruck.me/api/characters/byId/56ea4cfe8c27d7c637505844

togiberlin commented 8 years ago

@jorjo1 Hi, there is already a field for PLODs in every character. app/models/character.js At the moment, these values are null for every character and therefore won't be displayed. PLOD needs to be inserted

mammuth commented 8 years ago

Thanks for the explanation. :+1:

sacdallago commented 8 years ago

Wait, wait, wait.. @togiberlin you are aware that PLOD's are two, right? https://github.com/Rostlab/JS16_ProjectA/blob/63a9d48ba0a03767fa3991cee1aa0fdf2370eee8/app/models/character.js#L18

To me it makes much more sense if you implement it the way you implemented sentiments. Separate calls, separate collections: https://github.com/Rostlab/JS16_ProjectA/blob/63a9d48ba0a03767fa3991cee1aa0fdf2370eee8/app/models/characterSentiment.js

togiberlin commented 8 years ago

@sacdallago Ok, and inside the characterPLOD model you do want two separate fields, right? plod1: Number and plod2: Number

sacdallago commented 8 years ago

Let's start of with I am inferring logic: You can simply store two entries for the same character, similarly as I THINK the idea is behind the twitter sentiment: https://github.com/Rostlab/JS16_ProjectA/blob/63a9d48ba0a03767fa3991cee1aa0fdf2370eee8/app/models/characterSentiment.js

Based on the number of X results, F / @jorjo1 can render X tabs showing the different entries.

Correct me if this doesn't make sense. Also, @togiberlin can you please confirm that's how your team-members have thought of implementing the sentiment thing? Otherwise we have a problem there as well, as only one team is represented per document.

sacdallago commented 8 years ago

P.S.: this would allow in the future to simply add entries in the database and have the webpage immediately render the third-machine learning device calculation: :heavy_check_mark: modularity, :heavy_check_mark: reusability

togiberlin commented 8 years ago

@sacdallago, yes you can store two values for a character, however how we want to differentiate between Project B, Group 6 / Group 7? I was thinking of this: var CharacterPlodSchema = new Schema({ character : {type: Schema.Types.ObjectId, ref: 'Character'}, plod1: Number, //% likelihood of death. Project B, Group 6 plod2: Number //% likelihood of death. Project B, Group 7 });

sacdallago commented 8 years ago

You did not quite understand what I told you :D @Adiolis @kordianbruck can you help me out here please? How is the Twitter thing implemented? (read my previous comments)

and for @togiberlin : What if tomorrow there is a new machine learning device that calculates a new PLOD? You'd have to completely redesign the schema. A much easier solution is:

var CharacterPlodSchema = new Schema({
      character : {type: Schema.Types.ObjectId, ref: 'Character'},
      plod: Number, //% likelihood of death.
      description: String //% Whatever. B7, B6, Method XYZ
});
sacdallago commented 8 years ago

Ok. I saw the commits, I like where this is going! I think that this is now settled, can we close?

togiberlin commented 8 years ago

@sacdallago What I have to add are the API routes/controllers to add/edit the PLOD values. It should be done with the next couple hours

kordianbruck commented 8 years ago

@togiberlin please remove status as it is redundant information, that is already saved in the character itself, if he/she is alive. Also description would be better named algorithm

togiberlin commented 8 years ago

@kordian did this. The PLOD thing has it's own controller/store file and API routes now.

kordian-kowalski commented 8 years ago

@togiberlin I think you got the wrong Kordian :)

kordianbruck commented 8 years ago

@KORDiAN it's me <3

@togiberlin thanks! Why did you add routes for character edit/delete?

sacdallago commented 8 years ago

@kordianbruck I like the description more because they might be using the same ML device!

kordianbruck commented 8 years ago

@sacdallago it might be the same device but different configuration of the algorithm (used features) - so I think is makes it clearer...

sacdallago commented 8 years ago

Our first couple fight, ohw :heart:

kordianbruck commented 8 years ago

Let's compromise, cause thats what you do in a relationship: descrithm k? :+1:

Legenzoo commented 8 years ago

Status?

I just assigned togi, because he has been doing this stuff. I have no clue about this at all.

Legenzoo commented 8 years ago

Again, status? Milestone is feature freeze...

togiberlin commented 8 years ago

@adiolis All GET methods should work. However, I couldn't figure out this access token thing, which is needed for adding/editing/removing data via API. I don't know if it's a bug or something. I asked @kordianbruck over fb for assistance. I think he knows better than me, how this access token works

Legenzoo commented 8 years ago

So only the testing is here left?

kordianbruck commented 8 years ago

token works now. Was an issue with multi threaded setup....

mina-kleid commented 8 years ago

I am a bit confused now, so getting a character by id or name has a PLOD inside it ? or i have to make a unique request for the character PLOD (i.e. https://api.got.show/api/plod/byId/:id ) ?

sacdallago commented 8 years ago

The PLOD is not in the character, you need a separate call like the one you put there. That was the design. If no one corrects me, then you have your answer.

mina-kleid commented 8 years ago

Ok any idea how the returned object looks like ?

sacdallago commented 8 years ago

https://github.com/Rostlab/JS16_ProjectA/blob/master/app/models/characterPlod.js

mina-kleid commented 8 years ago

Excuse my ignorance, but does the reference to the character model mean that all the character model attributes will be embedded also inside it? and if not i need at least an id or name

sacdallago commented 8 years ago

You have the same ability to navigate files as everyone else :laughing: https://github.com/Rostlab/JS16_ProjectA/blob/master/routes.js#L50

mina-kleid commented 8 years ago

@sacdallago Well its not normal to understand the code and navigate other project to understand how is the response looking like, the api doesnt return a sample object i can check or the documentation specifies how it should look like, and i have no idea which technology they are using or framework !!

sacdallago commented 8 years ago

Yes but all of the questions you are asking have already been asked, discussed and answered in this discussion if you scroll long enough and look at the commits ;) I am sorry but I get very irritable when I have to repeat things, it's one of those things I ought to become better at :laughing:

mina-kleid commented 8 years ago

no worries, But i still cant see an answer on how the response is going to look like. and excuse my ignorance one more time i am not aware of the technology they are using and what it means that the character model is referenced inside the characterPlod model. does that mean all the character attributes be embedded in the response or will be ingored

sacdallago commented 8 years ago

It depends on which of the GET calls you call. If you GET by alg I suppose you get the schema obj as the one I posted above for all chars with that alg. Yes. The _id of the char will be in the obj, not the entire obj. So you have to join the chars with the respective PLOD. That's usually how these things work, but maybe @togiberlin implemented it differently. Instead if you GET the PLOD of a character via _id you should get TWO objects, one is one PLOD and the otherone is the other PLOD, as in group 6 'nd 7.

sacdallago commented 8 years ago

https://api.got.show/api/plod