Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I am not sure what you mean by synonyms. But after looking at the MeSH ontology (downloaded from <a href="http://thesauri.cs.vu.nl/eswc06/" rel="nofollow noreferrer">here</a>). I run the following query to list all the different predicates:</p> <pre><code>SELECT DISTINCT ?p where { ?s ?p ?o } </code></pre> <p>... and I get ...</p> <pre><code>&lt;http://www.w3.org/2004/02/skos/core#historyNote&gt; &lt;http://www.nlm.nih.gov/mesh/2006#considerAlso&gt; &lt;http://www.nlm.nih.gov/mesh/2006#recordAuthorizer&gt; &lt;http://www.nlm.nih.gov/mesh/2006#dateEstablished&gt; &lt;http://www.nlm.nih.gov/mesh/2006#dateCreated&gt; &lt;http://www.nlm.nih.gov/mesh/2006#onlineNote&gt; &lt;http://www.nlm.nih.gov/mesh/2006#activeMeSHYear&gt; &lt;http://www.nlm.nih.gov/mesh/2006#historyNote&gt; &lt;http://www.w3.org/2004/02/skos/core#related&gt; &lt;&lt;&lt;--- &lt;http://www.w3.org/2004/02/skos/core#broader&gt; &lt;&lt;&lt;--- &lt;http://www.nlm.nih.gov/mesh/2006#recordMaintainer&gt; &lt;http://www.w3.org/2004/02/skos/core#scopeNote&gt; &lt;http://www.w3.org/2004/02/skos/core#altLabel&gt; &lt;http://www.w3.org/2004/02/skos/core#prefLabel&gt; &lt;http://www.nlm.nih.gov/mesh/2006#preferredCombination&gt; &lt;&lt;&lt;--- &lt;http://www.nlm.nih.gov/mesh/2006#publicMeSHNote&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://www.w3.org/2004/02/skos/core#annotation&gt; &lt;http://www.w3.org/2004/02/skos/core#hiddenLabel&gt; &lt;http://www.nlm.nih.gov/mesh/2006#recordOriginator&gt; &lt;http://www.nlm.nih.gov/mesh/2006#runningHead&gt; &lt;http://www.nlm.nih.gov/mesh/2006#dateRevised&gt; </code></pre> <p>... the predicates with <code>&lt;&lt;&lt;---</code> make me suppose some sort relationship between resources.</p> <p>For instance if we try <code>skos:related</code> with the following query:</p> <pre><code>PREFIX skos: &lt;http://www.w3.org/2004/02/skos/core#&gt; PREFIX rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; SELECT ?slabel ?olabel WHERE { ?s skos:related ?o . ?s skos:prefLabel ?slabel . ?o skos:prefLabel ?olabel . } </code></pre> <p>we get things like ...</p> <pre><code>"Anesthetics" "Adjuvants, Anesthesia" "Prostatic Neoplasms" "Prostate-Specific Antigen" "Elbow" "Tennis Elbow" "Uterine Hemorrhage" "Menorrhagia" "Ecology" "Environmental Health" "Endocarditis, Bacterial" "Aneurysm, Infected" ( .... and many more ) </code></pre> <p>If you try <code>skos:broader</code> with the following query (prefixes omitted). Notice that <code>skos:broader</code> is used to define hierarchies of concepts, so it has different semantics than <code>skos:related</code></p> <pre><code>SELECT ?slabel ?olabel WHERE { ?s skos:broader ?o . ?s skos:prefLabel ?slabel . ?o skos:prefLabel ?olabel . } </code></pre> <p>you get ... </p> <pre><code>"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) </code></pre> <p>Bottom line, if you don't know the schema run <a href="https://stackoverflow.com/questions/2930246/exploratory-sparql-queries">some exploratory queries</a> and try to see what's in there.</p> <p><strong>Edit: Queries for OWL file</strong></p> <p>@safé I think you are right, there are not such relations between classes in the OWL file you're using.</p> <p>The following query gives you all the OWL classes:</p> <pre><code>SELECT DISTINCT ?p WHERE { ?s a &lt;http://www.w3.org/2002/07/owl#Class&gt; . } </code></pre> <p>... and this other one gives all predicates used in any class:</p> <pre><code>SELECT DISTINCT ?p WHERE { ?s a &lt;http://www.w3.org/2002/07/owl#Class&gt; . ?s ?p ?o } </code></pre> <p>... this last query only returns:</p> <pre><code>&lt;http://www.w3.org/2000/01/rdf-schema#subClassOf&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; </code></pre> <p>Actually in that OWL file you only have things like:</p> <pre><code>&lt;http://org.snu.bike/MeSH#antimony_sodium_gluconate&gt; rdf:type owl:Class . </code></pre> <p>and ...</p> <pre><code>&lt;http://org.snu.bike/MeSH#antimony_sodium_gluconate&gt; rdfs:subClassOf &lt;http://org.snu.bike/MeSH#gluconate&gt;. </code></pre> <p>This means that the only thing that is declared in that OWL file is a hierarchy of classes and no synonyms are declared.</p> <p>If somehow you want to extract all subClasses do ...</p> <pre><code>SELECT * WHERE { ?subClass &lt;http://www.w3.org/2000/01/rdf-schema#subClassOf&gt; ?upperClass } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload