Lokal Profil has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/390312 )
Change subject: [WIP]Support prefixed dump types
......................................................................
[WIP]Support prefixed dump types
Adds a general support for prefixed dump formats and an explicit
support for the "-BETA" prefixed .ttl dump.
Bug: T163328
Change-Id: I7dd9a71c75ff9eb4a5efbb47bd855c3979fd0532
---
M DCAT.php
M README.md
M config.example.json
3 files changed, 16 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/dumps/dcat
refs/changes/12/390312/1
diff --git a/DCAT.php b/DCAT.php
index ce7e6e2..354b824 100644
--- a/DCAT.php
+++ b/DCAT.php
@@ -277,7 +277,7 @@
);
}
- $xml->writeElementNS( 'dcterms', 'format', null,
$mediatype );
+ $xml->writeElementNS( 'dcterms', 'format', null,
$mediatype['contentType'] );
// add description in each language
writeDistributionI18n( $xml, $data, $prefix, $format,
@@ -612,7 +612,11 @@
$testStrings = array();
foreach ( $data['config']['dump-info']['compression'] as $compression )
{
foreach ( $data['config']['dump-info']['mediatype'] as $format
=> $mediatype ) {
- $testStrings["$format$compression"] = '-all.' . $format
. '.' . $compression;
+ $prefix = '';
+ if ( array_key_exists( 'prefix', $mediatype ) ) {
+ $prefix = $mediatype['prefix'];
+ }
+ $testStrings["$format$compression"] = '-all' . $prefix
. '.' . $format . '.' . $compression;
}
}
diff --git a/README.md b/README.md
index 76fb017..1faef5c 100644
--- a/README.md
+++ b/README.md
@@ -102,8 +102,9 @@
* `accessURL`: URL to the directory where the *.json.gz* files
reside (`$1` is replaced on the fly by the actual filename),
e.g. *http://example.org/dumps/$1*
- * `mediatype`: (`object`) List of media types. e.g.
- `{"json": "application/json"}`
+ * `mediatype`: (`object`) List of media types and prefixes. e.g.
+ `"json": {"contentType": "application/json"}` or
+ `"ttl": {"contentType": "text/turtle", "prefix": "-BETA"}`
* `compression`: (`object`) List of compression formats, in the
format *name:file-ending* e.g. `{"gzip": "gz"}`
* `license`: See ld-info:license above
diff --git a/config.example.json b/config.example.json
index bc1e6f9..9535441 100644
--- a/config.example.json
+++ b/config.example.json
@@ -42,8 +42,13 @@
"dump-info": {
"accessURL": "https://dumps.wikimedia.org/wikidatawiki/entities/$1",
"mediatype": {
- "json": "application/json",
- "ttl": "text/turtle"
+ "json": {
+ "contentType": "application/json"
+ },
+ "ttl": {
+ "contentType": "text/turtle",
+ "prefix": "-BETA"
+ }
},
"compression": {
"gzip": "gz",
--
To view, visit https://gerrit.wikimedia.org/r/390312
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7dd9a71c75ff9eb4a5efbb47bd855c3979fd0532
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps/dcat
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits