Package org.apache.jena.sparql.util
Class ModelUtils
- java.lang.Object
-
- org.apache.jena.sparql.util.ModelUtils
-
public class ModelUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ModelUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RDFNodeconvertGraphNodeToRDFNode(Node node)Convert aNode(graph SPI) to an RDFNode (model API)static RDFNodeconvertGraphNodeToRDFNode(Node node, Model model)Convert aNode(graph SPI) to an RDFNode (model API), anchored to the model if possible.static ModelCollectorintersectCollector()static booleanisValidAsStatement(Node s, Node p, Node o)Determines whether a valid Statement can be formed from the given Subject, Predicate and Objectstatic java.util.Iterator<Triple>statementsToTriples(java.util.Iterator<Statement> it)static StmtIteratortriplesToStatements(java.util.Iterator<Triple> it, Model refModel)static StatementtripleToStatement(Model model, Triple t)static ModelCollectorunionCollector()
-
-
-
Method Detail
-
convertGraphNodeToRDFNode
public static RDFNode convertGraphNodeToRDFNode(Node node, Model model)
Convert aNode(graph SPI) to an RDFNode (model API), anchored to the model if possible.- Parameters:
node-model- (may be null)- Returns:
- RDFNode
-
convertGraphNodeToRDFNode
public static RDFNode convertGraphNodeToRDFNode(Node node)
Convert aNode(graph SPI) to an RDFNode (model API)- Parameters:
node-- Returns:
- RDFNode
-
isValidAsStatement
public static boolean isValidAsStatement(Node s, Node p, Node o)
Determines whether a valid Statement can be formed from the given Subject, Predicate and ObjectThis function reflects the fact that the
TripleAPI is flexible in allowing any Node type in any position (including non-RDF node types like Variable) and as such not all Triples can be safely converted into Statements- Parameters:
s- Subjectp- Predicateo- Object- Returns:
- True if a valid Statement can be formed
-
triplesToStatements
public static StmtIterator triplesToStatements(java.util.Iterator<Triple> it, Model refModel)
-
intersectCollector
public static ModelCollector intersectCollector()
-
unionCollector
public static ModelCollector unionCollector()
-
-