How to extract synonyms from MeSH ontology?

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

+6
source share
1 answer

I'm not sure what you mean by synonyms. But looking at the MeSH ontology (downloading 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> 

... predicates with <<<--- make me assume some kind of relationship between the resources.

For example, 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). Note that skos:broader used to define concept hierarchies, therefore it has a different semantics than skos:related

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

You'll 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) 

The bottom line is if you don’t know that the scheme launches several search queries and tries to see what is there.

Edit: requests for OWL file

@ safé I think you're right, in this OWL file there is no such relationship between classes.

The following query gives you all the OWL classes:

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

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

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

... this last query returns only:

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

Actually in this OWL file you 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 declared in this OWL file is the class hierarchy 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 } 
+8
source

Source: https://habr.com/ru/post/888422/


All Articles