Package org.apache.any23.extractor.xpath
Class QuadTemplate
- java.lang.Object
-
- org.apache.any23.extractor.xpath.QuadTemplate
-
public class QuadTemplate extends Object
This class models a NQuads template, that is a quadruple in which any component can be a variable.- Author:
- Michele Mostarda (mostarda@fbk.eu)
-
-
Constructor Summary
Constructors Constructor Description QuadTemplate(TemplateSubject subject, TemplatePredicate predicate, TemplateObject object)Constructor for template with no graph.QuadTemplate(TemplateSubject subject, TemplatePredicate predicate, TemplateObject object, TemplateGraph graph)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TemplateGraphgetGraph()TemplateObjectgetObject()TemplatePredicategetPredicate()TemplateSubjectgetSubject()voidprintOut(ExtractionResult er, Map<String,String> variableAssignment)Prints out this quad template in the givenExtractionResult, using the passed variableAssignment to expand variables.StringtoString()
-
-
-
Constructor Detail
-
QuadTemplate
public QuadTemplate(TemplateSubject subject, TemplatePredicate predicate, TemplateObject object, TemplateGraph graph)
Constructor.- Parameters:
subject- notnullsubject template.predicate- notnullpredicate template.object- notnullobject template.graph- graph template, can benull.
-
QuadTemplate
public QuadTemplate(TemplateSubject subject, TemplatePredicate predicate, TemplateObject object)
Constructor for template with no graph.- Parameters:
subject- a populatedTemplateSubjectpredicate- a populatedTemplatePredicateobject- a populatedTemplateObject
-
-
Method Detail
-
getSubject
public TemplateSubject getSubject()
- Returns:
- the template subject.
-
getPredicate
public TemplatePredicate getPredicate()
- Returns:
- the template predicate.
-
getObject
public TemplateObject getObject()
- Returns:
- the template object.
-
getGraph
public TemplateGraph getGraph()
- Returns:
- the template graph, can be
null.
-
printOut
public void printOut(ExtractionResult er, Map<String,String> variableAssignment)
Prints out this quad template in the givenExtractionResult, using the passed variableAssignment to expand variables.- Parameters:
er- extraction result instance on which write the quad produced by this template.variableAssignment- the assignment used to expand variables.
-
-