PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX nidm-experiment: <https://purl.org/nidash/nidm/schema/>
PREFIX linkml: <https://w3id.org/linkml/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX dctypes: <http://purl.org/dc/dcmitype/>
PREFIX nidm: <http://purl.org/nidash/nidm#>
PREFIX niiri: <http://iri.nidash.org/>
PREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#>
PREFIX crypto: <http://id.loc.gov/vocabulary/preservation/cryptographicHashFunctions#>
PREFIX sio: <http://semanticscience.org/ontology/sio.owl#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX onli: <http://neurolog.unice.fr/ontoneurolog/v3.0/instrument.owl#>
PREFIX bids: <http://bids.neuroimaging.io/>
PREFIX ndar: <https://ndar.nih.gov/api/datadictionary/v2/dataelement/>
PREFIX ilx: <http://uri.interlex.org/>
PREFIX dicom: <http://uri.interlex.org/dicom/uris/terms/>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
PREFIX schema: <http://schema.org/>
PREFIX reproschema: <http://schema.repronim.org/>
PREFIX fsl: <http://purl.org/nidash/fsl#>
PREFIX freesurfer: <https://surfer.nmr.mgh.harvard.edu/>
PREFIX ants: <http://stnava.github.io/ANTs/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX pav: <http://purl.org/pav/>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX vann: <http://purl.org/vocab/vann/>

<https://purl.org/nidash/nidm/schema> a owl:Ontology ;
  rdfs:label "NIDM-Experiment Schema" ;
  rdfs:comment "Schema describing the structure of NIDM (Neuroimaging Data Model) RDF graphs. NIDM files use the W3C PROV data model to represent neuroimaging study provenance, metadata, and derived data.  This schema is used by AI-assisted SPARQL query generation to understand the graph structure." ;
  dct:license "Apache-2.0" ;
  pav:version "0.1.0" ;
  nidm-experiment:graph_hierarchy """Project (nidm:Project, prov:Activity)
  -> Session (nidm:Session, prov:Activity)  [via dct:isPartOf]
    -> Acquisition (nidm:Acquisition, prov:Activity)  [via dct:isPartOf]
      -> AcquisitionObject (nidm:AcquisitionObject, prov:Entity)  [via prov:wasGeneratedBy]
  -> DataElement (nidm:DataElement, prov:Entity)
  -> Derivative (nidm:Derivative, prov:Activity)  [via dct:isPartOf]
    -> DerivativeObject (prov:Entity)  [via prov:wasGeneratedBy]""" ;
  nidm-experiment:sparql_get_all_projects """SELECT ?project ?title WHERE {
  ?project rdf:type nidm:Project .
  OPTIONAL { ?project dctypes:title ?title }
}""" ;
  nidm-experiment:sparql_get_sessions_for_project """SELECT ?session WHERE {
  ?session rdf:type nidm:Session ;
           dct:isPartOf ?project .
  ?project rdf:type nidm:Project .
}""" ;
  nidm-experiment:sparql_get_subjects_and_ids """SELECT ?person ?subject_id WHERE {
  ?person rdf:type prov:Person ;
          ndar:src_subject_id ?subject_id .
}""" ;
  nidm-experiment:sparql_get_subject_data """SELECT ?acq_obj ?predicate ?value WHERE {
  ?person ndar:src_subject_id \"SUB_ID\"^^xsd:string .
  ?assoc prov:agent ?person .
  ?acq prov:qualifiedAssociation ?assoc .
  ?acq_obj prov:wasGeneratedBy ?acq ;
           ?predicate ?value .
}""" ;
  nidm-experiment:sparql_get_data_elements """SELECT ?de ?label ?description WHERE {
  { ?de rdf:type nidm:DataElement }
  UNION
  { ?de rdf:type nidm:PersonalDataElement }
  OPTIONAL { ?de rdfs:label ?label }
  OPTIONAL { ?de dct:description ?description }
}""" ;
  nidm-experiment:sparql_get_values_for_variable """SELECT ?subject_id ?value WHERE {
  ?de rdfs:label \"VARIABLE_LABEL\" .
  ?acq_obj ?de ?value ;
           prov:wasGeneratedBy ?acq .
  ?acq prov:qualifiedAssociation ?assoc .
  ?assoc prov:agent ?person .
  ?person ndar:src_subject_id ?subject_id .
}""" ;
  nidm-experiment:sparql_get_imaging_acquisitions """SELECT ?acq_obj ?modality ?contrast ?filename WHERE {
  ?acq_obj rdf:type nidm:AcquisitionObject ;
           nidm:hadAcquisitionModality ?modality ;
           nidm:hadImageContrastType ?contrast .
  OPTIONAL { ?acq_obj nfo:filename ?filename }
}""" ;
  nidm-experiment:sparql_get_export_provenance """SELECT ?activity ?label ?software ?version ?time WHERE {
  ?entity prov:wasGeneratedBy ?activity .
  ?activity prov:wasAssociatedWith ?agent ;
            rdfs:label ?label ;
            prov:startedAtTime ?time .
  ?agent rdf:type prov:SoftwareAgent ;
         rdfs:label ?software ;
         schema:softwareVersion ?version .
}""" ;
  nidm-experiment:important_notes "(1) All instance identifiers typically use the niiri: namespace with UUIDs (e.g. niiri:abc123-def456). (2) DataElement URIs serve a DUAL PURPOSE: as RDF subjects carrying metadata (label, description, isAbout), AND as RDF predicates on AcquisitionObjects to store actual measurement values. (3) DataElements from processing pipelines (FreeSurfer, FSL, ANTs) may use pipeline-specific namespaces (freesurfer:, fsl:, ants:) instead of niiri:. (4) Subject data is accessed through the prov:qualifiedAssociation chain: Acquisition -> prov:qualifiedAssociation -> Association -> prov:agent -> Person.  The Person carries ndar:src_subject_id. (5) Assessment/questionnaire and demographic data are stored as properties on AcquisitionObjects, using DataElement URIs as predicates with literal values. (6) Literal values are often typed as xsd:string even for numeric data. Check the DataElement's nidm:valueType for the intended type. (7) Multiple NIDM files can describe data from different sites or projects but share the same schema structure." ;
  vann:preferredNamespacePrefix "nidm-experiment" ;
  vann:preferredNamespaceUri "https://purl.org/nidash/nidm/schema/"^^xsd:anyURI ;
  sh:declare [
    sh:prefix "nidm-experiment" ;
    sh:namespace "https://purl.org/nidash/nidm/schema/"^^xsd:anyURI
  ] , [
    sh:prefix "linkml" ;
    sh:namespace "https://w3id.org/linkml/"^^xsd:anyURI
  ] , [
    sh:prefix "rdf" ;
    sh:namespace "http://www.w3.org/1999/02/22-rdf-syntax-ns#"^^xsd:anyURI
  ] , [
    sh:prefix "rdfs" ;
    sh:namespace "http://www.w3.org/2000/01/rdf-schema#"^^xsd:anyURI
  ] , [
    sh:prefix "xsd" ;
    sh:namespace "http://www.w3.org/2001/XMLSchema#"^^xsd:anyURI
  ] , [
    sh:prefix "prov" ;
    sh:namespace "http://www.w3.org/ns/prov#"^^xsd:anyURI
  ] , [
    sh:prefix "dct" ;
    sh:namespace "http://purl.org/dc/terms/"^^xsd:anyURI
  ] , [
    sh:prefix "dctypes" ;
    sh:namespace "http://purl.org/dc/dcmitype/"^^xsd:anyURI
  ] , [
    sh:prefix "nidm" ;
    sh:namespace "http://purl.org/nidash/nidm#"^^xsd:anyURI
  ] , [
    sh:prefix "niiri" ;
    sh:namespace "http://iri.nidash.org/"^^xsd:anyURI
  ] , [
    sh:prefix "nfo" ;
    sh:namespace "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#"^^xsd:anyURI
  ] , [
    sh:prefix "crypto" ;
    sh:namespace "http://id.loc.gov/vocabulary/preservation/cryptographicHashFunctions#"^^xsd:anyURI
  ] , [
    sh:prefix "sio" ;
    sh:namespace "http://semanticscience.org/ontology/sio.owl#"^^xsd:anyURI
  ] , [
    sh:prefix "obo" ;
    sh:namespace "http://purl.obolibrary.org/obo/"^^xsd:anyURI
  ] , [
    sh:prefix "onli" ;
    sh:namespace "http://neurolog.unice.fr/ontoneurolog/v3.0/instrument.owl#"^^xsd:anyURI
  ] , [
    sh:prefix "bids" ;
    sh:namespace "http://bids.neuroimaging.io/"^^xsd:anyURI
  ] , [
    sh:prefix "ndar" ;
    sh:namespace "https://ndar.nih.gov/api/datadictionary/v2/dataelement/"^^xsd:anyURI
  ] , [
    sh:prefix "ilx" ;
    sh:namespace "http://uri.interlex.org/"^^xsd:anyURI
  ] , [
    sh:prefix "dicom" ;
    sh:namespace "http://uri.interlex.org/dicom/uris/terms/"^^xsd:anyURI
  ] , [
    sh:prefix "dcat" ;
    sh:namespace "http://www.w3.org/ns/dcat#"^^xsd:anyURI
  ] , [
    sh:prefix "schema" ;
    sh:namespace "http://schema.org/"^^xsd:anyURI
  ] , [
    sh:prefix "reproschema" ;
    sh:namespace "http://schema.repronim.org/"^^xsd:anyURI
  ] , [
    sh:prefix "fsl" ;
    sh:namespace "http://purl.org/nidash/fsl#"^^xsd:anyURI
  ] , [
    sh:prefix "freesurfer" ;
    sh:namespace "https://surfer.nmr.mgh.harvard.edu/"^^xsd:anyURI
  ] , [
    sh:prefix "ants" ;
    sh:namespace "http://stnava.github.io/ANTs/"^^xsd:anyURI
  ] .

nidm:Project a owl:Class ;
  rdfs:comment "Top-level container for a research project or study.  Every NIDM graph has at least one Project.  A Project is also a prov:Activity." ;
  skos:note "RDF types: nidm:Project, prov:Activity" , "Children are linked back to the Project via dct:isPartOf" ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty dctypes:title ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty dctypes:title ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty dct:description ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty dct:description ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty dct:license ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty dct:license ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty obo:IAO_0000623 ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty obo:IAO_0000623 ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty obo:IAO_0000324 ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty obo:IAO_0000324 ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty sio:Identifier ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty sio:Identifier ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty dcat:author ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty dcat:author ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty dct:hasVersion ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty dct:hasVersion ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm-experiment:sessions ;
    owl:allValuesFrom nidm:Session
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm-experiment:data_elements ;
    owl:allValuesFrom nidm:DataElement
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm-experiment:derivatives ;
    owl:allValuesFrom nidm:Derivative
  ] .

nidm:Session a owl:Class ;
  rdfs:comment "A study session, typically one per participant visit.  Contains acquisition activities.  A Session is also a prov:Activity." ;
  skos:note "RDF types: nidm:Session, prov:Activity" , "Linked to Project via dct:isPartOf" ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty dct:isPartOf ;
    owl:allValuesFrom nidm:Project
  ] , [
    a owl:Restriction ;
    owl:onProperty dct:isPartOf ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty bids:session_number ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty bids:session_number ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm-experiment:acquisitions ;
    owl:allValuesFrom nidm:Acquisition
  ] .

nidm:Acquisition a owl:Class ;
  rdfs:comment "An acquisition activity such as an MRI scan or questionnaire administration.  Produces AcquisitionObjects.  Also a prov:Activity." ;
  skos:note "RDF types: nidm:Acquisition, prov:Activity" , "Linked to Session via dct:isPartOf" , "May also carry onli:instrument-based-assessment type for assessments" , "Participant linkage: Acquisition -> prov:qualifiedAssociation -> prov:Association (with prov:agent -> Person, prov:hadRole -> sio:Subject)" ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty dct:isPartOf ;
    owl:allValuesFrom nidm:Session
  ] , [
    a owl:Restriction ;
    owl:onProperty dct:isPartOf ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:qualifiedAssociation ;
    owl:allValuesFrom prov:Association
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm-experiment:acquisition_objects ;
    owl:allValuesFrom nidm:AcquisitionObject
  ] .

nidm:AcquisitionObject a owl:Class ;
  rdfs:comment "A data entity produced by an Acquisition.  Can represent imaging data, assessment/questionnaire results, or demographic data.  Also a prov:Entity." ;
  skos:note "RDF types: nidm:AcquisitionObject, prov:Entity" , "May additionally have type onli:assessment-instrument for assessments" , "Linked to its Acquisition via prov:wasGeneratedBy" , "Assessment and demographic values are stored as extra properties on this object, using DataElement URIs as predicates with literal values." ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty prov:wasGeneratedBy ;
    owl:allValuesFrom nidm:Acquisition
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:wasGeneratedBy ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:hadAcquisitionModality ;
    owl:allValuesFrom nidm-experiment:AcquisitionModalityEnum
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:hadAcquisitionModality ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:hadImageContrastType ;
    owl:allValuesFrom nidm-experiment:ImageContrastTypeEnum
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:hadImageContrastType ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:hadImageUsageType ;
    owl:allValuesFrom nidm-experiment:ImageUsageTypeEnum
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:hadImageUsageType ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:Task ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:Task ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:AcquisitionObject ;
    owl:allValuesFrom xsd:integer
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:AcquisitionObject ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nfo:filename ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty nfo:filename ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty crypto:sha512 ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty crypto:sha512 ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:Location ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:Location ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] .

nidm:DataElement a owl:Class ;
  rdfs:comment "Metadata describing a measured variable.  Defines the semantics, data type, units, and ontology mapping for a column/variable in the study data.  Also a prov:Entity." ;
  skos:note "RDF types: nidm:DataElement, prov:Entity" , "DataElement URIs serve a DUAL PURPOSE: (1) as subjects carrying metadata (label, description, isAbout), and (2) as predicates on AcquisitionObjects to store actual measurement values." , "DataElements from processing pipelines (FreeSurfer, FSL, ANTs) may use pipeline-specific namespaces (freesurfer:, fsl:, ants:) instead of niiri: for their URIs." ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty rdfs:label ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty rdfs:label ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty dct:description ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty dct:description ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:isAbout ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:sourceVariable ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:sourceVariable ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:valueType ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:minValue ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:minValue ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:maxValue ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:maxValue ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:measureOf ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:datumType ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:hasUnit ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:hasUnit ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:hasLaterality ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:hasLaterality ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty reproschema:choices ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty reproschema:choices ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] .

nidm:PersonalDataElement a owl:Class ;
  rdfs:comment "A DataElement for personal or demographic data (age, sex, handedness, diagnosis, etc.).  Subclass of nidm:DataElement." ;
  skos:note "RDF types: nidm:PersonalDataElement, prov:Entity" , "nidm:PersonalDataElement rdfs:subClassOf nidm:DataElement" ;
  rdfs:subClassOf nidm:DataElement .

nidm:Derivative a owl:Class ;
  rdfs:comment "A processing or analysis activity that produces derived data (e.g. brain volume measurements from FreeSurfer, FSL, ANTs).  Also a prov:Activity." ;
  skos:note "RDF types: nidm:Derivative, prov:Activity" , "Linked to Project via dct:isPartOf" ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty dct:isPartOf ;
    owl:allValuesFrom nidm:Project
  ] , [
    a owl:Restriction ;
    owl:onProperty dct:isPartOf ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:used ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] .

nidm:DerivativeObject a owl:Class ;
  rdfs:comment "An entity produced by a Derivative processing activity.  Contains derived measurements.  Also a prov:Entity." ;
  skos:note "RDF types: nidm:DerivativeObject, prov:Entity" , "Like AcquisitionObject, derived measurement values are stored as properties using DataElement URIs as predicates." ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty prov:wasGeneratedBy ;
    owl:allValuesFrom nidm:Derivative
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:wasGeneratedBy ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] .

prov:Person a owl:Class ;
  rdfs:comment "A research participant or subject.  Also a prov:Agent." ;
  skos:note "RDF types: prov:Person, prov:Agent" , "Linked to Acquisitions via prov:qualifiedAssociation -> prov:Association (with prov:hadRole sio:Subject)" ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty ndar:src_subject_id ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty ndar:src_subject_id ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] .

prov:SoftwareAgent a owl:Class ;
  rdfs:comment "Software that produced or processed data (e.g. bidsmri2nidm.py, csv2nidm.py, FreeSurfer).  Also a prov:Agent." ;
  skos:note "RDF types: prov:SoftwareAgent, prov:Agent" ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty rdfs:label ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty rdfs:label ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty schema:name ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty schema:name ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty schema:softwareVersion ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty schema:softwareVersion ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:command ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:command ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty schema:runtimePlatform ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty schema:runtimePlatform ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] .

prov:Association a owl:Class ;
  rdfs:comment "Links an Acquisition activity to an agent (participant) with a specific role.  Typically connects to a Person with role sio:Subject." ;
  skos:note "RDF type: prov:Association" , "Created as a blank node in the graph" ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty prov:agent ;
    owl:allValuesFrom prov:Person
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:agent ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:hadRole ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] .

prov:Collection a owl:Class ;
  rdfs:comment "A collection of entities (e.g. a BIDS dataset, a FreeSurfer stats collection).  Also a prov:Entity." ;
  skos:note "RDF types: prov:Collection, prov:Entity" , "May additionally have type bids:Dataset, nidm:FSStatsCollection, nidm:FSLStatsCollection, or nidm:ANTSStatsCollection" ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty bids:BIDSVersion ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty bids:BIDSVersion ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty dct:license ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty dct:license ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:hadMember ;
    owl:allValuesFrom owl:Thing
  ] .

prov:Activity a owl:Class ;
  rdfs:comment "An export activity recording which tool created or modified the NIDM file.  Part of the export provenance pattern." ;
  skos:note "RDF type: prov:Activity" , "Pattern: ExportActivity -> prov:wasAssociatedWith -> SoftwareAgent; output Entity -> prov:wasGeneratedBy -> ExportActivity; ExportActivity -> prov:used -> input Collection or Project" ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty rdfs:label ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty rdfs:label ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:outputFormat ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty nidm:outputFormat ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:startedAtTime ;
    owl:allValuesFrom xsd:dateTime
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:startedAtTime ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:endedAtTime ;
    owl:allValuesFrom xsd:dateTime
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:endedAtTime ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:wasAssociatedWith ;
    owl:allValuesFrom prov:SoftwareAgent
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:wasAssociatedWith ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty prov:used ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] .

dctypes:title a owl:DatatypeProperty ;
  rdfs:comment "Project or study name" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

dct:description a owl:DatatypeProperty ;
  rdfs:comment "Project description" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

dct:license a owl:DatatypeProperty ;
  rdfs:comment "Data license" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

obo:IAO_0000623 a owl:DatatypeProperty ;
  rdfs:comment "Funding information" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

obo:IAO_0000324 a owl:DatatypeProperty ;
  rdfs:comment "Acknowledgments" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

sio:Identifier a owl:DatatypeProperty ;
  rdfs:comment "Project version or identifier" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

dcat:author a owl:DatatypeProperty ;
  rdfs:comment "Dataset author(s)" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

dct:hasVersion a owl:DatatypeProperty ;
  rdfs:comment "Dataset version" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

nidm-experiment:sessions a owl:ObjectProperty ;
  rdfs:comment "Sessions belonging to this project" ;
  rdfs:range nidm:Session .

nidm-experiment:data_elements a owl:ObjectProperty ;
  rdfs:comment "DataElement definitions for this project" ;
  rdfs:range nidm:DataElement .

nidm-experiment:derivatives a owl:ObjectProperty ;
  rdfs:comment "Derivative processing activities" ;
  rdfs:range nidm:Derivative .

dct:isPartOf a owl:ObjectProperty ;
  rdfs:comment "The Project this Session belongs to" ;
  a owl:FunctionalProperty .

bids:session_number a owl:DatatypeProperty ;
  rdfs:comment "Session number within the study" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

nidm-experiment:acquisitions a owl:ObjectProperty ;
  rdfs:comment "Acquisition activities in this session" ;
  rdfs:range nidm:Acquisition .

prov:qualifiedAssociation a owl:ObjectProperty ;
  rdfs:comment "Association(s) linking this activity to agents (participants)" ;
  rdfs:range prov:Association .

nidm-experiment:acquisition_objects a owl:ObjectProperty ;
  rdfs:comment "Entities generated by this acquisition" ;
  rdfs:range nidm:AcquisitionObject .

prov:wasGeneratedBy a owl:ObjectProperty ;
  rdfs:comment "The Acquisition that produced this object" ;
  a owl:FunctionalProperty .

nidm:hadAcquisitionModality a owl:ObjectProperty ;
  rdfs:comment "Imaging modality (MRI, PET)" ;
  rdfs:range nidm-experiment:AcquisitionModalityEnum ;
  a owl:FunctionalProperty .

nidm:hadImageContrastType a owl:ObjectProperty ;
  rdfs:comment "Image contrast type (T1, T2, DWI, etc.)" ;
  rdfs:range nidm-experiment:ImageContrastTypeEnum ;
  a owl:FunctionalProperty .

nidm:hadImageUsageType a owl:ObjectProperty ;
  rdfs:comment "Intended image usage (Anatomical, Functional, DWI)" ;
  rdfs:range nidm-experiment:ImageUsageTypeEnum ;
  a owl:FunctionalProperty .

nidm:Task a owl:DatatypeProperty ;
  rdfs:comment "Task name for functional MRI" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

nfo:filename a owl:DatatypeProperty ;
  rdfs:comment "File path, often in BIDS format (e.g. bids::sub-XX/anat/sub-XX_T1w.nii.gz)" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

crypto:sha512 a owl:DatatypeProperty ;
  rdfs:comment "SHA-512 hash of the file" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

prov:Location a owl:DatatypeProperty ;
  rdfs:comment "URL or file path location" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

rdfs:label a owl:DatatypeProperty ;
  rdfs:comment "Human-readable variable label" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

nidm:isAbout a owl:ObjectProperty ;
  rdfs:comment "Ontology concept this variable measures (typically ilx:, obo:, or dicom: URI)" ;
  a owl:FunctionalProperty .

nidm:sourceVariable a owl:DatatypeProperty ;
  rdfs:comment "Original variable name in source data" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

nidm:valueType a owl:ObjectProperty ;
  rdfs:comment "XSD data type (xsd:string, xsd:float, xsd:integer)" ;
  a owl:FunctionalProperty .

nidm:minValue a owl:DatatypeProperty ;
  rdfs:comment "Minimum allowed value" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

nidm:maxValue a owl:DatatypeProperty ;
  rdfs:comment "Maximum allowed value" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

nidm:measureOf a owl:ObjectProperty ;
  rdfs:comment "Brain structure or region measured" ;
  a owl:FunctionalProperty .

nidm:datumType a owl:ObjectProperty ;
  rdfs:comment "Type of measurement (e.g. anatomical volume)" ;
  a owl:FunctionalProperty .

nidm:hasUnit a owl:DatatypeProperty ;
  rdfs:comment "Unit of measurement (e.g. mm^3)" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

nidm:hasLaterality a owl:DatatypeProperty ;
  rdfs:comment "Brain laterality (Left, Right, Bilateral)" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

reproschema:choices a owl:DatatypeProperty ;
  rdfs:comment "Valid categorical choices for this variable" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

prov:used a owl:ObjectProperty ;
  rdfs:comment "Source entity consumed by this derivative activity" ;
  a owl:FunctionalProperty .

ndar:src_subject_id a owl:DatatypeProperty ;
  rdfs:comment "Subject ID in the study (e.g. 'sub-0050002').  This is the primary human-readable identifier for participants." ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

schema:name a owl:DatatypeProperty ;
  rdfs:comment "Software name (e.g. 'PyNIDM')" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

schema:softwareVersion a owl:DatatypeProperty ;
  rdfs:comment "Software version string" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

nidm:command a owl:DatatypeProperty ;
  rdfs:comment "Command or script name" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

schema:runtimePlatform a owl:DatatypeProperty ;
  rdfs:comment "Runtime environment (e.g. 'Python 3.9.23')" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

prov:agent a owl:ObjectProperty ;
  rdfs:comment "The agent (participant) involved" ;
  rdfs:range prov:Person ;
  a owl:FunctionalProperty .

prov:hadRole a owl:ObjectProperty ;
  rdfs:comment "Role of the agent (typically sio:Subject)" ;
  a owl:FunctionalProperty .

bids:BIDSVersion a owl:DatatypeProperty ;
  rdfs:comment "BIDS standard version" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

prov:hadMember a owl:ObjectProperty ;
  rdfs:comment "Member entities of this collection" .

nidm:outputFormat a owl:DatatypeProperty ;
  rdfs:comment "Output format (e.g. 'turtle')" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

prov:startedAtTime a owl:DatatypeProperty ;
  rdfs:range xsd:dateTime ;
  a owl:FunctionalProperty .

prov:endedAtTime a owl:DatatypeProperty ;
  rdfs:range xsd:dateTime ;
  a owl:FunctionalProperty .

prov:wasAssociatedWith a owl:ObjectProperty ;
  rdfs:range prov:SoftwareAgent ;
  a owl:FunctionalProperty .

nidm-experiment:AcquisitionModalityEnum a owl:Class ;
  rdfs:comment "Imaging acquisition modality types" ;
  owl:equivalentClass [
    a owl:Class ;
    owl:oneOf ( nidm:MagneticResonanceImaging nidm:PositronEmissionTomography )
  ] .

nidm:MagneticResonanceImaging a owl:NamedIndividual , nidm-experiment:AcquisitionModalityEnum .

nidm:PositronEmissionTomography a owl:NamedIndividual , nidm-experiment:AcquisitionModalityEnum .

nidm-experiment:ImageContrastTypeEnum a owl:Class ;
  rdfs:comment "MRI image contrast types" ;
  owl:equivalentClass [
    a owl:Class ;
    owl:oneOf ( nidm:T1Weighted nidm:T2Weighted nidm:T2StarWeighted nidm:DiffusionWeighted nidm:DiffusionTensor nidm:FlowWeighted nidm:ArterialSpinLabeling )
  ] .

nidm:T1Weighted a owl:NamedIndividual , nidm-experiment:ImageContrastTypeEnum .

nidm:T2Weighted a owl:NamedIndividual , nidm-experiment:ImageContrastTypeEnum .

nidm:T2StarWeighted a owl:NamedIndividual , nidm-experiment:ImageContrastTypeEnum .

nidm:DiffusionWeighted a owl:NamedIndividual , nidm-experiment:ImageContrastTypeEnum , nidm-experiment:ImageUsageTypeEnum .

nidm:DiffusionTensor a owl:NamedIndividual , nidm-experiment:ImageContrastTypeEnum .

nidm:FlowWeighted a owl:NamedIndividual , nidm-experiment:ImageContrastTypeEnum .

nidm:ArterialSpinLabeling a owl:NamedIndividual , nidm-experiment:ImageContrastTypeEnum .

nidm-experiment:ImageUsageTypeEnum a owl:Class ;
  rdfs:comment "Intended usage of an acquired image" ;
  owl:equivalentClass [
    a owl:Class ;
    owl:oneOf ( nidm:Anatomical nidm:Functional nidm:DiffusionWeighted )
  ] .

nidm:Anatomical a owl:NamedIndividual , nidm-experiment:ImageUsageTypeEnum .

nidm:Functional a owl:NamedIndividual , nidm-experiment:ImageUsageTypeEnum .

pav:version a owl:AnnotationProperty .

nidm-experiment:graph_hierarchy a owl:AnnotationProperty .

nidm-experiment:sparql_get_all_projects a owl:AnnotationProperty .

nidm-experiment:sparql_get_sessions_for_project a owl:AnnotationProperty .

nidm-experiment:sparql_get_subjects_and_ids a owl:AnnotationProperty .

nidm-experiment:sparql_get_subject_data a owl:AnnotationProperty .

nidm-experiment:sparql_get_data_elements a owl:AnnotationProperty .

nidm-experiment:sparql_get_values_for_variable a owl:AnnotationProperty .

nidm-experiment:sparql_get_imaging_acquisitions a owl:AnnotationProperty .

nidm-experiment:sparql_get_export_provenance a owl:AnnotationProperty .

nidm-experiment:important_notes a owl:AnnotationProperty .

vann:preferredNamespacePrefix a owl:AnnotationProperty .

vann:preferredNamespaceUri a owl:AnnotationProperty .

skos:note a owl:AnnotationProperty .

sh:declare a owl:AnnotationProperty .

sh:prefix a owl:AnnotationProperty .

sh:namespace a owl:AnnotationProperty .
