Package com.inrupt.rdf.wrapping.jena
Class UriOrBlankFactory
- java.lang.Object
-
- org.apache.jena.enhanced.Implementation
-
- com.inrupt.rdf.wrapping.jena.UriOrBlankFactory
-
public class UriOrBlankFactory extends org.apache.jena.enhanced.Implementation
A factory for generating facets from blank and IRI nodes in enhanced graphs. Note: should not be invoked directly by user code: useas()
instead.Example: Given a node wrapper
N
and a graph wrapperG
, this class can be used to make the relationship between the two easier to write.public class N extends ResourceImpl { static final Implementation factory = new UriOrBlankFactory(N::new); public N(final Node n, final EnhGraph g) { super(n, g); } } public class G extends ModelCom { public G(final Model model) { getPersonality().add(N.class, N.factory); } }
-
-
Constructor Summary
Constructors Constructor Description UriOrBlankFactory(BiFunction<org.apache.jena.graph.Node,org.apache.jena.enhanced.EnhGraph,org.apache.jena.enhanced.EnhNode> factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canWrap(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph enhGraph)
org.apache.jena.enhanced.EnhNode
wrap(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph enhGraph)
-
-
-
Constructor Detail
-
UriOrBlankFactory
public UriOrBlankFactory(BiFunction<org.apache.jena.graph.Node,org.apache.jena.enhanced.EnhGraph,org.apache.jena.enhanced.EnhNode> factory)
-
-
Method Detail
-
wrap
public org.apache.jena.enhanced.EnhNode wrap(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph enhGraph)
- Specified by:
wrap
in classorg.apache.jena.enhanced.Implementation
-
canWrap
public boolean canWrap(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph enhGraph)
- Specified by:
canWrap
in classorg.apache.jena.enhanced.Implementation
-
-