2011-05-18 25 views
6

在我工作的這個層面,我需要從MeSH本體中提取一個類別同義詞。 我正在爲SPARQL查詢尋找正確的語法:他們如何將同義詞存儲在MeSH中?我如何提取它們?如何從MeSH本體提取同義詞?

+1

@safé:你說的「類同義詞」究竟是什麼意思? OWL等價類?此外,如果您將您正在使用的本體的一部分添加到您的問題中,以及您想要提取的本體的一個示例,這將有所幫助:這將有助於理解您正在做什麼以及建議解決方案。 – MarcoS 2011-05-19 06:47:41

+0

我不確切知道這些類是如何在OWL中分類的,但我相信它們不是等價的。例如,當使用MeSH瀏覽器並添加「癌症」作爲查詢時,返回的所有信息都是關於「腫瘤」,因爲在MeSH中,「癌症」和「腫瘤」是同義詞[link](http://www.nlm.nih。 gov/cgi/mesh/2011/MB_cgi?mode =&index = 8969&view = concept)(請參閱相關概念)。但是我不知道這個關係在OWL中是如何描述的以及如何使用sparql來解析它。 – 2011-05-19 08:59:57

+0

@safé:恐怕我幫不了你。爲了編寫SPARQL查詢,您必須知道要查詢的RDF圖的結構。您可以查詢OWL本體,只要您知道它是如何組織的(以及它的RDF序列化如何)。我建議你找出「主題詞」本體的結構,然後再問你的問題。因爲目前它就像是問我「如何從數據庫中提取信息,我不知道它是如何製作的」? ...不可能:) – MarcoS 2011-05-19 09:14:44

回答

8

我不確定你的意思是同義詞。但是在看了MeSH本體之後(從here下載)。我運行以下查詢列出所有的不同的謂詞:

SELECT DISTINCT ?p where { ?s ?p ?o } 

...我得到...

<http://www.w3.org/2004/02/skos/core#historyNote> 
<http://www.nlm.nih.gov/mesh/2006#considerAlso> 
<http://www.nlm.nih.gov/mesh/2006#recordAuthorizer> 
<http://www.nlm.nih.gov/mesh/2006#dateEstablished> 
<http://www.nlm.nih.gov/mesh/2006#dateCreated> 
<http://www.nlm.nih.gov/mesh/2006#onlineNote> 
<http://www.nlm.nih.gov/mesh/2006#activeMeSHYear> 
<http://www.nlm.nih.gov/mesh/2006#historyNote> 
<http://www.w3.org/2004/02/skos/core#related> <<<--- 
<http://www.w3.org/2004/02/skos/core#broader> <<<--- 
<http://www.nlm.nih.gov/mesh/2006#recordMaintainer> 
<http://www.w3.org/2004/02/skos/core#scopeNote> 
<http://www.w3.org/2004/02/skos/core#altLabel> 
<http://www.w3.org/2004/02/skos/core#prefLabel> 
<http://www.nlm.nih.gov/mesh/2006#preferredCombination> <<<--- 
<http://www.nlm.nih.gov/mesh/2006#publicMeSHNote> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2004/02/skos/core#annotation> 
<http://www.w3.org/2004/02/skos/core#hiddenLabel> 
<http://www.nlm.nih.gov/mesh/2006#recordOriginator> 
<http://www.nlm.nih.gov/mesh/2006#runningHead> 
<http://www.nlm.nih.gov/mesh/2006#dateRevised> 

...與<<<---謂詞讓我猜資源之間的某種關係。

舉例來說,如果我們試圖與skos:related以下查詢:

PREFIX skos: <http://www.w3.org/2004/02/skos/core#> 
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 

SELECT ?slabel ?olabel 
WHERE { 
    ?s skos:related ?o . 
    ?s skos:prefLabel ?slabel . 
    ?o skos:prefLabel ?olabel . 
} 

我們得到的東西像...

"Anesthetics" "Adjuvants, Anesthesia" 
"Prostatic Neoplasms" "Prostate-Specific Antigen" 
"Elbow" "Tennis Elbow" 
"Uterine Hemorrhage" "Menorrhagia" 
"Ecology" "Environmental Health" 
"Endocarditis, Bacterial" "Aneurysm, Infected" 
(.... and many more) 

如果您嘗試skos:broader用下面的查詢(省略前綴)。請注意,skos:broader用於定義的概念層次結構,因此具有不同的語義比skos:related

SELECT ?slabel ?olabel 
WHERE { 
    ?s skos:broader ?o . 
    ?s skos:prefLabel ?slabel . 
    ?o skos:prefLabel ?olabel . 
} 

你...

"Healthy People Programs" "Health Promotion" 
"Suggestion" "Hypnosis" 
"Sodium Iodide" "Iodides" 
"Unnecessary Procedures" "Health Services Misuse" 
"Bornanes" "Norbornanes" 
"Prajmaline" "Ajmaline" 
"Vestibular Nerve" "Vestibulocochlear Nerve" 
"Adenolymphoma" "Neoplasms, Complex and Mixed" 
"Child, Gifted" "Child, Exceptional" 
"Tooth Germ" "Tooth Components" 
"Breast Self-Examination" "Self-Examination" 
(... and many more) 

底線,如果你不知道的模式運行some exploratory queries並嘗試看看裏面有什麼。

編輯:查詢的OWL文件

@安全,我認爲你是對的,有沒有在你使用的OWL文件類之間的這種關係。

下面的查詢爲您提供所有的OWL類:

SELECT DISTINCT ?p WHERE { ?s a <http://www.w3.org/2002/07/owl#Class> . } 

...這等人給任何類使用的所有謂詞:

SELECT DISTINCT ?p WHERE { 
    ?s a <http://www.w3.org/2002/07/owl#Class> . 
    ?s ?p ?o } 

...這最後的查詢只回復:

<http://www.w3.org/2000/01/rdf-schema#subClassOf> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 

其實在那個OWL文件中你只有這樣的東西:

<http://org.snu.bike/MeSH#antimony_sodium_gluconate> rdf:type owl:Class . 

和...

<http://org.snu.bike/MeSH#antimony_sodium_gluconate> rdfs:subClassOf <http://org.snu.bike/MeSH#gluconate>. 

這意味着,在該OWL文件中聲明的唯一的事情是分層次的類和沒有同義詞的聲明。

如果不知何故你想提取所有的子類做...

SELECT * WHERE { 
?subClass <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?upperClass 
} 
+0

你在這裏寫的是interent,然而你使用的本體被保存在一個rdf文件中,而我需要使用一個OWL文件,因爲我正在提取類和子類。 – 2011-05-19 13:37:02

+0

OWL文件在哪裏?我如何訪問它以進一步調查? – 2011-05-19 13:44:49

+0

這裏是我正在使用的OWL文件[鏈接](http://bike.snu.ac.kr/sites/default/files/meshonto.owl),但我不細想這包含我正在尋找的關係。 – 2011-05-19 13:47:34