freme-project / Broker

FREME Broker
Apache License 2.0
2 stars 0 forks source link

[e-Terminology] html output no references to tilde terms #137

Open bjdmeest opened 8 years ago

bjdmeest commented 8 years ago

When using e-terminology, informat=text/html and outformat=text/html results in html that only notes if a word is detected as a term, but no reference to the actual tilde terms, shouldn't these references be included? The references are included in, e.g., outformat=text/n3.

POSTing http://api-dev.freme-project.eu/current/e-terminology/tilde?informat=text%2Fhtml&outformat=text%2Fhtml&source-lang=en&target-lang=en&mode=annotation with body <p>Paris is a city in France.</p> returns <html><head><body><p><span its-term="yes">Paris</span> is a <span its-term="yes">city</span> in <span its-term="yes">France</span>.</p></body></html> This is the same for mode=annotation as for mode=full

jnehring commented 8 years ago

@borriellom can you comment on this?

fsalliau commented 8 years ago

@borriellom @jnehring @bjdmeest hi all any news on this topic?

borriellom commented 8 years ago

Sorry for the late reply. At the moment the term is represented in the HTML document by using the ITS Terminology category. I'm not an expert, but I don't think we can refer the actual Tilde term. What we can do is to use the termInfoRef attribute that can contain an IRI referring to the resource providing information about the term. You can find more on this in the ITS 2.0 Specification.

I hope this answers your question.

jnehring commented 8 years ago

@borriellom can you implement this?

andish commented 8 years ago

This is example of NIF turtle containing term and annotation:

@prefix : <https://term.tilde.com/terms/>.

      ...

<https://services.tilde.com/document/1#char=0,5> nif:anchorOf "Paris"@en;
   nif:annotationUnit _:autos6790;
   nif:beginIndex "0"^^xsd:nonNegativeInteger;
   nif:endIndex "5"^^xsd:nonNegativeInteger;
   nif:referenceContext <https://services.tilde.com/document/1>;
   a nif:RFC5147String;
   itsrdf:term "yes";
   itsrdf:termInfoRef :357963.

   ... 

And into HTML it goes like this:

<span its-term="yes" its-term-info-ref="https://term.tilde.com/terms/357963">Paris</span>

I wondering, what happens, when the term has multiple term references? How it can be included in HTML markup?

If someone wants to get any term info, it must query that IRI.

If there is a need to include full or partial term info into the HTML file, it could be done using < script > tag with id:

<script id="https://term.tilde.com/terms/357963" type="application/ld+json">
  {
  "@graph": [
    {
      "@id": "_:b0",
      "label": {
        "@language": "en",
        "@value": "Paris"
      },
      "itsrdf:taConfidence": 1
    },
    {
      "@id": "http://freme-project.eu/#char=0,5",
      "@type": [
        "nif:Context",
        "nif:String",
        "nif:RFC5147String"
      ],
      "anchorOf": {

   ...etc...
</script>
fsasaki commented 8 years ago

@bjdmeest, the output that is embedded in the HTML markup will always be partial. The script tag sounds like a good solution. That would require a workflow like: 1) call e-terminology with HTML roundtripping to generate attributes like its-term-info-ref="https://term.tilde.com/terms/357963 2) call e-terminology with the same HTML content, but this time with json-ld output. The output will contain URIs (or abbreviated forms) like https://term.tilde.com/terms/357963 which you can use in javascript processing to e.g. visualize all term information. not nice, but I don't see a way to store all term information in HTML "inline".

bjdmeest commented 8 years ago

@fsasaki yes, that sounds like a good workflow to me :). Indeed, not everything can be stored inside the HTML, but a reference to the term URI would already be great :)

jnehring commented 8 years ago

@bjdmeest did you use this workflow? How did it work out? Can we close this issue?

bjdmeest commented 8 years ago

@jnehring Sorry for the late reply: current HTML roundtripping does not include the its-term-info-ref attributes, so I was not able to test this workflow yet