Package org.openrdf.model.impl

Examples of org.openrdf.model.impl.LiteralImpl


                .contentType(RDFFormat.TURTLE.getDefaultMIMEType())
                .body(SesameMatchers.rdfStringMatches(RDFFormat.TURTLE.getDefaultMIMEType(), baseUrl + newResource+".png",
                        SesameMatchers.hasStatement(new URIImpl(baseUrl + newResource+".png"), RDF.TYPE, LDP.Resource),
                        SesameMatchers.hasStatement(new URIImpl(baseUrl + newResource+".png"), RDF.TYPE, LDP.NonRDFSource),
                        SesameMatchers.hasStatement(new URIImpl(baseUrl + newResource+".png"), DCTERMS.MODIFIED, null),
                        SesameMatchers.hasStatement(new URIImpl(baseUrl + newResource+".png"), DCTERMS.FORMAT, new LiteralImpl(mimeType)),
                        SesameMatchers.hasStatement(new URIImpl(baseUrl + newResource+".png"), DCTERMS.IS_FORMAT_OF, new URIImpl(baseUrl + newResource))
                ))
                .get(newResource + ".png");

        // now check that the data is really there
View Full Code Here


            out.writeTriple(documentURI, csv.row, rowSubject);
            // the progressive row number
            out.writeTriple(
                    rowSubject,
                    csv.rowPosition,
                    new LiteralImpl(String.valueOf(index))
            );
            index++;
        }
        // add some CSV metadata such as the number of rows and columns
        addTableMetadataStatements(
View Full Code Here

            }
            if (!RDFUtils.isAbsoluteURI(header[index])) {
                out.writeTriple(
                        singleHeader,
                        RDFS.LABEL,
                        new LiteralImpl(header[index])
                );
            }
            out.writeTriple(
                    singleHeader,
                    csv.columnPosition,
                    new LiteralImpl(String.valueOf(index), XMLSchema.INTEGER)
            );
            index++;
        }
    }
View Full Code Here

            if (isInteger(cell)) {
                datatype = XMLSchema.INTEGER;
            } else if(isFloat(cell)) {
                datatype = XMLSchema.FLOAT;
            }
            object = new LiteralImpl(cell, datatype);
        }
        return object;
    }
View Full Code Here

            int numberOfRows,
            int numberOfColumns) {
        out.writeTriple(
                documentURI,
                csv.numberOfRows,
                new LiteralImpl(String.valueOf(numberOfRows), XMLSchema.INTEGER)
        );
        out.writeTriple(
                documentURI,
                csv.numberOfColumns,
                new LiteralImpl(String.valueOf(numberOfColumns), XMLSchema.INTEGER)
        );
    }
View Full Code Here

                lang = meta.getLang();
            }
            out.writeTriple(
                    documentURI,
                    meta.getName(),
                    new LiteralImpl(meta.getContent(), lang)
            );
        }
    }
View Full Code Here

                    );
                }
            case bnode:
                return new BNodeImpl(value);
            case literal:
                return new LiteralImpl(value);
            default:
                throw new IllegalStateException();
        }
    }
View Full Code Here

   
    // Test remove of named graph
    tmp.add(Graphs.newGraph(new StatementImpl(
        new URIImpl("urn:test:a"),
        new URIImpl("urn:test:b"),
        new LiteralImpl("hello world"))), "http://example.org/aGraph");
   
    String sparql = "SELECT ?a WHERE { GRAPH <http://example.org/aGraph> { ?a ?b ?c } }";
    List<Map<String,String>> results = tmp.query(sparql, new RowMapper<Map<String,String>>() {

      @Override
View Full Code Here

        String uriA = "urn:test:t";
        String uriB = "urn:test:u";
        String litA = "hello world";
        String litB = "goodbye";
       
        adder.statement(new URIImpl(uriA), new URIImpl(uriB), new LiteralImpl(litA));
        adder.statement(new URIImpl(uriA), new URIImpl(uriB), new LiteralImpl(litB));
        return true;
      }    
    });
   
    List<String> results = snarlTemplate.doWithGetter(null, "urn:test:u", new GetterCallback<String>() {
View Full Code Here

  public void write(Adder adder, List<? extends TestRecord> items)
      throws StardogException {
   
    for (TestRecord item : items) {
      adder.statement(new URIImpl(item.getName()), new URIImpl("urn:test:propertyUpdate"), new LiteralImpl((String) item.getValue() + "update"));
    }
   
  }
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.