Is it still possible to dynamically load SPARQL functions from the classpath? I 
have it working with tarql, which uses Jena 3.11, but I can’t seem to get it 
working with the latest version of Jena:

$ JVM_ARGS="-cp 
/Users/ryanshaw/Code/ncg-dataset/lib/sparql-functions/build/libs/sparql-functions.jar"
 ./tools/apache-jena-4.8.0/bin/arq --data=dataset.nt --query=queries/new-ids.rq

19:36:15 WARN  ClsLoader       :: Class not found: org.ncgazetteer.mint
19:36:15 WARN  exec            :: URI <java:org.ncgazetteer.mint> has no 
registered function factory

$ cat queries/new-ids.rq:

PREFIX ncp: <http://n2t.net/ark:/39333/ncg/place/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX f:   <java:org.ncgazetteer.>

CONSTRUCT {
  ?oldid owl:sameAs ?newid .
}
WHERE {
  SELECT DISTINCT ?oldid (f:mint("ncp") AS ?newid)
  WHERE {
    ?oldid ?p ?o .
    FILTER(REGEX(STR(?oldid), "^http://n2t.net/ark:/39333/ncg/place/NCG";))
  }
}

$ unzip -l 
/Users/ryanshaw/Code/ncg-dataset/lib/sparql-functions/build/libs/sparql-functions.jar
 | grep mint

     4174  05-21-2023 16:34   org/ncgazetteer/mint.class



Reply via email to