Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.

Relationship not getting store fix - #79

Merged
ansjin merged 13 commits into
developfrom
relationship_not_getting_store_fix
Jun 4, 2017
Merged

ansjin merged 13 commits into
developfrom
relationship_not_getting_store_fix

Conversation

@ansjin

@ansjin ansjin commented May 4, 2017

Copy link
Copy Markdown
Member

No description provided.

@ansjin
ansjin requested review from Henni and Sandr0x00 May 4, 2017 10:48
Bauer Sandro added 2 commits May 4, 2017 16:01
+ fixed some stuff in the fileparser, regarding reading local files
Additionally, we should NOT create Aritsts!
Comment thread app/dbConnection/index.js Outdated

})
.then(newEntity => {
return artist.setEntity(newEntity).then(() => newEntity);

@Sandr0x00 Sandr0x00 May 4, 2017 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should NOT set that here? @ansjin what do you think?
The artist.setEntity(...) stuff.

Comment thread app/dbConnection/index.js Outdated
let entities = context.models.entities;
let eventJSON = eventEntityJSON.content;
return artists.findOrCreate({ // TODO: change to findOne
return artists.find({

@Sandr0x00 Sandr0x00 May 4, 2017 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reason for null-artists, Before merging, please check this case as well!

Comment thread app/dbConnection/index.js Outdated
// TODO: remove the limit
context.sequelize.query(
'SELECT * from (SELECT blob_url, COUNT(*) as count FROM (select * from websites limit 1000) w LEFT JOIN contains c ON w.id = c."websiteId" GROUP BY blob_url ORDER BY count DESC) a where a.count > 50;',
'SELECT * from (SELECT blob_url, COUNT(*) as count FROM (select * from websites limit 100000 ) w LEFT JOIN contains c ON w.id = c."websiteId" GROUP BY blob_url ORDER BY count DESC) a where a.count > 5;',

@Henni Henni May 4, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • remove limit
  • make threshold configurable and pass it into the query

Comment thread app/dbConnection/index.js Outdated
.then(newEntity => {
return entities.create({
'name': entityName,
'artist_type': 'Composer'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Entity has no artist type, but artist has.

Comment thread app/dbConnection/index.js
});
}

exports.writeEvents = function (eventEntityJSON) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ansjin I do not understand this method, can you check that again please?
Problems:

  • The stuff i wrote in other comments
  • In the last then, we collect all promises, but then ignore them?
  • We should create a event, even if we have no corresponding artist or entity.
  • We should not create artists!
  • We should not create entities? Or should we? Makes no sense in my Opinion.

I think the best way would be to create relationshipEntities. Maybe.

We should check if entityName is undefined or null, before creating null-entries ;)
Where do we get the entityName? Does the algorithm already know the entity?

@ansjin

ansjin commented May 5, 2017

Copy link
Copy Markdown
Member Author

no merging until we test this!

@kordianbruck

Copy link
Copy Markdown
Contributor

@anshul0708 @SANDR00 can we get this merged please, so we have it for our run?

@ansjin

ansjin commented Jun 3, 2017

Copy link
Copy Markdown
Member Author

@kordianbruck you tagged here the other anshul :)

@ansjin

ansjin commented Jun 3, 2017

Copy link
Copy Markdown
Member Author

@Henni Please approve this!

@ansjin
ansjin merged commit 0f3d0e3 into develop Jun 4, 2017
@ansjin
ansjin deleted the relationship_not_getting_store_fix branch June 4, 2017 15:26
@kordianbruck

Copy link
Copy Markdown
Contributor

@ansjin happens to me every time 😢

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants