Package org.openrdf.model.impl

Examples of org.openrdf.model.impl.LiteralImpl


      public Boolean add(Adder adder) throws StardogException {
        String uriA = "urn:test:resource";
        String uriB = "urn:test:predicate";
       
        for (int i = 0; i < 20; i++) {
          adder.statement(new URIImpl(uriA), new URIImpl(uriB), new LiteralImpl("lit" + i));
        }
        return true;
      }    
    });
   
View Full Code Here


          throws StardogException {
       
        String uriA = "urn:test:test";
        String uriB = "urn:test:property";
        for (Object item : items) {
          adder.statement(new URIImpl(uriA), new URIImpl(uriB), new LiteralImpl((String)item));
        }
      }
     
     
    });
View Full Code Here

              "literal ("+getLiteralType(value)+")";
  }

  @Override
  public Literal createLiteral(String content) {
    return new LiteralImpl(content);
  }
View Full Code Here

  public Literal createLiteral(String content, Locale language, URI type) {
    log.debug("creating literal with content \"{}\", language {}, datatype {}",new Object[]{content,language,type});
    if(language == null && type == null) {
      return createLiteral(content);
    } else if(type == null) {
      return new LiteralImpl(content,language.getLanguage());
    } else  {
      return new LiteralImpl(content, createURI(type.toString()));
    }
  }
View Full Code Here

    public void testListTriples() {
        URI subject1 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
        URI subject2 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
        URI predicate1 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
        URI predicate2 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
        Literal object1 = new LiteralImpl("http://localhost/"+ RandomStringUtils.random(40));
        Literal object2 = new LiteralImpl("http://localhost/"+ RandomStringUtils.random(40));

        Statement stmt1 = new StatementImpl(subject1,predicate1,object1);
        Statement stmt2 = new StatementImpl(subject1,predicate1,object2);
        Statement stmt3 = new StatementImpl(subject1,predicate2,object1);
        Statement stmt4 = new StatementImpl(subject1,predicate2,object2);
View Full Code Here

    public void testRemoveTriples() {
        URI subject1 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
        URI subject2 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
        URI predicate1 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
        URI predicate2 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
        Literal object1 = new LiteralImpl("http://localhost/"+ RandomStringUtils.random(40));
        Literal object2 = new LiteralImpl("http://localhost/"+ RandomStringUtils.random(40));

        Statement stmt1 = new StatementImpl(subject1,predicate1,object1);
        Statement stmt2 = new StatementImpl(subject1,predicate1,object2);
        Statement stmt3 = new StatementImpl(subject1,predicate2,object1);
        Statement stmt4 = new StatementImpl(subject1,predicate2,object2);
View Full Code Here

        alice = new URIImpl("http://example/alice");
        bob = new URIImpl("http://example/bob");
        charlie = new URIImpl("http://example/charlie");

        lcBob = new LiteralImpl("bob");
        ucBob = new LiteralImpl("Bob");
    }
View Full Code Here

            case TYPE_LITERAL:
                String lang  = DataIO.readString(in);
                String dtype  = DataIO.readString(in);

                if(lang != null) {
                    return new LiteralImpl(label,lang);
                } else if(dtype != null) {
                    return new LiteralImpl(label, new URIImpl(dtype));
                } else {
                    return new LiteralImpl(label);
                }
        }
        throw new ClassNotFoundException("could not find class with type "+type);
    }
View Full Code Here

                "literal ("+getLiteralType(value)+")";
    }

    @Override
    public Literal createLiteral(String content) {
        return new LiteralImpl(content);
    }
View Full Code Here

    public Literal createLiteral(String content, Locale language, URI type) {
        log.debug("creating literal with content \"{}\", language {}, datatype {}",new Object[]{content,language,type});
        if(language == null && type == null) {
            return createLiteral(content);
        } else if(type == null) {
            return new LiteralImpl(content,language.getLanguage());
        } else  {
            return new LiteralImpl(content, createURI(type.toString()));
        }
    }
View Full Code Here

TOP

Related Classes of org.openrdf.model.impl.LiteralImpl

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.