Examples of FCAGraph


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

      bodyModel.read(Channels.newInputStream(request.getMessageBody()
          .read()), source.getURIRef());
    } catch (Exception e) {
      throw new HandlerException(e);
    }
    final FCAGraph graph = new FCAGraphImpl(bodyModel);
    if (resourceURIStrings != null) {

      final Set<GroundedNode> onlyForGroundedNodes = new HashSet<GroundedNode>(
          resourceURIStrings.length);
      for (String uriString : resourceURIStrings) {
        onlyForGroundedNodes.add(new NamedNodeImpl(uriString));
      }
      // response.setBody(reconstructGraph(filterableDecomposition,
      // onlyForGroundedNodes));
      store.perform(source, new StoreTransaction() {

        public void execute(SourceStoreView storeView) {
          FCAGraph fcaGraph = storeView.getGraph();
          storeView
              .revokeGraph(fcaGraph.filter(onlyForGroundedNodes));
          storeView.assertGraph(graph);
        }

      });
    } else {
View Full Code Here

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

    String assertedRDFXML = parameters.getParameteValues("assert")[0].toString();
    String revokedRDFXML = parameters.getParameteValues("revoke")[0].toString();
    Model assertedModel = ModelFactory.createDefaultModel();
    assertedModel
        .read(new StringReader(assertedRDFXML), source.getURIRef());
    FCAGraph assertedGraph = new FCAGraphImpl(assertedModel);
    Model revokedModel = ModelFactory.createDefaultModel();
    revokedModel.read(new StringReader(revokedRDFXML), source.getURIRef());
    FCAGraph revokedGraph = new FCAGraphImpl(revokedModel);
    store.changeGraph(source, revokedGraph, assertedGraph);
  }
View Full Code Here

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

        response.setHeader(HeaderName.get("X-GVS-Following"),
            previousDateStringList.toArray());
      }
    }
    if (resourceURIStrings != null) {
      FCAGraph fcaGraph = got.getGraph(moment);
      Set<GroundedNode> onlyForGroundedNodes = new HashSet<GroundedNode>(
          resourceURIStrings.length);
      for (String uriString : resourceURIStrings) {
        onlyForGroundedNodes.add(new NamedNodeImpl(uriString));
      }
      response.setBody(fcaGraph.filter(onlyForGroundedNodes));
    } else {
      response.setBody(got.getGraph(moment));
    }
  }
View Full Code Here

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

  public void testComapringWithConverter() {
    Model origModel = ModelCreationUtil.createRandomModel(1000);
    Graph origGraph = JenaUtil.getGraphFromModel(origModel, true);
    Graph leanGraph = MoleculeBasedLeanifier.getLeanVersionOf(origGraph);
    Model leanModel = JenaUtil.getModelFromGraph(leanGraph);
    FCAGraph fcaGraph = new FCAGraphImpl(leanGraph);
    Model modelOnFCA = ModelFactory.createModelForGraph(fcaGraph);
    assertTrue(leanModel.isIsomorphicWith(modelOnFCA));
  }
View Full Code Here

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

   */
  public void testFilter() {
    Model model = ModelFactory.createDefaultModel();
    model.read(getClass().getResource("filter-test.n3").toString(),
        "N3");
    FCAGraph fcaGraph = new FCAGraphImpl(model);
    FCAGraph subGraph = fcaGraph.filter(Collections.singleton((GroundedNode)new NamedNodeImpl("mailto:test@example.org")));
    assertEquals(3, subGraph.size());
    FCAGraph subGraph2 = fcaGraph.filter(Collections.singleton((GroundedNode)new NamedNodeImpl("http://example.org/foo")));
    assertEquals(3, subGraph2.size());
    //ModelFactory.createModelForGraph(subGraph2).write(System.out);
  }
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.