Skip to content

Commit

Permalink
Merge pull request #4413 from inception-project/bugfix/4412-PMC-searc…
Browse files Browse the repository at this point in the history
…h-returns-some-results-that-cannot-be-imported

#4412 - PMC search returns some results that cannot be imported
  • Loading branch information
reckart authored Dec 28, 2023
2 parents 3b71116 + 1e9a669 commit c2a8943
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public List<ExternalSearchResult> executeQuery(DocumentRepository aDocumentRepos
PubMedProviderTraits aTraits, String aQuery)
{
var date = Instant.now().atZone(ZoneOffset.UTC).minus(Duration.ofHours(24));
var query = aQuery + " AND \"free full text\"[filter] AND (\"0001/01/01\"[PubDate] : \""
var query = aQuery + " AND \"open access\"[filter] AND (\"0001/01/01\"[PubDate] : \""
+ date.get(YEAR) + "/" + date.get(MONTH_OF_YEAR) + "/" + date.get(DAY_OF_MONTH)
+ "\"[PubDate])";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static de.tudarmstadt.ukp.inception.support.json.JSONUtil.toJsonString;

import java.io.IOException;
import java.lang.invoke.MethodHandles;

import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
Expand Down Expand Up @@ -50,7 +51,7 @@
public class PubMedCentralProviderFactory
implements BeanNameAware, ExternalSearchProviderFactory<PubMedProviderTraits>
{
private final Logger log = LoggerFactory.getLogger(getClass());
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

private final EntrezClient entrezClient;
private final PmcOaClient pmcOaClient;
Expand Down Expand Up @@ -81,7 +82,7 @@ public String getBeanName()
@Override
public String getDisplayName()
{
return "PubMed Central (experimental)";
return "PubMed Central Open Access (experimental)";
}

@Override
Expand All @@ -105,7 +106,7 @@ public PubMedProviderTraits readTraits(DocumentRepository aDocumentRepository)
aDocumentRepository.getProperties());
}
catch (IOException e) {
log.error("Error while reading traits", e);
LOG.error("Error while reading traits", e);
}

if (traits == null) {
Expand All @@ -124,7 +125,7 @@ public void writeTraits(DocumentRepository aDocumentRepository,
aDocumentRepository.setProperties(json);
}
catch (IOException e) {
log.error("Error while writing traits", e);
LOG.error("Error while writing traits", e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
<wicket:panel>
<div class="offset-sm-3 d-flex text-muted" role="alert">
<i class="fas fa-info-circle mr-2 mt-1"></i>
<p class="mb-0 mx-2 small">
<wicket:message key="openAccessHint"/>
</p>
</div>
<form wicket:id="form">
</form>
</wicket:panel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
openAccessHint=#(product.name) uses the BioC version of the PMC documents for import. This is only available for \
Open Access texts. #(product.name) automatically adds a filter for open access results \
(<code>"open access"[filter]</code>) to the query. The BioC version of these texts may be available only with a \
delay #(product.name) automatically excludes results that were published in the last 24h to try to keep the \
number of non-importable results low. If you are still unable to import a result, try a bit later.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ support for the BioC format used by this repository connector.
link:https://www.ncbi.nlm.nih.gov/pmc/[PubMed Central]® (PMC) is a free full-text archive of biomedical and life sciences journal literature at the U.S. National Institutes of Health's National Library of Medicine (NIH/NLM). It can be added as an external document repository by
selecting the **PubMed Central** repository type.

NOTE: {product-name} uses the BioC version of the PMC documents for import. The search tries to
consider only documents that have full text available, but the BioC version of these texts may be
available only with a delay. Thus, if you cannot import a recently uploaded document from PMC into
{product-name}, you may try it again a day later and have more success.
NOTE: {product-name} uses the BioC version of the PMC documents for import. This is only available for
Open Access texts. {product-name} automatically adds a filter for open access results (`"open access"[filter]`)
to the query. The BioC version of these texts may be available only with a delay {product-name} automatically
excludes results that were published in the last 24h to try to keep the number of non-importable results low.
If you are still unable to import a result, try a bit later.
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
* limitations under the License.
*/
function bootstrapFeedbackPanelCloseAll() {
$('.alert').each((i, e) => {
$('.feedbackPanel .alert').each((i, e) => {
console.log("Closing", e);
bootstrap.Alert.getOrCreateInstance(e).close();
});
}

function bootstrapFeedbackPanelFade() {
setTimeout(function() {
$(".alert.alert-success").fadeTo(600, 0, function(){
$(".feedbackPanel .alert.alert-success").fadeTo(600, 0, function(){
$(".alert.alert-success").each((i, e) => bootstrap.Alert.getOrCreateInstance(e).close());
});
$(".alert.alert-info").fadeTo(600, 0, function(){
$(".feedbackPanel .alert.alert-info").fadeTo(600, 0, function(){
$(".alert.alert-info").each((i, e) => bootstrap.Alert.getOrCreateInstance(e).close());
});
}, 2000);
Expand Down

0 comments on commit c2a8943

Please sign in to comment.