From ded22e8666edb627365642aaa253e19fa4d74e50 Mon Sep 17 00:00:00 2001
From: Pascal Christoph @Messages.get("api.content_types.header")
curl http://lobid.org@routes.Application.get("DE-6")
@Messages.get("api.content_types.negotiate")
curl --header "Accept: text/csv" http://lobid.org@routes.Application.search("kunst")
curl --header "Accept: text/tab-separated-values" http://lobid.org@routes.Application.search("kunst")
curl --header "Accept: application/x-jsonlines" http://lobid.org@routes.Application.search("kunst") > kunst.jsonl
@Messages.get("api.content_types.override") @routes.Application.get("DE-6", format="json")
@Messages.get("api.content_types.dotFormat") @routes.Application.getDotFormat("DE-6", format="json")
@@ -70,6 +71,10 @@@Messages.get("api.autocomplete.intro")
@desc(Messages.get("api.autocomplete.name") + " \"format=json:name\"", routes.Application.search("name:dnb OR alternateName:dnb", format="json:name")) @@ -111,4 +116,4 @@@Html(Messages.get("search.footer.api_text", routes.Application.search(q=qParam, from=from, format="json", location=location), - routes.Application.search(q=qParam, from=from, format="csv", location=location), routes.Application.api()))
+ routes.Application.search(q=qParam, from=from, format="csv", location=location), routes.Application.search(q=qParam, from=from, format="tsv", location=location), routes.Application.api())) }} else { @if(!q.isEmpty) { } } } -}} \ No newline at end of file +}} diff --git a/conf/dataset.jsonld b/conf/dataset.jsonld index ee821109..7e0eeef1 100644 --- a/conf/dataset.jsonld +++ b/conf/dataset.jsonld @@ -137,6 +137,7 @@ "documentation": "http://lobid.org/organisations/api", "encodingFormat": [ "text/csv", + "text/tab-separated-values", "application/json", "application/ld+json" ], diff --git a/conf/messages.de b/conf/messages.de index ea2e26b7..bbb97817 100644 --- a/conf/messages.de +++ b/conf/messages.de @@ -37,7 +37,7 @@ search.location = Standort search.prev = vorige search.next = nächste search.total_results = Trefferzahl -search.footer.api_text = Sie können auf diese Daten auch als JSON oder CSV über unsere Programmierschnittstelle zugreifen. +search.footer.api_text = Sie können auf diese Daten auch als JSON oder CSV (resp. TSV TSV) über unsere Programmierschnittstelle zugreifen. search.footer.no_results = Keine Ergebnisse für{0}
.
search.type = Typ
search.collects = Bestandsgröße
@@ -64,7 +64,7 @@ api.location.distance = Suche über Distanz zu einem Punkt ("location": Koordina
api.content_types.header = Inhaltstypen
api.content_types.default = Standardmäßig liefert dieser Dienst strukturierte API-Antworten (als JSON):
-api.content_types.negotiate = Er unterstützt Content-Negotiation über den Accept-Header für JSON (application/json), CSV (text/csv), JSON lines (application/x-jsonlines) oder HTML (text/html):
+api.content_types.negotiate = Er unterstützt Content-Negotiation über den Accept-Header für JSON (application/json), CSV (text/csv), TSV (text/tab-separated-values), JSON lines (application/x-jsonlines) oder HTML (text/html):
api.content_types.override = Der Query-Parameter "format" kann verwendet werden, um den Accept-Header aufzuheben, z.B. zur Anzeige von JSON im Browser:
api.content_types.dotFormat = Der Wert des Format-Parameters kann für Einzeltreffer auch in URLs als Dateiendung verwendet werden:
api.content_types.compress = Für größere Anfragen kann die Antwort als gzip komprimiert werden:
@@ -74,6 +74,10 @@ api.csv.header = CSV-Export
api.csv.default = Standardfelder ("format=csv")
api.csv.custom = Benutzerdefinierte Felder ("format": zu verwendende Felder, mit Punkten für geschachtelte Felder im Format "csv:feld1,feld2.unterfeld")
+api.tsv.header = TSV-Export
+api.tsv.default = Standardfelder ("format=tsv")
+api.tsv.custom = Benutzerdefinierte Felder ("format": zu verwendende Felder, mit Punkten für geschachtelte Felder im Format "tsv:feld1,feld2.unterfeld")
+
api.autocomplete.header = Autovervollständigung
api.autocomplete.intro = Die API unterstützt ein spezielles Antwortformat mit Vorschlägen zur Vervollständigung aus einem angegebenen Feld:
api.autocomplete.name = Name vorschlagen:
diff --git a/conf/messages.en b/conf/messages.en
index 200f8505..1caa8317 100644
--- a/conf/messages.en
+++ b/conf/messages.en
@@ -37,7 +37,7 @@ search.location = Location
search.prev = prev
search.next = next
search.total_results = Total results
-search.footer.api_text = You can also access this data as JSON or CSV using our API.
+search.footer.api_text = You can also access this data as JSON or CSV (resp. TSV) using our API.
search.footer.no_results = No results for {0}
.
search.type = Type
search.collects = Stock size
@@ -64,7 +64,7 @@ api.location.distance = Query with distance ("location": coordinate of a point a
api.content_types.header = Content types
api.content_types.default = By default, this service returns structured API responses (as JSON):
-api.content_types.negotiate = It supports content negotiation based on the "Accept" header to serve JSON (application/json), CSV (text/csv), JSON lines (application/x-jsonlines), or HTML (text/html):
+api.content_types.negotiate = It supports content negotiation based on the "Accept" header to serve JSON (application/json), CSV (text/csv), TSV (text/tab-separated-values), JSON lines (application/x-jsonlines), or HTML (text/html):
api.content_types.override = An optional "format" query parameter can be used to override the "Accept" header, e.g. to display JSON in a browser:
api.content_types.dotFormat = For individual organisations, the format parameter values can be used as file extensions in URLs:
api.content_types.compress = For larger requests, the response can be compressed as gzip:
@@ -74,6 +74,10 @@ api.csv.header = CSV export
api.csv.default = Default fields ("format=csv")
api.csv.custom = Custom fields ("format": fields to use, with dots for nested fields "csv:field1,field2.subfield")
+api.tsv.header = TSV export
+api.tsv.default = Default fields ("format=tsv")
+api.tsv.custom = Custom fields ("format": fields to use, with dots for nested fields "tsv:field1,field2.subfield")
+
api.autocomplete.header = Auto-complete
api.autocomplete.intro = The API supports a response format for auto-complete suggestions using a specified field:
api.autocomplete.name = Suggest name:
From e31c8e54b4cf7c459dba26f06be069ef07cd1d33 Mon Sep 17 00:00:00 2001
From: Pascal Christoph