Package org.openrdf.rio.rdfjson.RDFJSONUtility

Examples of org.openrdf.rio.rdfjson.RDFJSONUtility.URI


     */
    public static RDFNode parseRDFJSONNode(Map<String, String> nodeDef) {
        RDFNode object;

        if( nodeDef.get(TYPE).equals(URI) ) {
            object = new URI(nodeDef.get(VALUE));
        } else if( nodeDef.get(TYPE).equals(BNODE) ) {
            object = new BNode(nodeDef.get(VALUE));
        } else {
            if( nodeDef.get(LANG) != null ) {
                object = new Literal(nodeDef.get(VALUE),nodeDef.get(LANG));
            } else if( nodeDef.get(DATATYPE) != null) {
                object = new Literal(nodeDef.get(VALUE),new URI(nodeDef.get(DATATYPE)));
            } else {
                object = new Literal(nodeDef.get(VALUE));
            }
        }
        return object;
View Full Code Here


     */
    public static RDFNode parseRDFJSONNode(Value value) {
        RDFNode object;

        if( value instanceof org.openrdf.model.URI ) {
            object = new URI(value.stringValue());
        } else if( value instanceof BNode ) {
            object = new BNode(value.stringValue());
        } else {
            org.openrdf.model.Literal literal = (org.openrdf.model.Literal)value;
            if( literal.getLanguage() != null ) {
                object = new Literal(literal.getLabel(), literal.getLanguage());
            } else if( literal.getDatatype() != null) {
                object = new Literal(literal.getLabel(),new URI(literal.getDatatype().stringValue()));
            } else {
                object = new Literal(literal.getLabel());
            }
        }
        return object;
View Full Code Here

TOP

Related Classes of org.openrdf.rio.rdfjson.RDFJSONUtility.URI

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.