semantalytics / stardog-extensions

Single repository for all Stardog function extensions
Apache License 2.0
3 stars 2 forks source link

Function naming conflict Warnings on Stardog Start #11

Closed RafaelCampoJr closed 7 months ago

RafaelCampoJr commented 7 months ago

Hello,

I'm seeing a many warnings appear in the stardog.log after stardog-admin server start. From reading the stacktrace it seems that there is a naming conflict that the imported functions provided by stardog-extensions.

In some cases I see an internal conflict (internal to this extension)

WARN  2024-02-28T12:52:54,841-0500 [main] com.complexible.stardog.plan.filter.functions.FunctionRegistry:<init>(88): Local name conflict prohibits calling unqualified functions http://semantalytics.com/2017/09/ns/stardog/kibble/array/equals http://semantalytics.com/2017/09/ns/stardog/kibble/string/equals

and in other cases, conflicts between this extension and Stardog

WARN  2024-02-28T12:52:54,879-0500 [main] com.complexible.stardog.plan.filter.functions.FunctionRegistry:<init>(88): Local name conflict prohibits calling unqualified functions http://www.w3.org/2005/xpath-functions#contains http://semantalytics.com/2017/09/ns/stardog/kibble/array/contain

Is there a way to configure the extension so warnings don't appear? I have attached the stardog.log for reference.

stardog.log

zacharywhitley commented 7 months ago

Hey! Someone is actually using this. Awesome. I'm sure there's a way to configure the stardog logging to suppress the warnings but why would you want to? It's just a warning and a fairly informative one at that. I believe that Stardog will allow you to call a function without a prefix (unqualified as the warning refers to it) if the function name is unambiguous. As you can see this function has the same name as a built in function so it's just saying, "Hey there are two functions with the same name. The built in one is getting preference. If you want to call the second one you'll have to give the full prefixed name."

RafaelCampoJr commented 7 months ago

Using is still a little too strong, though we started looking into it for because we wanted use the Levenshtein distance function for a search use-case. It's still in the idea/planning phase and the warning spooks a lot of people over here and had they not appeared it smooth sailing. But these requests, come and go so I'll have a look on how into to suppress the warnings and let you know what I find.

RafaelCampoJr commented 7 months ago

By moving the log4j2.xml file found in the $STARDOG_HOME/server/dbms into the $STARDOG_HOME directory and adding the following code within the <Loggers> leaf suppressed the log messages.

<Logger name="com.complexible.stardog.plan.filter.functions.FunctionRegistry" level="ERROR" additivity="false">
                        <AppenderRef ref="stardogAppender"/>
</Logger>

Thanks for the help.