Why can I not match a URI in a sparql query?

90 Views Asked by At

I'm writing a sparql query to search in the following rdfxml

<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="PhysicalEntity0001">
    <bqbiol:is rdf:resource="https://identifiers.org/uniprot/PD12345"/>
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/fma:1234"/>
  </rdf:Description>
  <rdf:Description rdf:about="SemsimMetaid0000">
    <bqbiol:isPropertyOf rdf:resource="PhysicalEntity0001"/>
    <bqbiol:isVersionOf rdf:resource="https://identifiers.org/opb/opb_1234"/>
  </rdf:Description>
</rdf:RDF>

This query:

                "SELECT ?subject ?predicate ?resource\n"
                "WHERE { \n"
                "   ?subject ?predicate ?resource .\n"
                "}";

Works as I expect and produces:

subject,predicate,resource
SemsimMetaid0000,http://biomodels.net/biology-qualifiers/isPropertyOf,PhysicalEntity0000
PhysicalEntity0000,http://biomodels.net/biology-qualifiers/is,https://identifiers.org/uniprot/PD12345
PhysicalEntity0000,http://biomodels.net/biology-qualifiers/isPartOf,https://identifiers.org/fma/fma:1234

when formatted as csv. However this:

                "SELECT ?predicate ?resource\n"
                "WHERE { \n"
                "   <SemsimMetaid0000> ?predicate ?resource .\n"
                "}";

comes up as an empty result set. Can anybody tell me why ?

Notes:

  • I'm using a C library called rasqal to execute the query and the rdf graph is raptor (if that means anything to any of you =])
  • All nodes are URI / IRI nodes so trying "SemsimMetaid0000" does not work either.
  • There is no base uri at the point of searching the rdf graph. A base uri is required for serializing to rdfxml but at the point of searching the graph, I have not set a base uri.
0

There are 0 best solutions below