Java Code Examples for org.openrdf.model.Value#toString()

The following examples show how to use org.openrdf.model.Value#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SparqlGenerator.java    From tinkerpop3 with GNU General Public License v2.0 5 votes vote down vote up
private String sparql(final Value val) {
    if (val instanceof Literal) {
        return val.toString();
    } else if (val instanceof URI) {
        return '<' + val.stringValue() + '>';
    } else {
        throw new IllegalArgumentException();
    }
}
 
Example 2
Source File: BigdataGASEngine.java    From database with GNU General Public License v2.0 4 votes vote down vote up
private IV<?,?> getIV(final Value u) {
    
    if (u == null)
        return null;
    
    if (u instanceof IV)
        return (IV<?, ?>) u;

    if (u instanceof BigdataValue) {
    
        final IV<?,?> iv = ((BigdataValue) u).getIV();
        
        if(iv == null)
            throw new NotMaterializedException(u.toString());
        
        return iv;
        
    }

    throw new RuntimeException("No IV: " + u);
    
}