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

enh: extract fiq/piq #7

Closed
wants to merge 7 commits into from
Closed

Conversation

satra
Copy link
Contributor

@satra satra commented Sep 19, 2019

@jbpoline - updated query

@jbpoline
Copy link

thanks a lot - will try asap

@jbpoline
Copy link

@satra : hum, seems that this query does not give me any results ... I tried to add the ?piq ?fiq at the end of the select but (as expected) this is not the issue
does it return results for you ?

prefix GrayMatter: http://uri.interlex.org/ilx_0104768#
prefix afni: http://purl.org/nidash/afni#
prefix ants: http://stnava.github.io/ANTs/
prefix bids: http://bids.neuroimaging.io/
prefix birnlex: http://bioontology.org/projects/ontologies/birnlex/
prefix crypto: http://id.loc.gov/vocabulary/preservation/cryptographicHashFunctions#
prefix dc: http://purl.org/dc/elements/1.1/
prefix dcat: http://www.w3.org/ns/dcat#
prefix dct: http://purl.org/dc/terms/
prefix dctypes: http://purl.org/dc/dcmitype/
prefix dicom: http://neurolex.org/wiki/Category:DICOM_term/
prefix foaf: http://xmlns.com/foaf/0.1/
prefix freesurfer: https://surfer.nmr.mgh.harvard.edu/
prefix fsl: http://purl.org/nidash/fsl#
prefix full4_iq: dbkeator/nidm-local-terms#2
prefix hasDatumType: http://uri.interlex.org/ilx_0738262#
prefix hasLaterality: http://uri.interlex.org/ilx_0381387#
prefix hasMeasurementType: http://uri.interlex.org/ilx_0381388#
prefix isAbout: http://uri.interlex.org/ilx_0381385#
prefix isMeasureOf: http://uri.interlex.org/ilx_0381389#
prefix measurement_datum: http://uri.interlex.org/base/ilx_0738269#
prefix ncicb: http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#
prefix ncit: http://ncitt.ncit.nih.gov/
prefix ndar: https://ndar.nih.gov/api/datadictionary/v2/dataelement/
prefix nfo: http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#
prefix nidm: http://purl.org/nidash/nidm#
prefix niiri: http://iri.nidash.org/
prefix nlx: http://uri.neuinfo.org/nif/nifstd/
prefix obo: http://purl.obolibrary.org/obo/
prefix onli: http://neurolog.unice.fr/ontoneurolog/v3.0/instrument.owl#
prefix owl: http://www.w3.org/2002/07/owl#
prefix pato: http://purl.obolibrary.org/obo/pato#
prefix performance_iq: dbkeator/nidm-local-terms#4
prefix prov: http://www.w3.org/ns/prov#
prefix qc_anatomical_1: dbkeator/nidm-local-terms#63
prefix qc_rest_1: dbkeator/nidm-local-terms#62
prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
prefix rdfs: http://www.w3.org/2000/01/rdf-schema#
prefix scr: http://scicrunch.org/resolver/
prefix sio: http://semanticscience.org/ontology/sio.owl#
prefix spm: http://purl.org/nidash/spm#
prefix vc: http://www.w3.org/2006/vcard/ns#
prefix verbal_iq: dbkeator/nidm-local-terms#3
prefix xml: http://www.w3.org/XML/1998/namespace
prefix xsd: http://www.w3.org/2001/XMLSchema#
prefix ilx: http://uri.interlex.org/base/ilx_

SELECT DISTINCT ?study ?ID ?Age ?Gender ?dx ?value ?tool ?structure
WHERE
{
?e a onli:assessment-instrument;
prov:wasGeneratedBy ?act;
ncicb:Age ?Age;
ncit:Diagnosis ?dx;
ndar:gender ?Gender;
full4_iq: ?fiq;
performance_iq: ?piq .

?act a onli:instrument-based-assessment;
dct:isPartOf/dct:isPartOf [ a nidm:Project;
dctypes:title ?study];
prov:wasAssociatedWith [ a prov:Person;
ndar:src_subject_id ?ID ] .

?tool_act a prov:Activity ;
prov:qualifiedAssociation [prov:wasAssociatedWith [ndar:src_subject_id ?ID]],
[prov:wasAssociatedWith [nidm:NIDM_0000164 ?tool]] .

?tool_stats prov:wasGeneratedBy ?tool_act;
?measure ?value .

?measure a measurement_datum:;
rdfs:label ?label;
isAbout: ?structure; #http://purl.obolibrary.org/obo/UBERON_0001873;
hasMeasurementType: ilx:0112559;
hasDatumType: ?datum_uri .

}

@satra
Copy link
Contributor Author

satra commented Sep 19, 2019

@jbpoline - pushed a couple of changes. following the readme, i get about 58k records back.

@jbpoline
Copy link

@satra : Not sure what was happening - I had a weird port error (port was already taken by a jupyer notebook) but I changed the port so not sure that was the issue. In any case, restarted blazegraph, made sure test.ttl seemed ok and got you 58k records back ... Back on track !
thanks a lot !

@satra
Copy link
Contributor Author

satra commented Sep 28, 2019

@jbpoline - see the updated query. the reason hasUnit didn't work is because it wasn't in the prefix list

@jbpoline
Copy link

jbpoline commented Sep 29, 2019

@satra (also @dbkeator )
thanks - I thought I had checked that !

I am adding laterality as well I suppose it refers to right or left side of the brain ? Does this PR https://github.com/satra/simple2_NIDM_examples/pull/1/commits makes sense ?

Also: do you know if "cerebral hemisphere" is the best proxy for "total brain volume" ? it seems that in the "structure" result I have limited options (see below) but may be missing something:

{'cavum septum pellucidum': 'http://purl.obolibrary.org/obo/UBERON_0001869',
'cerebellum': 'http://purl.obolibrary.org/obo/UBERON_0002285',
'cerebellar cortex': 'http://purl.obolibrary.org/obo/UBERON_0001954',
'perivascular space': 'http://purl.obolibrary.org/obo/UBERON_0001876',
"Ammon's horn": 'http://purl.obolibrary.org/obo/UBERON_0014930',
'inferior horn of the lateral ventricle': 'http://purl.obolibrary.org/obo/UBERON_0001874',
'brainstem': 'http://purl.obolibrary.org/obo/UBERON_0001886',
'amygdala': 'http://purl.obolibrary.org/obo/UBERON_0000959',
'optic chiasma': 'http://purl.obolibrary.org/obo/UBERON_0006091',
'dorsal plus ventral thalamus': 'http://purl.obolibrary.org/obo/UBERON_0002298',
'cerebral hemisphere': 'http://purl.obolibrary.org/obo/UBERON_0009857',
'caudate nucleus': 'http://purl.obolibrary.org/obo/UBERON_0002286', 'telencephalic ventricle': 'http://purl.obolibrary.org/obo/UBERON_0002037',
'putamen': 'http://purl.obolibrary.org/obo/UBERON_0001873',
'third ventricle': 'http://purl.obolibrary.org/obo/UBERON_0006514',
'choroid plexus': 'http://purl.obolibrary.org/obo/UBERON_0002422',
'fourth ventricle': 'http://purl.obolibrary.org/obo/UBERON_0002129',
'pallidum': 'http://purl.obolibrary.org/obo/UBERON_0001897',
'nucleus accumbens': 'http://purl.obolibrary.org/obo/UBERON_0001882'}

@satra
Copy link
Contributor Author

satra commented Sep 29, 2019

@jbpoline - could you please change the target of the PR to the wBrainVols branch?

the mapping file is here: https://github.com/dbkeator/segstats_jsonld/blob/master/segstats_jsonld/mapping_data/freesurfermap.json

there are several things that could constitute brain vol - i would think this may be a good starting point: http://purl.obolibrary.org/obo/UBERON_0003128

@jbpoline
Copy link

@satra : PR is now on wBrainVols - thanks for pointing this
Atm the query does not return http://purl.obolibrary.org/obo/UBERON_0003128 - looking now how I can extend it
thanks again

satra added 4 commits October 31, 2019 13:42
* upstream/wBrainVols:
  New round of adding brain volumes.
  updated awesome query to make laterality and isabout optional
  resetting branch to NIDM files without brain volumes
  made dx optional in sparql query for adhd200 dataset
  added laterality to Keator's f'ing awesome query
  updated README files
  readme file for query
  volumes query from Keator's f'ing awesome runs super fast with pynidm query
  updated brain vols with FSL data
  updated add fsl scripts
  updated NIDM files with freesurfer brain volume data and new CDEs
  new version of NIDM files with Freesurfer brain volumes using new CDEs mapping
  rolling back to NIDM files without brain volumes for new round of conversions
  added ANTS helper script
* upstream/wBrainVols: (22 commits)
  new run of NIDM wBrainVols files and results from simple2 sparql query in queries directory
  updated query for new assessment data elememnts
  new NIDM files with brain volumes and new assessment data elements
  resetting ABIDE and ADHD200 NIDM files to before adding brain volumes but with new assessment CDE formats
  checking in NIDM files with ants brain vols using new qualified association syntax
  updated FSL data for abide and adhd200 fixing syntax difference in qualified associations between brain volume data and other nidm-e activities
  updated freesurfer brain volumes with altered prov:Activity qualified associations with agents
  updated queries to reflect changes in qualified associations with brain volume data
  updated helper scripts
  added ANTS brian volumes to CoRR dataset
  bug in url building for ants helper script
  updates to ants helper script
  renamed get_volumes_KEatorsAwesomeQuery.sparql to simple2_query.sparql.  Added a new brain volumes only query get_volumes_NoExpData.sparql.  Added a new text file  nidm_list_with_corr.txt which includes ABIDE, ADHD200, and CoRR project NIDM files for query. Updated README.md with new instructions.
  added prefix for dctypes to query
  added FSL brain volumes to CoRR NIDM files
  updated CoRR data with Freesurfer brain volumes
  added study to query
  CoRR NIDM files with Freesurfer brain volumes
  edited add_fsl helper script to accomodate CoRR dataset
  added freesurfer nidm files for corr dataset
  ...
* upstream/wBrainVols:
  updated curl simple2 query and no-experimental data get brain volumes query
  updating / adding more queries
  updated queries supporting subClassOf relationships of brain volume types with nidm:DataElement
  new nidm files with brain volumes and brain volume cde definitions separated out into cde directory
  updated data elements construct query with curl command
  added data elements construct sparql query and resulting graph to queries
  added simple2_data_elements.csv query output of all data elements and properties in simple 2 ABIDE and ADHD200 data
@satra satra closed this Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants