I'm trying to implement a plugin for Ontotext GraphDB. I hope it will compute the distance between two entities via breath first search (see GraphDB as an undirected graph).
I found RDF4J custom function maybe a good way.
public Value evaluate(ValueFactory valueFactory, Value... values) throws ValueExprEvaluationException {
if (values.length!=2 || !values[0].isResource() || !values[1].isResource()){
throw new ValueExprEvaluationException("Usage Wrong");
}
Resource source= (Resource) values[0];
Resource target= (Resource) values[1];
return null;
}
However, I can not get the properties (neighbors) of an entity through Value
. And it seems that valueFactory
can only create an entity.
Now I sucessfully implement the example on Ontotext GraphDB. But the example only involves the string handling.
Is there any way to access the properties of entity in RDF4J custom function?
Appreciate your reply.