Examples of PlainLiteral


Examples of org.ontoware.rdf2go.model.node.PlainLiteral

    // relations
    URI hasName = model.createURI("http://xmlns.com/foaf/0.1/#term_name");
    URI hasAge = model.createURI("http://example.com/relations#age");
    hasTag = model.createURI("http://example.com/relations#hasTag");
    // tags
    PlainLiteral tagJava = model.createPlainLiteral("Java");
    PlainLiteral tagPython = model.createPlainLiteral("Python");
   
    // adding statements
    // naming
    model.addStatement(max, hasName, "Max Völkel");
    model.addStatement(konrad, hasName, "Konrad Völkel");
View Full Code Here

Examples of org.ontoware.rdf2go.model.node.PlainLiteral

    // relations
    URI hasName = model.createURI("http://xmlns.com/foaf/0.1/#term_name");
    URI hasAge = model.createURI("http://example.com/relations#age");
    hasTag = model.createURI("http://example.com/relations#hasTag");
    // tags
    PlainLiteral tagJava = model.createPlainLiteral("Java");
    PlainLiteral tagPython = model.createPlainLiteral("Python");
   
    // adding statements
    // naming
    model.addStatement(max, hasName, "Max Völkel");
    model.addStatement(konrad, hasName, "Konrad Völkel");
View Full Code Here

Examples of org.ontoware.rdf2go.model.node.PlainLiteral

    // relations
    URI hasName = model.createURI("http://xmlns.com/foaf/0.1/#term_name");
    URI hasAge = model.createURI("http://example.com/relations#age");
    hasTag = model.createURI("http://example.com/relations#hasTag");
    // tags
    PlainLiteral tagJava = model.createPlainLiteral("Java");
    PlainLiteral tagPython = model.createPlainLiteral("Python");
    PlainLiteral tagComputers = model.createPlainLiteral("Computers");
   
    // adding statements
    // naming
    model.addStatement(max, hasName, "Max Völkel");
    model.addStatement(konrad, hasName, "Konrad Völkel");
    model.addStatement(guido, hasName, "Guido van Rossum");
    model.addStatement(james, hasName, "James Gosling");
   
    // a typed property, age
    model.addStatement(konrad, hasAge, model.createDatatypeLiteral("19", XSD._integer));
    model.addStatement(max, hasAge, model.createDatatypeLiteral("29", XSD._integer));
   
    // tagging
    tag(max, tagJava);
    tag(james, tagJava);
    tag(konrad, tagJava);
    tag(konrad, tagPython);
    tag(guido, tagPython);
   
    // simple SPARQL CONSTRUCT
    System.out.println("Query 1:");
    // suggest tagJava implies tagComputers
    String queryString = "CONSTRUCT { ?resource <"+hasTag+"> "+tagComputers.toSPARQL()+" } WHERE { ?resource <"+hasTag+"> "+tagJava.toSPARQL()+" }";
    ClosableIterable<? extends Statement> results = model.sparqlConstruct(queryString);
    for(Statement result : results) {
      System.out.println(result);
    }
   
View Full Code Here

Examples of org.ontoware.rdf2go.model.node.PlainLiteral

    URI guido = model.createURI("http://example.com/persons#guido");
    URI james = model.createURI("http://example.com/persons#james");
    // relations
    hasTag = model.createURI("http://example.com/relations#hasTag");
    // tags
    PlainLiteral tagJava = model.createPlainLiteral("Java");
    PlainLiteral tagPython = model.createPlainLiteral("Python");
   
    // adding statements
    // tagging
    tag(max, tagJava);
    tag(james, tagJava);
View Full Code Here

Examples of org.ontoware.rdf2go.model.node.PlainLiteral

    URI max = model.createURI("http://xam.de/foaf.rdf.xml#i");
    URI name = model.createURI(foafURI+"#term_name");
    URI icqId = model.createURI(foafURI+"#term_icqChatID");
    URI typeInteger = XSD._integer;
    BlankNode konrad = model.createBlankNode();
    PlainLiteral maxNameAsPlainLiteral = model.createPlainLiteral("Max Völkel");
    DatatypeLiteral number = model.createDatatypeLiteral("123", typeInteger);
    LanguageTagLiteral konradNameEnglish = model.createLanguageTagLiteral("Konrad Voelkel", "en");
    LanguageTagLiteral konradNameGerman = model.createLanguageTagLiteral("Konrad Völkel", "de");

    // adding statements to the model
View Full Code Here

Examples of org.ontoware.rdf2go.model.node.PlainLiteral

  /* subclasses should overwrite this method for better performance */
  @Override
    public PlainLiteral createPlainLiteral(String literal) {
    Model defaultModel = this.getDefaultModel();
    PlainLiteral result = defaultModel.createPlainLiteral(literal);
    defaultModel.close();
    return result;
  }
View Full Code Here

Examples of org.ontoware.rdf2go.model.node.PlainLiteral

            "en-us");
    assertEquals("literal@en-us", languageTagLiteral.toString());
  }
 
  public void testCreatePlainLiteral() {
    PlainLiteral literal = this.model.createPlainLiteral("Something");
    assertEquals("Something", literal.getValue());
  }
View Full Code Here

Examples of org.ontoware.rdf2go.model.node.PlainLiteral

    assertEquals("literal@en-us", languageTagLiteral.toString());
  }
 
  @Test
  public void testCreatePlainLiteral() {
    PlainLiteral literal = this.modelset.createPlainLiteral("Something");
    assertEquals("Something", literal.getValue());
  }
View Full Code Here

Examples of sherpa.protocol.PlainLiteral

    } else if (value instanceof RDFNode) {
      return (RDFNode) value;
    } else if (value instanceof IRI) {
      return new NamedNodeImpl(URI.create(((IRI)value).iri.toString()));
    } else if (value instanceof PlainLiteral) {
      PlainLiteral pl = (PlainLiteral)value;
      String lang = pl.language != null ? pl.language.toString() : null;
      return new PlainLiteralImpl(pl.lexical.toString(), lang);
    } else if (value instanceof TypedLiteral) {
      TypedLiteral tl = (TypedLiteral)value;
      return new TypedLiteralImpl(tl.lexical.toString(), URI.create(tl.datatype.toString()));
View Full Code Here

Examples of sherpa.protocol.PlainLiteral

    }
    return list;
  }
 
  public static PlainLiteral plainLit(PlainLiteralImpl l) {
    PlainLiteral lit = new PlainLiteral();
    lit.lexical = l.getLexical();
    lit.language = l.getLanguage();
    return lit;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.