0
1

I would like to get the preferred name of classes and their one top level upper classes in the Radlex ontology, as hosted at BioPortal.

And The Output I want to see:

Term: equal density subClassOf: density descriptor

It looks like, the code below solved my problem, but still requires some modification. Because, it brings all off the upper classes but I only want one level upper class. PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#

SELECT DISTINCT  ?concept ?subClassOf
WHERE
{ GRAPH <http://bioportal.bioontology.org/ontologies/RADLEX_OWL>
  { ?term  a <http://bioontology.org/projects/ontologies/radlex/radlexOwl#radlex_metaclass> ;
        <http://bioontology.org/projects/ontologies/radlex/radlexOwl#Preferred_name>  ?concept
  }
  ?term rdfs:subClassOf ?upperClass. 
  ?upperClass <http://bioontology.org/projects/ontologies/radlex/radlexOwl#Preferred_name>  ?subClassOf.
} LIMIT 10 OFFSET 10

asked 23 Jun, 14:09

selenb's gravatar image

selenb
011
accept rate: 0%

edited 26 Jun, 16:06


What about using http://www.openrdf.org/schema/sesame#directSubClassOf instead of rdfs:subClassOf in "?term rdfs:subClassOf ?upperClass." pattern ?

link

answered 26 Jun, 03:25

Damyan%20Ognyanov's gravatar image

Damyan Ognyanov ♦♦
34317
accept rate: 25%

Actually, I was making a structural error and I fixed it as below which is working now.

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX radlex: <http://bioontology.org/projects/ontologies/radlex/radlexOwlDlComponent#>

SELECT DISTINCT ?term ?name ?synonym ?subClassOf ?subClassOf_name
FROM <http://bioportal.bioontology.org/ontologies/RID>
WHERE
{
 ?term radlex:Preferred_name ?name .
 ?term radlex:Synonym ?synonym .
 ?term rdfs:subClassOf ?subClassOf .
  ?subClassOf radlex:Preferred_name ?subClassOf_name
}  LIMIT 100
link

answered 26 Jun, 16:05

selenb's gravatar image

selenb
011
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×37

Asked: 23 Jun, 14:09

Seen: 49 times

Last updated: 26 Jun, 16:06

powered by BitNami OSQA