Package org.wymiwyg.commons.util.dirbrowser

Examples of org.wymiwyg.commons.util.dirbrowser.PathNode


   *
   */
  public MoleculeDiffDeserialized(File file) throws IOException {
    ZipFile zipFile = new ZipFile(file);
    // PathNode zipRoot = new ZipPathNode(zipFile, "");
    PathNode commonFgNodesPath = new ZipPathNode(zipFile,
        "fgNodes/used-common/");// zipRoot.getSubPath("fgnodes/onlyIn1/");
    deserializeFgNodes(zipFile, commonFgNodesPath,
        commonFgNodesInDiffMolecules);

    PathNode fgNodesOnlyIn1Path = new ZipPathNode(zipFile,
        "fgNodes/onlyIn1/");// zipRoot.getSubPath("fgnodes/onlyIn1/");
    deserializeFgNodes(zipFile, fgNodesOnlyIn1Path, fgNodesOnlyIn1);
    PathNode fgNodesOnlyIn2Path = new ZipPathNode(zipFile,
        "fgNodes/onlyIn2/");// zipRoot.getSubPath("fgnodes/onlyIn2/");
    deserializeFgNodes(zipFile, fgNodesOnlyIn2Path, fgNodesOnlyIn2);

   
   
    PathNode cgFgNodesPath = new ZipPathNode(zipFile,
        "fgNodes/crossGraphFgNodes/");
    deserializeCgFgNodes(zipFile, cgFgNodesPath);
    functionallyGroundedBuilder.release();
    PathNode moleculesOnlyIn1Path = new ZipPathNode(zipFile,
        "contextual-molecules/onlyIn1/");
    deserializeMolecules(moleculesOnlyIn1Path, contextualMoleculesOnlyIn1);
    PathNode moleculesOnlyIn2Path = new ZipPathNode(zipFile,
        "contextual-molecules/onlyIn2/");
    deserializeMolecules(moleculesOnlyIn2Path, contextualMoleculesOnlyIn2);
    PathNode terminalMoleculesOnlyIn1Path = new ZipPathNode(zipFile,
        "terminal-molecules/onlyIn1/");
    deserializeTerminalMolecules(terminalMoleculesOnlyIn1Path,
        terminalMoleculesOnlyIn1);
    PathNode terminalMoleculesOnlyIn2Path = new ZipPathNode(zipFile,
        "terminal-molecules/onlyIn2/");
    deserializeTerminalMolecules(terminalMoleculesOnlyIn2Path,
        terminalMoleculesOnlyIn2);
    fgNodesOnlyIn1 = new HashSet<FunctionallyGroundedNode>(fgNodesOnlyIn1);
    fgNodesOnlyIn2 = new HashSet<FunctionallyGroundedNode>(fgNodesOnlyIn2);
View Full Code Here


    return molecule;
  }

  private Graph getTriplesFromPathNode(PathNode dirPathNode, String name)
      throws IOException {
    PathNode moleculePathNode = dirPathNode.getSubPath(name);
    Model model = ModelFactory.createDefaultModel();
    model.read(moleculePathNode.getInputStream(),
        ReferencingNaturalizer.rootURL + moleculePathNode.getPath());
    Graph graph = JenaUtil.getGraphFromModel(model, false);
    SimpleGraph simpleGraph = new SimpleGraph();
    //Collection<Node> origFgNodes = new HashSet<Node>();
    Map<Node, NamedNode> node2descriptionDocMap = new HashMap<Node, NamedNode>();
    //NamedNode descriptionDoc = null;
View Full Code Here

   */
  private void deserializeCgFgNodes(ZipFile zipFile, PathNode cgFgNodesPath)
      throws IOException {
    String[] names = cgFgNodesPath.list();
    for (String name : names) {
      PathNode currentPath = cgFgNodesPath.getSubPath(name);
      crossGraphFgNodes.add(getCgFgNodeFromPathNode(zipFile, currentPath));
    }
  }
View Full Code Here

  private CrossGraphFgNode getCgFgNodeFromPathNode(ZipFile zipFile, PathNode currentPath)
      throws IOException {
    NamedNode describingResource = new NamedNodeImpl(
        ReferencingNaturalizer.rootURL + currentPath.getPath());
    CrossGraphFgNode result = new CrossGraphFgNode();
    PathNode nodesIn1Path = currentPath.getSubPath("onlyIn1/");
    deserializeFgNodes(zipFile, nodesIn1Path, result.getNodesIn1());
    PathNode nodesIn2Path = currentPath.getSubPath("onlyIn2/");
    deserializeFgNodes(zipFile, nodesIn2Path, result.getNodesIn2());
    descriptionPathToFgNode.put(describingResource, result);
    return result;
  }
View Full Code Here

   */
  private void deserializeFgNodes(ZipFile zipFile, PathNode fgNodesPath,
      Set<FunctionallyGroundedNode> fgNodesTargetSet) throws IOException {
    String[] names = fgNodesPath.list();
    for (String name : names) {
      PathNode currentPath = fgNodesPath.getSubPath(name);
      fgNodesTargetSet.add(getFgNodeFromPathNode(zipFile, currentPath));
    }
  }
View Full Code Here

    }
    try {
      String relativePath = new URI(ReferencingNaturalizer.rootURL)
          .relativize(describingResource.getURIRef(), URI.SAMEDOCUMENT
              | URI.ABSOLUTE | URI.RELATIVE | URI.PARENT);
      PathNode pathNode = new ZipPathNode(zipFile, relativePath);
      //FunctionallyGroundedNode result =
      return getFgNodeFromPathNode(zipFile, pathNode, describingResource);
    } catch (MalformedURIException e) {
      throw new RuntimeException(e);
    }
View Full Code Here

      PathNode pathNode, NamedNode describingResource) throws IOException {
    Node afgn = null;
    FunctionallyGroundedNodeImpl result = functionallyGroundedBuilder.createFGNode();
    descriptionPathToFgNode.put(describingResource, result);
    for (String moleculeNodeName : pathNode.list()) {
      PathNode moleculePathNode = pathNode.getSubPath(moleculeNodeName);
      Model model = ModelFactory.createDefaultModel();
      model
          .read(moleculePathNode.getInputStream(),
              ReferencingNaturalizer.rootURL
                  + moleculePathNode.getPath());
      /*
       * StmtIterator specialStmtIter = model.listStatements(null,
       * MODELDIFF.functionallyGroundedIn, (Resource)null); Statement
       * specialStmt = specialStmtIter.nextStatement();
       * specialStmtIter.close(); Resource groundedNodedRes =
View Full Code Here

      enumeration = ModelUtil.class.getClassLoader().getResources(
          "META-INF/rwcf/"/* model-section.rdf" */
      );
      while (enumeration.hasMoreElements()) {
        URL current = (URL) enumeration.nextElement();
        PathNode node = PathNodeFactory.getPathNode(current);
        String[] subFiles = node.list(new PathNameFilter() {
          public boolean accept(PathNode dir, String name) {
            return name.endsWith(".rdf") || name.endsWith(".n3");
          }
        });
        for (int i = 0; i < subFiles.length; i++) {
View Full Code Here

   */
  protected HttpResource[] getResources(URL url) {
    String extraPath = url.getPath();
    extraPath = addIndex(root, extraPath);
    PathHandler resourceHandler = new PathHandler(root, extraPath);
    PathNode directory = resourceHandler.getDirectory();
    final String namePrefix = resourceHandler.getFilePortion() + ".";
    String[] matching = directory.list(new PathNameFilter() {
      public boolean accept(PathNode dir, String name) {
        return name.startsWith(namePrefix)
            && (name.charAt(name.length() - 1) != '~');
      }
    });
View Full Code Here

TOP

Related Classes of org.wymiwyg.commons.util.dirbrowser.PathNode

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.