ontoportal-lirmm / goo

Graph Oriented Objects (GOO) for Ruby. A RDF/SPARQL based ORM.
http://ncbo.github.io/goo/
Other
0 stars 4 forks source link

Object goo_attrs_to_load is not working as excepted #46

Open syphax-bouazzouni opened 1 year ago

syphax-bouazzouni commented 1 year ago

Doing OntologySubmission.goo_attrs_to_load([:contact, :ontology])

Should return all the attributes of contact and ontology that are needed to be loaded in a request

{
  :contact=>[:name, :email],
  :ontology=>[:administeredBy, :acronym, :name, :summaryOnly, :flat, :ontologyType, :group, :hasDomain, 
                        :viewingRestriction, :viewOf, :views, :reviews, :notes, :projects]

}

But the returned object is

{
  :contact=>[:ontology],
  :ontology=>[:administeredBy, :acronym, :name, :summaryOnly, :flat, :ontologyType, :group, :hasDomain, :viewingRestriction, :viewOf, :views, :reviews, :notes, :projects]

}

This function is used mostly in the API layer with the include parameter, when we do for example /submissions?include=contact or /submissions?include=all, this function goo_attrs_to_load is called.

Having the function not working, causes this sort of issue https://github.com/ontoportal-lirmm/ontologies_api/issues/22, where do fetch all the asked attributes correctly.
All of the hot fixed and ad-hoc code were made in the API layer to handle this, but this function was never fixed.

syphax-bouazzouni commented 1 year ago

This bug is also present in NCBO Bioporal (https://data.bioontology.org/ontologies/SPD/submissions?display=contact,submissionId&display_context=false&display_context=false)