Package org.apache.any23.extractor.xpath
Class TemplateXPathExtractionRuleImpl
- java.lang.Object
-
- org.apache.any23.extractor.xpath.TemplateXPathExtractionRuleImpl
-
- All Implemented Interfaces:
TemplateXPathExtractionRule,XPathExtractionRule
public class TemplateXPathExtractionRuleImpl extends Object implements TemplateXPathExtractionRule
Default implementation ofXPathExtractionRule.- Author:
- Michele Mostarda (mostarda@fbk.eu)
-
-
Constructor Summary
Constructors Constructor Description TemplateXPathExtractionRuleImpl(String name, String uriRegex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptIRI(org.eclipse.rdf4j.model.IRI uri)Checks if the rule can be applied on the given document IRI.voidadd(QuadTemplate template)Adds aQuadTemplateto the rule.voidadd(Variable variable)Adds a variable to the template.StringgetName()StringgetUriRegex()voidprocess(Document in, ExtractionResult er)Processes this extraction rule on the given document.booleanremove(QuadTemplate template)Removes a quad template from the rule.booleanremove(Variable variable)Removes a variable from the template.StringtoString()
-
-
-
Method Detail
-
getUriRegex
public String getUriRegex()
- Returns:
- the regex pattern filtering the template pages.
-
add
public void add(Variable variable)
Description copied from interface:TemplateXPathExtractionRuleAdds a variable to the template.- Specified by:
addin interfaceTemplateXPathExtractionRule- Parameters:
variable- variable to be added.
-
remove
public boolean remove(Variable variable)
Description copied from interface:TemplateXPathExtractionRuleRemoves a variable from the template.- Specified by:
removein interfaceTemplateXPathExtractionRule- Parameters:
variable- variable to be removed.- Returns:
- true if the
variableargument was found.
-
add
public void add(QuadTemplate template)
Description copied from interface:TemplateXPathExtractionRuleAdds aQuadTemplateto the rule.- Specified by:
addin interfaceTemplateXPathExtractionRule- Parameters:
template- template instance to be added.
-
remove
public boolean remove(QuadTemplate template)
Description copied from interface:TemplateXPathExtractionRuleRemoves a quad template from the rule.- Specified by:
removein interfaceTemplateXPathExtractionRule- Parameters:
template- template to be removed.- Returns:
trueif thetemplateargument was found.
-
getName
public String getName()
- Specified by:
getNamein interfaceTemplateXPathExtractionRule- Specified by:
getNamein interfaceXPathExtractionRule- Returns:
- human readable description for this rule.
-
acceptIRI
public boolean acceptIRI(org.eclipse.rdf4j.model.IRI uri)
Description copied from interface:XPathExtractionRuleChecks if the rule can be applied on the given document IRI.- Specified by:
acceptIRIin interfaceXPathExtractionRule- Parameters:
uri- input document IRI.- Returns:
trueif applied,falseotherwise.
-
process
public void process(Document in, ExtractionResult er)
Description copied from interface:XPathExtractionRuleProcesses this extraction rule on the given document.- Specified by:
processin interfaceXPathExtractionRule- Parameters:
in- input document to be processed.er- output result writer.
-
-