Package com.hp.hpl.jena.gvs

Examples of com.hp.hpl.jena.gvs.FCAGraph


    Model model1 = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");
    Model model2 = modelWithStatements("_a dc:subject 'hullo'; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");

    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20060912");
    FCAGraph graph1 = new FCAGraphImpl(model1);
    FCAGraph graph2 = new FCAGraphImpl(model2);
    Source source = new SourceImpl("http://example.org/graph-source");
    clock.setTime(date1);
    store.updateGraph(source, graph1);
    store = reGetStoreImpl();
    source = new SourceImpl("http://example.org/graph-source");
    clock.setTime(date2);
    store.assertGraph(source, graph2);
    FCAGraph graphR  = store.getGraphOverTime(Collections.singleton(source)).getGraph(dateFormat.parse("20060913"));
    JenaUtil.getModelFromGraph(graphR).write(System.out);
  }
View Full Code Here


    Model model1 = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox \"foo\"; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");
    Model model2 = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");

    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20060912");
    FCAGraph graph1 = new FCAGraphImpl(model1);
    FCAGraph graph2 = new FCAGraphImpl(model2);
    Source source = new SourceImpl("http://example.org/graph-source");
    clock.setTime(date1);
    store.updateGraph(source, graph1);
    store = reGetStoreImpl();
    clock.setTime(date2);
    store.revokeGraph(source, graph2);
    FCAGraph graphR  = store.getGraphOverTime(Collections.singleton(source)).getGraph(dateFormat.parse("20060913"));
    JenaUtil.getModelFromGraph(graphR).write(System.out);
  }
View Full Code Here

    Model model2 = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");

    Date date1 = dateFormat.parse("20050607");
    Date date1b = dateFormat.parse("20050608");
    Date date2 = dateFormat.parse("20060912");
    FCAGraph graph1 = new FCAGraphImpl(model1);
    FCAGraph graph1b = new FCAGraphImpl(model1b);
    FCAGraph graph2 = new FCAGraphImpl(model2);
    Source source = new SourceImpl("http://example.org/graph-source");
    clock.setTime(date1);
    store.updateGraph(source, graph1);
    clock.setTime(date1b);
    store.assertGraph(source, graph1b);
    store = reGetStoreImpl();
    clock.setTime(date2);
    store.revokeGraph(source, graph2);
    FCAGraph graphR  = store.getGraphOverTime(Collections.singleton(source)).getGraph(dateFormat.parse("20060913"));
    //no exception retrieving graph containing fg-node that doesn't exist the same way as wehn stuff was added
    assertTrue(true);
    JenaUtil.getModelFromGraph(graphR).write(System.out);
  }
View Full Code Here

    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model1 = modelWithStatements("_a dc:subject 'sub1'; _a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/knows http://example.org/");
    Model model2 = modelWithStatements("_b dc:subject 'sub2'; _b dc:subject 'hello'; _b http://xmlns.com/foaf/0.1/knows http://example.org/");
    final FCAGraph graph2 = new FCAGraphImpl(model2);
    Source source = new SourceImpl("http://example.org/graph-source");
    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20050608");
    Date date3 = dateFormat.parse("20060912");
    clock.setTime(date1);
View Full Code Here

  public void testTransactions3() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model1 = modelWithStatements("_a dc:subject 'sub1'; _a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/knows http://example.org/; _c dc:subject 'foo'");
    final FCAGraph graph1 = new FCAGraphImpl(model1);
    Model model2 = modelWithStatements("_b dc:subject 'sub2'; _b dc:subject 'hello'; _b http://xmlns.com/foaf/0.1/knows http://example.org/");
    final FCAGraph graph2 = new FCAGraphImpl(model2);
    Source source = new SourceImpl("http://example.org/graph-source");
    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20050608");
    Date date3 = dateFormat.parse("20060912");
    clock.setTime(date1);
View Full Code Here

     * });
     */
    // TODO avoid unnecessary checking if component already present in
    // metastore
    Date moment = clock.getTime();
    FCAGraph revokedGraph = getGraphOverTime(Collections.singleton(source))
        .getGraph(moment);
    // c-mols
    Set<MaximumContextualMolecule> newCMols = new HashSet<MaximumContextualMolecule>(
        assertedGraph.getContextualMolecules());
    newCMols.removeAll(revokedGraph.getContextualMolecules());
    addCMolecules(source, newCMols, moment);
    Set<MaximumContextualMolecule> revokedCMols = new HashSet<MaximumContextualMolecule>(
        revokedGraph.getContextualMolecules());
    revokedCMols.removeAll(assertedGraph.getContextualMolecules());
    revokeCMolecules(source, revokedCMols, moment);
    // t-mols
    Set<TerminalMolecule> newTMols = new HashSet<TerminalMolecule>(
        assertedGraph.getTerminalMolecules());
    newTMols.removeAll(revokedGraph.getTerminalMolecules());
    addTMolecules(source, newTMols, moment);
    Set<TerminalMolecule> revokedTMols = new HashSet<TerminalMolecule>(
        revokedGraph.getTerminalMolecules());
    revokedTMols.removeAll(assertedGraph.getTerminalMolecules());
    revokeTMolecules(source, revokedTMols, moment);
    // fg-nodes
    Set<FunctionallyGroundedNode> newFGNodes = new HashSet<FunctionallyGroundedNode>(
        assertedGraph.getFunctionallyGroundedNodes());
    newFGNodes.removeAll(revokedGraph.getFunctionallyGroundedNodes());
    addFGNodes(source, newFGNodes, moment);
    Set<FunctionallyGroundedNode> revokedFGNodes = new HashSet<FunctionallyGroundedNode>(
        revokedGraph.getFunctionallyGroundedNodes());
    revokedFGNodes.removeAll(assertedGraph.getFunctionallyGroundedNodes());
    revokeFGNodes(source, revokedFGNodes, moment);

  }
View Full Code Here

     */
    public void revokeAll() {
      addingCMolecules.clear();
      addingTMolecules.clear();
      addingFGNodes.clear();
      FCAGraph currentGraph = getGraph();
      removingCMolecules.addAll(currentGraph.getContextualMolecules());
      removingTMolecules.addAll(currentGraph.getTerminalMolecules());
      removingFGNodes.addAll(currentGraph.getFunctionallyGroundedNodes());
    }
View Full Code Here

    String resourceURIString = ehRequest.getRequestURLWithoutParams()
        .toString();
    response.setDefaultStylesheet("/application/stylesheets/combined");
    Set<GroundedNode> resources = new HashSet<GroundedNode>();
    resources.add(new NamedNodeImpl(resourceURIString));
    FCAGraph completeGraph = trustedGOT.getGraph(moment);
    int lastResourcesCount = 0;
    FCAGraph graph = null;
    while (resources.size() > lastResourcesCount) {
      lastResourcesCount = resources.size();
      graph = completeGraph.filter(resources);
      for (Triple triple : graph) {
        if (triple.getPredicate().equals(
View Full Code Here

    infoBitResource.addProperty(RDF.type, DISCOBITS.InfoBit);
    store.perform(identity, new StoreTransaction() {

      public void execute(SourceStoreView storeView) {
        NamedNode locationNode = new NamedNodeImpl(locationString);
        FCAGraph origGraph = storeView.getGraph().filter(
            Collections.singleton((GroundedNode) locationNode));
        Model origModel = ModelFactory.createModelForGraph(origGraph);
        editableModel.add(origModel);
        Resource locationResource = editableModel
            .createResource(locationString);
View Full Code Here

      try {
        model.read(file.toURL().toString());
      } catch (MalformedURLException e) {
        throw new RuntimeException(e);
      }
      FCAGraph graph = new FCAGraphImpl(model);
      assertions.add(new Assertion(new SourceImpl(sourceString), graph,
          date));
    }
    return assertions;
  }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.gvs.FCAGraph

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.