I tried to convert a serql query to a sparql query, but I could not find a proper equivalent of the Localname (and Namespace) functions in SeRQL, or documentation/examples of how to do this with FILTER functions were too difficult to find. The solution chosen for SPARQL seems more powerful and extensible, but it is definitely more complicated and could use more examples (or easier to find with Google).
SeRQL:
SELECT DISTINCT cwa_concept, relation, cwa_concept2
FROM
{cwa_concept} relation {cwa_concept2}
WHERE
Localname(cwa_concept)= "C3000052"
USING NAMESPACE
cwa = <http://www.nbic.nl/cwa#>,
rdf = <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
My SPARQL ‘almost’ equivalent:
PREFIX cwa: <http://www.nbic.nl/cwa#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?cwa_concept ?relation ?cwa_concept2
WHERE {
?cwa_concept ?relation ?cwa_concept2.
FILTER (?cwa_concept = <http://www.nbic.nl/cwa/umls/C3000052>)
}
0 responses so far ↓
You must log in to post a comment.