public class ModelUtils extends Object
| Constructor and Description |
|---|
ModelUtils() |
| Modifier and Type | Method and Description |
|---|---|
static RDFNode |
convertGraphNodeToRDFNode(Node node)
Convert a
Node (graph SPI) to an RDFNode (model API) |
static RDFNode |
convertGraphNodeToRDFNode(Node node,
Model model)
Convert a
Node (graph SPI) to an RDFNode (model API), anchored to the model if possible. |
static ModelCollector |
intersectCollector() |
static boolean |
isValidAsStatement(Node s,
Node p,
Node o)
Determines whether a valid Statement can be formed from the given Subject, Predicate and Object
|
static Iterator<Triple> |
statementsToTriples(Iterator<Statement> it) |
static StmtIterator |
triplesToStatements(Iterator<Triple> it,
Model refModel) |
static Statement |
tripleToStatement(Model model,
Triple t) |
static ModelCollector |
unionCollector() |
public static RDFNode convertGraphNodeToRDFNode(Node node, Model model)
Node (graph SPI) to an RDFNode (model API), anchored to the model if possible.node - model - (may be null)public static RDFNode convertGraphNodeToRDFNode(Node node)
Node (graph SPI) to an RDFNode (model API)node - public static boolean isValidAsStatement(Node s, Node p, Node o)
This function reflects the fact that the Triple API 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
s - Subjectp - Predicateo - Objectpublic static StmtIterator triplesToStatements(Iterator<Triple> it, Model refModel)
public static ModelCollector intersectCollector()
public static ModelCollector unionCollector()
Licenced under the Apache License, Version 2.0