如何在Python中从长字符串提取以?开头的子串并生成列表
提取SPARQL查询中的所有变量
首先,先把你提供的原始SPARQL查询放出来方便对照:
PREFIX pht: <http://datalab.rwth-aachen.de/vocab/pht/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?Age, ?SexTypes, ?Chest_Pain_Type, ?trestbpsD, ?cholD, ?Fasting_Glucose_Level, ?Resting_ECG_Type, ?thalachD, ?Exercise_Induced_Angina, ?oldpeakD, ?caD, ?Slope, ?Thallium_Scintigraphy, ?Diagnosis WHERE {?URI a sct:125676002. }
我已经把所有以?开头的变量提取出来,整理成列表如下:
?Age?SexTypes?Chest_Pain_Type?trestbpsD?cholD?Fasting_Glucose_Level?Resting_ECG_Type?thalachD?Exercise_Induced_Angina?oldpeakD?caD?Slope?Thallium_Scintigraphy?Diagnosis?URI
内容的提问来源于stack exchange,提问作者Martin
相关产品推荐
相关产品推荐

