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 TemplateGraph
getGraph()
TemplateObject
getObject()
TemplatePredicate
getPredicate()
TemplateSubject
getSubject()
void
printOut(ExtractionResult er, Map<String,String> variableAssignment)
Prints out this quad template in the givenExtractionResult
, using the passed variableAssignment to expand variables.String
toString()
-
-
-
Constructor Detail
-
QuadTemplate
public QuadTemplate(TemplateSubject subject, TemplatePredicate predicate, TemplateObject object, TemplateGraph graph)
Constructor.- Parameters:
subject
- notnull
subject template.predicate
- notnull
predicate template.object
- notnull
object template.graph
- graph template, can benull
.
-
QuadTemplate
public QuadTemplate(TemplateSubject subject, TemplatePredicate predicate, TemplateObject object)
Constructor for template with no graph.- Parameters:
subject
- a populatedTemplateSubject
predicate
- a populatedTemplatePredicate
object
- 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.
-
-