Package org.wymiwyg.rdf.molecules.impl

Examples of org.wymiwyg.rdf.molecules.impl.SimpleTerminalMolecule


  public TerminalMolecule getTerminalMolecule(NamedNode moleculeRef) {
    return new MoleculeReader<TerminalMolecule>() {

      @Override
      protected TerminalMolecule asMolecule(Graph graphFromModel) {
        SimpleTerminalMolecule result = new SimpleTerminalMolecule();
        result.addAll(deNaturalize(graphFromModel));
        result.markFinalized();
        return result;
      }

    }.readComponent(new ComponentDirectory(moleculeRef.getURIRef()));
  }
View Full Code Here


            if (!current.equals(orig)) {
              Set<TerminalMolecule> originalTerminalMolecules = tMolecules;
              tMolecules = new HashSet<TerminalMolecule>();
              for (TerminalMolecule molecule : originalTerminalMolecules) {
                try {
                  SimpleTerminalMolecule replacement = new GraphUtil<SimpleTerminalMolecule>()
                      .replaceNode(
                          molecule,
                          orig,
                          current,
                          new SimpleTerminalMolecule());
                  replacement.markFinalized();
                  tMolecules.add(replacement);
                } catch (SourceNodeNotFoundException e) {
                  tMolecules.add(molecule);
                }
              }
View Full Code Here

  /* (non-Javadoc)
   * @see org.wymiwyg.rdf.molecules.diff.MoleculeFactory#createMolecule()
   */
  public TerminalMolecule createMolecule() {
    return new SimpleTerminalMolecule();
  }
View Full Code Here

  private static void replaceInTerminalMolecules(Set<TerminalMolecule> terminalMolecules, Set<? extends Node> replacingNodes, FunctionallyGroundedNode newNode) {
    Set<TerminalMolecule> newTerminalMolecules = new HashSet<TerminalMolecule>();
    for (Iterator<TerminalMolecule> iter = terminalMolecules.iterator(); iter.hasNext();) {
      TerminalMolecule current = iter.next();
      try {
        SimpleTerminalMolecule newMolecule = new SimpleTerminalMolecule();
        newMolecule.addAll(GraphUtil.replaceNode(current, replacingNodes, newNode));
        newMolecule.markFinalized();
        iter.remove();
        newTerminalMolecules.add(newMolecule);
      } catch (SourceNodeNotFoundException e) {
        //nothing, did not remove
      }
View Full Code Here

   * @throws IOException
   */
  private TerminalMolecule getTerminalMoleculeFromPathNode(
      PathNode dirPathNode, String name) throws IOException {

    SimpleTerminalMolecule molecule = new SimpleTerminalMolecule();
    molecule.addAll(getTriplesFromPathNode(dirPathNode, name));
    molecule.markFinalized();
    return molecule;
  }
View Full Code Here

        }
        contextualMolecules = newContextualModelcules;
        Set<TerminalMolecule> newTerminalMolecules = new HashSet<TerminalMolecule>();
        for (TerminalMolecule terminalMolecule : terminalMolecules) {
          try {
            SimpleTerminalMolecule replacement = new SimpleTerminalMolecule();
            new GraphUtil<TerminalMolecule>()
                .replaceNode(terminalMolecule, orig, current,
                    replacement);
            replacement.markFinalized();
            newTerminalMolecules.add(replacement);
            nodeReplaced = true;
          } catch (SourceNodeNotFoundException e) {
            newTerminalMolecules.add(terminalMolecule);
            log.debug("source not found");
View Full Code Here

TOP

Related Classes of org.wymiwyg.rdf.molecules.impl.SimpleTerminalMolecule

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.