com.hp.hpl.jena.sparql.util
Class ModelUtils

java.lang.Object
  extended by com.hp.hpl.jena.sparql.util.ModelUtils

public class ModelUtils
extends Object


Constructor Summary
ModelUtils()
           
 
Method Summary
static RDFNode convertGraphNodeToRDFNode(Node n, Model model)
           
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)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelUtils

public ModelUtils()
Method Detail

convertGraphNodeToRDFNode

public static RDFNode convertGraphNodeToRDFNode(Node n,
                                                Model model)

tripleToStatement

public static Statement tripleToStatement(Model model,
                                          Triple t)

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 Object

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

Parameters:
s - Subject
p - Predicate
o - Object
Returns:
True if a valid Statement can be formed

triplesToStatements

public static StmtIterator triplesToStatements(Iterator<Triple> it,
                                               Model refModel)

statementsToTriples

public static Iterator<Triple> statementsToTriples(Iterator<Statement> it)


Licenced under the Apache License, Version 2.0