Skip to content

Commit

Permalink
Merge pull request #280 from dbkeator/master
Browse files Browse the repository at this point in the history
fixed a bug with rest queries for subjects data. was adding a subject…
  • Loading branch information
dbkeator authored Aug 24, 2021
2 parents 6fdd955 + 68339c7 commit 9c866c2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions nidm/experiment/Query.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,24 +599,24 @@ def GetParticipantUUIDsForProjectCached(nidm_file_list:tuple, project_id, filter
for blank in rdf_graph.objects(subject=activity, predicate=Constants.PROV['qualifiedAssociation']):
if (blank, Constants.PROV['hadRole'], Constants.SIO['Subject']):
for participant in rdf_graph.objects(subject=blank, predicate=Constants.PROV['agent']):
uuid = (str(participant)).split('/')[-1] # srip off the http://whatever/whatever/
uuid = (str(participant)).split('/')[-1] # strip off the http://whatever/whatever/
if (not uuid in participants) and \
( (not filter) or CheckSubjectMatchesFilter( tuple([file]) , project, participant, filter) ):
### added by DBK for subject IDs as well ###
for id in rdf_graph.objects(subject=participant,predicate=URIRef(Constants.NIDM_SUBJECTID.uri)):
subid = (str(id)).split('/')[-1] # srip off the http://whatever/whatever/

### added by DBK for subject IDs as well ###
#participants.append(uuid)
if ( not uuid in participants['uuid'] ):
try:
participants['uuid'].append(uuid)
participants['subject id'].append(subid)
# just in case there's no subject id in the file...
except:
#participants.append(uuid)
participants['uuid'].append(uuid)
participants['subject id'].apend('')
subid = (str(id)).split('/')[-1] # strip off the http://whatever/whatever/

### added by DBK for subject IDs as well ###
#participants.append(uuid)
if ( not uuid in participants['uuid'] ):
try:
participants['uuid'].append(uuid)
participants['subject id'].append(subid)
# just in case there's no subject id in the file...
except:
#participants.append(uuid)
participants['uuid'].append(uuid)
participants['subject id'].append('')

return participants

Expand Down
2 changes: 1 addition & 1 deletion nidm/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z"
_version_major = 3
_version_minor = 8
_version_micro = '2' # use '' for first of series, number for 1 and above
_version_micro = '3' # use '' for first of series, number for 1 and above
_version_extra = ''
# _version_extra = '' # Uncomment this for full releases

Expand Down

0 comments on commit 9c866c2

Please sign in to comment.