Entity Classification API version 2.0
Performs classification of a given entity identified with a DBpedia URI. The classification can be performed with classes from the DBpedia Ontology or YAGO knowledge bases.
Language of the input text. You can choose between English, German and Dutch. Values:
Requested response format. Values: xml/json. Default value: xmlExample: format=xmlNote: The format can be also specified using the Accept request header. If format parameter is specified, then the format parameter will have higher priority.Example: Accept: application/xml.
NIF 1.0 support has been suspended, NIF 2.0 will be released once the specification is completed.
|provenance optional||Provenance of the results. Values: thd/dbpedia/yago. The client can choose one or more. Default value: thd,dbpedia,yago.Example: provenance=thd,dbpedia|
|knowledge_base optional||Defines, which knowledge base is used to retrieve types for thd. Currently applicable only, when provenance is set to thd or all. Values: linkedHypernymsDataset/local/live linkedHypernymsDataset - use the linked hypernyms dataset (recommended), local - local Wikipedia mirror (slight latency), for the date of the Wikipedia snapshot please refer to the technical information about application version in the page footer, live - live Wikipedia (highest latency), please be considerate and do not submit large amount of text or high number of requests. Recommended use: issue query containing single candidate entity, for which the other options failed to provide a type. Note: Only one option can be chosen.Default value: linkedHypernymsDataset Example: knowledge_base=linkedHypernymsDataset|
|types_filter optional NEW in version 2!||Filter types to selected namespaces for thd results. You can filter out only types as DBpedia instances, DBpedia Ontology types, or both of them. This setting has no effect for provenance=yago or provenance=dbpedia. Values: dbo/dbinstance/all dbo - filter only DBpedia Ontology types, dbinstance - filter only types defined as DBpedia instances, all - both, the entity types can be either DBpedia Ontology clases or DBpedia instances.Default value: all Example: types_filter=dbo|
|apikey required||Used for identification of a third-party application utilizing the service. Write us an email to get an api key.Example: apikey=123456789|
|startOffset||Integer||Start offset index of the found entity in the input text. The offset is counter from 0 from the beginning of the input text.|
|endOffset||Integer||End offset of the found entity in the input text. The offset is counter from 0 from the beginning of the input text.|
|underlyingString||String||The string considered as an entity.|
|entityType||String||The type of the extracted entity. Possible values: "named entity" or "common entity".|
|types||Array of types||
List of types for the found entity.
The corresponding XML is:
typeLabel - name by which the type is formally known.typeURI - DBpedia/YAGO URI describing the entity type. entityLabel - name by which the disambiguated entity is formally known. entityURI - DBpedia/YAGO URI describing the disambiguated entity. provenance - Provenance of the results. Possible values are: thd - produced by THD, thd-derived - also produced by THD through searching for superclasses in the Dbpedia ontology, dbpedia - produced by DBpedia, and yago - produced by YAGO2s ontology. confidence - estimated classification or linking (disambiguation) confidence.Classification confidence is the estimated probability that the typeLabel is correct for given entityURI.Linking confidence is the estimated probability of the entityURI being correct given the surface form of the entity. Confidence in XML: element <confidence> - Classification and linking confidence can be distinguished with the type attribute. Possible values for the type attribute are linking and classification. Confidence in JSON: Classification confidence in classificationConfidence object, linking confidence in the linkingConfidence object. The actual confidence value is stored at the key value. Note: if you use WikipediaSearch as entity linking method (read more here), the linking confidence will always be -1. We are unable to estimate the linking confidence for the Wikipedia search based linking. salience - estimated salience of the entity to the document. The level of salience determines whether or not the document is about the entity. In XML the entity salience is encoded as follows: class - one of the following three classes indicating level of salience:
HTTP Status Codes
The THD API attempts to return appropriate HTTP status codes for every request.
|400||Bad Request||The request was invalid. An accompanying error message will explain why.|
|401||Unauthorized||Authentication credentials were missing or incorrect.|
|406||Not Acceptable||Returned by the API when an invalid format is specified in the request.|
|500||Internal Server Error||Something is broken. Please write us an email so the THD team can investigate.|
When the THD API returns error messages, it does so in your requested format. For example, returned error in JSON might look like this:
The corresponding XML response would be:
In addition to descriptive error text, error messages contain machine-parseable codes. The following table describes the codes which may appear when working with the API:
|31||Could not authenticate you||Authentication credentials were missing. Needs security credentials specified by the apikey parameter.|
|32||Could not authenticate you||Specified api key is not valid. The API could not authenticate you.|
|41||Not supported format||The format specified in the format parameter is not supported.|
|42||Not supported format||The format specified in the Accept header is not supported.|
|43||Not valid types_filter parameter||The value of the types_filter parameter is not valid. You can choose between dbo, dbinstance and all.|
|44||Not valid linking_method parameter||The value of the linking_method parameter is not valid. You can choose between LuceneSearch or WikipediaSearch.|
|45||Empty body request||The body of the request is empty.|
|46||Not valid knowledge_base parameter||Chosen knowledge base is not supported.|
|47||Not valid provenance parameter||The value of the provenance parameter is not valid. You can choose between thd, dbpedia and yago.|
|48||Not correctly set entity_type parameter||The value of the provenance parameter is not valid. You can choose between ne, ce and all.|
|49||Not supported language||Specified language in the lang parameter is not valid. You can choose between en, de and nl.|
|51||Internal error||Something went wrong on the server side. Please write us an email so the THD team can investigate.|
The Charles Bridge is a famous historic bridge that crosses the Vltava river in Prague, Czech Republic.