Class NodeUtil


  • public class NodeUtil
    extends Object
    Collection of utilities to help working with RDF at Node/Graph level.
    Author:
    Dave Reynolds
    • Constructor Detail

      • NodeUtil

        public NodeUtil()
    • Method Detail

      • literalValues

        public static List<String> literalValues​(org.apache.jena.graph.Node root,
                                                 org.apache.jena.graph.Node[] props,
                                                 org.apache.jena.graph.Graph g)
        Scans the properties in props testing if root has a value for that property. For the first such property it returns a list of all the lexical forms of that property.
      • getPropertyValue

        public static org.apache.jena.graph.Node getPropertyValue​(org.apache.jena.graph.Node root,
                                                                  org.apache.jena.graph.Node prop,
                                                                  org.apache.jena.graph.Graph g)
        Find the first value of the given property of the root node. Return null if there's no such property.
      • getLocalName

        public static String getLocalName​(org.apache.jena.graph.Node root)
        Find the local name of the URI of a node. This is for labelling purposes rather than XML serialization so splits at last # or /, may not return an NC name