Skip to content
Snippets Groups Projects
Commit 54d4e173 authored by Arkhangelskiy, Timofey's avatar Arkhangelskiy, Timofey
Browse files

Create templates for explain responses (not tested yet)

parent 6a6a5df4
Branches
No related tags found
No related merge requests found
p. 10: "Send explain request without version and operation parameter" -- but an explain request has to have the operation parameter with 'explain' as its value
p. 14: x-cmd-resource-info parameter present in the query example, but never explained (mentioned in some 2013 slides on FCS; should now probably be x-fcs-endpoint-description)
\ No newline at end of file
p. 14: x-cmd-resource-info parameter present in the query example, but never explained (mentioned in some 2013 slides on FCS; should now probably be x-fcs-endpoint-description)
p. 12 and elsewhere: http://explain.z3950.org/dtd/2.0/ mentioned as the URL of the record schema, but its actual URL is http://zeerex.z3950.org/dtd/zeerex-2.0.dtd .
\ No newline at end of file
<sru:extraResponseData>
<ed:EndpointDescription xmlns:ed="http://clarin.eu/fcs/endpoint-description" version="1">
<ed:Capabilities>
<ed:Capability>http://clarin.eu/fcs/capability/basic-search</ed:Capability>
</ed:Capabilities>
<ed:SupportedDataViews>
<ed:SupportedDataView id="hits" delivery-policy="send-by-default">application/x-clarin-fcs-hits+xml</ed:SupportedDataView>
</ed:SupportedDataViews>
<ed:Resources>{% for r in resources %}
<ed:Resource pid="{{ r.pid }}">{% for title in r.titles %}
<ed:Title xml:lang="{{ title.lang }}">{{ title.content }}</ed:Title>{% endfor %}{% for desc in r.descriptions %}
<ed:Description xml:lang="{{ desc.lang }}">{{ desc.content }}</ed:Description>
<ed:LandingPageURI>{{ r.landing_page }}</ed:LandingPageURI>{% if r.languages|length > 0 %}
<ed:Languages>{% for lang in r.languages %}
<ed:Language>{{ lang }}</ed:Language>{% endfor %}
</ed:Languages>{% endif %}
<ed:AvailableDataViews ref="hits"/>
</ed:Resource>{% endfor %}
</ed:Resources>
</ed:EndpointDescription>
</sru:extraResponseData>
\ No newline at end of file
<?xml version='1.0' encoding='utf-8'?>
<sru:explainResponse xmlns:sru="http://www.loc.gov/zing/srw/">
<sru:version>1.2</sru:version>
<sru:record>
<sru:recordSchema>http://explain.z3950.org/dtd/2.0/</sru:recordSchema>
<sru:recordPacking>xml</sru:recordPacking>
<sru:recordData>
<zr:explain xmlns:zr="http://explain.z3950.org/dtd/2.0/">
<!-- <zr:serverInfo > is REQUIRED -->
<zr:serverInfo protocol="SRU" version="1.2" transport="{{ transport_protocol }}" method="GET">
<zr:host>{{ host }}</zr:host>
<zr:port>{{ port }}</zr:port>
<zr:database>{{ url_path }}/fcs-endpoint/{{ platform }}/{{ corpus_id }}</zr:database>
</zr:serverInfo>
<!-- <zr:databaseInfo> is REQUIRED -->
<zr:databaseInfo>{% for title in titles %}
<zr:title lang="{{ title.lang }}"{% if title.primary %} primary="true"{% endif %}>{{ title.content }}</zr:title>{% endfor %}{% for desc in descriptions %}
<zr:description lang="{{ desc.lang }}"{% if desc.primary %} primary="true"{% endif %}>{{ desc.content }}</zr:description>{% endfor %}{% for author in authors %}
<zr:author lang="{{ author.lang }}"{% if author.primary %} primary="true"{% endif %}>{{ author.content }}</zr:author>{% endfor %}{% for contact in contacts %}
<zr:contact lang="{{ contact.lang }}"{% if contact.primary %} primary="true"{% endif %}>{{ contact.content }}</zr:contact>{% endfor %}{% for extent in extents %}
<zr:extent lang="{{ extent.lang }}"{% if extent.primary %} primary="true"{% endif %}>{{ extent.content }}</zr:extent>{% endfor %}{% for hist in history %}
<zr:history lang="{{ hist.lang }}"{% if hist.primary %} primary="true"{% endif %}>{{ hist.content }}</zr:history>{% endfor %}{% for restr in restrictions %}
<zr:restrictions lang="{{ restr.lang }}"{% if restr.primary %} primary="true"{% endif %}>{{ restr.content }}</zr:restrictions>{% endfor %}
</zr:databaseInfo>
<!-- <zr:schemaInfo> is REQUIRED -->
<zr:schemaInfo>
<zr:schema identifier="http://clarin.eu/fcs/resource" name="fcs">
<zr:title lang="en" primary="true">CLARIN Federated Content Search</zr:title>
</zr:schema>
</zr:schemaInfo>{% if max_hits > 0 %}
<!-- <zr:configInfo> is OPTIONAL -->
<zr:configInfo>
<zr:setting type="maximumRecords">{{ max_hits }}</zr:setting>
</zr:configInfo>{% endif %}
</zr:explain>
</sru:recordData>
</sru:record>
<!-- <sru:echoedExplainRequest> is OPTIONAL -->
<sru:echoedExplainRequest>
<sru:version>1.2</sru:version>
<sru:baseUrl>{{ base_url }}</sru:baseUrl>
</sru:echoedExplainRequest>{% if endpoint_desc_needed %}
{% include 'endpoint_description.xml' }{% endif %}
</sru:explainResponse>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment