Querying letter mu in Sparql

左心房为你撑大大i 提交于 2019-12-11 05:04:10

问题


I am using python library RDFLIB to query on semantic dicom owl file. I need to query for a label containing letter mu. I am not able to figure out how to query for labels containing this letter. The code is given below -

q = """SELECT ?ur WHERE{?ur rdfs:label "Exposure in uAs".}"""
qres = g.query(q)
for row in qres:
    print(row)

I am not getting any results for the above query.

The semantic dicom owl files contain the following triples -
Image of what I am trying to search contents of sedi file (<10 reputation, can't post images)

SEDI file - Semantic Dicom OWL file


回答1:


This is not the greek letter μ (U+03BC), but the micro sign (U+00B5).

The following code works for me in Python 3.6:

q = """SELECT ?ur WHERE{?ur rdfs:label "Exposure in µAs".}"""
qres = g.query(q)
for row in qres:
    print(row)

The following code works for me both in Python 2.7 and Python 3.6:

q = """SELECT ?ur WHERE{?ur rdfs:label "Exposure in \u00b5As".}"""
qres = g.query(q)
for row in qres:
    print(row)


来源:https://stackoverflow.com/questions/44062565/querying-letter-mu-in-sparql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!