java.lang.Object
org.apache.jena.sparql.util.ModelUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.jena.rdf.model.RDFNode
convertGraphNodeToRDFNode
(org.apache.jena.graph.Node node) Convert aNode
(graph SPI) to an RDFNode (model API)static org.apache.jena.rdf.model.RDFNode
convertGraphNodeToRDFNode
(org.apache.jena.graph.Node node, org.apache.jena.rdf.model.Model model) Convert aNode
(graph SPI) to an RDFNode (model API), anchored to the model if possible.static org.apache.jena.util.ModelCollector
static boolean
isValidAsStatement
(org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o) Determines whether a valid Statement can be formed from the given Subject, Predicate and Objectstatic Iterator<org.apache.jena.graph.Triple>
statementsToTriples
(Iterator<org.apache.jena.rdf.model.Statement> it) static org.apache.jena.rdf.model.StmtIterator
triplesToStatements
(Iterator<org.apache.jena.graph.Triple> it, org.apache.jena.rdf.model.Model refModel) static org.apache.jena.rdf.model.Statement
tripleToStatement
(org.apache.jena.rdf.model.Model model, org.apache.jena.graph.Triple t) static org.apache.jena.util.ModelCollector
-
Constructor Details
-
ModelUtils
public ModelUtils()
-
-
Method Details
-
convertGraphNodeToRDFNode
public static org.apache.jena.rdf.model.RDFNode convertGraphNodeToRDFNode(org.apache.jena.graph.Node node, org.apache.jena.rdf.model.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 org.apache.jena.rdf.model.RDFNode convertGraphNodeToRDFNode(org.apache.jena.graph.Node node) Convert aNode
(graph SPI) to an RDFNode (model API)- Parameters:
node
-- Returns:
- RDFNode
-
tripleToStatement
public static org.apache.jena.rdf.model.Statement tripleToStatement(org.apache.jena.rdf.model.Model model, org.apache.jena.graph.Triple t) -
isValidAsStatement
public static boolean isValidAsStatement(org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o) Determines whether a valid Statement can be formed from the given Subject, Predicate and ObjectThis 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- Parameters:
s
- Subjectp
- Predicateo
- Object- Returns:
- True if a valid Statement can be formed
-
triplesToStatements
public static org.apache.jena.rdf.model.StmtIterator triplesToStatements(Iterator<org.apache.jena.graph.Triple> it, org.apache.jena.rdf.model.Model refModel) -
intersectCollector
public static org.apache.jena.util.ModelCollector intersectCollector() -
unionCollector
public static org.apache.jena.util.ModelCollector unionCollector() -
statementsToTriples
-