Class DefaultConjunctiveQueryWithNegatedParts
java.lang.Object
fr.lirmm.graphik.integraal.core.DefaultConjunctiveQueryWithNegatedParts
- All Implemented Interfaces:
ConjunctiveQueryWithNegatedParts, Query
public class DefaultConjunctiveQueryWithNegatedParts
extends Object
implements ConjunctiveQueryWithNegatedParts
Default implementation of a conjunctive query with explicit negated parts.
- Author:
- Clément Sipieter (INRIA) <clement@6pi.fr>
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a copy of the specified query with negated parts.DefaultConjunctiveQueryWithNegatedParts(InMemoryAtomSet positiveAtomSet, List<InMemoryAtomSet> negatedParts) Creates a query with negated parts and infers the answer variables from the positive part.DefaultConjunctiveQueryWithNegatedParts(InMemoryAtomSet positiveAtomSet, List<InMemoryAtomSet> negatedParts, List<Term> ans) Creates a query with negated parts and explicit answer variables.DefaultConjunctiveQueryWithNegatedParts(String label, InMemoryAtomSet positiveAtomSet, List<InMemoryAtomSet> negatedParts) Creates a labeled query with negated parts and infers answer variables from the positive part.DefaultConjunctiveQueryWithNegatedParts(String label, InMemoryAtomSet positiveAtomSet, List<InMemoryAtomSet> negatedParts, List<Term> ans) Creates a labeled query with negated parts and explicit answer variables. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanCompares this query with another one by identity.booleanReturns the answer variables of the query.getLabel()The label (the name) for this query.Get the set of facts which must be false (at least one).Get the set of facts which must be true.booleanReturns whether the query expects a boolean answer.voidSets the query label.toString()
-
Constructor Details
-
DefaultConjunctiveQueryWithNegatedParts
public DefaultConjunctiveQueryWithNegatedParts(InMemoryAtomSet positiveAtomSet, List<InMemoryAtomSet> negatedParts) Creates a query with negated parts and infers the answer variables from the positive part.- Parameters:
positiveAtomSet- the positive query bodynegatedParts- the negated query parts
-
DefaultConjunctiveQueryWithNegatedParts
public DefaultConjunctiveQueryWithNegatedParts(String label, InMemoryAtomSet positiveAtomSet, List<InMemoryAtomSet> negatedParts) Creates a labeled query with negated parts and infers answer variables from the positive part.- Parameters:
label- the query labelpositiveAtomSet- the positive query bodynegatedParts- the negated query parts
-
DefaultConjunctiveQueryWithNegatedParts
public DefaultConjunctiveQueryWithNegatedParts(InMemoryAtomSet positiveAtomSet, List<InMemoryAtomSet> negatedParts, List<Term> ans) Creates a query with negated parts and explicit answer variables.- Parameters:
positiveAtomSet- the positive query bodynegatedParts- the negated query partsans- the answer variables
-
DefaultConjunctiveQueryWithNegatedParts
public DefaultConjunctiveQueryWithNegatedParts(String label, InMemoryAtomSet positiveAtomSet, List<InMemoryAtomSet> negatedParts, List<Term> ans) Creates a labeled query with negated parts and explicit answer variables.- Parameters:
label- the name of this querypositiveAtomSet- the positive part of the conjunction of atoms representing the querynegatedParts- a list of negated conjunctions of atomsans- the list of answer variables
-
DefaultConjunctiveQueryWithNegatedParts
Creates a copy of the specified query with negated parts.- Parameters:
query- the query to copy
-
-
Method Details
-
getLabel
Description copied from interface:ConjunctiveQueryWithNegatedPartsThe label (the name) for this query.- Specified by:
getLabelin interfaceConjunctiveQueryWithNegatedParts- Specified by:
getLabelin interfaceQuery- Returns:
- the label of this query.
-
setLabel
-
getPositivePart
Description copied from interface:ConjunctiveQueryWithNegatedPartsGet the set of facts which must be true.- Specified by:
getPositivePartin interfaceConjunctiveQueryWithNegatedParts- Returns:
- an atom set representing the atom conjunction of the query.
-
getNegatedParts
Description copied from interface:ConjunctiveQueryWithNegatedPartsGet the set of facts which must be false (at least one).- Specified by:
getNegatedPartsin interfaceConjunctiveQueryWithNegatedParts- Returns:
- a list of atom sets representing negated conjunctions of atoms.
-
getAnswerVariables
Returns the answer variables of the query.- Specified by:
getAnswerVariablesin interfaceConjunctiveQueryWithNegatedParts- Returns:
- an Collection of Term representing the answer variables.
-
isBoolean
-
toString
-
appendTo
-
equals
-
equals
Compares this query with another one by identity.- Parameters:
other- the query to compare with- Returns:
- true if both references are identical
-