Class 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: use as() instead.

    Example: Given a node wrapper N and a graph wrapper G, 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 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 class org.apache.jena.enhanced.Implementation
      • canWrap

        public boolean canWrap​(org.apache.jena.graph.Node node,
                               org.apache.jena.enhanced.EnhGraph enhGraph)
        Specified by:
        canWrap in class org.apache.jena.enhanced.Implementation