gpt4 book ai didi

sparql - 如何从 MeSH 本体中提取同义词?

转载 作者:行者123 更新时间:2023-12-04 14:33:59 24 4
gpt4 key购买 nike

在我这个级别的工作中,我需要从 MeSH 本体中提取一个类同义词。
我正在为 SPARQL 查询寻找正确的语法:同义词如何存储在 MeSH 中?我怎样才能提取它们?

最佳答案

我不确定你所说的同义词是什么意思。但是在查看了 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 文件查询

@safé 我认为您是对的,您使用的 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
}

关于sparql - 如何从 MeSH 本体中提取同义词?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6045980/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com