Building from the previous asked question (How can I programmatically compute path length using Jena RDF/Ontology API?), I need to multiply a numerical value (e.g. 3.5) to one of the specific class (its class size as detailed in the previous question) and be able to compute the overall path length(s) in an RDF Graph. Note that each path that fall-under this specific node will produce a new path weight result.
What I tried to do is to create a method called nValue
and passed to it the classSize
and the this numerical value variable then added it to the pathSize
method for computing the pathLength
, the method is as follows:
public static double nValue (int classWeight, double nv )
{
double numValue = classWeight*nv;
if ( nv < 1 ){
numValue = 1.0;
}
return numValue;
}
Then tried to call this method in the pathSize
method to vain. My problem is that I'm new to Jena. So I have a problem in getting a single class in an RDF graph and perform the multiplications to it and combine it to the pathLength
computation.