Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Latest commit

 

History

History
82 lines (56 loc) · 3.14 KB

README.md

File metadata and controls

82 lines (56 loc) · 3.14 KB

Ontomatch REST-based service

Available at http://ontomatch.lis.ic.unicamp.br

This service parses a given text and returns [possible]associated entities(URIs) within an ontology. Associations are made using string similarity and distance measures of rdfs:label properties and subsequent owl:AnnotationProperty annotations linked to the resource -- usually adopted for adding properties acting as alternative labels.

Available ontologyIDs: pato, tao, xao, hfo

The set of algorithms used in this project is based on the project java-string-similarity. Please refer to this link for further details and credits.

Available algorithmIDs for string similarity and distance measures: NormalizedLevenshtein, JaroWinkler, Cosine, Jaccard, MetricLCS Levenshtein, OptimalStringAlignment

Based on a given similarity threshold (/api/rest/resources)

  • URL: /api/rest/resources

  • Method: POST

  • Required POST Params:

    • text=[string]
    • n=[float] [the service will return the n most similar entities] [Default = 10]
    • ontology=[ontologyID] [see ontology IDs] [Default = hfo]
    • algorithm=[algorithmID] [see algorithmIDs] [Default = NormalizedLevenshtein]
    • floor=[float] [returns similarities >= floor ]
    • ceiling=[float] [returns similarities <= ceiling ]
  • Success Response:

    • Code: 200
    • Content: JSON array
  • Error Responses:

    • Code: 415 Unsupported Media Type
      Troubleshooting: Check parameters

    • Code: 404 NOT FOUND
      Troubleshooting: Ontology ID not found

  • Sample Call:

    • Code:
      $.ajax({
        url: "http://ontomatch.lis.ic.unicamp.br/api/rest/resources",
        dataType: "json",
        type : "POST",
        data: { text: "chest pain", n: 5, ontology:"hfo" },
        success : function(r) {
          console.log(r);
        }
      });
    • Return:
    [
    {"uri":"http://bmi.utah.edu/ontologies/hfontology/C0008031","label":"Chest Pain","similarity":1.0},
    {"uri":"http://bmi.utah.edu/ontologies/hfontology/C0030193","label":"Pain","similarity":0.7071067690849304},
    {"uri":"http://bmi.utah.edu/ontologies/hfontology/C0000737","label":"Abdominal Pain","similarity":0.5}
    ]