freme-project / freme-ner

Apache License 2.0
6 stars 1 forks source link

Implement NIF 2.1 changes #142

Closed jnehring closed 8 years ago

jnehring commented 8 years ago

Please implement changes to implement NIF 2.1 annotations. The use of annotation units should be switched on / off using a parameter "nif-version=2.0" or "nif-version=2.1" with the default value being "2.0"

jnehring commented 8 years ago

I wanted to implement the conversion of plaintext to NIF into FREME NER. I already implemented the API parameter: https://github.com/freme-project/freme-ner/blob/master/src/main/java/org/elinker/core/rest/FremeNerEnrichment.java#L101

Then I found out, that the NIF is generated inside of the Scala code. So I think you need to pass the NIFVersion parameter from the Rest API to the Scala code,.

m1ci commented 8 years ago

here is NIF output that will be produced by FREME NER after it implements NIF 2.1

https://raw.githubusercontent.com/freme-project/freme-ner/nif21/src/test/resources/nif21/fremener-spotlinkclassify-nif21.ttl

sandroacoelho commented 8 years ago

Hi @m1ci , @jnehring ,

FREME NER is ready for NIF 2.1. Thanks both for the support. Concerning to this item, I have two pending tasks that I intend to close today

jnehring commented 8 years ago

This API request fails with Internal Server Exception, message in the logs:

ERROR   2016-08-31 10:28:41,543 [http-nio-7001-exec-4] eu.freme.common.exception       .ExceptionHandlerService  - Request: http://rv2622.1blu.de:7001/e-entity/freme-ner/documents raised
java.lang.NullPointerException
        at org.elinker.core.rest.FremeNerEnrichment.execute(FremeNerEnrichment.java:105)

This line fails:

nifVersion = nifVersion == null && nifVersion.isEmpty() ? RDFConstants.nifVersion2_0 : nifVersion;

nifVersion==null && nifVersion.isEmpty() must fail when nifVersion is null.

m1ci commented 8 years ago

nif-version should be an optional parameter with default value of 2.0? right @jnehring? or default value is 2.1? I think at the moment nif-version is not an optional parameter BTW, here you can check the NIF 2.1 output for FREME NER.

sandroacoelho commented 8 years ago

NullPointerException fixed.

TODOs::

jnehring commented 8 years ago

nif-version should be an optional parameter with default value of 2.0? right @jnehring?

right

m1ci commented 8 years ago

the task is finished, @jnehring please check and close

jnehring commented 8 years ago

i tested it and it looks good. this task is finished