Class JenaSesameUtils


  • public final class JenaSesameUtils
    extends java.lang.Object

    Utility methods for converting between the Jena and Sesame APIs

    Since:
    0.6.9
    Version:
    6.0
    Author:
    Michael Grove
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.function.Function<Value,​org.apache.jena.graph.Node> TO_NODE  
      static java.util.function.Function<org.apache.jena.graph.Node,​Value> TO_VALUE  
      static java.util.function.Function<Statement,​org.apache.jena.sparql.core.Quad> TOQUAD  
      static java.util.function.Function<org.apache.jena.graph.Triple,​org.apache.jena.rdf.model.Statement> TOSTMT  
      static java.util.function.Function<Statement,​org.apache.jena.graph.Triple> TOTRIPLE
      Function which will convert sesame statements to Jena graph Triples on the fly
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.jena.graph.Node anonNode​(BNode theBNode)
      Create a Jena anonymous Graph Node from the Sesame BNode
      static BNode bnode​(org.apache.jena.graph.Node theNode)  
      static org.apache.jena.riot.system.PrefixMap createPrefixMap​(java.util.Optional<Connection> conn)  
      static org.apache.jena.shared.PrefixMapping createPrefixMapping​(java.util.Optional<Connection> conn)  
      static IRI iri​(org.apache.jena.graph.Node theNode)  
      static boolean isAnyOrNull​(org.apache.jena.graph.Node theNode)  
      static Literal literal​(org.apache.jena.graph.Node theNode)  
      static org.apache.jena.graph.Node literalNode​(Literal theLiteral)
      Return a Jena Literal Graph Node from the Sesame Literal
      static org.apache.jena.rdf.model.Model model​(java.util.Set<Statement> theGraph)  
      static org.apache.jena.graph.Node node​(Value theValue)
      Return the equivalent Jena Graph Node for the provided Sesame Value
      static Resource resource​(org.apache.jena.graph.Node theNode)  
      static org.apache.jena.rdf.model.Statement statement​(Statement theStatement)  
      static Statement statement​(org.apache.jena.graph.Triple theTriple)  
      static org.apache.jena.rdf.model.StmtIterator stmtIterator​(java.util.Iterator<Statement> theIterator)  
      static org.apache.jena.graph.Triple triple​(Statement theStatement)  
      static org.apache.jena.graph.Node uriNode​(IRI theURI)  
      static Value value​(org.apache.jena.graph.Node theNode)  
      • Methods inherited from class java.lang.Object

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

      • TOTRIPLE

        public static final java.util.function.Function<Statement,​org.apache.jena.graph.Triple> TOTRIPLE
        Function which will convert sesame statements to Jena graph Triples on the fly
      • TOQUAD

        public static final java.util.function.Function<Statement,​org.apache.jena.sparql.core.Quad> TOQUAD
      • TOSTMT

        public static final java.util.function.Function<org.apache.jena.graph.Triple,​org.apache.jena.rdf.model.Statement> TOSTMT
      • TO_NODE

        public static final java.util.function.Function<Value,​org.apache.jena.graph.Node> TO_NODE
      • TO_VALUE

        public static final java.util.function.Function<org.apache.jena.graph.Node,​Value> TO_VALUE
    • Method Detail

      • stmtIterator

        public static org.apache.jena.rdf.model.StmtIterator stmtIterator​(java.util.Iterator<Statement> theIterator)
      • statement

        public static org.apache.jena.rdf.model.Statement statement​(Statement theStatement)
      • triple

        public static org.apache.jena.graph.Triple triple​(Statement theStatement)
      • model

        public static org.apache.jena.rdf.model.Model model​(java.util.Set<Statement> theGraph)
      • node

        public static org.apache.jena.graph.Node node​(Value theValue)
        Return the equivalent Jena Graph Node for the provided Sesame Value
        Parameters:
        theValue - the value
        Returns:
        the Jena Node equivalent to the Sesame Value
      • literalNode

        public static org.apache.jena.graph.Node literalNode​(Literal theLiteral)
        Return a Jena Literal Graph Node from the Sesame Literal
        Parameters:
        theLiteral - the literal
        Returns:
        the equivalent Jena graph node for the Sesame Literal
      • anonNode

        public static org.apache.jena.graph.Node anonNode​(BNode theBNode)
        Create a Jena anonymous Graph Node from the Sesame BNode
        Parameters:
        theBNode - the bnode
        Returns:
        the equivalent Jena Graph node for the Sesame BNode
      • uriNode

        public static org.apache.jena.graph.Node uriNode​(IRI theURI)
      • value

        public static Value value​(org.apache.jena.graph.Node theNode)
      • isAnyOrNull

        public static boolean isAnyOrNull​(org.apache.jena.graph.Node theNode)
      • resource

        public static Resource resource​(org.apache.jena.graph.Node theNode)
      • iri

        public static IRI iri​(org.apache.jena.graph.Node theNode)
      • bnode

        public static BNode bnode​(org.apache.jena.graph.Node theNode)
      • literal

        public static Literal literal​(org.apache.jena.graph.Node theNode)
      • statement

        public static Statement statement​(org.apache.jena.graph.Triple theTriple)
      • createPrefixMapping

        public static org.apache.jena.shared.PrefixMapping createPrefixMapping​(java.util.Optional<Connection> conn)
      • createPrefixMap

        public static org.apache.jena.riot.system.PrefixMap createPrefixMap​(java.util.Optional<Connection> conn)