Class NodeEnvsubst

java.lang.Object
org.aksw.jenax.arq.util.node.NodeEnvsubst

public class NodeEnvsubst extends Object
Envsubst (environment substitution) for nodes: A NodeTransform with the following rules: By default, IRIs using the scheme 'env' are subject to substitution. Assuming a placeholder 'x' is mapped to 'http://example.org' then applying envsubst to a node will yield a transformed node as follows <env:x> is mapped to the literal "http://example.org" <env://x> is mapped to the iri <http://example.org>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    getEnvKey(org.apache.jena.graph.Node node)
    Return a pair (key, flag for string (false)/iri(true)) for nodes that reference environment variables - null otherwise.
    static boolean
    isEnvKey(org.apache.jena.graph.Node node)
     
    static String
    nodeToString(org.apache.jena.graph.Node node)
     
    static org.apache.jena.graph.Node
    subst(org.apache.jena.graph.Node node, Function<String,String> lookup)
    Substitute placeholder nodes with corresponding values from a lookup map.
    static org.apache.jena.graph.Node
    substWithNode(org.apache.jena.graph.Node node, Function<String,org.apache.jena.graph.Node> lookup)
    Substitute placeholders directly with the node obtained via lookup Unmapped nodes are left unchanged Note that if the placholder demanded an IRI then a substitution with a node will create an IRI from its lexical form (this means literals will become IRIs).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • NodeEnvsubst

      public NodeEnvsubst()
  • Method Details

    • subst

      public static org.apache.jena.graph.Node subst(org.apache.jena.graph.Node node, Function<String,String> lookup)
      Substitute placeholder nodes with corresponding values from a lookup map. Non-placeholder nodes and placeholder nodes for which no substitution was specified are left unchanged
    • substWithNode

      public static org.apache.jena.graph.Node substWithNode(org.apache.jena.graph.Node node, Function<String,org.apache.jena.graph.Node> lookup)
      Substitute placeholders directly with the node obtained via lookup Unmapped nodes are left unchanged Note that if the placholder demanded an IRI then a substitution with a node will create an IRI from its lexical form (this means literals will become IRIs).
    • nodeToString

      public static String nodeToString(org.apache.jena.graph.Node node)
    • getEnvKey

      public static Map.Entry<String,Boolean> getEnvKey(org.apache.jena.graph.Node node)
      Return a pair (key, flag for string (false)/iri(true)) for nodes that reference environment variables - null otherwise.
      Parameters:
      node -
      Returns:
    • isEnvKey

      public static boolean isEnvKey(org.apache.jena.graph.Node node)