freme-project / e-Link

Apache License 2.0
0 stars 0 forks source link

Update template model #46

Closed jnehring closed 9 years ago

jnehring commented 9 years ago

Please add an enum "type" to the template model with values SPARQL and LDF. Please set SPARQL as default value.

m1ci commented 9 years ago

also it looks that the template based enrichment is performed with the templates stored in RDF, not the one from the database. I suggest we switch only to one - database. In this direction, can you please provide how we can in DataEnricher retrieve template by ID?

jnehring commented 9 years ago

also it looks that the template based enrichment is performed with the templates stored in RDF, not the one from the database

Thanks for the update. Will discuss this with @ArneBinder tomorrow.

can you please provide how we can in DataEnricher retrieve template by ID?

1st get the template repository which is defined in FREMECommon. Requires FREMECommonConfig to be imported to your config.

import eu.freme.common.persistence.repository.TemplateRepository;
...
@Autowired
TemplateRepository templateRepository

Then use repository:

Template template = templateRepository.findOneById( "123" );

Right now the template ID is implemented as string but I am quiet sure that this will change to an Integer in the near future.

ArneBinder commented 9 years ago

I added a field "type" to the template model, can be used via getter/setter. Should the value be auto-infered in any way or do we have to change the POST and PUT method?

also it looks that the template based enrichment is performed with the templates stored in RDF, not the one from the database.

@m1ci why do you assume that? The currently used and autowired TemplateDAO uses the MySQL database.

m1ci commented 9 years ago

I added a field "type" to the template model, can be used via getter/setter. Should the value be auto-infered in any way or do we have to change the POST and PUT method?

Thanks will try now. Well, the type value influences the GET, PUT and POST. Not sure if we should change them.

Should the value be auto-infered

If this refers to a default value, then, yes, if the user does not specify he endpoint type, then by default we can assume that it is a SPARQL endpoint and set the value to SPARQL.

@m1ci why do you assume that? The currently used and autowired TemplateDAO uses the MySQL database.

My mistake, you are right - it uses the database.

ArneBinder commented 9 years ago

@m1ci sorry, there are still some problems with the new type field, had to remove it temporarily. I will let to know you, when it is fixed.

jnehring commented 9 years ago

done. @m1ci please check and close the issue.

m1ci commented 9 years ago

I see the type field is implemented as parameter when submitting the query. I think this info should be part of the JSON template. If it is OK with you, I'll remove the param and add this as part of the JSON object. Any objections?

jnehring commented 9 years ago

I see the type field is implemented as parameter when submitting the query. I think this info should be part of the JSON template. If it is OK with you, I'll remove the param and add this as part of the JSON object. Any objections?

Ok. I guess this will break the integration tests. Please run the integration tests when you do this update.

m1ci commented 9 years ago

Ok. I guess this will break the integration tests. Please run the integration tests when you do this update.

Yes, it broke the integration tests, but I fixed them and now it compiles OK. Jenkins also shows that it compiles OK. Since this task is done, I'm closing this issue. Instructions on how to use the endpoint-type field can be found here: https://github.com/freme-project/e-Link/issues/29#issuecomment-148036658