Class LDJsonParseFilter
- java.lang.Object
-
- com.digitalpebble.stormcrawler.util.AbstractConfigurable
-
- com.digitalpebble.stormcrawler.parse.ParseFilter
-
- com.digitalpebble.stormcrawler.parse.filter.LDJsonParseFilter
-
- All Implemented Interfaces:
Configurable
public class LDJsonParseFilter extends ParseFilter
Extracts data from JSON-LD representation (https://json-ld.org/)
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Logger
LOG
-
Constructor Summary
Constructors Constructor Description LDJsonParseFilter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(@NotNull Map<String,Object> stormConf, @NotNull com.fasterxml.jackson.databind.JsonNode filterParams)
Called when this filter is being initializedvoid
filter(String URL, byte[] content, DocumentFragment doc, ParseResult parse)
Called when parsing a specific pagestatic com.fasterxml.jackson.databind.JsonNode
filterJson(DocumentFragment doc)
boolean
needsDOM()
Specifies whether this filter requires a DOM representation of the document-
Methods inherited from class com.digitalpebble.stormcrawler.util.AbstractConfigurable
configure, getName
-
-
-
-
Method Detail
-
filter
public void filter(String URL, byte[] content, DocumentFragment doc, ParseResult parse)
Description copied from class:ParseFilter
Called when parsing a specific page- Specified by:
filter
in classParseFilter
- Parameters:
URL
- the URL of the page being parsedcontent
- the content being parseddoc
- the DOM tree resulting of the parsing of the content or null ifParseFilter.needsDOM()
returnsfalse
parse
- the metadata to be updated with the resulting of the parsing
-
filterJson
public static com.fasterxml.jackson.databind.JsonNode filterJson(DocumentFragment doc) throws Exception
- Throws:
Exception
-
configure
public void configure(@NotNull @NotNull Map<String,Object> stormConf, @NotNull @NotNull com.fasterxml.jackson.databind.JsonNode filterParams)
Description copied from interface:Configurable
Called when this filter is being initialized- Parameters:
stormConf
- The Storm configuration used for the configurablefilterParams
- the filter specific configuration. Never null
-
needsDOM
public boolean needsDOM()
Description copied from class:ParseFilter
Specifies whether this filter requires a DOM representation of the document- Overrides:
needsDOM
in classParseFilter
- Returns:
true
if this needs a DOM representation of the document,false
otherwise.
-
-