Examples of FunctionallyGroundedNode


Examples of org.wymiwyg.rdf.graphs.fgnodes.FunctionallyGroundedNode

   * @return
   */
  private static FunctionallyGroundedNode getFgNodeWith(Set fgNodes,
      NonTerminalMolecule ntMolecule) {
    for (Iterator iter = fgNodes.iterator(); iter.hasNext();) {
      FunctionallyGroundedNode currentNode = (FunctionallyGroundedNode) iter
          .next();
      for (Iterator iterator = currentNode.getGroundingMolecules()
          .iterator(); iterator.hasNext();) {
        NonTerminalMolecule currentMoleculeFromNode = (NonTerminalMolecule) iterator
            .next();
        if (ntMolecule.equals(currentMoleculeFromNode)) {
          return currentNode;
View Full Code Here

Examples of org.wymiwyg.rdf.graphs.fgnodes.FunctionallyGroundedNode

  public void print(PrintWriter out) {
    out.println("CrossGraphFgNode, that will be referenced as "+id);
    out.println("Versions in 1: "+nodesIn1.size());
    PrintWriter iOut = new PrintWriter(new IndentWriter(out));
    for (Iterator<FunctionallyGroundedNode> iter = nodesIn1.iterator(); iter.hasNext();) {
      FunctionallyGroundedNode current =  iter.next();
      iOut.print("-");
      iOut.println(current);
    }
    iOut.flush();
   
    out.println();
    out.println("Versions in 2: "+nodesIn2.size());
    PrintWriter iOut2 = new PrintWriter(new IndentWriter(out));
    for (Iterator<FunctionallyGroundedNode> iter = nodesIn2.iterator(); iter.hasNext();) {
      FunctionallyGroundedNode current =  iter.next();
      iOut2.print("-");
      iOut2.println(current);
    }
    iOut2.flush();
    out.println();
View Full Code Here

Examples of org.wymiwyg.rdf.graphs.fgnodes.FunctionallyGroundedNode

   * @see org.wymiwyg.rdf.graphs.fgnodes.FunctionallyGroundedNode#getGroundingMolecules()
   */
  public Set<NonTerminalMolecule> getGroundingMolecules() {
    Set<NonTerminalMolecule> result = new HashSet<NonTerminalMolecule>();
    for (Iterator<FunctionallyGroundedNode> iter = nodesIn1.iterator(); iter.hasNext();) {
      FunctionallyGroundedNode currentFgNode = iter.next();
      result.addAll(currentFgNode.getGroundingMolecules());
    }
    for (Iterator<FunctionallyGroundedNode> iter = nodesIn2.iterator(); iter.hasNext();) {
      FunctionallyGroundedNode currentFgNode = iter.next();
      result.addAll(currentFgNode.getGroundingMolecules());
    }
    return result;
  }
View Full Code Here

Examples of org.wymiwyg.rdf.graphs.fgnodes.FunctionallyGroundedNode

    for (CrossGraphFgNode cgFgNode : diff.getCrossGraphFgNodes()) {
      //FunctionallyGroundedNode newNode = new FunctionallyGroundedNodeImpl(cgFgNode.getGroundingMolecules());
      //replaceInMolecules(cgFgNode.getNodesIn1(), newNode);
      if (cgFgNode.is1To1()) {
        //FunctionallyGroundedNode versionIn1  = cgFgNode.getNodesIn1().iterator().next();
        FunctionallyGroundedNode versionIn2  = cgFgNode.getNodesIn2().iterator().next();
        Set<CrossGraphFgNode> cgFgSingleton = Collections.singleton(cgFgNode);
        replaceInMolecules(cgFgNode.getNodesIn1(), versionIn2);
        replaceInTerminalMolecules(terminalOnlyIn1, cgFgSingleton, versionIn2);
        replaceInTerminalMolecules(terminalOnlyIn2, cgFgSingleton, versionIn2);
        replaceInContextualMolecules(contextualOnlyIn1, cgFgSingleton, versionIn2);
View Full Code Here

Examples of org.wymiwyg.rdf.graphs.fgnodes.FunctionallyGroundedNode

    }
  }

  private FunctionallyGroundedNode getFgNodeFromDescribingNode(
      ZipFile zipFile, NamedNode describingResource) throws IOException {
    FunctionallyGroundedNode existing = descriptionPathToFgNode.get(describingResource);
    if (existing != null) {
      return existing;
    }
    try {
      String relativePath = new URI(ReferencingNaturalizer.rootURL)
View Full Code Here

Examples of org.wymiwyg.rdf.graphs.fgnodes.FunctionallyGroundedNode

  private FunctionallyGroundedNode getFgNodeFromPathNode(ZipFile zipFile,
      PathNode pathNode) throws IOException {
   
    NamedNode describingResource = new NamedNodeImpl(
        ReferencingNaturalizer.rootURL + pathNode.getPath());
    FunctionallyGroundedNode existing = descriptionPathToFgNode.get(describingResource);
    if (existing != null) {
      return existing;
    }
    return getFgNodeFromPathNode(zipFile, pathNode, describingResource);
  }
View Full Code Here

Examples of org.wymiwyg.rdf.graphs.fgnodes.FunctionallyGroundedNode

          if (!describingResource.equals(triple.getObject())) {
            // throw new RuntimeException("invalid diff");
            // now legal as fg-nodes may reference to others in
            // their nt-molecules
            //infinite recursion by cache
            FunctionallyGroundedNode replacement = getFgNodeFromDescribingNode(zipFile,
                (NamedNode) triple.getObject());
            innerReplacements.put(subject, replacement);
           
          } else {
            currentAfgn = subject;
View Full Code Here

Examples of org.wymiwyg.rdf.graphs.fgnodes.FunctionallyGroundedNode

    Set<FunctionallyGroundedNode> fgNodes = dec
        .getFunctionallyGroundedNodes();
    ReferenceGroundedDecomposition dec1 = getDecomposition(model1);
    Set<FunctionallyGroundedNode> fgNodes1 = dec1
        .getFunctionallyGroundedNodes();
    FunctionallyGroundedNode fgNode = fgNodes.iterator().next();
    FunctionallyGroundedNode fgNode1 = fgNodes1.iterator().next();
    System.out.println("Hash: " + fgNode.hashCode());
    System.out.println("Hash1: " + fgNode1.hashCode());
    System.out.println("Equals: " + fgNode.equals(fgNode1));
    assertEquals("fgnodes", 2, dec1.getFunctionallyGroundedNodes().size());
    assertEquals("Hashsed", fgNode.hashCode(), fgNode1.hashCode());
  }
View Full Code Here

Examples of org.wymiwyg.rdf.graphs.fgnodes.FunctionallyGroundedNode

    Set<FunctionallyGroundedNode> fgNodes = dec
        .getFunctionallyGroundedNodes();
    ReferenceGroundedDecomposition dec1 = getDecomposition(model1);
    Set<FunctionallyGroundedNode> fgNodes1 = dec1
        .getFunctionallyGroundedNodes();
    FunctionallyGroundedNode fgNode = selectFGNodeWithProperty(fgNodes,
        new FunctionalPropertyNodeImpl(FOAF.mbox.getURI()));
    FunctionallyGroundedNode fgNode1 = selectFGNodeWithProperty(fgNodes1,
        new FunctionalPropertyNodeImpl(FOAF.mbox.getURI()));
    System.out.println("Hash: " + fgNode.hashCode());
    System.out.println("Hash1: " + fgNode1.hashCode());
    System.out.println("Equals: " + fgNode.equals(fgNode1));
    assertDiffer("Hashsed", fgNode.hashCode(), fgNode1.hashCode());
  }
View Full Code Here

Examples of org.wymiwyg.rdf.graphs.fgnodes.FunctionallyGroundedNode

    boolean nodeReplaced = false;
    Set<TerminalMolecule> terminalMolecules = refDec.getTerminalMolecules();
    //TODO iterate over molecules
    for (Entry<FunctionallyGroundedNode, FunctionallyGroundedNode> entry : fgNodeMap
        .entrySet()) {
      FunctionallyGroundedNode orig = entry.getKey();
      FunctionallyGroundedNode current = entry.getValue();
      if (!current.equals(orig)) {
        Set<MaximumContextualMolecule> newContextualModelcules = new HashSet<MaximumContextualMolecule>();
        for (MaximumContextualMolecule maximumContextualMolecule : contextualMolecules) {
          try {
            ContextualMoleculeImpl replacement = new ContextualMoleculeImpl();
            new GraphUtil<MaximumContextualMolecule>()
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.