To avoid a possible "XY problem", let me explain my real goal: I am trying to change the capitalization of language tags in an rdf4j repo, using sparql. But although rdf4j stores language tags as written when they were defined, it knows enough to treat them as case-insensitive as the standard dictates. So it treats my attempted edit as a no-op:
Set-up:
INSERT DATA { test:a skos:prefLabel "hello"@EN }
Attempt:
DELETE { test:a skos:prefLabel "hello"@EN }
INSERT { test:a skos:prefLabel "hello"@en }
WHERE
{ test:a skos:prefLabel "hello"@EN }
Result:
This query does nothing. The language tag is still spelled EN
.
Interestingly, this also fails if I execute two separate queries:
Query 1:
DELETE DATA { test:a skos:prefLabel "hello"@EN }
Query 2:
INSERT DATA { test:a skos:prefLabel "hello"@en }
Evidently, deleted strings remain in an internal cache and are resurrected, so that my INSERT query resurrects "hello"@EN
instead. A restart will clear the cache, but it's not the best UX...
Now, with some older versions of rdf4j I could clear this internal cache with the magic command CLEAR SILENT GRAPH <urn:uri:cache>
. But this does not appear to work with rdf4j 2.3.3, which is what we are stuck with at the moment. Is there still a way to clear the string cache without a restart, or to change the capitalization of language tags in any other way?
PS I found this interesting thread about the handling of case in language tags; but it has brought me no closer to a solution.