Package net.fortytwo.ripple.query.commands

Source Code of net.fortytwo.ripple.query.commands.UndefineListCmd

package net.fortytwo.ripple.query.commands;

import net.fortytwo.ripple.RippleException;
import net.fortytwo.ripple.model.ModelConnection;
import net.fortytwo.ripple.model.RDFValue;
import net.fortytwo.ripple.query.Command;
import net.fortytwo.ripple.query.QueryEngine;

/**
* @author Joshua Shinavier (http://fortytwo.net)
*/
public class UndefineListCmd extends Command {
    private final String term;

    public UndefineListCmd(final String term) {
        this.term = term;
    }

    public void execute(final QueryEngine qe, final ModelConnection mc)
            throws RippleException {
        RDFValue uri = mc.valueOf(java.net.URI.create(qe.getLexicon().getDefaultNamespace() + term));
//System.out.println("uri = " + uri);
        mc.remove(uri, null, null);
        mc.commit();
        mc.getModel().getSpecialValues().remove(uri.sesameValue());
    }

    public String getName() {
        return "unlist";
    }

    protected void abort() {
    }
}
TOP

Related Classes of net.fortytwo.ripple.query.commands.UndefineListCmd

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.