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

org.aksw.jenax.arq.rdfterm.RdfTermUtils Maven / Gradle / Ivy

There is a newer version: 5.2.0-1
Show newest version
package org.aksw.jenax.arq.rdfterm;

import org.apache.jena.graph.Node;

public class RdfTermUtils {
    /** Return the rdf term type for the given node */
    public static RdfTermType classify(Node node) {
        RdfTermType result;
        if (node == null) {
            result = RdfTermType.UNKNOWN;
        } else if (node.isURI()) {
            result = RdfTermType.IRI;
        } else if (node.isLiteral()) {
            result = RdfTermType.LITERAL;
        } else if (node.isBlank()) {
            result = RdfTermType.BNODE;
        } else if (node.isNodeTriple()) {
            result = RdfTermType.TRIPLE;
        } else if (node.isVariable()) {
            result = RdfTermType.VARIABLE;
        } else {
            result = RdfTermType.UNKNOWN;
        }

        return result;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy