Class AlgebraicRewriter
- java.lang.Object
-
- org.aksw.limes.core.execution.rewriter.Rewriter
-
- org.aksw.limes.core.execution.rewriter.AlgebraicRewriter
-
- All Implemented Interfaces:
IRewriter
public class AlgebraicRewriter extends Rewriter
Implements the algebraic rewriter class. The idea is that the rewriter gets as input a link specification returns an equivalent yet probably more time-efficient link specification.- Version:
- 1.0
- Author:
- Axel-C. Ngonga Ngomo (ngonga@informatik.uni-leipzig.de)
-
-
Constructor Summary
Constructors Constructor Description AlgebraicRewriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LinkSpecificationcollapseSpec(LinkSpecification spec)Collapses a spec by making use of the dependencies within the specification.LinkSpecificationcomputeAllDependencies(LinkSpecification spec)Updates all dependencies within a specification.LinkSpecificationcomputeAtomicDependencies(LinkSpecification spec)Computes all atomic dependencies within a link specification.LinkSpecificationcomputeAtomicDependency(LinkSpecification source, LinkSpecification target)Checks whether source depends on target, i.e., whether the mapping generated by source is a subset of the mapping generated by target.LinkSpecificationcomputeNonAtomicDependencies(LinkSpecification spec)Updates the non-atomic dependencies of a link specification.StringgetMeasure(LinkSpecification spec)Returns the measure used in the specification.List<String>getProperties(LinkSpecification spec)Returns the properties that are used for the comparison.LinkSpecificationremoveDuplicates(LinkSpecification spec)Removes duplicated specifications from specification.LinkSpecificationremoveUnaryOperators(LinkSpecification spec)Removes unary operators from a specification.LinkSpecificationrewrite(LinkSpecification spec)Rewrites a Link Specification.LinkSpecificationupdateThresholds(LinkSpecification spec)Updates the thresholds within the input link specification.
-
-
-
Method Detail
-
rewrite
public LinkSpecification rewrite(LinkSpecification spec)
Rewrites a Link Specification. The idea is that the rewriter gets as input a link specification returns an equivalent yet probably more time-efficient link specification.- Parameters:
spec- , Input link specification- Returns:
- the input link specification.
-
updateThresholds
public LinkSpecification updateThresholds(LinkSpecification spec)
Updates the thresholds within the input link specification.- Parameters:
spec- , The input link specification- Returns:
- Return spec with updated weights
-
removeDuplicates
public LinkSpecification removeDuplicates(LinkSpecification spec)
Removes duplicated specifications from specification.- Parameters:
spec- , The input link specification- Returns:
- spec, de-duplicated specification
-
removeUnaryOperators
public LinkSpecification removeUnaryOperators(LinkSpecification spec)
Removes unary operators from a specification.- Parameters:
spec- , The input link specification- Returns:
- Cleaned up spec
-
computeAtomicDependency
public LinkSpecification computeAtomicDependency(LinkSpecification source, LinkSpecification target)
Checks whether source depends on target, i.e., whether the mapping generated by source is a subset of the mapping generated by target. Returns 0 if no dependency is found, 1 if target is included in source, -1 if source is included in target and +2 if they are equivalent.- Parameters:
source- Source link spectarget- Target link spec- Returns:
- -1, 0, +1 or +2
-
getProperties
public List<String> getProperties(LinkSpecification spec)
Returns the properties that are used for the comparison. Only works for atomic specifications.- Parameters:
spec- , The input specification- Returns:
- List of properties used in the specification
-
getMeasure
public String getMeasure(LinkSpecification spec)
Returns the measure used in the specification.- Parameters:
spec- , The input specification- Returns:
- Measure used in the specification, null if the specification is not atomic
-
computeAllDependencies
public LinkSpecification computeAllDependencies(LinkSpecification spec)
Updates all dependencies within a specification.- Parameters:
spec- , The input specification- Returns:
- spec, with all dependencies updated
-
computeNonAtomicDependencies
public LinkSpecification computeNonAtomicDependencies(LinkSpecification spec)
Updates the non-atomic dependencies of a link specification.- Parameters:
spec- , The input specification- Returns:
- spec, updated specification with non-atomic dependencies
-
computeAtomicDependencies
public LinkSpecification computeAtomicDependencies(LinkSpecification spec)
Computes all atomic dependencies within a link specification.- Parameters:
spec- , The input specification- Returns:
- spec, updated specification with atomic dependencies
-
collapseSpec
public LinkSpecification collapseSpec(LinkSpecification spec)
Collapses a spec by making use of the dependencies within the specification.- Parameters:
spec- , The input specification- Returns:
- Collapsed spec, i.e., specification where dependencies have been removed
-
-