Skip to content

2.4 XPathLearner

Ricardo Usbeck edited this page Jul 7, 2014 · 1 revision

Introduction

The XPathLearner step generates a set of pairs of XPath expressions from a set of pairs of positive values (annotations from RDF triples). XPathLearner also provides a method for applying pairs of XPath expressions and to generate new extracted values.

Parameters

XPathLearner provides two methods, getXPathExpressions and getExtractionResults. The first method generates a a set of XPath expressions from:

  • Set<Pair<Resoure,Resource>> posExamples: a set of pairs, each pair contains a string for subject and a string for object.
  • URL Domain: the domain URL that contains the HTML pages.
  • @return: This method returns a set of pairs of XPath expressions, that extracts subject and object in all the pages.

The second method generates a a set of ExtractionResults from:

  • List<Pair<XPathRule,XPathRule>> expressions: a list of pairs of XPath expressions, that extracts subject and object in all the pages.
  • URL Domain: the domain URL that contains the HTML pages.
  • @return: This method returns a set of ExtractionResult, these instances contain the extracted values of a pair of XPath expressions in a page.
public interface XPathLearner {
	
        public Set<ExtractionResult> getExtractionResults(List<Pair<XPathRule, XPathRule>> expressions, URL domain);
        public List<Pair<XPathRule, XPathRule>> getXPathExpressions(Set<Pair<Resource, Resource>> posExamples, URL Domain)
	
}

Implementation

An implementation can be found in the XPathLearnerImpl.java.

You can’t perform that action at this time.