Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to query based on class type, e.g., rdf:Class or owl:Class #132

Open
tekrajchhetri opened this issue Jan 16, 2025 · 4 comments
Open
Assignees

Comments

@tekrajchhetri
Copy link
Contributor

Currently, we cannot perform queries to retrieve all classes defined as rdfs:Class or owl:Class. For instance, while GeneAnnotation is a class, the current annotations do not explicitly indicate this, making it impossible to identify GeneAnnotation as a class in such queries.

Below is a snippet of the current version of annotated data (in TTL representation). As we can clearly see that its lacking the explicit indication of the class.

@prefix NCBIAssembly: <https://www.ncbi.nlm.nih.gov/assembly/> .
@prefix NCBIGene: <http://identifiers.org/ncbigene/> .
@prefix bican: <https://identifiers.org/brain-bican/vocab/> .
@prefix biolink: <https://w3id.org/biolink/vocab/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema1: <http://schema.org/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .


bican:000015fd3d6a449b47e75651210a6cc74fca918255232c8af9e46d077034c84d a bican:GeneAnnotation ;
    rdfs:label "LOC106504536" ;
    schema1:identifier "106504536" ;
    bican:molecular_type "protein_coding" ;
    bican:referenced_in bican:d5c45501b3b8e5d8b5b5ba0f4d72750d8548515c1b00c23473a03a213f15360a ;
    biolink:category bican:GeneAnnotation ;
    biolink:in_taxon bican:7d54dfcbd21418ea26d9bfd51015414b6ad1d3760d09672afc2e1e4e6c7da1dd ;
    biolink:in_taxon_label "Sus scrofa" ;
    biolink:symbol "LOC106504536" ;
    biolink:xref NCBIGene:106504536 .

To address this issue, we need the annotation in the following format.

@prefix NCBIAssembly: <https://www.ncbi.nlm.nih.gov/assembly/> .
@prefix NCBIGene: <http://identifiers.org/ncbigene/> .
@prefix bican: <https://identifiers.org/brain-bican/vocab/> .
@prefix biolink: <https://w3id.org/biolink/vocab/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema1: <http://schema.org/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .

bican:GeneAnnotation a owl:Class ;
    rdfs:label "Gene Annotation" ;
    rdfs:comment "A class representing gene annotations." .

bican:000015fd3d6a449b47e75651210a6cc74fca918255232c8af9e46d077034c84d a bican:GeneAnnotation ;
    rdfs:label "LOC106504536" ;
    schema1:identifier "106504536" ;
    bican:molecular_type "protein_coding" ;
    bican:referenced_in bican:d5c45501b3b8e5d8b5b5ba0f4d72750d8548515c1b00c23473a03a213f15360a ;
    biolink:category bican:GeneAnnotation ;
    biolink:in_taxon bican:7d54dfcbd21418ea26d9bfd51015414b6ad1d3760d09672afc2e1e4e6c7da1dd ;
    biolink:in_taxon_label "Sus scrofa" ;
    biolink:symbol "LOC106504536" ;
    biolink:xref NCBIGene:106504536 .

In this version, we now have explicit semantics encoded, enabling us to query (see below) by rdfs:Class.

bican:GeneAnnotation a owl:Class ;
    rdfs:label "Gene Annotation" ;
    rdfs:comment "A class representing gene annotations." .

Query:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 

SELECT DISTINCT ?class 
WHERE {
    ?class a rdfs:Class
}
@satra
Copy link
Contributor

satra commented Jan 16, 2025

perhaps test out the gen-jsonld for the linkml model itself. i.e. what this needs is a conversion of the model itself, not data encoded in the model. perhaps there is something that exports the model as owl as well.

@djarecka
Copy link
Collaborator

I could generate an owl representation of the model and see how it looks like. I will be testing newer version of linkml, so can add it as well.

@satra
Copy link
Contributor

satra commented Jan 16, 2025

also relatedly, this is where we should pull in any related/relevant ontologies.

@tekrajchhetri
Copy link
Contributor Author

Yes, we can pull the relevant ontologies. I was not sure if it would be the best approach as in some cases we might be using just a class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants