org.activemath.content.mediator.rewriter
Class MappingPattern
java.lang.Object
org.activemath.content.mediator.rewriter.MappingPattern
public class MappingPattern
- extends Object
A MappingPattern consist of a MatchingPattern, which should
match with a given query and a Set of ReplacementPatterns which
are proceeded to the given query. If there are n ReplacementPatterns,
applying the MappingPattern to a query will give us n mapped queries.
We allow only one RelationRestriction for the MappingPattern, because
more than one makes no sense (because we do not know what to do
with the different IDs behind the relations). But for the
ReplacementPatterns we allow more than one. We need at least one
relation-replacement-restriction if we have a matching-relation-restr. And
if there is no matching relation restr., we do not allow any replacement
relation restriction.
Only one PlaceholderPropertyRestriction is allowed for each pattern. A
PlaceholderPropertyRestriction looks like "type=*" and matches for
each property constraint which specifies the property "type". (In the xml
mapping file there is no exp_value specified.)
Mind that "a mapping pattern consists of two patterns" and not "a mapping pattern
is a special pattern" holds!
|
Field Summary |
protected static boolean |
DEBUG
|
DEBUG
protected static final boolean DEBUG
MappingPattern
public MappingPattern(org.jdom.Element patternE)
throws MappingParseException
- Throws:
MappingParseException
isApplicableTo
public boolean isApplicableTo(KBQuery kbQuery)
- Returns whether the MappingPattern is applicable to the given
KBQuery. This is the case, if the queries classcontraints contains all
classes of the patterns class restriction _and_ the same with
relation- and property-constraints.
- Parameters:
kbQuery - the query to check for
- Returns:
- whether the mappingpattern is applicable to the given query.
toString
public String toString()
- Overrides:
toString in class Object
getMatchingPattern
public Pattern getMatchingPattern()
getReplacementPatterns
public Set getReplacementPatterns()