Closed jnehring closed 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?
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.
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.
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.
@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.
done. @m1ci please check and close the issue.
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?
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.
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
Please add an enum "type" to the template model with values
SPARQL
andLDF
. Please set SPARQL as default value.