[
https://issues.apache.org/jira/browse/ANY23-291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16358993#comment-16358993
]
ASF GitHub Bot commented on ANY23-291:
--------------------------------------
Github user ferrerod commented on the issue:
https://github.com/apache/any23/pull/60
My Java skills may be quite rusty, hence the 3 year old JDK. Looking at
implementation of method run(.., Document in, ExtractionResult out) in
`EmbeddedJSONLDExtractor.java`, I see a couple things that puzzle me and if you
have time to explain I'd be grateful:
1. I do NOT see anywhere in EmbeddedJSONLDExtractor.java where 'out' is
being written to. Why is that?
2. // the results of this method are never used?
`jsonldScripts = extractJSONLDScript(in, baseProfile, ..., out);`
3. //the inner class JSONLDScript takes 3 parameters in the initializer but
only assigns xpath to an instance variable but the other two (IRI name, String
content) are never assigned to the instance. Is this intended / correct?
` public JSONLDScript(String xpath, IRI name, String content) {
this.xpath = xpath;
}
`
> JSON-LD should be looked up in entire HTML document, not just in <head>
> -----------------------------------------------------------------------
>
> Key: ANY23-291
> URL: https://issues.apache.org/jira/browse/ANY23-291
> Project: Apache Any23
> Issue Type: Improvement
> Components: extractors
> Affects Versions: 1.2
> Reporter: Thomas Francart
> Assignee: Hans Brende
> Priority: Minor
> Fix For: 2.2
>
> Attachments: example-embedded-jsonld.html
>
>
> In
> org.apache.any23.extractor.html.EmbeddedJSONLDExtractor.extractJSONLDScript(),
> I think this line :
> List<Node> scriptNodes = DomUtils.findAll(in, "/HTML/HEAD/SCRIPT");
> is too restrictive. scripts containing json-ld can be placed anywhere in the
> page, and actually some CMS/Wordpress plugin inserting JSON-LD are generating
> their output in the body, not in the head.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)