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

LOOP query in webapp does not work! #2053

Closed
sergiocontrino opened this issue Jun 26, 2019 · 9 comments
Closed

LOOP query in webapp does not work! #2053

sergiocontrino opened this issue Jun 26, 2019 · 9 comments
Assignees
Labels

Comments

@sergiocontrino
Copy link
Member

a user send this via email to support:

For example, I tried the following query in FlyMine:

<query name="" model="genomic" view="Gene.primaryIdentifier Gene.symbol Gene.interactions.participant2.primaryIdentifier Gene.interactions.participant2.symbol Gene.interactions.participant2.interactions.participant2.primaryIdentifier Gene.interactions.participant2.interactions.participant2.symbol" longDescription="For a specified gene, show physical and genetic interaction partners.  Optionally constrain to show just physical or genetic interactions or interactions determined by a specific method." sortOrder="Gene.primaryIdentifier asc" constraintLogic="A and B">
  <constraint path="Gene" code="A" op="LOOKUP" value="notch" extraValue="D. melanogaster"/>
  <constraint path="Gene" code="B" op="!=" loopPath="Gene.interactions.participant2.interactions.participant2"/>
</query>

And I got the following error message:
XML is not well formatted. Got
<query model="genomic" view="Gene.primaryIdentifier Gene.symbol Gene.interactions.participant2.primaryIdentifier Gene.interactions.participant2.symbol Gene.interactions.participant2.interactions.participant2.primaryIdentifier Gene.interactions.participant2.interactions.participant2.symbol" sortOrder="Gene.primaryIdentifier ASC" constraintLogic="A and B" ><constraint path="Gene" op="LOOKUP" value="notch" extraValue="D. melanogaster" code="A" /><constraint path="Gene" op="!=" code="B" /></query>.

I guess the loop constraint was not processed correctly and it was truncated.

@sergiocontrino
Copy link
Member Author

the loop constraint is not passed to the server, but is created in the query builder.

with what i think is the query of our docs:
query in webapp error message:

<query model="genomic" 
view="Gene.symbol Gene.primaryIdentifier Gene.organism.name Gene.homologues.homologue.symbol Gene.homologues.homologue.primaryIdentifier Gene.pathways.genes.symbol Gene.pathways.genes.primaryIdentifier" sortOrder="Gene.symbol ASC">
<constraint path="Gene.homologues.homologue" op="=" code="A" /></query>.

but query builder export

<query name="" model="genomic" 
view="Gene.symbol Gene.primaryIdentifier Gene.organism.name Gene.homologues.homologue.symbol Gene.homologues.homologue.primaryIdentifier Gene.pathways.genes.symbol Gene.pathways.genes.primaryIdentifier" sortOrder="Gene.symbol asc">
<constraint path="Gene.homologues.homologue" op="=" loopPath="Gene.pathways.genes"/>
</query>

@julie-sullivan julie-sullivan added this to the InterMine 4.1.0 milestone Jun 28, 2019
@julie-sullivan
Copy link
Member

When I try to import that query with a loop constraint, I get:

Import of query(ies) failed. Invalid format of query: "null"

@julie-sullivan
Copy link
Member

When someone (doesn't matter who) added JSON queries, they updated the syntax of the loop queries, i think this is where the problem started:
f93bda9#diff-0d762552042f052bfb56ff88bb9bf069

@julie-sullivan
Copy link
Member

Looking at the code in ExportQueryAction.java that works:

    private String getQueryXML(String name, PathQuery query) {
        String modelName = query.getModel().getName();
        return PathQueryBinding.marshal(query, (name != null ? name : ""), modelName,
                PathQuery.USERPROFILE_VERSION);
    }

This exports the query with loopPath intact. Used in export in myMine, template form and query builder.

This is the code that fails to populate loopPath:

# in PathQuery.toXML()
PathQueryBinding.marshal(this, "query", model.getName(), writer, version);

PathQuery.toXML() is used when queries are imported or executed (in the case of saved queries)

@julie-sullivan
Copy link
Member

Anyway, both the export and import look like they use the same xml binding code, so why are they acting different?

@julie-sullivan
Copy link
Member

<query name="" model="genomic" view="Gene.symbol Gene.homologues.homologue.symbol" longDescription="" sortOrder="Gene.symbol asc">
  <constraint path="Gene" op="=" loopPath="Gene.homologues.homologue"/>
</query>

@julie-sullivan
Copy link
Member

Running that query in iodocs works, running that query in the webapp does not.

@julie-sullivan
Copy link
Member

This looks like a problem with imjs, not with the query code. @yochannah can you comment?

@danielabutano danielabutano moved this from InterMine 4.1.0 (Fall 2019) to InterMine 4.2.0 (Winter 2019) in Roadmap & release planning Sep 9, 2019
@danielabutano danielabutano removed this from InterMine 4.2.0 (Winter 2019) in Roadmap & release planning Sep 9, 2019
@yochannah
Copy link
Member

yochannah commented Sep 19, 2019

I'm about 80% confident it's imjs, and it's on the roadmap to be done reasonably soon! :)

edit to add: intermine will need to bump its imjs supported version so this issue should definitely remain in place.

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

4 participants