Skip to main content

Web Service Method: Annotate from Text

Abstract

Web Service Method: Annotate from Text

Description

[text] Returns the document annotated with extracted concepts and extracted terms in RDF/XML representation.

URL: /extractor/api/annotate

Request

Supported Methods

POST

GET

Content-Type

Content-Type: application/x-www-form-urlencoded

HTTP Parameters

Parameter

Type

Required

Description

categorizationWithPpxBoost

boolean

false

Use Extractor boosting, default = false

categorize

boolean

false

Categorization extraction, default = false

conceptMinimumScore

Double

false

Minimum required score of concepts, default = 0

conceptSchemeFilters

Array of String

false

Concept scheme URI filters

corpusScoring

Array of String

false

Corpus term scoring. Enabled if corpusIds (UUID) are provided.

customAttributeFilters

Array of CustomProperty

false

Custom attribute (property uri and string value) filters

customClassFilters

Array of String

false

Custom class URI filters

disambiguate

boolean

false

Use thesaurus based disambiguation, default = false

displayText

boolean

false

Include text extracted from url in response, default = false

documentClassifierIds

Array of String

false

Enable document classification by giving the document classifier IDs as input

documentId

String

false

Internal ID of the document, taken from documentUri

documentUri

String

true

URI of annotated document, used as ID

extraConceptLanguages

Array of PPLocale

false

Additional languages used for concept extraction (en|de|es|fr|...)

extractorVersion

String

false

Version of PPX Extractor used

filterNestedConcepts

boolean

false

Remove concepts matches which are contained within other matches, default = true

findPersonNames

boolean

false

Deprecated (use nerParameters) - extracts person names from the given text

language

PPLocale

false

Extraction language (en|de|es|fr|...)

lemmatization

boolean

false

Use lemmatization, default = true

locationExtraction

boolean

false

Deprecated (use nerParameters) - extracts locations from the given text

nerParameters

Array of NERConfig

false

Array of models that are used for Named Entity Recognition

numberOfConcepts

Integer

false

Retrieve number of concepts, default = 25

numberOfTerms

Integer

false

Retrieve number of terms, default = 25

phraseLength

Integer

false

Phrase length, default = 4

projectId

Array of String

false

Thesaurus projectIds

properties

Array of String

false

Array of custom class attributes and relations that will be fetched by providing their property URIs as input. Furthermore it supports http://www.w3.org/1999/02/22-rdf-syntax-ns#type.

Set to all to fetch all properties.

regexFilename

String

false

File name for regex patterns

resultFilterSparql

String

false

Specify an optional SPARQL query for filtering the RDF result

sentimentAnalysis

boolean

false

Sentiment analysis, default: false

shadowConceptCorpusId

Array of String

false

Shadow concepts calculation. Enabled if corpusIds (UUID) are provided.

showMatchingDetails

boolean

false

Shows which concept labels where found inside the text, default = false

showMatchingPosition

boolean

false

Shows the position of the matched text. Only shown if showMatchingDetails = true. default = false

text

String

true

Text of the document

tfidfScoring

boolean

false

Use TFIDF scoring, default = false

title

String

false

Title of the document

useRelatedConcepts

boolean

false

Retrieve related concepts, default = false

useTransitiveBroaderConcepts

boolean

false

Retrieve transitive broader concepts, default = false

useTransitiveBroaderTopConcepts

boolean

false

Retrieve transitive broader top concepts, default = false

useTypes

boolean

false

Retrieve custom types for concepts, default = false

CASE_INSENSITIVE_ORDER

Comparator

false

hash

int

false

serialPersistentFields

Array of ObjectStreamField

false

serialVersionUID

long

false

value

Array of char

false

Custom Property Object

Attribute

Type

Required

Comment

property

String

false

Property

value

String

false

Value

Example of CustomProperty Object
{
  "property" : "https://semantic-web.com/api/property#30874",
  "value" : "some value"
}
NERConfig Object

Named Entity Recognition configuration

Attribute

Type

Required

Comment

method

Method

false

Method used for Named Entity Extraction. (default: MAXIMUM_ENTROPY) RULE_BASED | MAXIMUM_ENTROPY

type

String

false

Type of Named Entity Model. Pre-defined models for MAXIMUM_ENTROPY: person, organization, location

Example for an NER Configuration
{
  "method" : "MAXIMUM_ENTROPY",
  "type" : "https://semantic-web.com/api/type#16216"
}
ObjectStreamField Object

Attribute

Type

Required

Comment

field

Field

false

name

String

false

offset

int

false

signature

String

false

type

Class

false

unshared

boolean

false

Example of an ObjectStreamField Object

Click here to expand...

{
  "field" : {
    "genericInfo" : {
      "factory" : null,
      "tree" : null,
      "genericType" : null
    },
    "declaredAnnotations" : { },
    "overrideFieldAccessor" : { },
    "signature" : "some signature",
    "annotations" : [ 54, 99 ],
    "securityCheckCache" : { },
    "slot" : 7232,
    "fieldAccessor" : { },
    "modifiers" : 9075,
    "type" : {
      "annotationData" : null,
      "genericInfo" : null,
      "ENUM" : 10078,
      "enumConstantDirectory" : { },
      "classRedefinedCount" : 31375,
      "initted" : false,
      "cachedConstructor" : null,
      "useCaches" : false,
      "SYNTHETIC" : 4809,
      "annotationType" : null,
      "newInstanceCallerCache" : null,
      "reflectionData" : null,
      "classValueMap" : { },
      "serialPersistentFields" : [ null, null ],
      "serialVersionUID" : 24960,
      "ANNOTATION" : 32249,
      "enumConstants" : [ null, null, null ],
      "name" : "some name",
      "reflectionFactory" : null,
      "allPermDomain" : null
    },
    "ACCESS_PERMISSION" : {
      "serialVersionUID" : 17792,
      "name" : "some name"
    },
    "root" : {
      "genericInfo" : null,
      "declaredAnnotations" : { },
      "overrideFieldAccessor" : null,
      "signature" : "some signature",
      "annotations" : [ 44 ],
      "securityCheckCache" : null,
      "slot" : 1259,
      "fieldAccessor" : null,
      "modifiers" : 15456,
      "type" : null,
      "ACCESS_PERMISSION" : null,
      "root" : null,
      "name" : "some name",
      "override" : true,
      "reflectionFactory" : null,
      "clazz" : null
    },
    "name" : "some name",
    "override" : true,
    "reflectionFactory" : {
      "inflationThreshold" : 16638,
      "initted" : true,
      "soleInstance" : null,
      "reflectionFactoryAccessPerm" : null,
      "langReflectAccess" : null,
      "noInflation" : true
    },
    "clazz" : {
      "annotationData" : null,
      "genericInfo" : null,
      "ENUM" : 30901,
      "enumConstantDirectory" : { },
      "classRedefinedCount" : 13157,
      "initted" : false,
      "cachedConstructor" : null,
      "useCaches" : true,
      "SYNTHETIC" : 18792,
      "annotationType" : null,
      "newInstanceCallerCache" : null,
      "reflectionData" : null,
      "classValueMap" : { },
      "serialPersistentFields" : [ null, null ],
      "serialVersionUID" : 7011,
      "ANNOTATION" : 3943,
      "enumConstants" : [ null, null, null ],
      "name" : "some name",
      "reflectionFactory" : null,
      "allPermDomain" : null
    }
  },
  "offset" : 7713,
  "signature" : "some signature",
  "unshared" : false,
  "name" : "some name",
  "type" : {
    "annotationData" : {
      "declaredAnnotations" : { },
      "redefinedCount" : 9363,
      "annotations" : { }
    },
    "genericInfo" : {
      "factory" : null,
      "superclass" : null,
      "tree" : null,
      "typeParams" : [ null, null ],
      "NONE" : null,
      "superInterfaces" : [ null, null ]
    },
    "ENUM" : 10784,
    "enumConstantDirectory" : { },
    "classRedefinedCount" : 11824,
    "initted" : true,
    "cachedConstructor" : {
      "genericInfo" : null,
      "declaredAnnotations" : { },
      "hasRealParameterData" : true,
      "parameterTypes" : [ null, null, null ],
      "signature" : "some signature",
      "annotations" : [ 85, 4, 110 ],
      "securityCheckCache" : null,
      "constructorAccessor" : null,
      "slot" : 20713,
      "modifiers" : 7871,
      "ACCESS_PERMISSION" : null,
      "exceptionTypes" : [ null, null, null ],
      "root" : null,
      "override" : false,
      "parameterAnnotations" : [ 42 ],
      "reflectionFactory" : null,
      "clazz" : null,
      "parameters" : [ null, null ]
    },
    "useCaches" : true,
    "SYNTHETIC" : 5209,
    "annotationType" : {
      "inherited" : true,
      "members" : { },
      "memberDefaults" : { },
      "$assertionsDisabled" : true,
      "memberTypes" : { },
      "retention" : "SOURCE"
    },
    "newInstanceCallerCache" : {
      "annotationData" : null,
      "genericInfo" : null,
      "ENUM" : 139,
      "enumConstantDirectory" : { },
      "classRedefinedCount" : 12963,
      "initted" : true,
      "cachedConstructor" : null,
      "useCaches" : true,
      "SYNTHETIC" : 23823,
      "annotationType" : null,
      "newInstanceCallerCache" : null,
      "reflectionData" : null,
      "classValueMap" : { },
      "serialPersistentFields" : [ null, null, null ],
      "serialVersionUID" : 10600,
      "ANNOTATION" : 1872,
      "enumConstants" : [ null ],
      "name" : "some name",
      "reflectionFactory" : null,
      "allPermDomain" : null
    },
    "reflectionData" : {
      "next" : null,
      "discovered" : null,
      "referent" : null,
      "pending" : null,
      "lock" : null,
      "clock" : 31429,
      "queue" : null,
      "timestamp" : 5262
    },
    "classValueMap" : { },
    "serialPersistentFields" : [ {
      "field" : null,
      "offset" : 18525,
      "signature" : "some signature",
      "unshared" : true,
      "name" : "some name",
      "type" : null
    }, {
      "field" : null,
      "offset" : 6141,
      "signature" : "some signature",
      "unshared" : true,
      "name" : "some name",
      "type" : null
    } ],
    "serialVersionUID" : 7640,
    "ANNOTATION" : 16250,
    "enumConstants" : [ { }, { }, { } ],
    "name" : "some name",
    "reflectionFactory" : {
      "inflationThreshold" : 19353,
      "initted" : false,
      "soleInstance" : null,
      "reflectionFactoryAccessPerm" : null,
      "langReflectAccess" : null,
      "noInflation" : false
    },
    "allPermDomain" : {
      "staticPermissions" : true,
      "debug" : null,
      "hasAllPerm" : true,
      "codesource" : null,
      "permissions" : null,
      "classloader" : null,
      "principals" : [ null, null ],
      "key" : null
    }
  }
}
ResponseDefault:

Content-type: text/plain

Status: 200 - Ok

Configure the Response Format

You can now manipulate the response format to any RDF format, as also defined here: http://docs.rdf4j.org/javadoc/2.3/org/eclipse/rdf4j/rio/RDFFormat.html

Example Formats:
  • application/rdf+xml

  • application/n-triples

  • application/x-turtle

  • application/trix

  • application/trig

In order to configure the response format, use an additional Accept header in your call.

Using an HTTP REST client, such as Postman, the call would look like this:

23901367.png