freme-project / e-services

Apache License 2.0
1 stars 1 forks source link

[e-link_dev] bad HTML return #23

Closed bjdmeest closed 8 years ago

bjdmeest commented 8 years ago

when I run following curl, the returned HTML is all mangled up, it's like the spans are placed one letter too much to the right.

curl 'http://api-dev.freme-project.eu/current/e-entity/freme-ner/documents?informat=text%2Fhtml&outformat=text%2Fhtml&language=en&dataset=dbpedia&mode=all' -H 'Origin: http://localhost:63343' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-GB,en-US;q=0.8,en;q=0.6' -H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2782.1 Safari/537.36' -H 'Content-Type: text/html' -H 'Accept: text/n3' -H 'Referer: http://localhost:63343/CKEditor-Plugin/ckeditor/samples/freme.html?_ijt=1f2h7b8k9q28rg7m6ubdcq7hii' -H 'Connection: keep-alive' --data-binary '<p>Dissident Chinese artist Ai Weiwei has been refused a six-month visa by the British government amid claims he lied on his visa application form. Ai posted a letter on Instagram stating his entry to the UK had been restricted because he failed to declare his "criminal conviction". But Ai, though detained in China for 81 days in 2011, has never been charged or convicted of a crime in China. The artist was granted a 20-day visa to attend the opening of his London show.</p>' --compressed
ArneBinder commented 8 years ago

This seems to be a bug of e-Internalisation. Sending the raw text content works fine, as expected:

@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix itsrdf: <http://www.w3.org/2005/11/its/rdf#> .
@prefix nif:   <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .

<http://freme-project.eu/#char=10,17>
        a                     nif:Phrase , nif:Word , nif:RFC5147String , nif:String ;
        nif:anchorOf          "Chinese"^^xsd:string ;
        nif:beginIndex        "10"^^xsd:int ;
        nif:endIndex          "17"^^xsd:int ;
        nif:referenceContext  <http://freme-project.eu/#char=0,470> ;
        itsrdf:taClassRef     <http://www.w3.org/2002/07/owl#Thing> , <http://dbpedia.org/ontology/Language> ;
        itsrdf:taConfidence   "0.8768297988175746"^^xsd:double ;
        itsrdf:taIdentRef     <http://dbpedia.org/resource/Chinese_language> .

<http://freme-project.eu/#char=285,287>
        a                     nif:Word , nif:String , nif:Phrase , nif:RFC5147String ;
        nif:anchorOf          "Ai"^^xsd:string ;
        nif:beginIndex        "285"^^xsd:int ;
        nif:endIndex          "287"^^xsd:int ;
        nif:referenceContext  <http://freme-project.eu/#char=0,470> ;
        itsrdf:taClassRef     <http://nerd.eurecom.fr/ontology#Location> ;
        itsrdf:taConfidence   "0.4120373593663368"^^xsd:double ;
        itsrdf:taIdentRef     <http://dbpedia.org/resource/Artificial_intelligence> .

<http://freme-project.eu/#char=458,464>
        a                     nif:String , nif:Phrase , nif:Word , nif:RFC5147String ;
        nif:anchorOf          "London"^^xsd:string ;
        nif:beginIndex        "458"^^xsd:int ;
        nif:endIndex          "464"^^xsd:int ;
        nif:referenceContext  <http://freme-project.eu/#char=0,470> ;
        itsrdf:taClassRef     <http://dbpedia.org/ontology/PopulatedPlace> , <http://dbpedia.org/ontology/Location> , <http://nerd.eurecom.fr/ontology#Location> , <http://dbpedia.org/ontology/Settlement> , <http://dbpedia.org/ontology/Place> ;
        itsrdf:taConfidence   "0.9462773207624285"^^xsd:double ;
        itsrdf:taIdentRef     <http://dbpedia.org/resource/London> .

<http://freme-project.eu/#char=25,34>
        a                     nif:String , nif:Word , nif:RFC5147String , nif:Phrase ;
        nif:anchorOf          "Ai Weiwei"^^xsd:string ;
        nif:beginIndex        "25"^^xsd:int ;
        nif:endIndex          "34"^^xsd:int ;
        nif:referenceContext  <http://freme-project.eu/#char=0,470> ;
        itsrdf:taClassRef     <http://dbpedia.org/ontology/Person> , <http://dbpedia.org/ontology/Artist> , <http://dbpedia.org/ontology/Agent> , <http://nerd.eurecom.fr/ontology#Person> ;
        itsrdf:taConfidence   "0.9718246960349378"^^xsd:double ;
        itsrdf:taIdentRef     <http://dbpedia.org/resource/Ai_Weiwei> .

<http://freme-project.eu/#char=202,204>
        a                     nif:String , nif:Word , nif:RFC5147String , nif:Phrase ;
        nif:anchorOf          "UK"^^xsd:string ;
        nif:beginIndex        "202"^^xsd:int ;
        nif:endIndex          "204"^^xsd:int ;
        nif:referenceContext  <http://freme-project.eu/#char=0,470> ;
        itsrdf:taClassRef     <http://dbpedia.org/ontology/PopulatedPlace> , <http://dbpedia.org/ontology/Location> , <http://dbpedia.org/ontology/Place> , <http://dbpedia.org/ontology/Country> , <http://nerd.eurecom.fr/ontology#Location> ;
        itsrdf:taConfidence   "0.987058692626895"^^xsd:double ;
        itsrdf:taIdentRef     <http://dbpedia.org/resource/United_Kingdom> .

<http://freme-project.eu/#char=0,470>
        a               nif:String , nif:Context , nif:RFC5147String ;
        nif:beginIndex  "0"^^xsd:int ;
        nif:endIndex    "470"^^xsd:int ;
        nif:isString    "Dissident Chinese artist Ai Weiwei has been refused a six-month visa by the British government amid claims he lied on his visa application form. Ai posted a letter on Instagram stating his entry to the UK had been restricted because he failed to declare his \"criminal conviction\". But Ai, though detained in China for 81 days in 2011, has never been charged or convicted of a crime in China. The artist was granted a 20-day visa to attend the opening of his London show."^^xsd:string .

<http://freme-project.eu/#char=385,390>
        a                     nif:String , nif:RFC5147String , nif:Phrase , nif:Word ;
        nif:anchorOf          "China"^^xsd:string ;
        nif:beginIndex        "385"^^xsd:int ;
        nif:endIndex          "390"^^xsd:int ;
        nif:referenceContext  <http://freme-project.eu/#char=0,470> ;
        itsrdf:taClassRef     <http://dbpedia.org/ontology/Place> , <http://dbpedia.org/ontology/PopulatedPlace> , <http://dbpedia.org/ontology/Location> , <http://dbpedia.org/ontology/Country> , <http://nerd.eurecom.fr/ontology#Location> ;
        itsrdf:taConfidence   "0.9966052698102266"^^xsd:double ;
        itsrdf:taIdentRef     <http://dbpedia.org/resource/China> .

<http://freme-project.eu/#char=145,147>
        a                     nif:Word , nif:RFC5147String , nif:String , nif:Phrase ;
        nif:anchorOf          "Ai"^^xsd:string ;
        nif:beginIndex        "145"^^xsd:int ;
        nif:endIndex          "147"^^xsd:int ;
        nif:referenceContext  <http://freme-project.eu/#char=0,470> ;
        itsrdf:taClassRef     <http://nerd.eurecom.fr/ontology#Person> ;
        itsrdf:taConfidence   "0.576344061630415"^^xsd:double ;
        itsrdf:taIdentRef     <http://dbpedia.org/resource/Artificial_intelligence> .

<http://freme-project.eu/#char=167,176>
        a                     nif:Phrase , nif:RFC5147String , nif:String , nif:Word ;
        nif:anchorOf          "Instagram"^^xsd:string ;
        nif:beginIndex        "167"^^xsd:int ;
        nif:endIndex          "176"^^xsd:int ;
        nif:referenceContext  <http://freme-project.eu/#char=0,470> ;
        itsrdf:taClassRef     <http://dbpedia.org/ontology/Software> , <http://dbpedia.org/ontology/Work> , <http://nerd.eurecom.fr/ontology#Organization> ;
        itsrdf:taConfidence   "0.41672582730870034"^^xsd:double ;
        itsrdf:taIdentRef     <http://dbpedia.org/resource/Instagram> .

<http://freme-project.eu/#char=308,313>
        a                     nif:Word , nif:RFC5147String , nif:String , nif:Phrase ;
        nif:anchorOf          "China"^^xsd:string ;
        nif:beginIndex        "308"^^xsd:int ;
        nif:endIndex          "313"^^xsd:int ;
        nif:referenceContext  <http://freme-project.eu/#char=0,470> ;
        itsrdf:taClassRef     <http://dbpedia.org/ontology/Location> , <http://dbpedia.org/ontology/PopulatedPlace> , <http://dbpedia.org/ontology/Country> , <http://nerd.eurecom.fr/ontology#Location> , <http://dbpedia.org/ontology/Place> ;
        itsrdf:taConfidence   "0.997960791639201"^^xsd:double ;
        itsrdf:taIdentRef     <http://dbpedia.org/resource/China> .

<http://freme-project.eu/#char=76,94>
        a                     nif:String , nif:RFC5147String , nif:Word , nif:Phrase ;
        nif:anchorOf          "British government"^^xsd:string ;
        nif:beginIndex        "76"^^xsd:int ;
        nif:endIndex          "94"^^xsd:int ;
        nif:referenceContext  <http://freme-project.eu/#char=0,470> ;
        itsrdf:taClassRef     <http://nerd.eurecom.fr/ontology#Organization> ;
        itsrdf:taConfidence   "0.6656248757521315"^^xsd:double ;
        itsrdf:taIdentRef     <http://dbpedia.org/resource/Government_of_the_United_Kingdom> .
ArneBinder commented 8 years ago

Moved to https://github.com/freme-project/basic-services/issues/55.