freme-project / e-services

Apache License 2.0
1 stars 1 forks source link

Update dbpedia spotlight to NIF 2.1 #31

Open jnehring opened 7 years ago

jnehring commented 7 years ago

FREME does not generate any NIF when using DBPedia spotlight. The conversion from plaintext to NIF is done at DBPedia spotlight. Also the annotations are generated by DBPedia spotlight. So it is hard for us to update the output of dbpedia spotlight to NIF 2.1.

@m1ci what are the plans regarding dbpedia spotlight and nif 2.1? is an update planned?

m1ci commented 7 years ago

on FREME side we can update the return from dbpedia spotlight so that it is NIF 2.1 ready.

sandroacoelho commented 7 years ago

Hi @m1ci , @jnehring

I will upgrade our NIF wraper to 2.1 for DBpedia Spotlight.

jnehring commented 7 years ago

When this is finished we need to update the API documentation. https://github.com/freme-project/freme-project.github.io/issues/294 added the parameter to all e-Services except dbpedia spotlight.

sandroacoelho commented 7 years ago

Hi @m1ci , @jnehring

Spotlight has been updated to generate NIF 2.1. We don't need to use proxies anymore

Best,

jnehring commented 7 years ago

Thank you I will test. The latest version is not installed on freme-dev because of https://github.com/freme-project/basic-services/issues/119 . I will fix it and test afterwards.

jnehring commented 7 years ago

curl -X POST -H "Cache-Control: no-cache" -H "Postman-Token: c858ca9c-e4c8-fd55-9270-520160da243a" -d '' "http://rv1443.1blu.de/current/e-entity/dbpedia-spotlight/documents?confidence=0.3&input=This%2Bis%2BGermany&informat=text&language=en"

replies

{
  "exception": "eu.freme.common.exception.ExternalServiceFailedException",
  "path": "/e-entity/dbpedia-spotlight/documents",
  "error": "Bad Gateway",
  "status": 502,
  "timestamp": 1484645337262
}

Probably dbpedia spotlight is down right now,.

m1ci commented 7 years ago

DBpedia spotlight now is using another endpoint and @sandroacoelho appropriately updated it in the FREME code. I guess the FREME instance running at http://rv1443.1blu.de/ is not using the latest code...maybe.

jnehring commented 7 years ago

Right it did not use the latest code. I updated it and now the API request produces NIF 2.1.

One question: @sandroacoelho did you implement a nif-version parameter? Or does DBPedia spotlight produce nif 2.1 always?

sandroacoelho commented 7 years ago

DBpedia Spotlight always produces NIF 2.1, but we can add this parameter there if is useful

jnehring commented 7 years ago

Ok. I think we do not need to add the parameter. Also when there is no parameter we do not need to update the documentation. So this topic is done. Many thanks for the implementation :)

m1ci commented 7 years ago

@sandroacoelho it seems only english is enabled for dbpedia spotlight in FREME. Can you please enable all other possible languages that are available from this dbpedia spotlight intance?

m1ci commented 7 years ago

@sandroacoelho please also update the documentation page

@jnehring how can we also have this updates fixed in the live instance?

jnehring commented 7 years ago

documentation is updated. Now there is a problem in the live instance:

http://api.freme-project.eu/current/e-entity/dbpedia-spotlight/documents?confidence=0.3&input=This+is+Germany&informat=text&language=es&outformat=turtle

produces

{
  "exception": "eu.freme.common.exception.BadRequestException",
  "path": "/e-entity/dbpedia-spotlight/documents",
  "message": "java.nio.charset.MalformedInputException: Input length = 1",
  "error": "Bad Request",
  "status": 400,
  "timestamp": 1485268432877
}

But it seems this was fixed on dev. @sandroacoelho did you change the codes of dbpedia spotlight after the FREME 1.0 release?

http://rv1443.1blu.de/current/e-entity/dbpedia-spotlight/documents?confidence=0.3&input=This+is+Germany&informat=text&language=es&outformat=turtle

m1ci commented 7 years ago

last change to the dbpedia spotlight code has been done on Jan 18, 2017 which seems to be a day before the release. Maybe the pom version has not been updated and thus the code changes not considered in the release?

See https://github.com/freme-project/e-services/commits/master

jnehring commented 7 years ago

I dont think so because dbpedia spotlight was released to version 1.0 which is installed on the live server. Also on dev the 1.0 version is installed still. This is odd... but we need to get the dbpedia spotlight service fixed before the review.

m1ci commented 7 years ago

actually it works, but with this request

http://api.freme-project.eu/current/e-entity/dbpedia-spotlight/documents?language=de&dataset=dbpedia&mode=all&outformat=turtle&informat=text&input=Diego%20Maradona%20is%20from%20Argentina

jnehring commented 7 years ago

I am not sure what is the difference between your and my API request.

This example has exactly the same parameters, only the input text differs. It works for "Diego Maradonna is form Argentina" and it does not work for "This is Germany":

http://api.freme-project.eu/current/e-entity/dbpedia-spotlight/documents?confidence=0.3&input=This+is+Germany&informat=text&language=es&outformat=turtle&dataset=dbpedia&mode=all

http://api.freme-project.eu/current/e-entity/dbpedia-spotlight/documents?confidence=0.3&input=Diego%20Maradona%20is%20from%20Argentina&informat=text&language=es&outformat=turtle&dataset=dbpedia&mode=all

m1ci commented 7 years ago

Also if you switch the language parameter from en to es, then it works. @sandroacoelho, can you investigate?

sandroacoelho commented 7 years ago

Hi @jnehring , @m1ci,

The problem is with our Spanish DBpedia Spotlight instance. I am checking the server right now.