freme-project / e-services

Apache License 2.0
1 stars 1 forks source link

Add nif version annotation to e-Translation and e-Terminology output #45

Closed jnehring closed 7 years ago

jnehring commented 7 years ago

When nif-version=2.1 is set then e-Services should add rdf data to annotate the nif version. This is already implemented in freme ner (example). The added RDF is:

<http://freme-project.eu/#collection>
        a               nif:ContextCollection ;
        nif:hasContext  <http://freme-project.eu/#offset_0_33> ;
        <http://purl.org/dc/terms/conformsTo>
                <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core/2.1> .

This will prevent problems like #113

andish commented 7 years ago

I don't think that each e-service should add such general info.
Context collection (nif:ContextCollection) should be created by client submitting the NIF or by FREME server while converting from any format to NIF. Of course, the FREME server can normalize/tune up/refine the NIF ducument, but this should be done in one place not in each e-service.

jnehring commented 7 years ago

I see your point. @m1ci what do you think?

m1ci commented 7 years ago

since FREME acts as broker, this info can be also added by FREME.

m1ci commented 7 years ago

whats the status of this issue? @andish @jnehring

jnehring commented 7 years ago

We did not work on this issue. I will ask @bgrusdt to implement it in the broker.

jnehring commented 7 years ago

@bgrusdt please implement this feature in FREMECommon

bgrusdt commented 7 years ago

I have implemented it in this commit. I have not yet included called the new method in e-translation and e-terminology.

bgrusdt commented 7 years ago

This is now included for e-translation and e-terminology.

jnehring commented 7 years ago

Thank you! One more thing:

When the prefix parameter is set, then please change the collection also:

Example:

curl -X POST -H "Cache-Control: no-cache" -H "Postman-Token: ab7dc708-5b2e-80ca-f2ca-57fd96901c0b" -d 'Show me the source of knowledge' "http://api-dev.freme-project.eu/current/e-translation/tilde?input=Hello%2C%20world!&informat=text&outformat=turtle&source-lang=en&target-lang=de&nif-version=2.1&prefix=http%3A%2F%2Ftest.de"

produces

@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix itsrdf: <http://www.w3.org/2005/11/its/rdf#> .
@prefix its:   <http://www.w3.org/2005/11/its> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix nif:   <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .

<http://test.de/#offset_0_5>
        a                     nif:Phrase , nif:OffsetBasedString ;
        nif:anchorOf          "Hello"^^xsd:string ;
        nif:annotationUnit    [ itsrdf:taAnnotatorsRef  <https://services.tilde.com/systems/translation/smt-c71f6f22-5e2a-4682-a4cc-2d97d38fac5e> ;
                                itsrdf:target           "Guten Tag"@de
                              ] ;
        nif:beginIndex        "0"^^xsd:nonNegativeInteger ;
        nif:endIndex          "5"^^xsd:nonNegativeInteger ;
        nif:referenceContext  <http://test.de/#offset_0_13> .

<http://freme-project.eu/#collection>
        a               nif:ContextCollection ;
        nif:hasContext  <http://test.de/#offset_0_13> ;
        <http://purl.org/dc/terms/conformsTo>
                "http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core/2.1" .

The line <http://freme-project.eu/#collection> should use the prefix parameter also.

bgrusdt commented 7 years ago

@jnehring I have changed this with this commit. I've also updated the calls to this method in e-translation and e-terminology.

jnehring commented 7 years ago

ok great thanks