This SPARQL query should print a list that has a first column stating the name of the disease the patient has, a second column stating the other factor for the death of the patient and finally a third column with the title of the paper that the information is on.
PREFIX snomed: <http://www.ihtsdo.org/SCT_>
PREFIX sct: <http://wasp.cs.vu.nl/sct/sct#>
PREFIX drugbank: <https://www.drugbank.ca/drugs/>
PREFIX ztonekg:<http://www.ztonebv.nl/KG#>
PREFIX pubmed:<http://www.ncbi.nlm.nih.gov/pubmed/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select distinct ?disease ?suicide ?title
where {
?diseaseid rdfs:subClassOf snomed:73595000.
?t1s1 ztonekg:SenseURL ?diseaseid.
?diseaseid sct:hasEnglishLabel ?disease.
?t1 ztonekg:hasSense ?t1s1.
?s7 ztonekg:hasSenses ?t1.
?s ztonekg:hasTerm ?s7.
?s1 ztonekg:hasAnnotation ?s.
?s1 ztonekg:hasSource "Title".
?pubmed ztonekg:hasAnnotations ?s1.
?pubmed ztonekg:hasAnnotations ?s1b.
?s1b ztonekg:hasSource "Title".
?s1b ztonekg:hasAnnotation ?sb.
?sb ztonekg:hasTerm ?s7b.
?s7b ztonekg:hasSenses ?t1b.
?t1b ztonekg:hasSense ?t1s1b.
?t1s1b ztonekg:SenseURL ?suicideid.
?suicideid rdfs:subClassOf snomed:262188008. #suice:44301001
?suicideid sct:hasEnglishLabel ?suicide.
?s1b ztonekg:hasText ?title.
}
The only solution that I have for now is to bypass the problem which is caused by
- ?diseaseid rdfs:subClassOf snomed:73595000.
- ?suicideid rdfs:subClassOf snomed:262188008.
by doing it like this
same prefixes as before
select ?t1s1 ?t1s1b ?title
where {
?t1s1 ztonekg:SenseURL snomed:248062006. #40683002.#248062006.#self-harm
?t1 ztonekg:hasSense ?t1s1.
?s7 ztonekg:hasSenses ?t1.
?s ztonekg:hasTerm ?s7.
?s1 ztonekg:hasAnnotation ?s.
?s1 ztonekg:hasSource "Title".
?pubmed ztonekg:hasAnnotations ?s1.
?pubmed ztonekg:hasAnnotations ?s1b.
?s1b ztonekg:hasSource "Title".
?s1b ztonekg:hasAnnotation ?sb.
?sb ztonekg:hasTerm ?s7b.
?s7b ztonekg:hasSenses ?t1b.
?t1b ztonekg:hasSense ?t1s1b.
?t1s1b ztonekg:SenseURL snomed:133937008.#adolescent
?s1b ztonekg:hasText ?title.
}
But I would like the first way to work since in further steps of this project I will need to use that subject