Skip to content

Commit

Permalink
Fixed pubs issue pub->pubs. This partly deals with #49. We should pro…
Browse files Browse the repository at this point in the history
…bably still sub pub->pubs for anat_2_ep
  • Loading branch information
dosumis committed Oct 10, 2019
1 parent 6093e4c commit 4f37608
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
5 changes: 1 addition & 4 deletions src/json_schema/vfb_query.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
"$ref": "mod.json#definitions/minimal_entity_info"
},
"pub": {
"type": "array",
"items": {
"$ref": "mod.json#definitions/pub"
}
"$ref": "mod.json#definitions/pub"
},
"anatomy_channel_image": {
"type": "array",
Expand Down
12 changes: 6 additions & 6 deletions src/vfb_query_builder/query_roller.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,12 @@ def pub_syn(self):
% (self._pub_return, self._syn_return),
vars=['pub_syn'])

def pub(self):
def pubs(self):
return Clause(MATCH=Template("OPTIONAL MATCH ($pvar$labels)"
"-[rp:has_reference]->(p:pub) "),
WITH="CASE WHEN p is null THEN [] ELSE "
"collect(" + self._pub_return + ") END AS pub",
vars=['pub'])
"collect(" + self._pub_return + ") END AS pubs",
vars=['pubs'])


def dataSet_license(self):
Expand Down Expand Up @@ -441,7 +441,7 @@ def dataset_term_info(self, short_form, *args, pretty_print=False,
self.anatomy_channel_image(),
self.xrefs(),
self.license(),
self.pub()],
self.pubs()],
q_name=q_name,
pretty_print=pretty_print)

Expand Down Expand Up @@ -545,7 +545,7 @@ def template_2_datasets_query(self, short_form):
# For this reason, we may have to remove aci from this
# query for now. Maybe add counts instead for now?
aci.__setattr__('limit', '')
pub = self.pub()
pub = self.pubs()
pub.__setattr__('pvar', 'ds')
li =self.license()
li.__setattr__('pvar', 'ds')
Expand All @@ -564,7 +564,7 @@ def all_datasets_query(self):
# For this reason, we may have to remove aci from this
# query for now. Maybe add counts instead for now?
aci.__setattr__('limit', '')
pub = self.pub()
pub = self.pubs()
pub.__setattr__('pvar', 'ds')
li = self.license()
li.__setattr__('pvar', 'ds')
Expand Down
2 changes: 1 addition & 1 deletion src/vfb_query_builder/test/TermInfo_schema_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_dataset_pub(self):
query = query_builder(query_labels=['DataSet'],
query_short_forms=['Ito2013'],
clauses=[self.ql.term(),
self.ql.pub()])
self.ql.pubs()])
r = self.qw.test(t=self,
query=query)

Expand Down

0 comments on commit 4f37608

Please sign in to comment.