Package org.apache.marmotta.client.model.rdf

Examples of org.apache.marmotta.client.model.rdf.Literal


     * @return
     */
    public static Metadata fromPropertiesMap(String resource, Map<String,String> map) {
        Metadata m = new Metadata(resource);
        for(Map.Entry<String,String> entry : map.entrySet()) {
            m.put(entry.getKey(), ImmutableSet.<RDFNode>of(new Literal(entry.getValue())));
        }
        return m;
    }
View Full Code Here


            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

        } 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

                                    } else if(nodeDef instanceof org.openrdf.model.BNode) {
                                        node = new BNode(((org.openrdf.model.BNode)nodeDef).getID());
                                    } else if(nodeDef instanceof org.openrdf.model.Literal) {
                                        org.openrdf.model.Literal nodeLiteral = (org.openrdf.model.Literal)nodeDef;
                                        if(nodeLiteral.getLanguage() != null) {
                                            node = new Literal(nodeLiteral.getLabel(), nodeLiteral.getLanguage());
                                        } else if(nodeLiteral.getDatatype() != null) {
                                            node = new Literal(nodeLiteral.getLabel(), new URI(nodeLiteral.getDatatype().stringValue()));
                                        } else {
                                            node = new Literal(nodeLiteral.getLabel());
                                        }
                                    } else {
                                        log.error("unknown result node type: {}",nodeDef);
                                    }
                                   
View Full Code Here

                                              "typed-literal".equalsIgnoreCase(nodeDef.get("type"))) {
                                        String lang = nodeDef.get("xml:lang");
                                        String datatype = nodeDef.get("datatype");

                                        if(lang != null) {
                                            node = new Literal(nodeDef.get("value"),lang);
                                        } else if(datatype != null) {
                                            node = new Literal(nodeDef.get("value"),new URI(datatype));
                                        } else {
                                            node = new Literal(nodeDef.get("value"));
                                        }
                                    } else if("bnode".equalsIgnoreCase(nodeDef.get("type"))) {
                                        node = new BNode(nodeDef.get("value"));
                                    } else {
                                        log.error("unknown result node type: {}",nodeDef.get("type"));
View Full Code Here

            object = new URI(nodeDef.get(VALUE));
        } else if( nodeDef.get(TYPE).equals(TYPE_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

TOP

Related Classes of org.apache.marmotta.client.model.rdf.Literal

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.