Hi Andy,

>From version 4.x to 5.2.0, everything has been working as expected. However, 
>after upgrading to 5.3.0, I no longer see the println("Initializing getParts 
>property function") message in Fuseki's startup logs. This is what makes me 
>think the init method is no longer being called.

In 5.3.0, I'm running the server like this:

#!/bin/sh
exec \
  "${JAVA_HOME}/bin/java" \
  ${JAVA_OPTS} \
  -Xshare:off \
  -Dlog4j.configurationFile="${FUSEKI_HOME}/log4j2.properties" \
  -cp "${FUSEKI_HOME}/fuseki-server.jar:${FUSEKI_HOME}/lib/*" \
  org.apache.jena.fuseki.main.cmds.FusekiServerCmd

I also tried using the legacy org.apache.jena.fuseki.cmd.FusekiCmd, but neither 
method seems to invoke the init method.
 
If it's helpful, here's the branch with my changes for 5.3.0: 
https://github.com/Kurrawong/jena-compound-naming/pull/13/files.

The main branch is currently on 5.2.0. The issue is reproducible using the 
Dockerfile in the repository.

Apologies if this is unrelated to Fuseki modules. I’m still working to 
understand the ins and outs of Jena.

I appreciate any insights you can provide.

Thanks,
Edmond

 

 

 


On Monday, 10 February 2025 at 20:50, Andy Seaborne <a...@apache.org> wrote:

> Edmond,
> 
> I don't see any use of Fuseki modules here.
> 
> ja:loadClass -> init calling PropertyFunctionRegistry is working for me
> 
> with Fuseki 5.3.0
> 
> How are you running the server?
> 
> Andy
> 
> On 10/02/2025 03:32, Edmond Chuc wrote:
> 
> > Hi,
> > 
> > I'd like to add that I am also experiencing this issue except with 
> > registering custom property functions with Fuseki main server. The module 
> > is added to the classpath when I start Fuseki Server, and I load the class 
> > in the global assembler config.ttl file.
> > 
> > [] rdf:type fuseki:Server ;
> > ja:loadClass "com.example.jena.myFunc" ;
> > .
> > 
> > With my custom property function, Fuseki used to previously call the static 
> > void init method on my class. But now, it no longer calls it and I can't 
> > register the custom property function with my own IRI.
> > 
> > class getParts : PFuncSimpleAndList() {
> > companion object {
> > @JvmStatic
> > fun init() {
> > println("Initializing getParts property function")
> > 
> > // Register the property function with the IRI
> > PropertyFunctionRegistry.get().put(
> > "https://linked.data.gov.au/def/cn/func/getParts";,
> > GetPartsPropertyFunctionFactory(),
> > )
> > }
> > }
> > 
> > The above is in Kotlin, but hopefully you get the idea.
> > 
> > Note that I can still use the custom property function in my SPARQL queries 
> > if I use the java:... syntax but I'd prefer it if I can continue to use the 
> > init hook to register my function with an IRI.
> > 
> > Cheers,
> > 
> > Edmond
> > 
> > On Monday, 10 February 2025 at 03:12, Andy Seaborne a...@apache.org wrote:
> > 
> > > Hi Mikhail,
> > > 
> > > There wasn't an intentional change but there has been a signficant
> > > amount of change in the area.
> > > 
> > > I have a question below:
> > > 
> > > On 08/02/2025 17:39, Mikhail Komyshev wrote:
> > > 
> > > > Hi!
> > > > 
> > > > I have an application that uses Fuseki Main server and tried updating
> > > > the jena-fuseki-server-X.X.X.jar binary from 5.2.0 to 5.3.0 from 1.
> > > > But from some reason, auto modules stopped loading.
> > > > 
> > > > Unfortuantely, I haven't found any notices about changes in this regard.
> > > > Sorry if I missed something. Did the behaviour change or is this a bug?
> > > > 
> > > > The minimal example is as follows (suppose compiled against
> > > > org.apache.jena/jena-fuseki-main from Maven version 5.3.0):
> > > > ```
> > > > package com.example;
> > > > 
> > > > import java.util.Set;
> > > > import org.apache.jena.rdf.model.Model;
> > > > import org.apache.jena.fuseki.main.sys.FusekiAutoModule;
> > > > import org.apache.jena.fuseki.main.FusekiServer;
> > > > 
> > > > public class MyModule implements FusekiAutoModule {
> > > > public MyModule() {}
> > > > 
> > > > public String name() {
> > > > return "My Module";
> > > > }
> > > > 
> > > > public void prepare(
> > > > FusekiServer.Builder builder,
> > > > Set<String> datasetNames,
> > > > Model configModel
> > > > ) {
> > > > System.out.println("Hello world!");
> > > > }
> > > > }
> > > > ```
> > > > 
> > > > Then, in the file `META-INF/services/ 
> > > > org.apache.jena.fuseki.main.sys.FusekiAutoModule` on the classpath, you
> > > > put this line:
> > > > `com.example.MyModule`
> > > > 
> > > > When running the following shell command, you can see the info message
> > > > about the module being loaded and the Hello world message in the
> > > > standard output:
> > > > `java -cp jena-fuseki-server-5.2.0.jar:src/java:resources \\\\ 
> > > > org.apache.jena.fuseki.main.cmds.FusekiMainCmd --mem --modules=true 
> > > > \\\\ '/test'`
> > > 
> > > How is the file com/example/MyModule.class getting onto the classpath?
> > > 
> > > > Yet, running the same command with the 5.3.0 binary doesn't seem to load
> > > > the module and therefore doesn't produce the two messages.
> > > > 
> > > > Thanks in advance!
> > > > 
> > > > server/5.3.0/jena-fuseki-server-5.3.0.jar
> > > > 
> > > > Cheers,
> > > > Mikhail

Reply via email to