ols4 icon indicating copy to clipboard operation
ols4 copied to clipboard

OLS4 does not return `TopObjectProperty` as a parent

Open jamesamcl opened this issue 2 years ago • 1 comments
trafficstars

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 avatar Dec 15 '22 03:12 jamesamcl

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?

jamesamcl avatar Dec 19 '22 03:12 jamesamcl