diff --git a/notes.txt b/notes.txt index 689cfb4b2a2385259d2f4fb0f3797bb89d1c8ac7..26bb1de27c9c8290e08442c8b081d837d3564cbc 100644 --- a/notes.txt +++ b/notes.txt @@ -1,3 +1,5 @@ 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 diff --git a/static/endpoint_description.xml b/static/endpoint_description.xml new file mode 100644 index 0000000000000000000000000000000000000000..d68eaa5e410a0ff772edb2f3ed6e96a02386eaa3 --- /dev/null +++ b/static/endpoint_description.xml @@ -0,0 +1,21 @@ + <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 diff --git a/static/explain_response_1.2.xml b/static/explain_response_1.2.xml new file mode 100644 index 0000000000000000000000000000000000000000..1cedcb7af471cd82d07863cf3985562ecd534104 --- /dev/null +++ b/static/explain_response_1.2.xml @@ -0,0 +1,44 @@ +<?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