On 29/08/13 14:28, Andrew Reslan wrote:
I have three custom property functions, that I have been using in Jena for some 
time.

I have been using these through Java code, and manually register the function 
factory before queries are processed.

I want to use these property functions via Fuseki, but at the moment it looks 
as though they are being bypassed and the query gets send through to the 
backing store (in this case D2RQ).

I have added the following line to my config file in the server definition to 
load a class that registers the property functions in a static block.

[] ja:loadClass "foo.bar.MyClass"

If I use the wrong class name then I see a ClassNotFoundError, so it appears 
that the class is correctly located.

In the class I have added a static block:

{
        PropertyFunctionRegistry.get().put("FUNCTION1 URI", new 
FunctionFactory());
        PropertyFunctionRegistry.get().put("FUNCTION2 URI", new 
FunctionFactory());
        PropertyFunctionRegistry.get().put("FUNCTION3 URI", new 
FunctionFactory());
}

I have added System.err debug messages to the static block and the function 
classes, but I see none of these, does fuseki redirect System.err?

Depends how you run fuseki. I think the script 'fuseki' send output to log/stderrout.log, 'fuseki-server' does not -- where does your normal output go?

Does the class have a "public static void init()" method? That is what is called by [] ja:loadClass "foo.bar.MyClass" No init() and the class is only loaded which I think means no calling static blocks.

(can't remember how D2RQ works)

It's the particular query engine that provides property functions. If the query goes to D2RQ, then property functions will only work if D2RQ provides then.

If it's a single graph in a general dataset then the query engine is the general one and they will work.

        Andy




Andy



Reply via email to