001 /*
002 * The contents of this file are subject to the Mozilla Public License
003 * Version 1.1 (the "License"); you may not use this file except in
004 * compliance with the License. You may obtain a copy of the License at
005 * http://www.mozilla.org/MPL/
006 *
007 * Software distributed under the License is distributed on an "AS IS" basis,
008 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
009 * the specific language governing rights and limitations under the License.
010 *
011 * The Original Code is Protege-2000.
012 *
013 * The Initial Developer of the Original Code is Stanford University. Portions
014 * created by Stanford University are Copyright (C) 2007. All Rights Reserved.
015 *
016 * Protege was developed by Stanford Medical Informatics
017 * (http://www.smi.stanford.edu) at the Stanford University School of Medicine
018 * with support from the National Library of Medicine, the National Science
019 * Foundation, and the Defense Advanced Research Projects Agency. Current
020 * information about Protege can be obtained at http://protege.stanford.edu.
021 *
022 */
023
024 package edu.stanford.smi.protegex.owl.swrl.model;
025
026 import edu.stanford.smi.protegex.owl.swrl.parser.SWRLParseException;
027
028 import java.util.Set;
029
030 /**
031 * @author Martin O'Connor <moconnor@smi.stanford.edu>
032 * @author Holger Knublauch <holger@knublauch.com>
033 */
034 public interface SWRLImp extends SWRLIndividual
035 {
036 SWRLImp createClone();
037
038 /**
039 * Deletes this and all depending objects of the rule.
040 */
041 void deleteImp();
042 Set getReferencedInstances();
043 SWRLAtomList getBody();
044 void setBody(SWRLAtomList swrlAtomList);
045 SWRLAtomList getHead();
046 void setHead(SWRLAtomList swrlAtomList);
047
048 /**
049 * Tries to parse the given text to create head and body
050 * of this Imp. This will replace the old content.
051 * This method can be used to implement editing of existing
052 * rules without deleting them.
053 *
054 * @param parsableText a SWRL expression
055 */
056 void setExpression(String parsableText) throws SWRLParseException;
057
058 // Annotation-driven methods
059 boolean isEnabled();
060 void enable();
061 void disable();
062
063 Set<String> getRuleGroupNames();
064 boolean addRuleGroup(String name); // Return true on successful addition
065 boolean removeRuleGroup(String name); // Return true on successful deletion
066 boolean isInRuleGroups(Set<String> names);
067 boolean isInRuleGroup(String name);
068
069 } // SWRLImp
070
071