Package org.aksw.jenax.arq.util.node
Class NodeEnvsubst
java.lang.Object
org.aksw.jenax.arq.util.node.NodeEnvsubst
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEnvKey(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 booleanisEnvKey(org.apache.jena.graph.Node node) static StringnodeToString(org.apache.jena.graph.Node node) static org.apache.jena.graph.NodeSubstitute placeholder nodes with corresponding values from a lookup map.static org.apache.jena.graph.NodesubstWithNode(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).
-
Field Details
-
ENV_PREFIX
- See Also:
-
-
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
-
getEnvKey
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)
-