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

发布于 2024-11-08 16:48:07 字数 86 浏览 0 评论 0原文

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

In this level of my work, I need to extract a class synonyms from MeSH ontology.
I am searching for the right syntax for the SPARQL query: how synonyms are they stored in MeSH? and how can I extract them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

波浪屿的海角声 2024-11-15 16:48:07

我不确定你所说的同义词是什么意思。但在查看了 MeSH 本体之后(从此处下载)。我运行以下查询来列出所有不同的谓词:

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:lated

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 用于定义概念的层次结构,因此它与

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

您得到的 skos:lated 具有不同的语义...

"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)

底线,如果您不知道的话该模式运行一些探索性查询并尝试查看其中的内容。

编辑: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 
}

I am not sure what you mean by synonyms. But after looking at the MeSH ontology (downloaded from here). I run the following query to list all the different predicates:

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

... and I get ...

<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>

... the predicates with <<<--- make me suppose some sort relationship between resources.

For instance if we try skos:related with the following query:

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 .
}

we get things like ...

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

If you try skos:broader with the following query (prefixes omitted). Notice that skos:broader is used to define hierarchies of concepts, so it has different semantics than skos:related

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

you get ...

"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)

Bottom line, if you don't know the schema run some exploratory queries and try to see what's in there.

Edit: Queries for OWL file

@safé I think you are right, there are not such relations between classes in the OWL file you're using.

The following query gives you all the OWL classes:

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

... and this other one gives all predicates used in any class:

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

... this last query only returns:

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

Actually in that OWL file you only have things like:

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

and ...

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

This means that the only thing that is declared in that OWL file is a hierarchy of classes and no synonyms are declared.

If somehow you want to extract all subClasses do ...

SELECT * WHERE { 
?subClass <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?upperClass 
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文