Redlink API Documentation

The Redlink API provides a set of RESTful web services, grouped according their purpose: content analysis, semantic search and linked data publishing.

General

Introduction

The Redlink Platform consists of a number of services that are offered to users through a REST API. The Platform provides three main services: Redlink Content Analysis, Redlink Linked Data Publishing and Redlink Semantic Search.

The Redlink Platform is implemented as "software as a service" (SaaS) running on a distributed cloud infrastructure. Users can access the system here through a uniform web service API using a private key to identify themselves. For the most common web frameworks, we will provide plugins providing out-of-the-box services. All requests to the API are handled by a single gateway which takes care of accounting and forwards the requests to backend clusters providing the necessary functionality.

You can register at my.redlink.io for getting free access to the platform for a trial period of 42 days (pricing details).

Components

The Redlink API is organized in three major components:

component description available
Content Analysis Semantic Content Analysis, Interlinking and Enrichement
Linked Data Publish and query Linked Data, huge public datasets (DBPedia, Freebase, and many more) as well as your personal.
Semantic Search Combine the two above to turn search into find!

Endpoints

All endpoints are available under the following schema:

https://api.redlink.io/1.0/{ENDPOINT}?key={KEY}&...

where:

{ENDPOINT}
is the concrete REST endpoint to call
{KEY}
is your key for using the API

Note: Take into account that all requests to all endpoints to the API require the key parameter. Therefore it'll be not mentioned further on their concrete documentations.

You can play around with our API console.

The API provides a special endpoint at the root:

https://api.redlink.io/1.0?key={KEY}

which supply some information about the usage of each app for the currently billing period (month):

{
  "accessible": true,   //provided key is valid and enabled
  "limit": 10000,       //request limit/credit (within the current reporting period)
  "requests": 521,      //requests sent/credit used so far
  "bytes": 345657,      //bytes sent so far
  "seconds": 42         //total processing time
  "owner": "007",       //user-id the key belongs to
  "analyses": [         //analysis services enabled for this key
    "my-analysis"
  ],
  "datasets": [         //datasets enabled for this key
    "my-dataset1",
    "my-dataset2"
  ]
}

Security

Keeping your data safe is important for us here at redlink, that's why the redlink API is only available using the https protocol. Therefore clients need to deal with TLS/SSL.

All SDKs for this API provided by us come with TLS/SSL support enabled. You should not trust clients that do not use the certificate to access the API.

Issues

Do you have any issue or question about the API? Please, contact us.

Content Analysis

Introduction

Redlink Content Analysis offers fact extraction, topic classification, and fact linking from textual and media documents in different languages. Users will be able to send text (and in the future media content) and get back facts and entities that have been identified automatically. In addition, the service will provide references to existing datasets (public datasets like Dbpedia and Freebase, as well as custom user-created vocabularies like a product database) about the entities identified in the content. Users will be able to create their own custom configurations with some simple steps, e.g. for adding advanced natural language processing features or commercial datasets.

Endpoints

Before using an analysis endpoint, the service must be configured in my.redlink.io and assigned to an application.

post /analysis/{analysis}/enhance

Performs an analysis of the content posted in the request body, getting enhancements results in the requested format. The {analysis} in the path bounds to the analysis to a concrete service previously configured.

Parameters

name description required restricted value/s
in Format used for encode the content to analyze optional (when missing, different heuristics are applied) text, pdf, html, office
out Format preferred to get the enhacement results optional (when missing, HTTP content negotiation is applied) json, xml, jsonld, rdfxml, rdfjson turtle nt
confidence Set the minimum threshold for the confidence optional, requires the usage of the Confidence Filter, where the default value is 0.85 double (0.00..1.00)
summary Request content summary optional true/false
thumbnail Request Thumbnail URLs optional true/false

The response could come in RDF (for jsonld, rdfxml and turtle formats) using this structure; or using a simplied version (for json and xml formats) which follows the following schema:

{

    "languages": [ // Detected languages
        "en"
    ],

    "entities": [ // if no entity-extraction was done (e.g. because not activated in the analysis) 
                  // this property is completely omitted.
        {
            "dataset": "dbpedia", // The configured dataset (id/name/...) this entity comes from
            "reference": "http://dbpedia.org/resource/Saturday_Night_Live", // this is the URI of the entity
            "confidence": 1.0, // the maximum confidence of all mentions

            "properties": { // (1) basic properties, for every entity, always present
                "name": "name",
                "summary": "short summary",

                "type": [ // list of types, used to know which specific props are available (see below)
                    "creative work",
                    "event",
                    "organisation",
                    "person",
                    "place",
                    "product",
                    "other"
                ],
                "sameAs": [ // sameAs links of the "reference"
                    "http://rdf.freebase.com/ns/m.xxxxx",
                    "http://yago-knowledge.org/resource/xxxx"
                ],

                // 
                "image": [ (2) optional basic properties, might come with every entity
                ],

                "homepage": "http://example.org/", // optional

                // (3) type specific properties

                // (3.1) creative work
                "creator": "...",
                "genre": "...", //
                "publisher": "...",
                "datePublished": "2015-01-01",

                // (3.2) event
                "startDate": "2014-08-26T10:00:00Z",
                "endDate": "2014-08-26T12:30:00Z", // optional


                // (3.3) organisation
                /* nothing extra here */

                // (3.4) person
                "gender": "male",
                "birth": "1974-04-01",
                "death": "2013-11-09", // optional ;-)
                "nationality": "de",

                // (3.5) place
                /* nothing extra here */

                // (3.6) product
                "brand": "Apple",
                "manufacturer": "Foxconn",

                // (3.7) other
                /* nothing extra here */

                // (3.8) Shared
                // (3.8.1) place || event || organisation (headquarter)
                "location": {
                    "lat": 43.3333,
                    "lon": 13.3333
                }

            }, /* END properties */
            "mentions": [
                {
                    "prefix": "c died on ", // 10 chars before the text
                    "text": "Saturday",     // aka anchor
                    "suffix": " at the ag", // 10 chars after the text
                    "context": " the context where the entity was recognized ",
                    "confidence": 0.9,
                    "start": 104,
                    "end": 112
                },
                { /* more mentions ... */ }
            ] /* END mentions */
        }, /* END entity */
        { /* more entities ... */ }
    ], /* END entities */

    "facts": [ // if no fact-extraction was done (e.g. because not activated in the analysis) 
               // this property is completely omitted.
        {
            "name": "Product Weight", // preferred label of the fact-def. in the lang of the text
            "reference": "http://example.com/foo/ProductWeight", // URI of the fact-definition
            "type": "numeric", // enum, entity, numeric, range, dimension, date, duration, event
            "value": [
                "foo", "bar"
            ],
            "mentions": [
                { 
                    "prefix": "x50x15 mm ",
                    "text": "Weight: 0.3 kg",
                    "suffix": " Shipping ",
                    "context": "...",
                    "start": 15,
                    "end": 26
                },
                { /* more mentions ... */}
            ]
        },
        { /* more facts */ }
    ], /* END facts */

    "categories": [ // if no classification was done (e.g. because not activated in the analysis)  
                    // this property is completely omitted.
        {
            "dataset": "dbpedia",
            "component": "machine-linking",
            "reference": "http://dbpedia.org/resource/xxxx",
            "confidence": 0.1234563,
            "properties": {
                "name": "...",
                "summary": "...",
                "image": [
                    "http://..."
                ]
            }
        },
        { /* more categories */ }
    ], /* END categories */

    "sentiments": { // if no sentiment analysis was done (e.g. because not activated in the analysis) 
                    //  this property is completely omitted.
        "positive": 0.6213,
        "negative": 0.2112
    } /* END sentiments */
    
    "keywords": [ // if no keyword extraction was done (e.g. because not activated in the analysis)  
                  // this property is completely omitted.
        {
            "count": 2, //how often the keyword appears in the processed text. For n-grams this also
                        //includes counts of sub-mentions.
            "keyword": "Hagia Sophia", //the extracted keyword
            "metric": 0.8167006795638168 // measure of the importance of the keyword 
                                         // relative to the parsed text
        },
        { /* more keywords */ }
    ] /* END categories */

}

Linked Data

Introduction

Redlink Linked Data Publishing offers data management, data publication, and data integration for enterprise data using open standards and technologies (RDF and Linked Data); legacy proprietary data can be transformed into a standardized data model and integrated with data from other sources. The service will allow users to create their own Linked Data servers for managing vocabularies or publishing their own datasets (e.g. in Open Data projects). Datasets managed in this way can also be made available for content analysis and linking, and they can be either private (Linked Enterprise Data) or public (Linked Open Data).

Endpoints

Remember to enable your favourite datasets for the application (key) you are using!

Endpoints which have the dataset as part of the address restrict the operation to that dataset. Endpoints without a dataset in the path operate on all datasets configured for this application.

get /data/{dataset}

Export the dataset to the RDF serialization requested (using http content negotiation).

post /data/{dataset}

Import the raw RDF sent in the request body into the current dataset.

put /data/{dataset}

Import the raw RDF sent in the request body replacing the current dataset (i.e., removing all data before importing).

delete /data/{dataset}

Remove all data from the dataset (but it does not remove the dataset itself).

get /data/{dataset}/resource

Get a concrete resource in the RDF serialization requested (http content negotiation).

Parameters

name description required restricted value/s
uri Resource URI mandatory valid URI

post /data/{dataset}/resource

Add the raw data if the request body to this concrete resource. All triples with different subject will be ignored. Format is detected using content negotiation.

Parameters

name description required restricted value/s
uri Resource URI mandatory valid URI

put /data/{dataset}/resource

Replace the current resource with the raw data in the request body. All triples with different subject will be ignored. Format is detected using content negotiation.

Parameters

name description required restricted value/s
uri Resource URI mandatory valid URI

delete /data/{dataset}/resource

Remove a concrete resource from the dataset.

Parameters

name description required restricted value/s
uri Resource URI mandatory valid URI

get /data/resource

Get a concrete resource from all datasets in the RDF serialization requested (http content negotiation).

Parameters

name description required restricted value/s
uri Resource URI mandatory valid URI

get /data/{dataset}/sparql/select

Evaluates a SPARQL SELECT or ASK query over a dataset.

Parameters

name description required restricted value/s
query Query string mandatory n/a
in Format used to send data in the request optional (when missing, regular HTTP mechanisms are applied)
out Format preferred to get the results optional (when missing, HTTP content negotiation is applied) json, xml, tabs, csv

post /data/{dataset}/sparql/select

Evaluates a SPARQL SELECT or ASK query over a dataset.

Parameters

name description required restricted value/s
query Query string optional (if missing, a application/x-www-form-urlencoded should be sent and query will be read from the request body) n/a
in Format used to send data in the request optional (when missing, regular HTTP mechanisms are applied)
out Format preferred to get the results optional (when missing, HTTP content negotiation is applied) json, xml, tabs, csv

get /data/{dataset}/sparql/update

Evaluates a SPARQL UPDATE query over a dataset.

Parameters

name description required restricted value/s
update Query string. mandatory n/a
in Format used to send data in the request optional (when missing, regular HTTP mechanisms are applied)
out Format preferred to get the results optional (when missing, HTTP content negotiation is applied) json, xml, tabs, csv

post /data/{dataset}/sparql/update

Evaluates a SPARQL UPDATE query on the data.

Parameters

name description required restricted value/s
update Query string. When missing a application/x-www-form-urlencoded should be sent and query qould be ready from the request body. optional n/a
in Format used to send data in the request optional (when missing, regular HTTP mechanisms are applied)
out Format preferred to get the results optional (when missing, HTTP content negotiation is applied) json, xml, tabs, csv

get /data/sparql

Evaluates a SPARQL SELECT or ASK query over all datasets.

Parameters

name description required restricted value/s
query Query string mandatory n/a
in Format used to send data in the request optional (when missing, regular HTTP mechanisms are applied)
out Format preferred to get the results optional (when missing, HTTP content negotiation is applied) json, xml, tabs, csv

post /data/sparql

Evaluates a SPARQL SELECT or ASK query over all datasets.

Parameters

name description required restricted value/s
query Query string optional (hen missing, a application/x-www-form-urlencoded should be sent and query will be read from the request body) n/a
in Format used to send data in the request optional (when missing, regular HTTP mechanisms are applied)
out Format preferred to get the results optional (when missing, HTTP content negotiation is applied) json, xml, tabs, csv

get /data/{dataset}/ldpath

Evaluates a LDPath program over a dataset.

Parameters

name description required restricted value/s
program Program string mandatory n/a
uri Resource where to start to evaluate the program mandatory valid URI

post /data/{dataset}/ldpath

Evaluates a LDPath program over a dataset.

Parameters

name description required restricted value/s
program Program string mandatory n/a
uri Resource where to start to evaluate the program mandatory valid URI

get /data/ldpath

Evaluates a LDPath program over all datasets.

Parameters

name description required restricted value/s
program Program string mandatory n/a
uri Resource where to start to evaluate the program mandatory valid URI

post /data/ldpath

Evaluates a LDPath program over all datasets.

Parameters

name description required restricted value/s
program Program string mandatory n/a
uri Resource where to start to evaluate the program mandatory valid URI

get /data/{dataset}/release

Releases the current data in the dataset for being use in the analysis.

post /data/{dataset}/release

Releases the current data in the dataset for being use in the analysis.

In addition, all resources in a dataset explicitly published by the user will be publicly available according the Linked Data principles through our data hub (data.redlink.io) under the following schema:

http://data.redlink.io/{USER}/{DATASET}/...

Introduction

Redlink Semantic Search offers high performance faceted and semantic search over enterprise content, different ranking algorithms, auto completion, thesaurus/vocabulary integration, etc.; the service will provide advanced search functionalities based on Content Analysis and Linked Data. Users will be able to create their own search configurations, upload documents, analyse and link them with datasets and vocabularies, and provide powerful search functionalities, e.g. browsing documents by (automatically detected) categories, persons occurring in the text, etc.

Semantic Search is not yet part of the public API, only available for premium customers; but it will be included in the next versions, so stay tuned... In the meantime, you can check either our Search Engine or use the Redlink Solr plugin to semantically enrich your current search.