public class ExtractionResultImpl extends Object implements TagSoupExtractionResult
ExtractionResult; it receives
extraction output from one Extractor working on one document,
and passes the output on to a TripleHandler. It deals with
details such as creation of ExtractionContext objects
and closing any open contexts at the end of extraction.
The close() method must be invoked after the extractor has
finished processing.
There is usually no need to provide additional implementations
of the ExtractionWriter interface.
TripleHandler,
ExtractionContextTagSoupExtractionResult.PropertyPath, TagSoupExtractionResult.ResourceRootIssueReport.Issue, IssueReport.IssueLevel| Constructor and Description |
|---|
ExtractionResultImpl(ExtractionContext context,
Extractor<?> extractor,
TripleHandler tripleHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyPath(Class<? extends MicroformatExtractor> extractor,
org.openrdf.model.Resource propertySubject,
org.openrdf.model.Resource property,
org.openrdf.model.BNode object,
String[] path)
Adds a property path to the list of the extracted data.
|
void |
addResourceRoot(String[] path,
org.openrdf.model.Resource root,
Class<? extends MicroformatExtractor> extractor)
Adds a root property to the extraction result, specifying also
the path corresponding to the root of data which generated the property
and the extractor responsible for such addition.
|
void |
close() |
ExtractionContext |
getExtractionContext() |
Collection<IssueReport.Issue> |
getIssues() |
int |
getIssuesCount() |
List<TagSoupExtractionResult.PropertyPath> |
getPropertyPaths()
Returns all the collected property paths.
|
List<TagSoupExtractionResult.ResourceRoot> |
getResourceRoots()
Returns all the collected property roots.
|
boolean |
hasIssues() |
void |
notifyIssue(IssueReport.IssueLevel level,
String msg,
int row,
int col) |
ExtractionResult |
openSubResult(ExtractionContext context) |
void |
printReport(PrintStream ps) |
String |
toString() |
void |
writeNamespace(String prefix,
String uri) |
void |
writeTriple(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o) |
void |
writeTriple(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.URI g) |
public ExtractionResultImpl(ExtractionContext context, Extractor<?> extractor, TripleHandler tripleHandler)
public boolean hasIssues()
public int getIssuesCount()
public void printReport(PrintStream ps)
printReport in interface IssueReportpublic Collection<IssueReport.Issue> getIssues()
getIssues in interface IssueReportpublic ExtractionResult openSubResult(ExtractionContext context)
openSubResult in interface ExtractionResultpublic ExtractionContext getExtractionContext()
public void writeTriple(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.URI g)
writeTriple in interface ExtractionResultpublic void writeTriple(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o)
writeTriple in interface ExtractionResultpublic void writeNamespace(String prefix, String uri)
writeNamespace in interface ExtractionResultpublic void notifyIssue(IssueReport.IssueLevel level, String msg, int row, int col)
notifyIssue in interface IssueReportpublic void close()
close in interface ExtractionResultpublic void addResourceRoot(String[] path, org.openrdf.model.Resource root, Class<? extends MicroformatExtractor> extractor)
TagSoupExtractionResultaddResourceRoot in interface TagSoupExtractionResultpath - the path from the document root to the local root of the data generating the property.root - the property root node.extractor - the extractor responsible of such extraction.public List<TagSoupExtractionResult.ResourceRoot> getResourceRoots()
TagSoupExtractionResultgetResourceRoots in interface TagSoupExtractionResultTagSoupExtractionResult.ResourceRoots.public void addPropertyPath(Class<? extends MicroformatExtractor> extractor, org.openrdf.model.Resource propertySubject, org.openrdf.model.Resource property, org.openrdf.model.BNode object, String[] path)
TagSoupExtractionResultaddPropertyPath in interface TagSoupExtractionResultextractor - the identifier of the extractor responsible for retrieving such property.propertySubject - the subject of the property.property - the property URI.object - the property object if any, null otherwise.path - the path of the HTML node from which the property literal has been extracted.public List<TagSoupExtractionResult.PropertyPath> getPropertyPaths()
TagSoupExtractionResultgetPropertyPaths in interface TagSoupExtractionResultCopyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.