Hi Peter,

I see thanks! Yes, I was asking because removing those lines works, and the 
functions are also added. Other thing what is the point of using 
org.openrdf.query.algebra.evaluation.function.Function when there is an 
implementation of ServiceRegistry (NativeFunctionRegistry). Wouldn’t be better 
to use only org.apache.marmotta.kiwi.sparql.function.NativeFunction in 
META-INF/services? If yes, we should also modify later MARMOTTA-584 [6] because 
I added the GeoSparql functions at both files, and we also should remove those 
lines.

Cheers,
Xavier.

[6] 
https://github.com/apache/marmotta/tree/MARMOTTA-584/libraries/kiwi/kiwi-geosparql
 
<https://github.com/apache/marmotta/tree/MARMOTTA-584/libraries/kiwi/kiwi-geosparql>

On Jul 2, 2017 7:04 PM, "Peter Ansell" <[email protected] 
<mailto:[email protected]>> wrote:
Hi Xavier,

The META-INF/services files in [4] should be enough on their own and
if not there may be classpath/ClassLoader issues rather than marmotta
specific issues. Any ServiceLoader/ClassLoader issues would need to be
fixed by getting RDF4J to change the ClassLoader they are currently
using from "serviceClass.getClassLoader()" to something more
compatible, like the context class loader for example. [5]

Cheers,

Peter

[4] 
https://github.com/apache/marmotta/blob/develop/libraries/kiwi/kiwi-sparql/src/main/resources/META-INF/services/org.apache.marmotta.kiwi.sparql.function.NativeFunction
 
<https://github.com/apache/marmotta/blob/develop/libraries/kiwi/kiwi-sparql/src/main/resources/META-INF/services/org.apache.marmotta.kiwi.sparql.function.NativeFunction>

[5] 
https://github.com/eclipse/rdf4j/blob/develop/core/util/src/main/java/org/eclipse/rdf4j/common/lang/service/ServiceRegistry.java#L37
 
<https://github.com/eclipse/rdf4j/blob/develop/core/util/src/main/java/org/eclipse/rdf4j/common/lang/service/ServiceRegistry.java#L37>

On 3 July 2017 at 09:53, FRANCISCO XAVIER SUMBA TORAL
<[email protected] <mailto:[email protected]>> wrote:
> Hi,
>
> The FunctionRegistry class no longer manage continuos synchronised checking 
> in RDF4J and Sesame 4, instead they use a helper [1]. So, what is the purpose 
> to auto-register the full text functions [2 & 3] at instantiation time? 
> Besides, once the functions implement the Function class and are registered 
> in the services file, the FunctionRegistry keeps track of them automatically. 
> So, why this is necessary on those function?
>
> FulltextQueryFunction:
>     static {
>         if(!FunctionRegistry.getInstance().has(“full text query uri")) {
>             FunctionRegistry.getInstance().add(new FulltextQueryFunction());
>         }
>     }
>
> FulltextSearchFunction:
>     static {
>         if(!FunctionRegistry.getInstance().has(“full text search uri")) {
>             FunctionRegistry.getInstance().add(new FulltextSearchFunction());
>         }
>     }
>
> It could be deleted, or is there something that I’m missing?
>
> Cheers,
> Xavier.
>
>
>
> [1] 
> https://github.com/eclipse/rdf4j/blob/develop/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/FunctionRegistry.java
>  
> <https://github.com/eclipse/rdf4j/blob/develop/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/FunctionRegistry.java>
>  
> <https://github.com/eclipse/rdf4j/blob/develop/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/FunctionRegistry.java
>  
> <https://github.com/eclipse/rdf4j/blob/develop/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/FunctionRegistry.java>>
> [2] 
> https://github.com/apache/marmotta/blob/develop/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/function/custom/FulltextQueryFunction.java
>  
> <https://github.com/apache/marmotta/blob/develop/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/function/custom/FulltextQueryFunction.java>
>  
> <https://github.com/apache/marmotta/blob/develop/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/function/custom/FulltextQueryFunction.java
>  
> <https://github.com/apache/marmotta/blob/develop/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/function/custom/FulltextQueryFunction.java>>
> [3] 
> https://github.com/apache/marmotta/blob/develop/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/function/custom/FulltextSearchFunction.java
>  
> <https://github.com/apache/marmotta/blob/develop/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/function/custom/FulltextSearchFunction.java>
>  
> <https://github.com/apache/marmotta/blob/develop/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/function/custom/FulltextSearchFunction.java
>  
> <https://github.com/apache/marmotta/blob/develop/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/function/custom/FulltextSearchFunction.java>>

Reply via email to