EBISPOT / ols4

Version 4 of the EMBL-EBI Ontology Lookup Service (OLS)
http://www.ebi.ac.uk/ols4/
Apache License 2.0
43 stars 18 forks source link

OLS4 does not return `TopObjectProperty` as a parent #139

Open jamesamcl opened 1 year ago

jamesamcl commented 1 year ago

OLS3:

{
  "_embedded": {
    "properties": [
      {
        "_links": {
          "self": {
            "href": "<base>/api/ontologies/efo/properties/http%253A%252F%252Fwww.w3.org%252F2002%252F07%252Fowl%2523TopObjectProperty?lang=en"
          }
        },
        "annotation": {},
        "description": [],
        "has_children": false,
        "iri": "http://www.w3.org/2002/07/owl#TopObjectProperty",
        "is_defining_ontology": false,
        "is_obsolete": false,
        "is_root": true,
        "label": "TopObjectProperty",
        "lang": "en",
        "ontology_iri": "http://www.ebi.ac.uk/efo/efo.owl",
        "ontology_name": "efo",
        "ontology_prefix": "EFO",
        "short_form": "TopObjectProperty",
        "synonyms": []
      }
    ]
  },
  "_links": {
    "self": {
      "href": "<base>/api/ontologies/efo/properties/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FHANCESTRO_0329/parents"
    }
  },
  "page": {
    "number": 0,
    "size": 20,
    "totalElements": 1,
    "totalPages": 1
  }
}

OLS4:

{
  "_links": {
    "self": {
      "href": "<base>/api/ontologies/efo/properties/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FHANCESTRO_0329/parents?page=0&size=20"
    }
  },
  "page": {
    "number": 0,
    "size": 20,
    "totalElements": 0,
    "totalPages": 0
  }
}
jamesamcl commented 1 year ago

I REALLY hate the way this works in OLS3.

You can resolve TopObjectProperty at https://www.ebi.ac.uk/ols/api/ontologies/efo/properties/http%253A%252F%252Fwww.w3.org%252F2002%252F07%252Fowl%2523TopObjectProperty. It has is_root true BUT has_children false!

Yet you CAN retrieve its children (even though we were just told it didn't have any): https://www.ebi.ac.uk/ols/api/ontologies/efo/properties/http%253A%252F%252Fwww.w3.org%252F2002%252F07%252Fowl%2523TopObjectProperty/children

And they also have is_root true. So both TopObjectProperty and its children are roots, which totally breaks the whole purpose of is_root.

I think we should make a breaking change and completely remove this behaviour in OLS4 even for the OLS3 backwards compatibility layer. There's never any reason to retrieve TopObjectProperty. It's not part of the ontology, it's an implicit part of the OWL spec. The OLS3 behaviour feels like a bug to me and we probably would have fixed it in OLS3 if OLS4 wasn't being developed.

@henrietteharmse @dosumis what do you think?