wikipathways / WpVocabularies

WikiPathways vocabularies for RDF representation
https://vocabularies.wikipathways.org/
Apache License 2.0
1 stars 3 forks source link

Questions/Problems with "type/Type" #15

Open ariutta opened 7 years ago

ariutta commented 7 years ago

Two questions/problems:

Based on GPML2013a, Type is a property for elements like DataNode, with expected values like GeneProduct:

  <DataNode TextLabel="BDKRB2" GraphId="f54f5" Type="GeneProduct">
    <Attribute Key="org.pathvisio.model.BackpageHead" Value="BDKRB2 | bradykinin receptor B2"/>
    <Graphics CenterX="759.3333333333333" CenterY="388.0" Width="60.0" Height="20.0" ZOrder="32768" FontSize="10" Valign="Middle"/>
    <Xref Database="Entrez Gene" ID="624"/>
  </DataNode>

Based on rdf:type, the type above would be gpml:DataNode, not wp:GeneProduct. But when I query our sparql endpoint, it appears the type can be wp:DataNode or wp:GeneProduct but not gpml:DataNode.

Query for rdf:type wp:DataNode succeeds:

PREFIX gpml:    <http://vocabularies.wikipathways.org/gpml#>
PREFIX wp:      <http://vocabularies.wikipathways.org/wp#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dc:      <http://purl.org/dc/elements/1.1/>
PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 

select (count(distinct ?dataNode) as ?count) (str(?label) as ?species) where {
  ?dataNode a wp:DataNode ;
    dcterms:isPartOf ?pw .
  ?pw dc:title ?title ;
    wp:organism ?organism ;
    wp:organismName ?label .
} GROUP BY ?label ORDER BY DESC(?count)

Query for rdf:type wp:GeneProduct succeeds

PREFIX gpml:    <http://vocabularies.wikipathways.org/gpml#>
PREFIX wp:      <http://vocabularies.wikipathways.org/wp#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dc:      <http://purl.org/dc/elements/1.1/>
PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 

select (count(distinct ?geneProduct) as ?count) (str(?label) as ?species) where {
  ?geneProduct a wp:GeneProduct ;
    dcterms:isPartOf ?pw .
  ?pw dc:title ?title ;
    wp:organism ?organism ;
    wp:organismName ?label .
} GROUP BY ?label ORDER BY DESC(?count)

Query for rdf:type gpml:DataNode fails:

PREFIX gpml:    <http://vocabularies.wikipathways.org/gpml#>
PREFIX wp:      <http://vocabularies.wikipathways.org/wp#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dc:      <http://purl.org/dc/elements/1.1/>
PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 

select (count(distinct ?dataNode) as ?count) (str(?label) as ?species) where {
  ?dataNode a gpml:DataNode ;
    dcterms:isPartOf ?pw .
  ?pw dc:title ?title ;
    wp:organism ?organism ;
    wp:organismName ?label .
} GROUP BY ?label ORDER BY DESC(?count)
AlexanderPico commented 7 years ago

Fixed the links to go to WpRdf and WpTypes.

In terms of usage, for RDF queries on WP content, you should use the wp vocab. The queries look consistent to me if you stay within the wp vocab, i.e., wp:GeneProduct is a subclass of wp:DataNode, not gpml:DataNode. The inconsistent part seems to simply be the unnecessary prefix for gpml vocab, since it isn't used.

ariutta commented 7 years ago

For this DataNode:

  <DataNode TextLabel="BDKRB2" GraphId="f54f5" Type="GeneProduct">
    <Attribute Key="org.pathvisio.model.BackpageHead" Value="BDKRB2 | bradykinin receptor B2"/>
    <Graphics CenterX="759.3333333333333" CenterY="388.0" Width="60.0" Height="20.0" ZOrder="32768" FontSize="10" Valign="Middle"/>
    <Xref Database="Entrez Gene" ID="624"/>
  </DataNode>

I think these are the applicable types from the WP vocab:

ariutta commented 7 years ago

For wpTypes, it appears to not be used at present. Does that sound correct, @RyAMiller?