Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.Model


    userBeta.addProperty(ACCOUNTMANAGER.passwordSha1, Util.sha1(password));
    return userModel;
  }
 
  private Model createAuthorizationModel() {
    Model userModel = ModelFactory.createDefaultModel();
    Resource userBeta = userModel.createResource(FOAF.Person);
    Resource userSource = userModel.createResource(userSourceURL);
    userBeta.addProperty(AUTHORIZATION.mayImpersonate, userSource);
    userBeta.addProperty(ACCOUNTMANAGER.userName, username);
    return userModel;
  }
View Full Code Here


  public void testUpdate() throws Exception {
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Source source = new SourceImpl("http://example.org/graph-source#");
    Model model0 = ModelFactory.createDefaultModel();
    model0.read(StoreTest.class.getResource("update-test0.rdf").toString());
    FCAGraph graph0 = new FCAGraphImpl(model0);
    clock.setTime(new Date());
    store.updateGraph(source, graph0);
    store = null;
    Thread.sleep(2);
    store = reGetStoreImpl();
    Model model1 = ModelFactory.createDefaultModel();
    model1.read(StoreTest.class.getResource("update-test1.rdf").toString());
    FCAGraph graph1 = new FCAGraphImpl(model1);
    clock.setTime(new Date());
    store.updateGraph(new SourceImpl("http://example.org/graph-source#"),
        graph1);
    FCAGraph graphR = store.getGraphOverTime(
View Full Code Here

    // Model model1 = ModelFactory.createDefaultModel();
    // model1.createResource().addProperty(DC.subject, "test1");

    // Model model1 = modelWithStatements("_a dc:subject 'test1';
    // http://www.google.com/ foaf:maker 'ygf'");
    Model model1 = modelWithStatements("_a dc:subject _b");
    Model model2 = ModelFactory.createDefaultModel();
    model2.createResource().addProperty(DC.subject, "test2");
    graphs[0] = new FCAGraphImpl(model1);
    graphs[1] = new FCAGraphImpl(model2);
    clock.setTime(new W3CDateFormat()
    .parse("2006-05-01T16:30:00Z"));
    store.updateGraph(source, graphs[0]);
View Full Code Here

  public void testSimpleIFP() throws Exception {
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Source source0 = new SourceImpl("http://example.org/graph-source0");
    Source source1 = new SourceImpl("http://example.org/graph-source1");
    Model model0 = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox 'm'");
    Model model1 = modelWithStatements("_a rdfs:label 'hi'; _a http://xmlns.com/foaf/0.1/mbox 'm'");
    FCAGraph graph0 = new FCAGraphImpl(model0);
    FCAGraph graph1 = new FCAGraphImpl(model1);
    clock.setTime(new W3CDateFormat()
    .parse("2006-05-01T16:30:00Z"));
    store.updateGraph(source0, graph0);
View Full Code Here

  public void testOneAndTwoNTifp() throws Exception {
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Source source0 = new SourceImpl("http://example.org/graph-source0");
    Source source1 = new SourceImpl("http://example.org/graph-source1");
    Model model0 = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox 'm'; _a http://xmlns.com/foaf/0.1/mbox 'n'");
    Model model1 = modelWithStatements("_a rdfs:label 'hi'; _a http://xmlns.com/foaf/0.1/mbox 'm'");
    FCAGraph graph0 = new FCAGraphImpl(model0);
    FCAGraph graph1 = new FCAGraphImpl(model1);
    clock.setTime(new W3CDateFormat()
    .parse("2006-05-01T16:30:00Z"));
    store.updateGraph(source0, graph0);
View Full Code Here

    Store store = getStoreImpl(clock);
    Source source0 = new SourceImpl("http://example.org/graph-source0");
    Source source1 = new SourceImpl("http://example.org/graph-source1");
    Source source2 = new SourceImpl("http://example.org/graph-source2");
    Source source3 = new SourceImpl("http://example.org/graph-source3");
    Model model0 = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox 'm'; _a http://xmlns.com/foaf/0.1/mbox 'n'");
    Model model1 = modelWithStatements("_a rdfs:label 'hi'; _a http://xmlns.com/foaf/0.1/mbox 'm'");
    Model model2 = modelWithStatements("_a rdfs:comment 'foo'; _a http://xmlns.com/foaf/0.1/mbox 'n'; _a http://xmlns.com/foaf/0.1/mbox 'o'");
    Model model3 = modelWithStatements("_a rdfs:comment 'bar'; _a http://xmlns.com/foaf/0.1/mbox 'o'");
    FCAGraph graph0 = new FCAGraphImpl(model0);
    FCAGraph graph1 = new FCAGraphImpl(model1);
    FCAGraph graph2 = new FCAGraphImpl(model2);
    FCAGraph graph3 = new FCAGraphImpl(model3);
    clock.setTime(new W3CDateFormat()
        .parse("2006-05-01T16:30:00Z"));
    store.updateGraph(source0, graph0);
    clock.setTime(new W3CDateFormat()
    .parse("2006-05-01T16:32:00Z"));
    store.updateGraph(source1, graph1);
    store.updateGraph(source2, graph2);
    store.updateGraph(source3, graph3);
    Set<Source> sourceSet = new HashSet<Source>();
    sourceSet.add(source0);
    sourceSet.add(source1);
    sourceSet.add(source2);
    sourceSet.add(source3);
    FCAGraph retrievedGraph = store.getGraphOverTime(sourceSet).getGraph(
        new W3CDateFormat().parse("2006-06-01"));
    Model model = JenaUtil.getModelFromGraph(retrievedGraph);
    model.write(System.out);
    assertEquals(7, retrievedGraph.size());
  }
View Full Code Here

    retrievedGraph = store.getGraphOverTime(sourceSet).getGraph(date2);
    assertEquals(graphs[1], retrievedGraph);
  }

  protected Model getModelFromResource(String resName) {
    Model model = ModelFactory.createDefaultModel();
    if (resName.endsWith("nt")) {
      model.read(StoreTest.class.getResource(resName).toString(), "N-TRIPLE");
    } else {
      model.read(StoreTest.class.getResource(resName).toString());
    }
    return model;
  }
View Full Code Here

    performTestsWithGraphs(graphs);
  }

  public void testFromFiles4b() throws Exception {
    // JenaParameters.disableBNodeUIDGeneration = true;
    Model m0 = ModelFactory.createDefaultModel();
    Model m1 = ModelFactory.createDefaultModel();
    m0.read(MinimumFailingGraphDetector.class.getResource("test4-m0.rdf")
        .toString());
    m1.read(MinimumFailingGraphDetector.class.getResource("test4-m1.rdf")
        .toString());
    // m1.read(MinimumFailingGraphDetector.class.getResource("test13-1.nt").toString(),
    // "N-TRIPLE");
    // m2.read(MinimumFailingGraphDetector.class.getResource("test14-2.nt").toString(),
    // "N-TRIPLE");
View Full Code Here

    FCAGraph previousUnleanifiedGraph = null;
    // Model previousModel = null;

    for (int i = 0; i < 10; i++) {
      System.out.println("testing round " + i);
      Model model = ModelFactory.createDefaultModel();
      model.read(StoreTest.class.getResource("TestLeanError.rdf")
          .toString());

      FCAGraph unleanifiedGraph = new FCAGraphImpl(model);

      FCAGraph graph = new FCAGraphImpl(MoleculeBasedLeanifier
View Full Code Here

   */
  public void testAddingTheSame() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox 'm'; _a http://xmlns.com/foaf/0.1/mbox 'n'");
    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20060912");
    FCAGraph graph = new FCAGraphImpl(model);
    Source source = new SourceImpl("http://example.org/graph-source");
    clock.setTime(date1);
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.rdf.model.Model

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.