Skip to main content

Get Extraction Results as RDF

Abstract

Get Extraction Results as RDF

To obtain the extraction results as an RDF document use the PoolParty Extractor 'annotate' service. It expects the same parameters as the 'extract' services but returns the results as RDF/XML.

The only difference is that the parameter 'documentId' is required because it is part of the RDF results.

URL: /extractor/api/annotate

This API call accepts plain text, a web page referenced by a URL, and an uploaded file as input.

Plain text input

Supported Methods

GET

POST

Specific HTTP Parameters

Parameter

Type

Required

Value range

Comment

text

String

true

The text to be used for the extraction request.

title

String

false

The title of the document.

Web pages as input

Supported Methods

GET

POST

Specific HTTP Parameters

Parameter

Type

Required

Value range

Comment

url

String

true

The Url to the document be used for the extraction request.

File as input

Supported Methods

POST

The Mimetype of request must be 'multipart/form-data'.

Specific HTTP Parameters

Parameter

Type

Required

Value range

Comment

file

MultipartFile

true

The file to be uploaded for the extraction request. Supported input formats are Word, Excel, Powerpoint, Pdf, Open Document Format.

Common HTTP Parameters

The parameters are very similar to the /api/extract call (see Concept Extraction Service for more details).

Parameter

Type

Required

Value range

Comment

text

String

true

language

String

true

documentUri

String

true

The URI that will be used in the RDF output of the method.

projectId

String

false

numberOfConcepts

Integer

false

numberOfTerms

Integer

false

useTransitiveBroaderConcepts

Boolean

false

useTransitiveBroaderTopConcepts

Boolean

false

useRelatedConcepts

Boolean

false

Example

A simple example with a text of just one word would look like this:

http://test.semantic-web.at/extractor/api/annotate?projectId=1DAB156D-F01F-0001-ABCE-16301D4023C0&language=en&text=Aspirin&documentUri=SWC:1
Result:
<rdf:RDF>
        <rdf:Description rdf:about="SWC:1">
                <ctag:tagged rdf:resource="ppx:98838d58-3650-4c10-8b60-896a663cdca8"/>
        </rdf:Description>
        <rdf:Description rdf:about="ppx:98838d58-3650-4c10-8b60-896a663cdca8">
                <ctag:label xml:lang="en">Aspirin</ctag:label>
                <ctag:means rdf:resource="http://www.nlm.nih.gov/mesh/D001241"/>
                <rdf:type rdf:resource="http://commontag.org/ns#AutoTag"/>
        </rdf:Description>
        <rdf:Description rdf:about="http://www.nlm.nih.gov/mesh/D001241">
                <ppx:score rdf:datatype="http://www.w3.org/2001/XMLSchema#long">100</ppx:score>
                <skos:altLabel xml:lang="en">Micristin</skos:altLabel>
                <skos:altLabel xml:lang="en">Polopirin</skos:altLabel>
                <skos:altLabel xml:lang="en">Magnecyl</skos:altLabel>
                <skos:altLabel xml:lang="en">Zorprin</skos:altLabel>
                <skos:altLabel xml:lang="en">Ecotrin</skos:altLabel>
                <skos:altLabel xml:lang="en">Solupsan</skos:altLabel>
                <skos:altLabel xml:lang="en">Acetylsalicylic Acid</skos:altLabel>
                <skos:altLabel xml:lang="en">Solprin</skos:altLabel>
                <skos:altLabel xml:lang="en">Dispril</skos:altLabel>
                <skos:altLabel xml:lang="en">Acid, Acetylsalicylic</skos:altLabel>
                <skos:altLabel xml:lang="en">Aloxiprimum</skos:altLabel>
                <skos:altLabel xml:lang="en">Endosprin</skos:altLabel>
                <skos:altLabel xml:lang="en">2-(Acetyloxy)benzoic Acid</skos:altLabel>
                <skos:altLabel xml:lang="en">Easprin</skos:altLabel>
                <skos:altLabel xml:lang="en">Polopiryna</skos:altLabel>
                <skos:altLabel xml:lang="en">Acetysal</skos:altLabel>
                <skos:altLabel xml:lang="en">Colfarit</skos:altLabel>
                <skos:altLabel xml:lang="en">Acylpyrin</skos:altLabel>
                <skos:inScheme rdf:resource="http://www.nlm.nih.gov/mesh/Chemicals_and_Drugs"/>
        </rdf:Description>
        <rdf:Description rdf:about="ppx:98838d58-3650-4c10-8b60-896a663cdca8">
        <ctag:taggingDate>Wed Nov 20 14:33:29 CET 2013</ctag:taggingDate>
        </rdf:Description>
</rdf:RDF>

The result contains 3 types of resources. The document, the tagging events, and the description of the annotated concepts. The document links to the tagging events (predicate 'ctag:tagged') that contain the label (the 'skos:prefLabel' of the concept) and link themselves to the information about the annotated concept (predicate 'ctag:means').