User defined function loading prioritized above native

I was writing some property functions and one of them has a local part that is the same name as a built is and it seems to be loading my function and not the builtin one with the following warning

[main] WARN com.complexible.stardog.plan.filter.functions.FunctionRegistry - Multiple functions with same name 'contains', ignoring implementation class com.complexible.stardog.plan.filter.functions.string.Contains

I’m not sure why there was a conflict because the user defined function is using a fully qualified IRI and there are some warnings after that about "Local name conflict prohibits calling unqualified functions.

I didn’t think there would be a conflict but if there was a conflict I would have thought that the built in functions would have priority for being loaded.

Hi Zach,

Indeed, we will prioritize internal functions (which is a combination of XPath, XSD type casts, SWRL and SPARQL). You should still be able to call contains with the name <http://www.w3.org/2005/xpath-functions#contains>.

Jess

Makes sense but the warning makes it look like it’s ignoring the internal implementation but to be honest I didn’t test it to see which exact function was being ignored.

I just noticed this from the release notes

Allow functions to be called without namespace prefix (4054)

I’ll put together a quick test to see what exact function is being called
when there are multiple local names but I’ll just mention again that the
warning makes it appear as if the internal implementation is the one being
ignored. Hopefully it’s doing the right thing and it’s just the warning
that is incorrect or I’m misinterpreting it.

(In case anyone is wondering why I’ve been so quiet lately, I went on
vacation and when I returned my employer seems to have jacked up the
Stardog community web site for me so I can’t post. Hopefully responding to
emails like I’m doing now will work)

Hi Zach,

Replying to emails looks to have worked just fine. If things still look bad re: the warning, just let us know

I’m back! At least for responses. I’ll have to wait to ask new questions
till I get home, obnoxiously tack them onto someone’s else’s question or
figure out how to create new threads over email :frowning: I’ll keep you posted. I
was also responding in case anyone else missed that little feature :slight_smile:

Hi Zach,

Just looping back on this. Is this the code you’re using?

If so, it looks like the function name argument you’re passing to the superclass constructor will be “contains” (not an IRI) as you called toString() instead of stringValue(). The conflict occurs because our internal implementation is called “contains” (not an IRI).

Jess

Ah, thank you. I was really hoping to get some time to clean stuff up. I’m sorry to say but that it has become a collection of loose ends that I’d really like to finish up but time is limited.

I wanted to mention that I really liked what you had done with your jcfl github project. I was hoping to do something similar with git and maven repos. Linked-code.