All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.aksw.jenax.arq.aggregation.FunctionNodeValueToString Maven / Gradle / Ivy

The newest version!
package org.aksw.jenax.arq.aggregation;

import com.google.common.base.Function;
import org.apache.jena.graph.Node;
import org.apache.jena.sparql.expr.NodeValue;

public class FunctionNodeValueToString
    implements Function
{

    @Override
    public String apply(NodeValue nv) {
        String result = null;

        if(nv == null) {

        }
        else if(nv.isString()) {
            result = nv.asUnquotedString();
        }
        else if(nv.isLiteral()) {
            Node n = nv.asNode();
            if(n.isLiteral()) {
                result = n.getLiteralLexicalForm();
            }
        }

        return result;
    }
    
    
    public static final FunctionNodeValueToString fn = new FunctionNodeValueToString();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy