incf-nidash / PyNIDM

Other
21 stars 31 forks source link

add support for multiple nidm:isAbout #233

Open dbkeator opened 4 years ago

dbkeator commented 4 years ago

niiri:age_e3hrcc a nidm:DataElement, prov:Entity ; rdfs:label "age" ; dct:description "Age of participant at scan" ; nidm:isAbout XXX_1234 ; nidm:source_variable "age" ; nidm:valueType xsd:integer .

XXX_1234 a prov:Collection ; prov:hadMember YYY_1234 ; prov:hadMember ZZZ_1234 ;

hash(uri + label) a prov:Entity ; rdfs:uri <https://> ; rdfs:label "cognitive control" .

ZZZ_1234 a prov:Entity ; rdfs:uri <https://> ; rdfs:label "memory" .

dbkeator commented 4 years ago

@satra Are you good with the following implementation? Here we're trying to accommodate multiple isAbout references along with storing the labels of those isAbouts (and potentially other metadata). Basically we're adding a collection of entities, each entity storing one of the isAbout references + metadata about it (e.g. label, url. etc.).

If you're good with this then if we only have 1 isAbout (such as FS, FSL, ANTs brain region) should we just store the URI reference in the DataElement or should we just stay consistent with the pattern below (example below is shown with just 1 isAbout reference but we have examples in OpenNeuro that have many )?

niiri:sex_2sevke6 a nidm:DataElement,
        prov:Entity ;
    rdfs:label "sex" ;
    dct:description "Biological sex of participant" ;
    nidm:isAbout niiri:17rtf1a ;
    nidm:levels "{'Male': 'M', 'Female': 'F'}" ;
    nidm:source_variable "sex" ;
    nidm:valueType xsd:complexType .

niiri:17rtf1a a prov:Collection ;
    prov:hadMember niiri:3uj6v67 .

niiri:3uj6v67 a prov:Entity ;
    rdfs:label "Biological sex" ;
    nidm:url <http://uri.interlex.org/base/ilx_0101292> .
satra commented 4 years ago

thanks @dbkeator for the discussion. as discussed, here is the form i would prefer, where the entity related information would be pulled in from the uri.

niiri:sex_2sevke6 a nidm:DataElement,
        prov:Entity ;
    rdfs:label "sex" ;
    dct:description "Biological sex of participant" ;
    nidm:isAbout <http://uri.interlex.org/base/ilx_0101292> ;
    nidm:levels "{'Male': 'M', 'Female': 'F'}" ;
    nidm:source_variable "sex" ;
    nidm:valueType xsd:complexType .

<http://uri.interlex.org/base/ilx_0101292> a prov:Entity ;
    rdfs:label "Biological sex" .

this allows adding as many isAbout and keeps the properties directly related to the uri or allows us to augment (e.g., as prov:Entity)

satra commented 4 years ago

oh and the entities related to the uris can be cached in reprolake or locally or in the file itself. when merged, the same query should hold.

khelm commented 4 years ago

@satra - In the turtle files I'm using the namespace:term format for the isAbout - where would the URI come from?

satra commented 4 years ago

namespace:term is fine since it's a qname. i just used <url> to indicate a qname.

dbkeator commented 4 years ago

@satra Changes have been made based on our conversation yesterday: https://github.com/incf-nidash/PyNIDM/pull/236

Here's an example:

` niiri:sex_2sevke6 a nidm:DataElement, prov:Entity ; rdfs:label "sex" ; dct:description "Biological sex of participant" ; nidm:isAbout http://uri.interlex.org/base/ilx_0101292 ; nidm:levels "{'Male': 'M', 'Female': 'F'}" ; nidm:source_variable "sex" ; nidm:valueType xsd:complexType .

http://uri.interlex.org/base/ilx_0101292 a prov:Entity ; rdfs:label "Biological sex" .

`