From 531916fec122db41e07c0af8a95050c902ade478 Mon Sep 17 00:00:00 2001 From: JHogenboom Date: Mon, 30 Sep 2024 10:17:29 +0200 Subject: [PATCH] adapt query for main classes that do not have any sub_classes, e.g. age at diagnosis --- .../retrieve_classes.rq | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/triplestore-collaboration-descriptives/retrieve_classes.rq b/triplestore-collaboration-descriptives/retrieve_classes.rq index d7c2bbe..e6f2eb3 100644 --- a/triplestore-collaboration-descriptives/retrieve_classes.rq +++ b/triplestore-collaboration-descriptives/retrieve_classes.rq @@ -8,10 +8,10 @@ WHERE { ?patient rdf:type ?main_class. ?patient dbo:has_cell ?variable_cell. ?variable_cell dbo:has_value ?value. - ?variable_cell rdf:type ?sub_class. - + OPTIONAL { + ?variable_cell rdf:type ?sub_class. + FILTER(isURI(?sub_class) && STRSTARTS(STR(?sub_class), "http://") && !STRSTARTS(STR(?sub_class), "http://www.w3.org/") && !STRSTARTS(STR(?sub_class), "http://um-cds/") && !STRSTARTS(STR(?sub_class), "http://www.data.local/")) + } FILTER(isURI(?main_class) && STRSTARTS(STR(?main_class), "http://") && !STRSTARTS(STR(?main_class), "http://www.w3.org/") && !STRSTARTS(STR(?main_class), "http://um-cds/") && !STRSTARTS(STR(?main_class), "http://www.data.local/")) - FILTER(isURI(?sub_class) && STRSTARTS(STR(?sub_class), "http://") && !STRSTARTS(STR(?sub_class), "http://www.w3.org/") && !STRSTARTS(STR(?sub_class), "http://um-cds/") && !STRSTARTS(STR(?sub_class), "http://www.data.local/")) - } GROUP BY ?main_class ?sub_class \ No newline at end of file