org.apache.any23.extractor.xpath
Class QuadTemplate

java.lang.Object
  extended by 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
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
 TemplateGraph getGraph()
           
 TemplateObject getObject()
           
 TemplatePredicate getPredicate()
           
 TemplateSubject getSubject()
           
 void printOut(ExtractionResult er, Map<String,String> variableAssignment)
          Prints out this quad template in the given ExtractionResult, using the passed variableAssignment to expand variables.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QuadTemplate

public QuadTemplate(TemplateSubject subject,
                    TemplatePredicate predicate,
                    TemplateObject object,
                    TemplateGraph graph)
Constructor.

Parameters:
subject - not null subject template.
predicate - not null predicate template.
object - not null object template.
graph - graph template, can be null.

QuadTemplate

public QuadTemplate(TemplateSubject subject,
                    TemplatePredicate predicate,
                    TemplateObject object)
Constructor for template with no graph.

Parameters:
subject -
predicate -
object -
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 given ExtractionResult, 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.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.