{% extends "base.html" %}
{% import "entity_macros.html" as entity_macros %}

{% block body %}

<h1>Lookup Container by Identifier</h1>

{% if lookup_error == 400 %}
<div class="ui error message">
<div class="header">400: Syntax Error</div>
<b>{{ lookup_key }}:{{ lookup_value }}</code></b> doesn't look right to us. See
below for details.
</div>
{% elif lookup_error == 404 %}
<div class="ui error message">
<div class="header">404: Not Found</div>
Couldn't find a container with that identifier (<b><code>{{ lookup_key }}:{{
lookup_value }}</code></b>). If you think it should be in the catalog, you could
search for an existing record missing that identifier, or create a new container
entity. 
{% if lookup_key == "issnl" or lookup_key == "issn" or lookup_key == "issne" or lookup_key == "issnp" %}
<p>You can check if it is a registered ISSN by visiting:
<b><a href="https://portal.issn.org/api/search?search[]=MUST=allissnbis={{ lookup_value }}">https://portal.issn.org/api/search?search[]=MUST=allissnbis={{ lookup_value }}</a></b>.
{% elif lookup_key == "wikidata_qid" %}
<p>You can check if it is a real Wikidata entity by visiting:
<b><a href="https://www.wikidata.org/wiki/{{ lookup_value }}">https://www.wikidata.org/wiki/{{ lookup_value }}</a></b>
{% endif %}
</div>
{% endif %}

<div class="ui top attached segment">

<h2>ISSN</h2>
<p>Lookup container with the given ISSN as any of the ISSN-L, ISSN-E (electronic) or ISSN-P (print) ISSNs.
{{ entity_macros.lookup_form("container", "issn", "1234-567X", lookup_key, lookup_value, lookup_error) }}
<i>&nbsp; Must include the dash</i>

</div>
<div class="ui attached segment">

<h2>ISSN-L</h2>
<p>The "linking" ISSN for a journal or other publication is one of the 
"print" or "electronic"
<a href="https://en.wikipedia.org/wiki/International_Standard_Serial_Number#Linking_ISSN">International
Standard Serial Numbers</a>, which has been selected to represent the resource
in all media. It is usually the ISSN which was registered first, and defaults
to the "print" ISSN number for a journal. Fatcat uses ISSN-L as the primary
identifier for journals to reduce confusion and potential for duplication. The
ISSN organization publicly publishes a mapping between linking and
print/electronic ISSNs.
{{ entity_macros.lookup_form("container", "issnl", "1234-567X", lookup_key, lookup_value, lookup_error) }}
<i>&nbsp; Must include the dash</i>

</div>
<div class="ui attached bottom segment">

<h2>Wikidata QID</h2>
<p><a href="https://en.wikipedia.org/wiki/Wikidata#Items">Wikidata</a> is the
structured, machine-readable database that complements Wikipedia. Entities,
which can include bibliographic entities like books and papers, are identified
by a "QID". Fatcat also links container (journal) and creator (author) entities
to Wikidata by QID. Anybody can edit Wikidata and create QIDs.
{{ entity_macros.lookup_form("container", "wikidata_qid", "Q94324", lookup_key, lookup_value, lookup_error) }}
<i>&nbsp; Include the "Q" prefix.</i>

</div>

{% endblock %}