Class DefaultOntology
java.lang.Object
fr.lirmm.graphik.integraal.core.ruleset.DefaultOntology
- All Implemented Interfaces:
ImmutableRuleSet, Ontology, RuleSet, Iterable<Rule>
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty ontology.DefaultOntology(RuleSet rules) Creates an ontology initialized with the rules from the provided rule set.DefaultOntology(CloseableIterator<Object> parser) Creates an ontology from parser output filtered down to rules. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds a rule to this set.booleanaddAll(CloseableIterator<Rule> ruleIterator) Adds all rules provided by the specified closeable iterator.booleanAdds all rules provided by the specified iterator.booleanReturns whether the specified rule is present in this set.getNegativeConstraint(String name) Retrieves a negative constraint by its name.Returns the names of the negative constraints stored in this ontology.Retrieves a rule by its name.Returns the names of the rules stored in this ontology.Returns the vocabulary used by this ontology.booleanisEmpty()Returns whether this set contains no rule.iterator()booleanRemoves a rule from this set.booleanremoveAll(CloseableIterator<Rule> ruleIterator) Removes all rules provided by the specified closeable iterator.booleanRemoves all rules provided by the specified iterator.intsize()Returns the number of rules contained in this set.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
DefaultOntology
public DefaultOntology()Creates an empty ontology. -
DefaultOntology
Creates an ontology initialized with the rules from the provided rule set.- Parameters:
rules- the rules to import
-
DefaultOntology
Creates an ontology from parser output filtered down to rules.- Parameters:
parser- the parser iterator- Throws:
RuleSetException- if the parser output cannot be consumed as rules
-
-
Method Details
-
getRuleNames
Description copied from interface:OntologyReturns the names of the rules stored in this ontology.- Specified by:
getRuleNamesin interfaceOntology- Returns:
- the rule names
-
getRule
-
getNegativeConstraintNames
Description copied from interface:OntologyReturns the names of the negative constraints stored in this ontology.- Specified by:
getNegativeConstraintNamesin interfaceOntology- Returns:
- the negative constraint names
-
getNegativeConstraint
Description copied from interface:OntologyRetrieves a negative constraint by its name.- Specified by:
getNegativeConstraintin interfaceOntology- Parameters:
name- the negative constraint name- Returns:
- the matching negative constraint, or
nullif none exists
-
add
-
addAll
Description copied from interface:RuleSetAdds all rules provided by the specified iterator. -
addAll
Description copied from interface:RuleSetAdds all rules provided by the specified closeable iterator.- Specified by:
addAllin interfaceOntology- Specified by:
addAllin interfaceRuleSet- 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
-
removeAll
Description copied from interface:RuleSetRemoves all rules provided by the specified iterator. -
removeAll
Description copied from interface:RuleSetRemoves all rules provided by the specified closeable iterator.- Specified by:
removeAllin interfaceOntology- Specified by:
removeAllin interfaceRuleSet- 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
Description copied from interface:ImmutableRuleSetReturns whether the specified rule is present in this set. -
size
public int size()Description copied from interface:ImmutableRuleSetReturns the number of rules contained in this set. -
iterator
-
getVocabulary
Description copied from interface:OntologyReturns the vocabulary used by this ontology.- Specified by:
getVocabularyin interfaceOntology- Returns:
- a set of all predicates related to this ontology
-
isEmpty
public boolean isEmpty()Description copied from interface:ImmutableRuleSetReturns whether this set contains no rule.- Specified by:
isEmptyin interfaceImmutableRuleSet- Specified by:
isEmptyin interfaceRuleSet- Returns:
- true if this set is empty
-