SPARQL query of Turtle data returns no rows when using skos:prefLabel

32 views Asked by At

I'm trying to query PubChem disease data from their Turtle file in GraphDb. The standard query returns all the ?s ?p ?o rows as expected. But I just want the ?s and skos:prefLabel.

Example disease data: https://pubchem.ncbi.nlm.nih.gov/rest/rdf/disease/DZID8805.html

This returns 100 rows as expected. One row shown below.

select * 
FROM <http://localhost:7200/diseases>  
where { 
   ?s ?p ?o .
} limit 100 

disease:DZID1364 / rdf:type / obo:DOID_4

I tried various queries with no results. This is the latest attempt. It's from a named graph that contains all the data locally. I'm new to SPARQL and RDF and this just looks like it should work.

prefix skos: <http://www.w3.org/2004/02/skos/core#/>  
prefix disease: <http://rdf.ncbi.nlm.nih.gov/pubchem/disease/>

SELECT ?label
FROM <http://localhost:7200/diseases>  
WHERE { 
    ?disease skos:prefLabel ?label
} limit 100

Expected row below.

disease:DZID1364 / White platelet syndrome

From TTL file:

disease:DZID1364  skos:prefLabel  "White platelet syndrome" .
1

There are 1 answers

0
Sam B On

As stated by @UninformedUser, I removed the trailing / from the skos prefix declaration and it resolved the issue.