RESTful-API-based Semantic Search on Linked Data

Programmable use of the CHAIN-REDS Semantic Search Engine is possible thanks to a simple RESTful API. The API allows to get and reuse the millions of open access resources contained  in the CHAIN-REDS Knowledge Base and stored in a Virtuoso RDF-compliant database.

API usage

1) Get all information about the resources

- REQUEST (HTTP method GET)

To do a request one must insert into the URL three parameters:

1) keyword: is the keyword seeked; the keyword can contain any filters for example (keyword=author:SEEKED_AUTHOR, keyword=subject:SEEKED_SUBJECT, keyword=type:SEEKED_TYPE, keyword=format:SEEKED_FORMAT and keyword=publisher:SEEKED_PUBLISHER)

2) limit: is  the maximum number of resources that has to be retrieved by the query;

3) offset: is the value in the list of resources to start the retrieval with.

as shown below:

http://www.chain-project.eu/virtuoso/api/resources?keyword=SEEKED_KEYWORD&limit=MAX_NUMBER_OF_RESOURCES&offset=OFFSET

- RESPONSE (application/json)

A collection of resources is represented as a JSON array of objects containing the information about the resources:

{"resources":[

    {…resource 1...},

    {…resource 2…},

    {…resource 3…},

        ...

 

 

        …

    ]

}

 

A single resource is represented as a JSON object:

{

    "titles":["…","…","…"], "authors":["…","…"], "identifiers":["…","…"], "descriptions":["…","…"],

    "publishers":["…"], "subjects":["…","…","…","…","…"], "contributors":[], "sources":[], "coverages":[],

    "languages":[], "abstract_":[], "accessRigths":[], "accuralMethods":[], "accuralPeriodicity":[],

    "accuralPolicy":[], "alternative":[], "audience":[], "available":[], "bibliographicCitation":[],

    "conformsTo":[], "created":[], "dateAccepted":[], "dateCopyrighted":[], "dateSubmitted":[],

    "educationLevel":[], "extent":[], "hasFormat":[], "hasPart":[], "hasVersion":[], "instructionalMethod":[],

    "isFormatOf":[], "isPartOf":[], "isReferencedBy":[], "isReplacedBy":[], "isRequiredBy":[], "issued":[],

    "isVersionOf":[], "license":[], "mediator":[], "medium":[],"modified":[], "provenance":[], "references":[],

    "replaces":[], "requires":[], "rightsHolder":[], "spatial":[], "tableOfContents":[], "temporal":[], "valid":[],

  "dataset":{

       "identifierDataset":[], 

        "typeDataset":[],

        "formatDataset":[],

        "relationDataset":[]

    }

    "repository":{

        "name":"...",

        "countryCode":"...",

        "longitude":"...",

        "latitude":"...",

        "url":"...",

        "addressOAIPMH":"...",

        "address":"...",

        "acronim":..."",

        "domain":"...",

        "project":"...",

        "organization":"..."},

    }

 

All parameters are Dublin Core Metadata Elements (see http://dublincore.org/documents/dces/ and http://dublincore.org/documents/dcmi-terms/) except  the repository's parameters that include the information regarding the repository that contains the resource.

 If the keyword is not found, the result is an empty object.

{ }

           

 

Example

Search the first 10 resources (offset=0) that contain the keyword  "eye" inside the title.

- REQUEST:

http://www.chain-project.eu/virtuoso/api/resources?keyword=eye&limit=10&offset=0

- RESPONSE:

{"resources":[

  {

"titles":["Drug name confusion: evaluating the effectiveness of capital ( Tall Man ) letters using eye                movement data"],

"authors":["Gale,AlastairG.","Purdy,Kevin","Gerrett,David","Filik,Ruth"],

"identifiers":["https://dspace.lboro.ac.uk/2134/2195","0277-9536","FILIK, R. ... et al, 2004. Drug name    confusion: evaluating the effectiveness of  capital (\"Tall Man\") letters using eye movement data. Social Science and Medicine, 59, pp. 2597-2601"],

"descriptions":["This is Restricted Access. This article was published in the journal, Social Science and Medicine [© Elsevier] and is available at: http://www.sciencedirect.com/science/journal/02779536.", "Medication errors commonly involve confusion between drug names that look or sound alike. One possible method of reducing these errors is to print sections of the names in ‘‘Tall Man’’ (capital) letters, in order to emphasise differences between similar products. This paper reports an eye-tracking experiment that evaluates this strategy. Participants had their eye movements monitored while they searched for a target product amongst an array of product packs. The target pack was replaced by a similar distractor in the array. Participants made fewer errors when the appearance of the names had been altered, that is, they were less likely to incorrectly identify a distractor as the target drug. This result was reflected in the eye movement data."],

"publishers":["© Elsevier"],

"subjects":["Look-alike names","Drug labelling","Patient safety","Tall Man letters","Medication        error","Eye movements"],

"contributors":[], "sources":[], "coverages":[],"languages":["en"],"abstract_":[],"accessRigths":[],

"accuralMethods":[],"accuralPeriodicity":[],"accuralPolicy":[],"alternative":[],"audience":[],"available":[],

 "bibliographicCitation":[],"conformsTo":[], "created":[],"dateAccepted":[], "dateCopyrighted":[], "dateSubmitted":[],"educationLevel":[], "extent":[],"hasFormat":[],"hasPart":[],"hasVersion":[],

 "instructionalMethod":[],"isFormatOf":[],"isPartOf":[],"isReferencedBy":[],"isReplacedBy":[],

 "isRequiredBy":[],"issued":[], "isVersionOf":[],"license":[],"mediator":[],"medium":[],"modified":[],

 "provenance":[],"references":[],"replaces":[], "requires":[], "rightsHolder":[], "spatial":[],

 "tableOfContents":[], "temporal":[],"valid":[],

"dataset":{

"identifierDataset":["https://dspace.lboro.ac.uk/2134/2195"],

"typeDataset":["Article"],

"formatDataset":[""],

"relationDataset":[""]

  },

  "repository":{

               "name":"Loughborough University Institutional Repository",

               "countryCode":"GB",

               "longitude":"-1.237",

               "latitude":"52.763",

               "url":"https://dspace.lboro.ac.uk/dspace-jspui/",

               "addressOAIPMH":"https://dspace.lboro.ac.uk/dspace-oai/request",

               "address":"",

               "acronim":"",

               "domain":"Multidisciplinary",

               "project":"OpenDOAR",

               "organization":"Loughborough University"}

   }

 {resource 2 ….}

{resource 10 ….}

}

 

2) Get only authors, titles and id of the resources

- REQUEST (HTTP method GET)

To do a request one must insert into the URL three parameters

1) keyword: is the keyword seeked; the keyword can contain any filters for example (keyword=author:SEEKED_AUTHOR, keyword=subject:SEEKED_SUBJECT, keyword=type:SEEKED_TYPE, keyword=format:SEEKED_FORMAT and keyword=publisher:SEEKED_PUBLISHER)

2) limit: is  the maximum number of resources that has to be retrieved by the query;

3) offset: is the value in the list of resources to start the retrieval with.

as shown below:

http://www.chain-project.eu/virtuoso/api/simpleResources?keyword=SEEKED_KEYWORD&limit=MAX_NUMBER_OF_RESOURCES&offset=OFFSET

- RESPONSE (application/json)

A collection of resources is represented as a JSON array of objects containing authors, titles and id about the resources:

{"simpleResources":[

    {"titles":["…","…","…"], "authors":["…","…"], "idResource:"....."},

    {…resource 2…},

    {…resource 3…},

        ...

 

 

        …

    ]

}

 

3) Get all information about a single resource

- REQUEST (HTTP method GET)

To do a request one must insert into the URL one parameter

1) id: is the identifier of the resource inside the triple store Virtuoso; it is a uri

as shown below:

http://www.chain-project.eu/virtuoso/api/singleResource?id=ID_RESOURCE

- RESPONSE (application/json)

The response is represented as a JSON object containing all information about the single resource:

{

    "titles":["…","…","…"], "authors":["…","…"], "identifiers":["…","…"], "descriptions":["…","…"],

    "publishers":["…"], "subjects":["…","…","…","…","…"], "contributors":[], "sources":[], "coverages":[],

    "languages":[], "abstract_":[], "accessRigths":[], "accuralMethods":[], "accuralPeriodicity":[],

    "accuralPolicy":[], "alternative":[], "audience":[], "available":[], "bibliographicCitation":[],

    "conformsTo":[], "created":[], "dateAccepted":[], "dateCopyrighted":[], "dateSubmitted":[],

    "educationLevel":[], "extent":[], "hasFormat":[], "hasPart":[], "hasVersion":[], "instructionalMethod":[],

    "isFormatOf":[], "isPartOf":[], "isReferencedBy":[], "isReplacedBy":[], "isRequiredBy":[], "issued":[],

    "isVersionOf":[], "license":[], "mediator":[], "medium":[],"modified":[], "provenance":[], "references":[],

    "replaces":[], "requires":[], "rightsHolder":[], "spatial":[], "tableOfContents":[], "temporal":[], "valid":[],

  "dataset":{

       "identifierDataset":[], 

        "typeDataset":[],

        "formatDataset":[],

        "relationDataset":[]

    }

    "repository":{

        "name":"...",

        "countryCode":"...",

        "longitude":"...",

        "latitude":"...",

        "url":"...",

        "addressOAIPMH":"...",

        "address":"...",

        "acronim":..."",

        "domain":"...",

        "project":"...",

        "organization":"..."},

    }

 

4) Get information from Google Scholar by a title

- REQUEST (HTTP method GET)

To do a request one must insert into the URL one parameter

1) title: is the title by which to get information from Google Scholar

as shown below:

http://www.chain-project.eu/virtuoso/api/infoGS?title=SOURCE_TITLE

- RESPONSE (application/json)

The response is represented as a JSON object containing any information from Google Scholar:

{

 "url":"...",

 "versions":"...",

 "versionsList":"...",

 "citations":"...",

 "citationsList":"...",

 "year":"..."

}