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
,
ExtractionContext
TagSoupExtractionResult.PropertyPath, TagSoupExtractionResult.ResourceRoot
IssueReport.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 IssueReport
public Collection<IssueReport.Issue> getIssues()
getIssues
in interface IssueReport
public ExtractionResult openSubResult(ExtractionContext context)
openSubResult
in interface ExtractionResult
public 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 ExtractionResult
public void writeTriple(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o)
writeTriple
in interface ExtractionResult
public void writeNamespace(String prefix, String uri)
writeNamespace
in interface ExtractionResult
public void notifyIssue(IssueReport.IssueLevel level, String msg, int row, int col)
notifyIssue
in interface IssueReport
public void close()
close
in interface ExtractionResult
public void addResourceRoot(String[] path, org.openrdf.model.Resource root, Class<? extends MicroformatExtractor> extractor)
TagSoupExtractionResult
addResourceRoot
in interface TagSoupExtractionResult
path
- 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()
TagSoupExtractionResult
getResourceRoots
in interface TagSoupExtractionResult
TagSoupExtractionResult.ResourceRoot
s.public void addPropertyPath(Class<? extends MicroformatExtractor> extractor, org.openrdf.model.Resource propertySubject, org.openrdf.model.Resource property, org.openrdf.model.BNode object, String[] path)
TagSoupExtractionResult
addPropertyPath
in interface TagSoupExtractionResult
extractor
- 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()
TagSoupExtractionResult
getPropertyPaths
in interface TagSoupExtractionResult
Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.