We use proprietary and third party's cookies to improve your experience and our services, identifying your Internet Browsing preferences on our website; develop analytic activities and display advertising based on your preferences. If you keep browsing, you accept its use. You can get more information on our Cookie Policy
Cookies Policy
Semantic Annotation Open RESTful API Specification - FIWARE Forge Wiki

Semantic Annotation Open RESTful API Specification

From FIWARE Forge Wiki

Jump to: navigation, search

Contents

Introduction to Semantic Annotation API

The enabler basically consists of an API, which can be called by a simple HTTP GET request to an URL plus some parameters in order to obtain a specific JSON result, related to the input text. This API processes the input text in order to find entities (Persons, places, organizations) and associate to each entity a list of specific candidates coming from Linked Open Data Datasets (i.e. Dbpedia, Geonamesm, etc.)

This document specifically explains the interaction and result structure for the Semantic Annotation API. For further details about datasets and general info about the enabler check the Open Specifications.

API Operations

Verb URI Description
GET http://semantican.lab.fi-ware.eu/ajax/extract_words.php Semantically Annotate Text

Response codes:

  • JSON Response - If the request is successful (even if no entity is found in text)
  • HTTP/1.1 500 - If there are some unidentified errors.

API Parameters

Parameter shall be passed as HTTP 1.1 - GET:

Parameter Accepted Values Description
text urlencoded text The text to annotate
html_snippets on|off Tell the system to return or not the HTML Snippets related to entities

API Result

Returns Entities and Related Information in JSON format. Main parameters are:

Return Parameter Description
queyId Query Id, in order to cache queries and results (for future applications)
keywords The keywords found
terms array, each entry contains info about an entity
candidates array of candidates for each entity, each entry contains info about a candidate

for each "candidate" entry:

Return Parameter Description
label human readable label for the candidate
uri candidate URI
wrapper data source containing the candidate
sc relevance score for the entity
preferred parameter set to true for the candidate with the highest score

Return Example:

{
    "queryId": "12143",
    "lang": "it",
    "keywords": "Mario+Monti",
    "extags": "Mario Monti",
    "freeling": "Mario_Monti",
    "proc_time": "13",
    "terms": [
        {
            "id": "tc-Mario+Monti",
            "term": "Mario Monti",
            "candidates": [
                {
                    "id": "tag--Mario_Monti--http://dbpedia.org/resource/Mario_Monti",
                    "label": "Mario Monti",
                    "uri": "http://dbpedia.org/resource/Mario_Monti",
                    "type": "user",
                    "ext": "Mario Monti",
                    "extra": [],
                    "wrapper": "dbpedia",
                    "lev": "2",
                    "sim": "0.909090909091",
                    "sis": "1",
                    "jw": "0.963636363636",
                    "sc": "1",
                    "class": "empty",
                    "preferred": "true"
                }
            ],
            "html": "<fieldset><div class=panel><div class=header>A proposito di <b>Mario Monti</b></div><div class=panel_body></div></div><div class=panel><div class=panel_body><img src='http://upload.wikimedia.org/wikipedia/commons/thumb/3/33/Il_Presidente_del_Consiglio_incaricato_Mario_Monti_(cropped).jpg/200px-Il_Presidente_del_Consiglio_incaricato_Mario_Monti_(cropped).jpg' height=160 /><br><div class=info>È senatore a vita dal 9 novembre 2011 e dal successivo 16 novembre assume, per la prima volta, l'incarico di Presidente del Consiglio dei Ministri della Repubblica Italiana e allo stesso tempo di Ministro dell'Economia e delle Finanze dello stesso governo. Presidente dell'Università Bocconi dal 1994, Monti è stato c...<ul><li><a href='http://www.guardian.co.uk/world/mario-monti' target='_blank'>Link utile</a></li></ul></div></div></div></fieldset><fieldset><legend>Concetti associati a <strong>Mario Monti</strong></legend><ul><li><img src='img/user.png' alt='user' title='user'> <a href='http://dbpedia.org/resource/Mario_Monti' target='_blank' title='[2-0.909090909091-0.963636363636/1]' >Mario Monti</a> (dbpedia)</li></ul></fieldset>",
            "class": "empty"
        }
    ]
}
Personal tools
Create a book