NCATSTranslator / ReasonerAPI

NCATS Biomedical Translator Reasoners Standard API
35 stars 28 forks source link

Make predicate required and cleanup #377

Closed edeutsch closed 2 years ago

edeutsch commented 2 years ago

Make predicate required and not nullable and clean up examples, definitions, and make the allOf to oneOf switch for validator compatibility

marcdubybroad commented 2 years ago

Just to verify, does this mean that this query would be invalid (no predicate)?

  {
    "message": {
      "query_graph": {
        "edges": {
          "e00": {
            "subject": "n01",
            "object": "n00"
          }
        },
        "nodes": {
          "n00": {
            "categories": ["biolink:Gene"]
          },
          "n01": {
            "ids": ["MONDO:0011936"],
            "categories": ["biolink:DiseaseOrPhenotypicFeature"]
          }
        }
      }
    }
  }
edeutsch commented 2 years ago

Correct, that would become a schema violation. Is that okay? Or do we want to support such loose queries? If one simply added a predicate biolink:related_to, that would have the same meaning I suppose, and would be legal under the proposed scheme.

marcdubybroad commented 2 years ago

Should we also require categories then on nodes? Just trying to stay consistent on the rules for the json query. The more explicit we make the query, the easier it will be for the new user to be able to build a query from scratch should they not use the UI or other query building tool.

edeutsch commented 2 years ago

I think the general sentiment was that if you specify a CURIE, then a category was either redundant or potentially conflicting. Many felt that if you provide a CURIE, you should not provide a category. But there was some disagreement as well.

vdancik commented 2 years ago

@marcdubybroad actually the PR only specifies that a knowledge-graph edge is required; predicate in QEdge remains optional and your query example will still be valid.