Package org.jrdf.graph.global.molecule

Examples of org.jrdf.graph.global.molecule.Molecule


        boolean skip = false;
        int i1 = 0, i2;
        while (i1 < length && length > 1) {
            i2 = i1 + 1;
            while (i2 < length) {
                Molecule m1 = moleculeArray.get(i1);
                Molecule m2 = moleculeArray.get(i2);
                Map<BlankNode, BlankNode> map = mapper.createMap(m1, m2);
                Molecule molecule = localMerger.merge(m1, m2, map);
                //map.clear();
                if (molecule != null) {
                    moleculeArray.remove(m1);
                    moleculeArray.remove(m2);
                    moleculeArray.add(molecule);
View Full Code Here


    // TODO if a sub molecule is to be returned, the isTopLevel field isn't correctly set when creating the molecule.
    // TODO Maybe get the top-level molecule and return the subMolecule?
    private Molecule reconstructMolecule(Molecule parentMolecule, Long pid, Long mid) throws GraphException {
        Triple[] roots = iteratorAsTriples(readableIndex.findTriplesForMid(pid, mid));
        Map<BlankNode, Triple> rootTripleMap = getBNodeToRootMap(parentMolecule);
        Molecule molecule = new MoleculeImpl(moleculeComparator, roots);
        molecule = createSubMolecules(mid, molecule);
        if (null == parentMolecule) {
            return molecule;
        } else {
            Triple linkingTriple = findLinkingTriple(parentMolecule, roots, rootTripleMap, molecule);
View Full Code Here

        ClosableIterator<Long> iterator = readableIndex.findMoleculeIDs(tripleAsLongs);
        try {
            while (iterator.hasNext()) {
                final Long mid = iterator.next();
                if (readableIndex.isSubmoleculeOfParentID(1L, mid)) {
                    Molecule m = handler.createMolecule(1L, mid);
                    if (m != null && moleculeComparator.compare(molecule, m) == 0) {
                        AddMoleculeToIndex amti = new AddMoleculeToIndex(writableIndex, localizer);
                        amti.handleTriple(rootTriple);
                        return molecule.add(rootTriple);
                    }
View Full Code Here

        ClosableIterator<Long> iterator = readableIndex.findMoleculeIDs(tripleAsLongs);
        try {
            while (iterator.hasNext()) {
                Long aLong = iterator.next();
                if (readableIndex.isSubmoleculeOfParentID(1L, aLong)) {
                    Molecule m = handler.createMolecule(1L, aLong);
                    if (m != null && moleculeComparator.compare(molecule, m) == 0) {
                        return removeSubMolecules(molecule, rootTriple, tripleAsLongs, aLong);
                    }
                }
            }
View Full Code Here

        try {
            ClosableIterator<Molecule> iterator = iterator();
            try {
                MoleculeHandler tmpHandler = new MoleculeToText(builder, localizer.getLocalizer());
                while (iterator.hasNext()) {
                    Molecule molecule = iterator.next();
                    traverser.traverse(molecule, tmpHandler);
                }
                return builder.toString();
            } finally {
                iterator.close();
View Full Code Here

TOP

Related Classes of org.jrdf.graph.global.molecule.Molecule

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.