I'm working on a music player app that relies on SPARQL to get information about local tracks, and have been running into some trouble.
I'm running Fedora 21, and the database (Tracker) is queried via grilo (i.e., I write raw SPARQL queries, and grilo uses these queries to talk to the database and sends back any results).
Basically, any time I try to use REPLACE
, I get the following:
Grilo-WARNING : [tracker-source-request] grl-tracker-source-api.c:500: Could not execute sparql query id=1: 1.273: syntax error, expected primary expression
When I attempt to use fn:replace
, I instead get:
Grilo-WARNING : [tracker-source-request] grl-tracker-source-api.c:500: Could not execute sparql query id=1: 1.284: syntax error, Unknown function
For reference, here's the context in which I'm attempting to use REPLACE
:
SELECT DISTINCT
rdf:type(?album)
tracker:id(?album) AS id
(
SELECT
nmm:artistName(?artist)
WHERE {
?album nmm:albumArtist ?artist
}
LIMIT 1
) AS artist
REPLACE(nie:title(?album)^^xsd:string, "hello", "goodbye") AS title
nie:title(?album) AS album
[more SPARQL gobbldygook follows]
If you want a sense of what the other queries look like, view the whole file.
The ultimate goal is to use REPLACE
to strip off punctuation from album/artist names for sorting purposes.
Thanks!