Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Term detail API endpoint returns relationships #43

Open
hlapp opened this issue Jun 27, 2016 · 3 comments
Open

Term detail API endpoint returns relationships #43

hlapp opened this issue Jun 27, 2016 · 3 comments
Labels

Comments

@hlapp
Copy link
Member

hlapp commented Jun 27, 2016

The Term detail API endpoint at /api/term according to documentation returns only a label and a textual definition. In reality this is not true. For one, it also returns the @id attribute with the term ID (which is a good thing and should be kept, but is counter to documentation).

Secondly, it also returns relationships. For the example in the docs (basihyal bone), this is the following:

"relationships": [
    {
      "property": {
        "@id": "http://purl.obolibrary.org/obo/RO_0002158",
        "label": "homologous to"
      },
      "value": {
        "@id": "http://purl.obolibrary.org/obo/UBERON_0003999",
        "label": "hyoid bone body"
      }
    },
    {
      "property": {
        "@id": "http://purl.obolibrary.org/obo/RO_0002202",
        "label": "develops from"
      },
      "value": {
        "@id": "http://purl.obolibrary.org/obo/UBERON_0011615",
        "label": "basihyal cartilage"
      }
    },
    {
      "property": {
        "@id": "http://purl.obolibrary.org/obo/RO_0002473",
        "label": "composed primarily of"
      },
      "value": {
        "@id": "http://purl.obolibrary.org/obo/UBERON_0002481",
        "label": "bone tissue"
      }
    }
  ]

Aside from the fact that it is counter to documentation, I'm wondering why it is missing the is_a or subClassOf relationships?

In principle the relationships of a term are useful information and seem pertinent to a term's detail. However, when introducing such changes that add an attribute with zero or more values (in contrast to one value such as for label and definition) one needs to be aware that they can easily break code that uses the API in a way that expects (and in the documentation is promised!) a simple list of single-valued attributes. See phenoscape/rphenoscape#6 and phenoscape/rphenoscape#8 as an example.

@hlapp
Copy link
Member Author

hlapp commented Nov 3, 2018

The link to the API endpoint documentation above is obsolete, but at the now current documentation the same problem remain (documentation incorrect in not mentioning relationships), and the subClassOf/is_a are still not being returned.

$ curl -X GET "http://kb.phenoscape.org/api/term?iri=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FUBERON_0011618" -H "accept: application/json"

@balhoff
Copy link
Member

balhoff commented Sep 10, 2019

TODO:

  • add "classification" info into this service
  • use computed relation graphs to provide better "relationships" info in this service

@balhoff
Copy link
Member

balhoff commented Sep 10, 2019

Depends on phenoscape/pipeline#125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants