Interface Ontology

All Superinterfaces:
ImmutableRuleSet, Iterable<Rule>, RuleSet
All Known Implementing Classes:
DefaultOntology

public interface Ontology extends RuleSet
The Ontology interface is a way to manage set of rules, constraints and predicates (i.e. vocabulary).
Author:
Clément Sipieter (INRIA) <clement@6pi.fr>
  • Method Details

    • getRuleNames

      Set<String> getRuleNames()
      Returns the names of the rules stored in this ontology.
      Returns:
      the rule names
    • getRule

      Rule getRule(String name)
      Retrieves a rule by its name.
      Parameters:
      name - the rule name
      Returns:
      the matching rule, or null if none exists
    • getNegativeConstraintNames

      Set<String> getNegativeConstraintNames()
      Returns the names of the negative constraints stored in this ontology.
      Returns:
      the negative constraint names
    • getNegativeConstraint

      NegativeConstraint getNegativeConstraint(String name)
      Retrieves a negative constraint by its name.
      Parameters:
      name - the negative constraint name
      Returns:
      the matching negative constraint, or null if none exists
    • add

      boolean add(Rule rule)
      Description copied from interface: RuleSet
      Adds a rule to this set.
      Specified by:
      add in interface RuleSet
      Parameters:
      rule - the rule to add
      Returns:
      true if this set changed as a result of the call
    • addAll

      boolean addAll(Iterator<Rule> ruleIterator)
      Description copied from interface: RuleSet
      Adds all rules provided by the specified iterator.
      Specified by:
      addAll in interface RuleSet
      Parameters:
      ruleIterator - the rules to add
      Returns:
      true if this set changed as a result of the call
    • addAll

      boolean addAll(CloseableIterator<Rule> ruleIterator) throws RuleSetException
      Description copied from interface: RuleSet
      Adds all rules provided by the specified closeable iterator.
      Specified by:
      addAll in interface RuleSet
      Parameters:
      ruleIterator - the rules to add
      Returns:
      true if this set changed as a result of the call
      Throws:
      RuleSetException - if the iteration fails
    • remove

      boolean remove(Rule rule)
      Description copied from interface: RuleSet
      Removes a rule from this set.
      Specified by:
      remove in interface RuleSet
      Parameters:
      rule - the rule to remove
      Returns:
      true if this set changed as a result of the call
    • removeAll

      boolean removeAll(Iterator<Rule> ruleIterator)
      Description copied from interface: RuleSet
      Removes all rules provided by the specified iterator.
      Specified by:
      removeAll in interface RuleSet
      Parameters:
      ruleIterator - the rules to remove
      Returns:
      true if this set changed as a result of the call
    • removeAll

      boolean removeAll(CloseableIterator<Rule> ruleIterator) throws RuleSetException
      Description copied from interface: RuleSet
      Removes all rules provided by the specified closeable iterator.
      Specified by:
      removeAll in interface RuleSet
      Parameters:
      ruleIterator - the rules to remove
      Returns:
      true if this set changed as a result of the call
      Throws:
      RuleSetException - if the iteration fails
    • contains

      boolean contains(Rule rule)
      Description copied from interface: ImmutableRuleSet
      Returns whether the specified rule is present in this set.
      Specified by:
      contains in interface ImmutableRuleSet
      Specified by:
      contains in interface RuleSet
      Parameters:
      rule - the rule to search for
      Returns:
      true if the rule is present
    • size

      int size()
      Description copied from interface: ImmutableRuleSet
      Returns the number of rules contained in this set.
      Specified by:
      size in interface ImmutableRuleSet
      Specified by:
      size in interface RuleSet
      Returns:
      the number of rules contained in this set.
    • iterator

      Iterator<Rule> iterator()
      Specified by:
      iterator in interface ImmutableRuleSet
      Specified by:
      iterator in interface Iterable<Rule>
      Specified by:
      iterator in interface RuleSet
    • getVocabulary

      Set<Predicate> getVocabulary()
      Returns the vocabulary used by this ontology.
      Returns:
      a set of all predicates related to this ontology