Examples of createLiteral()


Examples of com.hp.hpl.jena.rdf.model.Model.createLiteral()

      XMLBean type = def.get_type(ctx);
      // simple type?
      if (type instanceof simpleType)
        ((simpleType) type).toRDF(subject, prop, attribute, value, null, null, ctx);
      // else add plain literal
      else subject.addProperty(prop, model.createLiteral(schema.processWhitespace(attribute,value,null,ctx)));
    }
  }
 
  /* preliminaries before matching on property name */

 
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.createLiteral()

        while (entrySetIterator.hasNext())
        {
          Map.Entry entry = (Map.Entry) entrySetIterator.next();
                String key = (String) entry.getKey();
                name = hshName.get(key);
                model.add(codeLists,ParserUtil.rdfsLabel,model.createLiteral(name,key));
        }
       
        ArrayList<Code> arrCode = obj.getCode();
        for(Code code:arrCode)
        {
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.createLiteral()

          {
            Map.Entry entry = (Map.Entry) entryIterator.next();
                  String key = (String) entry.getKey();
                  name = hshName.get(key);
                 
                  model.add(res,ParserUtil.skosLabel, model.createLiteral(name,key));
          }
         
          str = str.substring(0,str.indexOf("#"));
          Resource resource = model.createResource(str);
         
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.createLiteral()

          while(iter.hasNext())
          {
            Map.Entry titles = (Map.Entry)iter.next();
            lang = (String) titles.getKey();
            title = hsh.get(lang);
            model.add(dsd,ParserUtil.dcTitle,model.createLiteral(title,lang));
          }
      }

    writeRDFToFile("title", model);
  }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.createLiteral()

      {
        Map.Entry entry = (Map.Entry) entrySetIterator.next();
              String key = (String) entry.getKey();
              name = hshName.get(key);
              //writeLinetoFile("    skos:prefLabel \"" + name + "\"@" + key + ";");
              model.add(con,ParserUtil.skosLabel,model.createLiteral(name,key));
      }
     
      Resource res = model.createResource(ParserUtil.concepts);
      model.add(con,ParserUtil.skosScheme,res);
     
View Full Code Here

Examples of org.apache.any23.rdf.Any23ValueFactoryWrapper.createLiteral()

        final ValueFactory factory = new Any23ValueFactoryWrapper(ValueFactoryImpl.getInstance(), out);
        BNode point = factory.createBNode();
        out.writeTriple(extractionContext.getDocumentURI(), expand("dcterms:related"), point);
        out.writeTriple(point, expand("rdf:type"), expand("geo:Point"));
        out.writeTriple(point, expand("geo:lat"), factory.createLiteral(Float.toString(lat)));
        out.writeTriple(point, expand("geo:long"), factory.createLiteral(Float.toString(lon)));
    }

    private URI expand(String curie) {
        return factory.getPrefixes().expand(curie);
View Full Code Here

Examples of org.data2semantics.tools.rdf.RDFFileDataSet.createLiteral()

    allInstances.addAll(negSet);
   
    for (Pair<Resource> pair : posSet) {
      if (rand.nextDouble() <= fraction) {
        instances.add(pair);
        labels.add(dataset.createLiteral("true"));
      }
    }
   
    for (Pair<Resource> pair : negSet) {
      if (rand.nextDouble() <= fraction) {
View Full Code Here

Examples of org.jrdf.graph.GraphElementFactory.createLiteral()

            return getLocalizedResource(n);
        } else if (n instanceof Literal) {
            Literal l = (Literal) n;
            GraphElementFactory elementFactory = _connector.getElementFactory();
            if (l.getDatatypeURI() != null) {
                return elementFactory.createLiteral(l.getLexicalForm(),
                                                    l.getDatatypeURI());
            } else if (l.getLanguage() != null) {
                return elementFactory.createLiteral(l.getLexicalForm(),
                                                    l.getLanguage());
            } else {
View Full Code Here

Examples of org.openrdf.model.LiteralFactory.createLiteral()

    URIFactory uf = repository.getURIFactory();
    LiteralFactory lf = repository.getLiteralFactory();
    String foafName = "http://xmlns.com/foaf/0.1/name";
    String exEmpId = "http://example.org/ns#empId";
    RepositoryConnection conn = repository.getConnection();
    conn.add(uf.createURI("http://example.org/ns#" + id), uf.createURI(foafName), lf.createLiteral(name));
    conn.add(uf.createURI("http://example.org/ns#" + id), uf.createURI(exEmpId), lf.createLiteral(empId));
    conn.close();
  }

  private void assertResult(String queryStr, List<String> names)
View Full Code Here

Examples of org.openrdf.model.LiteralFactory.createLiteral()

    LiteralFactory lf = repository.getLiteralFactory();
    String foafName = "http://xmlns.com/foaf/0.1/name";
    String exEmpId = "http://example.org/ns#empId";
    RepositoryConnection conn = repository.getConnection();
    conn.add(uf.createURI("http://example.org/ns#" + id), uf.createURI(foafName), lf.createLiteral(name));
    conn.add(uf.createURI("http://example.org/ns#" + id), uf.createURI(exEmpId), lf.createLiteral(empId));
    conn.close();
  }

  private void assertResult(String queryStr, List<String> names)
    throws StoreException, MalformedQueryException, EvaluationException
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.