diff --git a/wdtk-dumpfiles/pom.xml b/wdtk-dumpfiles/pom.xml index 0ad35b7e5..9e215c78f 100644 --- a/wdtk-dumpfiles/pom.xml +++ b/wdtk-dumpfiles/pom.xml @@ -31,7 +31,12 @@ wdtk-testing ${project.version} test - + + + org.json + org.json + chargebee-1.0 + diff --git a/wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/JsonConverter.java b/wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/JsonConverter.java new file mode 100644 index 000000000..ef96ba36e --- /dev/null +++ b/wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/JsonConverter.java @@ -0,0 +1,1082 @@ +package org.wikidata.wdtk.dumpfiles; + +/* + * #%L + * Wikidata Toolkit Dump File Handling + * %% + * Copyright (C) 2014 Wikidata Toolkit Developers + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.Validate; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.wikidata.wdtk.datamodel.interfaces.Claim; +import org.wikidata.wdtk.datamodel.interfaces.DataObjectFactory; +import org.wikidata.wdtk.datamodel.interfaces.DatatypeIdValue; +import org.wikidata.wdtk.datamodel.interfaces.EntityIdValue; +import org.wikidata.wdtk.datamodel.interfaces.GlobeCoordinatesValue; +import org.wikidata.wdtk.datamodel.interfaces.ItemDocument; +import org.wikidata.wdtk.datamodel.interfaces.ItemIdValue; +import org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue; +import org.wikidata.wdtk.datamodel.interfaces.NoValueSnak; +import org.wikidata.wdtk.datamodel.interfaces.PropertyDocument; +import org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue; +import org.wikidata.wdtk.datamodel.interfaces.QuantityValue; +import org.wikidata.wdtk.datamodel.interfaces.Reference; +import org.wikidata.wdtk.datamodel.interfaces.SiteLink; +import org.wikidata.wdtk.datamodel.interfaces.Snak; +import org.wikidata.wdtk.datamodel.interfaces.SomeValueSnak; +import org.wikidata.wdtk.datamodel.interfaces.Statement; +import org.wikidata.wdtk.datamodel.interfaces.StatementGroup; +import org.wikidata.wdtk.datamodel.interfaces.StatementRank; +import org.wikidata.wdtk.datamodel.interfaces.StringValue; +import org.wikidata.wdtk.datamodel.interfaces.TimeValue; +import org.wikidata.wdtk.datamodel.interfaces.Value; +import org.wikidata.wdtk.datamodel.interfaces.ValueSnak; + +// TODO logging support +/** + * This class provides methods to convert dump-file JSON objects into + * representations according to the WDTK data model. Since the converted JSON + * normally belongs to the same domain, the base IRI is represented as an + * attribute. + * + * @author Fredo Erxleben + * + */ +public class JsonConverter { + + public static final String PREFIX_ITEM = "Q"; + public static final String PREFIX_PROPERTY = "P"; + + // Keys that might occur in the documents + private static final String KEY_LABEL = "label"; + private static final String KEY_ENTITY = "entity"; + private static final String KEY_DESCRIPTION = "description"; + private static final String KEY_ALIAS = "aliases"; + private static final String KEY_DATATYPE = "datatype"; + private static final String KEY_CLAIM = "claims"; + private static final String KEY_LINK = "links"; + + private final DataObjectFactory factory; + private String baseIri = ""; + private final MonolingualTextValueHandler mltvHandler; + + static final Logger logger = LoggerFactory.getLogger(JsonConverter.class); + + /** + * Creates a new instance of the JsonConverter. For the baseIri see + * also {@link org.wikidata.wdtk.datamodel.interfaces.ItemIdValue}. + * + * @param baseIri + * the base IRI to be used for entities + * @param factory + * the DataObjectFactory to be used to construct objects of the + * data model + */ + public JsonConverter(String baseIri, DataObjectFactory factory) { + this.setBaseIri(baseIri); + this.factory = factory; + + mltvHandler = new MonolingualTextValueHandler(this.factory); + } + + /** + * Attempts to parse a given JSON object into an instance of + * PropertyDocument. + * + * @param jsonObject + * the JSON object to convert. Must represent a property document + * and therefore contain the keys "entity", "label", + * "description", "aliases" and "datatype". + * @param propertyIdString + * is a string containing the id of the property provided by + * external sources; if null is given, the information will be + * extracted from the JSON + * @return the PropertyDocument as described in the JSON. + * @throws NullPointerException + * if toConvert was null. + * @throws JSONException + * if the JSON object did not contain a key it should have had. + */ + public PropertyDocument convertToPropertyDocument(JSONObject jsonObject, + String propertyIdString) throws JSONException { + + if (jsonObject.length() == 0) { // if the JSON object is empty + throw new JSONException("The JSON to convert was empty"); + } + + PropertyDocument result; + + PropertyIdValue propertyId; + + if (propertyIdString != null) { + propertyId = this.getPropertyIdValue(propertyIdString); + } else { + propertyId = this.getPropertyIdFromTopLevel(jsonObject); + } + + List labels = this.getMltv(KEY_LABEL, jsonObject); + + List descriptions = this.getMltv(KEY_DESCRIPTION, + jsonObject); + + List aliases = this + .getMltv(KEY_ALIAS, jsonObject); + + String jsonDataTypeId = jsonObject.getString(KEY_DATATYPE); + DatatypeIdValue datatypeId = this.getDataTypeId(jsonDataTypeId); + + result = this.factory.getPropertyDocument(propertyId, labels, + descriptions, aliases, datatypeId); + return result; + } + + /** + * Attempts to parse a given JSON object into an instance of ItemDocument. + * + * @param jsonObject + * the JSON object to convert. Must represent an item document + * and therefore might contain the keys "entity", "label", + * "description", "aliases", "claims" and "links". + * @param propertyIdString + * is a string containing the id of the item provided by external + * sources; if null is given, the information will be extracted + * from the JSON + * @return the ItemDocument as described in the JSON. + * @throws NullPointerException + * if toConvert was null. + * @throws JSONException + * if the JSON object did not contain a key it should have had. + */ + public ItemDocument convertToItemDocument(JSONObject jsonObject, + String itemIdString) throws JSONException, NullPointerException { + + if (jsonObject.length() == 0) { // if the JSON object is empty + throw new JSONException("The JSON to convert was empty"); + } + + ItemIdValue itemId; + if (itemIdString != null) { + itemId = this.getItemIdValue(itemIdString); + } else { + itemId = this.getItemIdFromTopLevel(jsonObject); + } + List labels = this.getMltv(KEY_LABEL, jsonObject); + + List descriptions = this.getMltv(KEY_DESCRIPTION, + jsonObject); + + List aliases = this + .getMltv(KEY_ALIAS, jsonObject); + + List statements = new LinkedList<>(); + if (jsonObject.has(KEY_CLAIM)) { + JSONArray jsonStatements = jsonObject.getJSONArray(KEY_CLAIM); + statements = this.getStatements(jsonStatements, itemId); + } + + Map siteLinks = new HashMap<>(); + + if (jsonObject.has(KEY_LINK)) { + JSONArray linkArray = jsonObject.optJSONArray(KEY_LINK); + if (linkArray == null) { + JSONObject jsonLinks = jsonObject.getJSONObject(KEY_LINK); + siteLinks = this.getSiteLinks(jsonLinks); + } + } + + ItemDocument result = factory.getItemDocument(itemId, labels, + descriptions, aliases, statements, siteLinks); + return result; + } + + /** + * Attempts to get the item id value from the given JSON-object. Note that + * in old dumps the entity is not an array but a string with appropriate + * prefix in lower case. + * + * @param topLevel + * is the JSON object describing the whole entity + * @return the items id as ItemIdValue + * @throws JSONException + * if the topLevel does not contain the key "entity" + */ + private ItemIdValue getItemIdFromTopLevel(JSONObject topLevel) + throws JSONException { + + if (!topLevel.has(KEY_ENTITY)) { + throw new JSONException("No entity entry found."); + } + + ItemIdValue itemId; + JSONArray entityJsonArray = topLevel.optJSONArray(KEY_ENTITY); + + if (entityJsonArray != null) { // it is an array + itemId = this.getItemId(entityJsonArray); + } else { // it is a String + String stringItemId = topLevel.getString(KEY_ENTITY); + itemId = this.getItemIdValue(stringItemId); + } + return itemId; + } + + /** + * Attempts to get the property id value from the given JSON-object. Note + * that in old dumps the entity is not an array but a string with + * appropriate prefix in lower case. + * + * @param topLevel + * is the JSON object describing the whole entity + * @return the properties id as PropertyIdValue + * @throws JSONException + * if the topLevel does not contain the key "entity" + */ + private PropertyIdValue getPropertyIdFromTopLevel(JSONObject topLevel) + throws JSONException { + + if (!topLevel.has(KEY_ENTITY)) { + throw new JSONException("No entity entry found."); + } + + PropertyIdValue propertyId; + JSONArray entityJsonArray = topLevel.optJSONArray(KEY_ENTITY); + + if (entityJsonArray != null) { // it is an array + propertyId = this.getPropertyId(entityJsonArray); + } else { // it is a String + String stringItemId = topLevel.getString(KEY_ENTITY); + propertyId = this.getPropertyIdValue(stringItemId); + } + return propertyId; + } + + /** + * Constructs the item id of a JSON array denoting an entity. + * + * @param jsonEntity + * a JSON array containing information about the item; The array + * should have the structure ["item", itemId] + * @return an ItemIdValue with the according prefix. + * @throws JSONException + * if the entity does not contain an "item" entry or the entry + * is not followed by an integer denoting the item id + */ + private ItemIdValue getItemId(JSONArray jsonEntity) throws JSONException { + + String entityTypeIndicator = jsonEntity.getString(0); + if (!entityTypeIndicator.equalsIgnoreCase("item")) { + throw new JSONException("Entity type indicator \"" + + entityTypeIndicator + + "\" did not match expected type indicator \"item\"."); + } + + int idValue = jsonEntity.getInt(1); + return this.factory.getItemIdValue(PREFIX_ITEM + idValue, this.baseIri); + } + + /** + * Constructs the property id of a JSON array denoting an entity. + * + * @param jsonEntity + * a JSON array containing information about the property; The + * array should have the structure ["property", propertyId] + * @return an PropertyIdValue with the according prefix. + * @throws JSONException + * if the entity does not contain an "property" entry or the + * entry is not followed by an integer denoting the property id + */ + private PropertyIdValue getPropertyId(JSONArray jsonEntity) + throws JSONException { + + String entityTypeIndicator = jsonEntity.getString(0); + if (!entityTypeIndicator.equalsIgnoreCase("property")) { + throw new JSONException("Entity type indicator \"" + + entityTypeIndicator + + "\" did not match expected type indicator \"property\"."); + } + + int idValue = jsonEntity.getInt(1); + return this.factory.getPropertyIdValue(PREFIX_PROPERTY + idValue, + this.baseIri); + } + + /** + * Creates an ItemIdValue from a string id given in JSON, which may have the + * form Q12345 or q12345. The lower case version is not a valid id but may + * occur in the JSON dump for historic reasons. + * + * @param id + * JSON string id of the item + * @return the corresponding ItemIdValue + * @throws JSONException + */ + private ItemIdValue getItemIdValue(String id) throws JSONException { + + try { + return this.factory.getItemIdValue(id.toUpperCase(), this.baseIri); + } catch (IllegalArgumentException e) { // invalid id format + throw new JSONException(e); + } + } + + /** + * Creates a PropertyIdValue from a string id given in JSON, which may have + * the form P12345 or p12345. The lower case version is not a valid id but + * may occur in the JSON dump for historic reasons. + * + * @param id + * JSON string id of the property + * @return the corresponding PropertyIdValue + * @throws JSONException + */ + private PropertyIdValue getPropertyIdValue(String id) throws JSONException { + + try { + return this.factory.getPropertyIdValue(id.toUpperCase(), + this.baseIri); + } catch (IllegalArgumentException e) { // invalid id format + throw new JSONException(e); + } + } + + /** + * Converts a JSONObject into a list of mono-lingual text values. The object + * to be converted is the value associated with the given key in the top + * level object. So if there is a JSONObject topLevel and the key + * "label" are given, only the JSONObject found in the topLevel under + * the key "label" will be converted, not the whole topLevel. + * + * MLTV is the abbreviation for MonoLingualTextValue. + * + * @param key + * is the key of the object to be converted in the topLevel. If + * the key is not present or not an object an empty list will be + * returned. + * @param topLevel + * is the JSONObject that contains the object to be converted + * under a given key. + * @return a list of extracted mono-lingual text values. Might be empty, but + * not null. + */ + private List getMltv(String key, JSONObject topLevel) { + + JSONObject toConvert = topLevel.optJSONObject(key); + if (toConvert != null) { + return this.mltvHandler.convertToMltv(toConvert); + } // else… + + return new LinkedList<>(); + } + + /** + * Converts the given JSON array into a list of Reference-objects. A + * reference is an array of reference statements which in turn are value + * snaks. Invalid references will be skipped. + * + * @param jsonReferences + * is an JSON array of JSON arrays of value snaks + * @return the appropriate List of references. + */ + private List getReferences(JSONArray jsonReferences) { + // References are [singeRef] + // singleRef are [refStatements] + // refStatements are value snaks + + List result = new LinkedList<>(); + + // process the single references + for (int i = 0; i < jsonReferences.length(); i++) { + try { + JSONArray jsonSingleRef = jsonReferences.getJSONArray(i); + Reference singleReference = this + .getSingleReference(jsonSingleRef); + result.add(singleReference); + + } catch (JSONException e) { + // skip over invalid references + continue; + } + + } + return result; + } + + /** + * Converts a given JSON-array into a single Reference. The array must be + * taken from the JSON-array of references. + * + * @param jsonSingleRef + * is a JSON-array describing a single reference, containing + * value snaks + * @return the appropriate reference + * @throws JSONException + * in case the conversion of the value snaks fails + */ + private Reference getSingleReference(JSONArray jsonSingleRef) + throws JSONException { + List valueSnaks = new LinkedList<>(); + + // process the reference statements + // do not recover from broken snaks, skip the reference + for (int j = 0; j < jsonSingleRef.length(); j++) { + + JSONArray jsonValueSnak = jsonSingleRef.getJSONArray(j); + ValueSnak currentValueSnak = this.getValueSnak(jsonValueSnak); + valueSnaks.add(currentValueSnak); + } + + Reference singleReference = factory.getReference(valueSnaks); + return singleReference; + } + + /** + * Converts a JSON object into a mapping from site keys to + * SiteLink-instances. + * + * @param jsonLinks + * a JSON object representing the site links. + * @return A mapping with a String representing a site key e.g. "enwiki" as + * key and a SiteLink-object as value. + * @throws JSONException + */ + private Map getSiteLinks(JSONObject jsonLinks) + throws JSONException { + // assert jsonLinks != null : "Link JSON object was null"; + + // links are siteKey:{"name":string,"badges":[string] } + // the siteKey is the key for the returned map + // or they are siteKey:string + + Map result = new HashMap(); + + // TODO where to get the site IRI from + String siteIri = ""; + + @SuppressWarnings("unchecked") + Iterator linkIterator = jsonLinks.keys(); + + while (linkIterator.hasNext()) { + + String title; + List badges; + + String siteKey = linkIterator.next(); + + JSONObject currentLink = jsonLinks.optJSONObject(siteKey); + + if (currentLink != null) { + + title = currentLink.getString("name"); + JSONArray badgeArray = currentLink.getJSONArray("badges"); + badges = new ArrayList<>(badgeArray.length()); + + // convert badges to List + for (int i = 0; i < badgeArray.length(); i++) { + badges.add(badgeArray.getString(i)); + } + } else { + String stringLink = jsonLinks.optString(siteKey); + if (stringLink != null) { // its a string + title = stringLink; + // initialize the badges as empty list + // since they are needed for the factory + badges = new ArrayList<>(); + } else { // none of the above, skip + logger.info("Site link is neither a JSON object nor a String. Skipped."); + continue; + } + } + + // create the SiteLink instance + SiteLink siteLink = factory.getSiteLink(title, siteKey, siteIri, + badges); + result.put(siteKey, siteLink); + } + + return result; + } + + /** + * Converts a JSON array containing statements into a list of statement + * groups as represented by the WDTK data model. + * + * @param jsonStatements + * contains all the statements about an item. must consist of + * JSON objects containing the keys "m", "q", "g", "refs" and + * "rank" each. + * + * @return a list of statement groups as specified by the WDTK data model. + * @throws JSONException + * if one of the JSON objects in the array did not contain all + * required keys. + */ + private List getStatements(JSONArray jsonStatements, + EntityIdValue subject) throws JSONException { + + // assert jsonStatements != null : "statements JSON array was null"; + // structure is [{"m":object, "q":[], "g":string, "rank":int, + // "refs":[…]},…] + // "q" => qualifiers + // "m" => main snak + // "g" => statement id + + List result; + List statementsFromJson = new ArrayList( + jsonStatements.length()); + + // iterate over all the statements in the item and decompose them + for (int i = 0; i < jsonStatements.length(); i++) { + JSONObject currentStatement = jsonStatements.getJSONObject(i); + + // get a list of statements in the order they are in the JSON + // get the claim + Claim currentClaim = this.getClaim(currentStatement, subject); + + // get the references + JSONArray jsonRefs = currentStatement.getJSONArray("refs"); + List references = this.getReferences(jsonRefs); + + // get the statement rank + int rankAsInt = currentStatement.getInt("rank"); + StatementRank rank = this.getStatementRank(rankAsInt); + + // get the statement id + String statementId = currentStatement.getString("g"); + + // combine into statement + Statement statement = factory.getStatement(currentClaim, + references, rank, statementId); + + statementsFromJson.add(statement); + + } + + // process the list of statements into a list of statement groups + StatementGroupBuilder builder = new StatementGroupBuilder(this.factory); + result = builder.buildFromStatementList(statementsFromJson); + + return result; + } + + /** + * Gets the claim from a statement in JSON. A Claim consists out of the + * EntityIdValue of the subject, the subjects main snak and its qualifiers. + * + * @param currentStatement + * a JSON object representing a whole statement from which the + * claim is to be extracted. + * @return + * @throws JSONException + * when a required key was not found or the snak type could not + * be identified. + */ + private Claim getClaim(JSONObject currentStatement, EntityIdValue subject) + throws JSONException { + + // m: main snak + // q: qualifiers + + // get the main snak + JSONArray jsonMainSnak = currentStatement.getJSONArray("m"); + Snak mainSnak = getSnak(jsonMainSnak); + + // get the qualifiers + JSONArray jsonQualifiers = currentStatement.getJSONArray("q"); + List qualifiers = this.getQualifiers(jsonQualifiers); + + // build it together + return this.factory.getClaim(subject, mainSnak, qualifiers); + } + + /** + * Transforms a statement rank from an integer representation to an + * enumerated value as requested by the WDTK data model.
+ * The number 0 maps to DEPRECATED.
+ * The number 1 maps to NORMAL.
+ * The number 2 maps to PREFERRED.
+ * Other ranks are regarded as an error. + * + * @param intRank + * the rank as integer. + * @return an appropriate StatementRank-value + */ + private StatementRank getStatementRank(int intRank) { + + switch (intRank) { + case 0: + return StatementRank.DEPRECATED; + case 1: + return StatementRank.NORMAL; + case 2: + return StatementRank.PREFERRED; + default: + throw new IllegalArgumentException("Undefined statement rank."); + } + } + + /** + * Converts the qualifiers from a JSON array to a list of value snaks. + * + * @param jsonQualifiers + * is a JSON array containing several snaks. + * @return a list of snaks corresponding to the given JSON array. + */ + private List getQualifiers(JSONArray jsonQualifiers) { + // effectively a list of value snaks + + List result = new ArrayList(jsonQualifiers.length()); + for (int i = 0; i < jsonQualifiers.length(); i++) { + try { + JSONArray currentValueSnak = jsonQualifiers.getJSONArray(i); + result.add(this.getSnak(currentValueSnak)); + } catch (JSONException e) { + // skip the snak on error + continue; + } + } + + return result; + } + + /** + * Converts the given JSON array into a Snak. This might either be a + * ValueSnak, NoValueSnak or SomeValueSnak. + * + * @param jsonMainSnak + * is the JSON array to be converted. Must not be null. + * @return A Snak corresponding to the given JSON array. + * @throws JSONException + * if the snack type could not determined. + */ + private Snak getSnak(JSONArray jsonMainSnak) throws JSONException { + + switch (jsonMainSnak.getString(0)) { + case "value": + return this.getValueSnak(jsonMainSnak); + case "somevalue": + return this.getSomeValueSnak(jsonMainSnak); + case "novalue": + return this.getNoValueSnak(jsonMainSnak); + default: // could not determine snak type... + throw new JSONException("Unknown snack type: " + + jsonMainSnak.getString(0)); + } + } + + /** + * Converts a JSON array into a NoValueSnak. + * + * @param jsonNoValueSnak + * is an JSON array that denotes a no-value snak. It has the form
+ * ["novalue", propertyID] + * + * @return an appropriate NoValueSnak-instance + * @throws JSONException + * if the format does not match the required one. + */ + private NoValueSnak getNoValueSnak(JSONArray jsonNoValueSnak) + throws JSONException { + // example: + // ["novalue",40], where P40 is the property "children" + + int intPropertyId = jsonNoValueSnak.getInt(1); + PropertyIdValue propertyId = this.getPropertyIdValue(PREFIX_PROPERTY + + intPropertyId); + + NoValueSnak result = this.factory.getNoValueSnak(propertyId); + + return result; + } + + /** + * Converts a JSON array into a SomeValueSnak. + * + * @param jsonSomeValueSnak + * is an JSON array that denotes a some-value snak. It has the + * form
+ * ["somevalue", propertyID] + * + * @return an appropriate SomeValueSnak-instance + * @throws JSONException + * if the format does not match the required one. + */ + private SomeValueSnak getSomeValueSnak(JSONArray jsonSomeValueSnak) + throws JSONException { + // example: + // ["somevalue",22], where P22 is the property "father" + + int intPropertyId = jsonSomeValueSnak.getInt(1); + PropertyIdValue propertyId = this.getPropertyIdValue(PREFIX_PROPERTY + + intPropertyId); + + SomeValueSnak result = this.factory.getSomeValueSnak(propertyId); + + return result; + } + + /** + * Converts the given JSON array into a ValueSnak. + * + * @param jsonValueSnak + * is a JSON array of the form
+ * ["value", propertyID, value type, value] + * where the structure of the value depends on the value type. + * Must not be null. + * @return a ValueSnak-instance according to the given JSON representation. + * @throws JSONException + * if the required format was not matched. + */ + private ValueSnak getValueSnak(JSONArray jsonValueSnak) + throws JSONException { + // a value snak is + // ["value", propertyID, value-type, value] + + ValueSnak result; + + // get the property id + int intPropertyId = jsonValueSnak.getInt(1); + PropertyIdValue propertyId = this.getPropertyIdValue(PREFIX_PROPERTY + + intPropertyId); + + // get the value + String valueString = jsonValueSnak.getString(2); + Value value; + switch (valueString) { + case "time": + value = this.getTimeValue(jsonValueSnak.getJSONObject(3)); + break; + case "wikibase-entityid": + value = this.getEntityIdValue(jsonValueSnak.getJSONObject(3)); + break; + case "string": + value = this.getStringIdValue(jsonValueSnak.getString(3)); + break; + case "globecoordinate": + value = this.getGlobeCoordinatesValue(jsonValueSnak + .getJSONObject(3)); + break; + case "quantity": + value = this.getQuantityValue(jsonValueSnak.getJSONObject(3)); + break; + default: + throw new JSONException("Unknown value type " + valueString + + " in value snak JSON"); + } + + // put it all together + result = this.factory.getValueSnak(propertyId, value); + return result; + } + + /** + * Transforms a given string into a DatatypeIdValue. + * + * @param jsonDataTypeId + * is the string to be converted. Must not be null. + * @return the appropriate DatatypeIdValue-instance. + */ + private DatatypeIdValue getDataTypeId(String jsonDataTypeId) { + // assert jsonDataTypeId != null : "Given JSON datatype id was null"; + + return this.factory.getDatatypeIdValue(jsonDataTypeId); + } + + /** + * Converts a JSON-objects into QuantityValues. + * + * @param jsonQuantityValue + * is a JSON-object containing the labels "amount", "upperBound" + * and "lowerBound". All other labels will be ignored. Must not + * be null. + * @return an appropriate QuantityValue-instance. + * @throws JSONException + */ + private QuantityValue getQuantityValue(JSONObject jsonQuantityValue) + throws JSONException { + // example: + // {"amount":"+34196", + // "unit":"1", + // "upperBound":"+34197", + // "lowerBound":"+34195"} + // NOTE ignore unit for now + // it will be reviewed later + + BigDecimal numericValue = new BigDecimal( + jsonQuantityValue.getString("amount")); + + BigDecimal lowerBound = new BigDecimal( + jsonQuantityValue.getString("lowerBound")); + + BigDecimal upperBound = new BigDecimal( + jsonQuantityValue.getString("upperBound")); + + QuantityValue result = this.factory.getQuantityValue(numericValue, + lowerBound, upperBound); + + return result; + } + + /** + * Converts a JSON-object into a GlobeCordinatesValue. + * + * @param jsonGlobeCoordinate + * is a JSON-object containing the labels "latitude", + * "longitude", "precision" and "globe". All other labels will be + * ignored. Must not be null. Precisions not covered by the + * current data model will be rounded to the next coarse + * precision. Note that an unwanted rounding might occur if the + * chosen representation is a slight bit higher then the limit + * for the precision. + * @return an appropriate GlobeCoordinatesValue + * @throws JSONException + * if a required label was missing. + */ + private GlobeCoordinatesValue getGlobeCoordinatesValue( + JSONObject jsonGlobeCoordinate) throws JSONException { + + // assert jsonGlobeCoordinate != null : + // "Globe coordinate JSON was null"; + // example: + // {"latitude":51.835, + // "longitude":10.785277777778, + // "altitude":null, + // "precision":0.00027777777777778, + // "globe":"http:\/\/www.wikidata.org\/entity\/Q2"} + // NOTE as for now, ignore "altitude". + // The key will be reviewed in the future. + // NOTE the precision is denoted in float as a part of the degree + // conversion into long necessary + // NOTE sometimes the latitude and longitude are provided as int in + // degree + + // convert latitude and longitude into nanodegrees + long latitude; + long longitude; + + // try if the coordinates are already in integer (with degree + // precision?) + + double doubleLatitude = jsonGlobeCoordinate.getDouble("latitude"); + latitude = (long) (doubleLatitude * GlobeCoordinatesValue.PREC_DEGREE); + + double doubleLongitude = jsonGlobeCoordinate.getDouble("longitude"); + longitude = (long) (doubleLongitude * GlobeCoordinatesValue.PREC_DEGREE); + + // getting the precision + // if the precision is available as double or integer it needs to be + // converted (integer can be parsed from JSON as double) + // NOTE this is done by hand, since otherwise one would get rounding + // errors + // also in older dumps the precision might be null + // in this case the precision might default to PREC_DEGREE + long precision; + + if (jsonGlobeCoordinate.isNull("precision")) { + + precision = GlobeCoordinatesValue.PREC_DEGREE; + + } else { + + Double doublePrecision = jsonGlobeCoordinate.getDouble("precision"); + + // Yes, one has to check all + // possible representations since they do not equal + // in their internal binary representation + // and Double can not cope with that + + if (doublePrecision > 1.0) { + precision = GlobeCoordinatesValue.PREC_TEN_DEGREE; + } else if (doublePrecision > 0.1) { + precision = GlobeCoordinatesValue.PREC_DEGREE; + } else if (doublePrecision > 0.016666666666667) { + precision = GlobeCoordinatesValue.PREC_DECI_DEGREE; + } else if (doublePrecision > 0.01) { + precision = GlobeCoordinatesValue.PREC_ARCMINUTE; + } else if (doublePrecision > 0.001) { + precision = GlobeCoordinatesValue.PREC_CENTI_DEGREE; + } else if (doublePrecision > 0.00027777777777778) { + precision = GlobeCoordinatesValue.PREC_MILLI_DEGREE; + } else if (doublePrecision > 0.0001) { + precision = GlobeCoordinatesValue.PREC_MILLI_DEGREE; + } else if (doublePrecision > 0.00002777777777778) { + precision = GlobeCoordinatesValue.PREC_HUNDRED_MICRO_DEGREE; + } else if (doublePrecision > 0.00001) { + precision = GlobeCoordinatesValue.PREC_ARCSECOND; + } else if (doublePrecision > 0.00000277777777778) { + precision = GlobeCoordinatesValue.PREC_TEN_MICRO_DEGREE; + } else if (doublePrecision > 0.000001) { + precision = GlobeCoordinatesValue.PREC_CENTI_ARCSECOND; + } else if (doublePrecision > 0.00000027777777778) { + precision = GlobeCoordinatesValue.PREC_MILLI_DEGREE; + } else { + precision = GlobeCoordinatesValue.PREC_MILLI_ARCSECOND; + } + } + + // get the globeIri + // caution: might be null + String globeIri = null; + globeIri = jsonGlobeCoordinate.optString("globe", ""); + + GlobeCoordinatesValue result = this.factory.getGlobeCoordinatesValue( + latitude, longitude, precision, globeIri); + + return result; + } + + /** + * Acquires the StringValue for a given String. + * + * @param string + * @return + */ + private StringValue getStringIdValue(String string) { + + // NOTE I decided against inlining, so + // if the StringValue changes somehow in the future + // one has only to change this method + return this.factory.getStringValue(string); + } + + /** + * Converts a given JSON-object to an EntityIdValue. An example JSON could + * look like: + *

+ * {"entity-type":"item",
"numeric-id":842256} + *

+ * + * @param jsonObject + * an JSON object denoting an entity id. It must contain the + * labels "entity-type" and "numeric-id". + * @return + * @throws JSONException + * if a required key was not available. + */ + private EntityIdValue getEntityIdValue(JSONObject jsonObject) + throws JSONException { + // NOTE there be any other entity-type then "item" in later releases + + String entityType = jsonObject.getString("entity-type"); + int entityId = jsonObject.getInt("numeric-id"); + + // check the entity type + switch (entityType) { + case "item": + return this.getItemIdValue(PREFIX_ITEM + entityId); + case "property": + // this case is possible in theory, + // but was never encountered it so far + return this.getPropertyIdValue(PREFIX_PROPERTY + entityId); + default: + throw new JSONException("Unknown entity type " + entityType + + " in entity id value JSON."); + } + } + + /** + * Converts a JSON-object into a TimeValue. An example in JSON might look + * like: + *

+ * {"time":"+00000002012-06-30T00:00:00Z",
+ * "timezone":0,
+ * "before":0,
+ * "after":0,
+ * "precision":11,
+ * "calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"} + *

+ * + * @param jsonTimeValue + * is a JSON-object with the keys "time", "timezone", "before", + * "after", "precision" and "calendarmodel". + * @return the TimeValue as described by the JSON-object. + * @throws JSONException + * if a required label was missing. + */ + private TimeValue getTimeValue(JSONObject jsonTimeValue) + throws JSONException { + + TimeValue result; + + String stringTime = jsonTimeValue.getString("time"); + String[] substrings = stringTime.split("(?baseIri see also + * {@link org.wikidata.wdtk.datamodel.interfaces.ItemId} + * + * @param baseIri + * the new baseIRI to be set. If the given string is null, + * nothing will be done. + */ + public void setBaseIri(String baseIri) { + Validate.notNull(baseIri); + this.baseIri = baseIri; + } + +} diff --git a/wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/MonolingualTextValueHandler.java b/wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/MonolingualTextValueHandler.java new file mode 100644 index 000000000..335b39c24 --- /dev/null +++ b/wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/MonolingualTextValueHandler.java @@ -0,0 +1,142 @@ +package org.wikidata.wdtk.dumpfiles; + +/* + * #%L + * Wikidata Toolkit Dump File Handling + * %% + * Copyright (C) 2014 Wikidata Toolkit Developers + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +import org.json.JSONArray; +import org.json.JSONObject; +import org.wikidata.wdtk.datamodel.interfaces.DataObjectFactory; +import org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue; + +/** + * This class is a handler for mono-lingual text values. + * + * @author Fredo Erxleben + * + */ +public class MonolingualTextValueHandler { + + private DataObjectFactory factory; + + public MonolingualTextValueHandler(DataObjectFactory factory) { + this.factory = factory; + } + + public List convertToMltv(JSONObject container) { + // the container object is of the form {"key", value} + // where the value might be a JSONArray of strings + // or a JSONObject itself + // or simply a string associated with the key + + List result = new LinkedList(); + + @SuppressWarnings("unchecked") + Iterator keyIterator = container.keys(); + + while (keyIterator.hasNext()) { + + String key = keyIterator.next(); + List values = new LinkedList<>(); + + // catch null values + if (container.isNull(key)) { + continue; + } + + // differentiate between objects and arrays + JSONArray arrayEntries = container.optJSONArray(key); + JSONObject objEntries = container.optJSONObject(key); + String stringEntry = container.optString(key); + + if (arrayEntries != null) { // it is an array + values = this.extractValues(arrayEntries); + } else if (objEntries != null) { // it is an object + values = this.extractValues(objEntries); + } else if(stringEntry != null){ // it is a string + values.add(stringEntry); + } + // else do nothing… + // this is not in a known format + + // add the found results to the overall result list + for (String s : values) { + MonolingualTextValue toAdd = this.factory + .getMonolingualTextValue(s, key); + result.add(toAdd); + } + } // all keys checked + + return result; + } + + private List extractValues(JSONObject objEntries) { + // object contains numericStrings as keys + // and the desired Strings as values + + List result = new LinkedList<>(); + + @SuppressWarnings("unchecked") + Iterator keyIterator = objEntries.keys(); + + while (keyIterator.hasNext()) { + + String key = keyIterator.next(); + + if (objEntries.isNull(key)) { // skip null values + continue; + } + + String value = objEntries.optString(key); + if (value != null) { + result.add(value); + } + } + + return result; + } + + /** + * Extract the entries of an JSONArray as a list of strings. + * + * @param arrayEntries + * is a JSONArray containing the desired Strings straight ahead. + * In case of other formats the entries which are not strings + * will be skipped. + * @return a list containing the extracted strings. Might be empty, but not + * null. + */ + private List extractValues(JSONArray arrayEntries) { + // the array contains the desired values + // straight forward + List result = new LinkedList<>(); + + for (int i = 0; i < arrayEntries.length(); i++) { + String value = arrayEntries.optString(i); + if (value != null) { + result.add(value); + } + } + return result; + } +} diff --git a/wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/StatementGroupBuilder.java b/wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/StatementGroupBuilder.java new file mode 100644 index 000000000..ce51ded41 --- /dev/null +++ b/wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/StatementGroupBuilder.java @@ -0,0 +1,154 @@ +package org.wikidata.wdtk.dumpfiles; + +/* + * #%L + * Wikidata Toolkit Dump File Handling + * %% + * Copyright (C) 2014 Wikidata Toolkit Developers + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.wikidata.wdtk.datamodel.implementation.DataObjectFactoryImpl; +import org.wikidata.wdtk.datamodel.interfaces.DataObjectFactory; +import org.wikidata.wdtk.datamodel.interfaces.Snak; +import org.wikidata.wdtk.datamodel.interfaces.Statement; +import org.wikidata.wdtk.datamodel.interfaces.StatementGroup; +import org.wikidata.wdtk.datamodel.interfaces.StatementRank; + +/** + * A helper class to construct StatementGroup-objects according to the WDTK data + * model. + * + * @author Fredo Erxleben + * + */ +class StatementGroupBuilder { + + private DataObjectFactory factory; + + StatementGroupBuilder() { + this(new DataObjectFactoryImpl()); + } + + /** + * Creates a new StatementGroupBuilder - instance. + * + * @param factory + * the DataObjectFactory-instance to be used for generating + * StatementGroup-Instances. + */ + StatementGroupBuilder(DataObjectFactory factory) { + this.factory = factory; + } + + /** + * + * @param statements + * a list of Statements concerning the same subject. The list + * will be decomposed in the process. + * @return + */ + List buildFromStatementList(List statements) { + // NOTE: the list of statements will be decomposed. + // Is this acceptable or do we need to work with a copy? + + List result = new LinkedList<>(); + + Map> groups = new HashMap<>(); + + while (!statements.isEmpty()) { + // pick the first statement and check + // if an according group already exists + // Therefore extract the main snak + + Statement currentStatement = statements.get(0); + Snak currentSnak = currentStatement.getClaim().getMainSnak(); + + if (groups.containsKey(currentSnak)) { + // add currentStatement to the list of statements + // corresponding to this key + List value = groups.get(currentSnak); + value.add(currentStatement); + } else { + // create a new group + List value = new LinkedList<>(); + value.add(currentStatement); + groups.put(currentSnak, value); + } + + // remove processed (first) statements + statements.remove(0); + } + + // now, sort each list by rank + // NOTE that one could extend the code + // to sort the statements, using other criteria + // by implementing other comparators. + + for (Snak s : groups.keySet()) { + List value = groups.get(s); + Collections.sort(value, new RankComparator()); + StatementGroup toAdd = this.factory.getStatementGroup(value); + result.add(toAdd); + } + + return result; + } + + /** + * The comparator used for sorting the statement lists by rank. Thereby the + * rank PREFERRED is to appear first, then NORMAL, then DEPRECATED. + * + * @author Fredo Erxleben + * + */ + private class RankComparator implements Comparator { + + private Integer rankToInteger(StatementRank rank) { + switch (rank) { + case PREFERRED: + return 1; + case DEPRECATED: + return -1; + default: + return 0; + } + } + + @Override + public int compare(Statement arg0, Statement arg1) { + + // simple principle: map each rank to a number between 1 and -1 + // and compare these to each other. + // the result is the result as requested by the Comparator-Interface + + Integer value0 = this.rankToInteger(arg0.getRank()); + Integer value1 = this.rankToInteger(arg1.getRank()); + + // return the negative result to achieve a sorting + // from highest to lowest rank + return -value0.compareTo(value1); + + } + + } +} diff --git a/wdtk-dumpfiles/src/test/java/org/wikidata/wdtk/dumpfiles/ItemTestCase.java b/wdtk-dumpfiles/src/test/java/org/wikidata/wdtk/dumpfiles/ItemTestCase.java new file mode 100644 index 000000000..d1016f72e --- /dev/null +++ b/wdtk-dumpfiles/src/test/java/org/wikidata/wdtk/dumpfiles/ItemTestCase.java @@ -0,0 +1,40 @@ +package org.wikidata.wdtk.dumpfiles; + +/* + * #%L + * Wikidata Toolkit Dump File Handling + * %% + * Copyright (C) 2014 Wikidata Toolkit Developers + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import org.json.JSONException; +import org.wikidata.wdtk.datamodel.interfaces.ItemDocument; + +class ItemTestCase extends TestCase { + + ItemTestCase(String filePath, JsonConverter converter) { + super(filePath, converter); + } + private ItemDocument result; + + void convert() throws JSONException { + this.result = this.converter.convertToItemDocument(this.json, null); + } + + ItemDocument getResult(){ + return this.result; + } +} diff --git a/wdtk-dumpfiles/src/test/java/org/wikidata/wdtk/dumpfiles/JsonConverterTest.java b/wdtk-dumpfiles/src/test/java/org/wikidata/wdtk/dumpfiles/JsonConverterTest.java new file mode 100644 index 000000000..ef4c39572 --- /dev/null +++ b/wdtk-dumpfiles/src/test/java/org/wikidata/wdtk/dumpfiles/JsonConverterTest.java @@ -0,0 +1,312 @@ +package org.wikidata.wdtk.dumpfiles; + +/* + * #%L + * Wikidata Toolkit Dump File Handling + * %% + * Copyright (C) 2014 Wikidata Toolkit Developers + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.json.JSONException; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.wikidata.wdtk.datamodel.implementation.DataObjectFactoryImpl; +import org.wikidata.wdtk.datamodel.interfaces.Claim; +import org.wikidata.wdtk.datamodel.interfaces.DataObjectFactory; +import org.wikidata.wdtk.datamodel.interfaces.DatatypeIdValue; +import org.wikidata.wdtk.datamodel.interfaces.ItemDocument; +import org.wikidata.wdtk.datamodel.interfaces.ItemIdValue; +import org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue; +import org.wikidata.wdtk.datamodel.interfaces.PropertyDocument; +import org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue; +import org.wikidata.wdtk.datamodel.interfaces.Reference; +import org.wikidata.wdtk.datamodel.interfaces.SiteLink; +import org.wikidata.wdtk.datamodel.interfaces.Snak; +import org.wikidata.wdtk.datamodel.interfaces.Statement; +import org.wikidata.wdtk.datamodel.interfaces.StatementGroup; +import org.wikidata.wdtk.datamodel.interfaces.StatementRank; +import org.wikidata.wdtk.datamodel.interfaces.Value; + +/** + * The test setup uses several files containing JSON. These files are read by + * the org.json-parser into sample objects to be converted. + * + * @author Fredo Erxleben + * + */ +@RunWith(JUnit4.class) +public class JsonConverterTest { + + private final String sampleFilesBasePath = "src/test/resources/testSamples/"; + private static JsonConverter unitUnderTest; + private static String baseIri = "test"; + private final DataObjectFactory factory = new DataObjectFactoryImpl(); + + @BeforeClass + public static void setUp() { + unitUnderTest = new JsonConverter(baseIri, new DataObjectFactoryImpl()); + } + + @Test + public void testEmptyProperty() throws JSONException { + // create the empty property test case + PropertyDocument emptyPropertyDocument = this + .createEmptyPropertyDocument(); + PropertyTestCase testCase = this + .generatePropertyTestCase("EmptyProperty.json"); + + testCase.convert(); + assert testCase.getResult().equals(emptyPropertyDocument) : "Converted and expected empty property documents did not match"; + } + + @Test + public void testEmptyItem() throws JSONException { + // create the empty property test case + ItemDocument emptyItemDocument = this.createEmptyItemDocument(); + ItemTestCase testCase = this.generateItemTestCase("EmptyItem.json"); + + testCase.convert(); + assertEquals(testCase.getResult(), emptyItemDocument); + } + + @Test + public void testBasicItem() throws JSONException { + // create the empty property test case + ItemDocument basicItemDocument = this.createBasicItemDocument(); + ItemTestCase testCase = this.generateItemTestCase("BasicItem.json"); + + testCase.convert(); + ItemDocument result = testCase.getResult(); + + assertEquals(result.getEntityId(), basicItemDocument.getEntityId()); + assertEquals(result.getItemId(), basicItemDocument.getItemId()); + assertEquals(result.getDescriptions(), + basicItemDocument.getDescriptions()); + assertEquals(result.getAliases(), basicItemDocument.getAliases()); + assertEquals(result.getLabels(), basicItemDocument.getLabels()); + assertEquals(result.getSiteLinks(), basicItemDocument.getSiteLinks()); + assertEquals(result.getStatementGroups(), + basicItemDocument.getStatementGroups()); + assertEquals(result, basicItemDocument); + } + + @Test + public void testRealItems() throws JSONException { + List testCases = new LinkedList<>(); + + testCases.add(this.generateItemTestCase("Chicago.json")); + testCases.add(this.generateItemTestCase("Haaften.json")); + testCases.add(this.generateItemTestCase("Tours.json")); + testCases.add(this.generateItemTestCase("JohnPaulII.json")); + testCases.add(this.generateItemTestCase("Wernigerode.json")); + + for (ItemTestCase t : testCases) { + t.convert(); + } + } + + @Test + public void testClaims() throws JSONException { + List testCases = new LinkedList<>(); + + testCases.add(this.generateItemTestCase("GlobalCoordinates.json")); + testCases.add(this.generateItemTestCase("StatementRanks.json")); + testCases.add(this.generateItemTestCase("SnakTypes.json")); + + for (ItemTestCase t : testCases) { + t.convert(); + } + } + + @Test + public void testDifferentNotations() throws JSONException { + List testCases = new LinkedList<>(); + + testCases.add(this.generateItemTestCase("DifferentNotations.json")); + testCases.add(this.generateItemTestCase("StringEntityItem.json")); + testCases.add(this + .generatePropertyTestCase("StringEntityProperty.json")); + + for (TestCase t : testCases) { + t.convert(); + } + } + + @Test + public void testBrokenDocuments() throws JSONException { + + boolean caughtException = true; + + ItemTestCase itemTest = this + .generateItemTestCase("NoEntityDocument.json"); + PropertyTestCase propertyTest = this + .generatePropertyTestCase("NoEntityDocument.json"); + + ItemTestCase miscErrors = this.generateItemTestCase("MiscErrors.json"); + + caughtException = false; + try { + itemTest.convert(); + } catch (JSONException e) { + caughtException = true; + + } + assertTrue(caughtException); + + caughtException = false; + try { + propertyTest.convert(); + } catch (JSONException e) { + caughtException = true; + + } + assertTrue(caughtException); + + caughtException = false; + try { + miscErrors.convert(); + } catch (JSONException e) { + caughtException = true; + + } + assertTrue(caughtException); + + ItemTestCase universe = this.generateItemTestCase("Universe.json"); + universe.convert(); + } + + /** + * Sets up an empty property document in the WDTK data model. + * + * @return + */ + private PropertyDocument createEmptyPropertyDocument() { + + PropertyIdValue propertyId = this.factory.getPropertyIdValue("P1", + baseIri); + List labels = new LinkedList<>(); + List descriptions = new LinkedList<>(); + List aliases = new LinkedList<>(); + DatatypeIdValue datatypeId = this.factory + .getDatatypeIdValue("globe-coordinate"); + PropertyDocument document = this.factory.getPropertyDocument( + propertyId, labels, descriptions, aliases, datatypeId); + return document; + } + + private ItemDocument createBasicItemDocument() { + + ItemIdValue itemIdValue = this.factory.getItemIdValue("Q1", baseIri); + + List labels = new LinkedList<>(); + labels.add(this.factory.getMonolingualTextValue("test", "en")); + + List descriptions = new LinkedList<>(); + descriptions.add(this.factory.getMonolingualTextValue("this is a test", + "en")); + + List aliases = new LinkedList<>(); + aliases.add(this.factory.getMonolingualTextValue("TEST", "en")); + aliases.add(this.factory.getMonolingualTextValue("Test", "en")); + + List statementGroups = new LinkedList<>(); + List statements = new LinkedList<>(); + + PropertyIdValue propertyId = this.factory.getPropertyIdValue("P1", + baseIri); + Value value = this.factory.getItemIdValue("Q1", baseIri); + Snak mainSnak = factory.getValueSnak(propertyId, value); + List qualifiers = new LinkedList<>(); + Claim claim = this.factory.getClaim(itemIdValue, mainSnak, qualifiers); + + List references = new LinkedList<>(); + StatementRank rank = StatementRank.NORMAL; + String statementId = "foo"; + statements.add(this.factory.getStatement(claim, references, rank, + statementId)); + + statementGroups.add(this.factory.getStatementGroup(statements)); + + Map siteLinks = new HashMap<>(); + List badges = new LinkedList<>(); + String siteKey = "enwiki"; + String title = "test"; + siteLinks.put("enwiki", + this.factory.getSiteLink(title, siteKey, "", badges)); + + ItemDocument document = this.factory.getItemDocument(itemIdValue, + labels, descriptions, aliases, statementGroups, siteLinks); + return document; + } + + private ItemDocument createEmptyItemDocument() { + + ItemIdValue itemIdValue = this.factory.getItemIdValue("Q1", baseIri); + List labels = new LinkedList<>(); + List descriptions = new LinkedList<>(); + List aliases = new LinkedList<>(); + List statementGroups = new LinkedList<>(); + Map siteLinks = new HashMap<>(); + ItemDocument document = this.factory.getItemDocument(itemIdValue, + labels, descriptions, aliases, statementGroups, siteLinks); + return document; + } + + /** + * A helper for setting up ItemTestCases + * + * @param fileName + * the file name only, no path information. The file is supposed + * to be in the "resources/testSamples/"-directory. + */ + private ItemTestCase generateItemTestCase(String fileName) { + String relativeFilePath = this.sampleFilesBasePath + fileName; + + ItemTestCase testCase = new ItemTestCase(relativeFilePath, + unitUnderTest); + + return testCase; + + } + + /** + * A helper for setting up PropertyTestCases + * + * @param fileName + * the file name only, no path information. The file is supposed + * to be in the "resources/testSamples/"-directory. + */ + private PropertyTestCase generatePropertyTestCase(String fileName) { + String relativeFilePath = this.sampleFilesBasePath + fileName; + + PropertyTestCase testCase = new PropertyTestCase(relativeFilePath, + unitUnderTest); + + return testCase; + + } + +} diff --git a/wdtk-dumpfiles/src/test/java/org/wikidata/wdtk/dumpfiles/PropertyTestCase.java b/wdtk-dumpfiles/src/test/java/org/wikidata/wdtk/dumpfiles/PropertyTestCase.java new file mode 100644 index 000000000..2978169a8 --- /dev/null +++ b/wdtk-dumpfiles/src/test/java/org/wikidata/wdtk/dumpfiles/PropertyTestCase.java @@ -0,0 +1,40 @@ +package org.wikidata.wdtk.dumpfiles; + +/* + * #%L + * Wikidata Toolkit Dump File Handling + * %% + * Copyright (C) 2014 Wikidata Toolkit Developers + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import org.json.JSONException; +import org.wikidata.wdtk.datamodel.interfaces.PropertyDocument; + +class PropertyTestCase extends TestCase { + + PropertyTestCase(String filePath, JsonConverter converter) { + super(filePath, converter); + } + private PropertyDocument result; + + void convert() throws JSONException { + this.result = this.converter.convertToPropertyDocument(this.json, null); + } + + PropertyDocument getResult(){ + return this.result; + } +} diff --git a/wdtk-dumpfiles/src/test/java/org/wikidata/wdtk/dumpfiles/TestCase.java b/wdtk-dumpfiles/src/test/java/org/wikidata/wdtk/dumpfiles/TestCase.java new file mode 100644 index 000000000..b2785e171 --- /dev/null +++ b/wdtk-dumpfiles/src/test/java/org/wikidata/wdtk/dumpfiles/TestCase.java @@ -0,0 +1,78 @@ +package org.wikidata.wdtk.dumpfiles; + +/* + * #%L + * Wikidata Toolkit Dump File Handling + * %% + * Copyright (C) 2014 Wikidata Toolkit Developers + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Scanner; + +import org.json.JSONException; +import org.json.JSONObject; + +abstract class TestCase { + + + + TestCase(String filePath, JsonConverter converter) { + this.filePath = filePath; + String contents; + try { + contents = readFile(filePath); + this.json = new JSONObject(contents); + } catch (JSONException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + this.converter = converter; + } + + private String readFile(String filePath) throws FileNotFoundException { + File file = new File(filePath); + if(!file.exists()){ + System.err.println("File " + file.getAbsolutePath() + " not found!"); + return ""; + } + + Scanner scanner = new Scanner(file); + scanner.useDelimiter("\\A"); + String entireFileText = scanner.next(); + scanner.close(); + + return entireFileText; + } + + private String filePath; + protected JSONObject json; + protected JsonConverter converter; + + abstract void convert() throws JSONException; + + @Override + public String toString() { + return this.filePath + "\n" + this.json.toString(); + } + + public JSONObject getJson() { + return this.json; + } +} diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/BasicItem.json b/wdtk-dumpfiles/src/test/resources/testSamples/BasicItem.json new file mode 100644 index 000000000..5ab5f91e3 --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/BasicItem.json @@ -0,0 +1,24 @@ +{ + "label":{ + "en": "test", + }, + "description":{ + "en": "this is a test" + }, + "aliases":{ + "en":["TEST", "Test"] + }, + "links":{ + "enwiki":{"name":"test","badges":[]} + }, + "entity":["item",1], + "claims":[ + { + "m":["value",1,"wikibase-entityid",{"entity-type":"item","numeric-id":1}], + "q":[], + "g":"foo", + "rank":1, + "refs":[] + } + ] +} diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/Chicago.json b/wdtk-dumpfiles/src/test/resources/testSamples/Chicago.json new file mode 100644 index 000000000..a09b21757 --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/Chicago.json @@ -0,0 +1,348 @@ +{ +"label": + { + "zh-hans":"\u829d\u52a0\u54e5", + "zh-hant":"\u829d\u52a0\u54e5", + "zh-hk":"\u829d\u52a0\u54e5", + "zh-cn":"\u829d\u52a0\u54e5", + "zh-sg":"\u829d\u52a0\u54e5", + "zh-tw":"\u829d\u52a0\u54e5", + "eu":"Chicago", + "pl":"Chicago", + "he":"\u05e9\u05d9\u05e7\u05d2\u05d5", + "bs":"Chicago", + "ko":"\uc2dc\uce74\uace0", + "fr":"Chicago", + "es":"Chicago", + "ta":"\u0b9a\u0bbf\u0b95\u0bbe\u0b95\u0bcb", + "hu":"Chicago", + "lv":"\u010cik\u0101ga", + "it":"Chicago", + "gl":"Chicago", + "id":"Chicago", + "de":"Chicago", + "ja":"\u30b7\u30ab\u30b4", + "el":"\u03a3\u03b9\u03ba\u03ac\u03b3\u03bf", + "sh":"Chicago", + "nl":"Chicago", + "ar":"\u0634\u064a\u0643\u0627\u063a\u0648", + "sv":"Chicago", + "pt":"Chicago", + "ru":"\u0427\u0438\u043a\u0430\u0433\u043e", + "en":"Chicago", + "sr-el":"\u010cikago", + "sr-ec":"\u0427\u0438\u043a\u0430\u0433\u043e", + "tr":"Chicago", + "th":"\u0e0a\u0e34\u0e04\u0e32\u0e42\u0e01", + "ro":"Chicago", + "mk":"\u0427\u0438\u043a\u0430\u0433\u043e", + "ca":"Chicago", + "fi":"Chicago", + "uk":"\u0427\u0438\u043a\u0430\u0433\u043e", + "cy":"Chicago", + "cs":"Chicago", + "mr":"\u0936\u093f\u0915\u093e\u0917\u094b", + "bg":"\u0427\u0438\u043a\u0430\u0433\u043e", + "fa":"\u0634\u06cc\u06a9\u0627\u06af\u0648", + "hr":"Chicago", + "da":"Chicago", + "de-formal":"Chicago", + "en-ca":"Chicago", + "en-gb":"Chicago", + "ka":"\u10e9\u10d8\u10d9\u10d0\u10d2\u10dd", + "nb":"Chicago", + "pt-br":"Chicago", + "sr":"\u0427\u0438\u043a\u0430\u0433\u043e", + "zh":"\u829d\u52a0\u54e5" + }, +"description": + { + "it":"film del 2002 diretto da Rob Marshall", + "en":"2002 Musical film directed by Rob Marshall adapted from the satirical stage musical of the same name", + "nl":"2002", + "de":"Musical-Filmdrama von Rob Marshall (2002)", + "mr":"\u0911\u0938\u094d\u0915\u0930 \u092a\u0941\u0930\u0938\u094d\u0915\u093e\u0930 \u092e\u093f\u0933\u093e\u0932\u0947\u0932\u093e \u091a\u093f\u0924\u094d\u0930\u092a\u091f.", + "fr":"film de Rob Marshall" + }, +"aliases": + { + "he":["\u05e9\u05d9\u05e7\u05d0\u05d2\u05d5"], + "sh":["\u0427\u0438\u043a\u0430\u0433\u043e","\u010cikago"], + "sr":["Chicago"], + "th":["Chicago"], + "fa":["\u0634\u064a\u0643\u0627\u06af\u0648"] + }, +"links": + { + "zhwiki":{"name":"\u829d\u52a0\u54e5 (\u96fb\u5f71)","badges":[]}, + "euwiki":{"name":"Chicago (2002ko filma)","badges":[]}, + "plwiki":{"name":"Chicago (film)","badges":[]}, + "hewiki":{"name":"\u05e9\u05d9\u05e7\u05d2\u05d5 (\u05e1\u05e8\u05d8)","badges":[]}, + "bswiki":{"name":"Chicago (film)","badges":[]}, + "kowiki":{"name":"\uc2dc\uce74\uace0 (2002\ub144 \uc601\ud654)","badges":[]}, + "frwiki":{"name":"Chicago (film, 2002)","badges":[]}, + "eswiki":{"name":"Chicago (pel\u00edcula de 2002)","badges":[]}, + "tawiki":{"name":"\u0b9a\u0bbf\u0b95\u0bbe\u0b95\u0bcb (\u0ba4\u0bbf\u0bb0\u0bc8\u0baa\u0bcd\u0baa\u0b9f\u0bae\u0bcd)","badges":[]}, + "huwiki":{"name":"Chicago (film, 2002)","badges":[]}, + "lvwiki":{"name":"\u010cik\u0101ga (filma)","badges":[]}, + "itwiki":{"name":"Chicago (film 2002)","badges":[]}, + "glwiki":{"name":"Chicago (filme)","badges":[]}, + "idwiki":{"name":"Chicago (film)","badges":[]}, + "dewiki":{"name":"Chicago (Film)","badges":[]}, + "jawiki":{"name":"\u30b7\u30ab\u30b4 (2002\u5e74\u306e\u6620\u753b)","badges":[]}, + "elwiki":{"name":"\u03a3\u03b9\u03ba\u03ac\u03b3\u03bf (\u03c4\u03b1\u03b9\u03bd\u03af\u03b1)","badges":[]}, + "shwiki":{"name":"Chicago (film, 2002)","badges":[]}, + "nlwiki":{"name":"Chicago (2002)","badges":[]}, + "arwiki":{"name":"\u0634\u064a\u0643\u0627\u063a\u0648 (\u0641\u064a\u0644\u0645)","badges":[]}, + "svwiki":{"name":"Chicago (film)","badges":[]}, + "ptwiki":{"name":"Chicago (2002)","badges":[]}, + "ruwiki":{"name":"\u0427\u0438\u043a\u0430\u0433\u043e (\u0444\u0438\u043b\u044c\u043c, 2002)","badges":[]}, + "enwiki":{"name":"Chicago (2002 film)","badges":[]}, + "srwiki":{"name":"\u0427\u0438\u043a\u0430\u0433\u043e (\u0444\u0438\u043b\u043c)","badges":[]}, + "trwiki":{"name":"Chicago (film, 2002)","badges":[]}, + "nowiki":{"name":"Chicago (film)","badges":[]}, + "thwiki":{"name":"\u0e0a\u0e34\u0e04\u0e32\u0e42\u0e01 (\u0e20\u0e32\u0e1e\u0e22\u0e19\u0e15\u0e23\u0e4c)","badges":[]}, + "rowiki":{"name":"Chicago (film din 2002)","badges":[]}, + "mkwiki":{"name":"\u0427\u0438\u043a\u0430\u0433\u043e (\u0444\u0438\u043b\u043c)","badges":[]}, + "cawiki":{"name":"Chicago (pel\u00b7l\u00edcula)","badges":[]}, + "fiwiki":{"name":"Chicago (elokuva)","badges":[]}, + "ukwiki":{"name":"\u0427\u0438\u043a\u0430\u0433\u043e (\u0444\u0456\u043b\u044c\u043c)","badges":[]}, + "cywiki":{"name":"Chicago (ffilm 2002)","badges":[]}, + "cswiki":{"name":"Chicago (film)","badges":[]}, + "mrwiki":{"name":"\u0936\u093f\u0915\u093e\u0917\u094b (\u0968\u0966\u0966\u0968 \u091a\u093f\u0924\u094d\u0930\u092a\u091f)","badges":[]}, + "bgwiki":{"name":"\u0427\u0438\u043a\u0430\u0433\u043e (\u0444\u0438\u043b\u043c, 2002)","badges":[]}, + "fawiki":{"name":"\u0634\u06cc\u06a9\u0627\u06af\u0648 (\u0641\u06cc\u0644\u0645 \u06f2\u06f0\u06f0\u06f2)","badges":[]}, + "hrwiki":{"name":"Chicago (2002.)","badges":[]}, + "dawiki":{"name":"Chicago (film)","badges":[]}, + "kawiki":{"name":"\u10e9\u10d8\u10d9\u10d0\u10d2\u10dd (2002 \u10ec\u10da\u10d8\u10e1 \u10e4\u10d8\u10da\u10db\u10d8)","badges":[]} + }, +"entity": + [ + "item",189889 + ], +"claims": + [ + { + "m":["value",31,"wikibase-entityid",{"entity-type":"item","numeric-id":11424}], + "q":[], + "g":"q189889$B10E50C1-EA90-49B8-944D-591A9E2D3AA7", + "rank":1, + "refs":[] + }, + { + "m":["value",373,"string","Chicago (film)"], + "q":[], + "g":"q189889$81595CC7-3F10-49C7-B453-0C65DE2660D2", + "rank":1, + "refs":[] + }, + { + "m":["value",345,"string","tt0299658"], + "q":[], + "g":"q189889$5A91BBB5-858C-4CA5-ACE0-6D9D8829FC78", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]],[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":8449}]]] + }, + { + "m":["value",57,"wikibase-entityid",{"entity-type":"item","numeric-id":353501}], + "q":[], + "g":"q189889$33AABD58-FA98-4A45-BBB1-D153F0FFE6F8", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]] + }, + { + "m":["value",58,"wikibase-entityid",{"entity-type":"item","numeric-id":361336}], + "q":[], + "g":"q189889$7A69C078-3160-45BD-84A2-1619C71A6332", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]] + }, + { + "m":["value",144,"wikibase-entityid",{"entity-type":"item","numeric-id":656285}], + "q":[], + "g":"q189889$AA57BBD3-9DBC-4B3A-A15A-07437E0CD492", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]] + }, + { + "m":["value",364,"wikibase-entityid",{"entity-type":"item","numeric-id":1860}], + "q":[], + "g":"q189889$F8ECE2C6-1C9C-43F1-A2C8-266E9E1155E2", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]] + }, + { + "m":["value",162,"wikibase-entityid",{"entity-type":"item","numeric-id":2261833}], + "q":[], + "g":"q189889$06AD5260-B1A5-4C0C-9654-1BC20611A001", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]] + }, + { + "m":["value",344,"wikibase-entityid",{"entity-type":"item","numeric-id":1226913}], + "q":[], + "g":"q189889$F98B44F6-3E3B-4EE1-B775-470074073A25", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]] + }, + { + "m":["value",161,"wikibase-entityid",{"entity-type":"item","numeric-id":122614}], + "q":[], + "g":"q189889$14FC81C0-660C-48DD-A491-DD31F70EAE41", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]] + }, + { + "m":["value",161,"wikibase-entityid",{"entity-type":"item","numeric-id":47664}], + "q":[], + "g":"q189889$A5B00D57-EC0F-430D-8FDF-DE66E99246D4", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]] + }, + { + "m":["value",161,"wikibase-entityid",{"entity-type":"item","numeric-id":48410}], + "q":[], + "g":"q189889$6170DEDD-5B22-4A83-A232-088A7E8B1D65", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]] + }, + { + "m":["value",161,"wikibase-entityid",{"entity-type":"item","numeric-id":1112005}], + "q":[], + "g":"q189889$FCF8EA06-414E-406F-B4A8-99C1319AB945", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]] + }, + { + "m":["value",161,"wikibase-entityid",{"entity-type":"item","numeric-id":223110}], + "q":[], + "g":"q189889$C7F25F7D-92E2-4CDF-9DB5-06676C31A0D2", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]] + }, + { + "m":["value",161,"wikibase-entityid",{"entity-type":"item","numeric-id":188375}], + "q":[], + "g":"q189889$97F27E2D-68A7-4A7D-AD45-3B69FEDC5FD2", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]] + }, + { + "m":["value",161,"wikibase-entityid",{"entity-type":"item","numeric-id":449679}], + "q":[], + "g":"q189889$BAF54EC6-ED42-4296-8882-FB6128DB4816", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]] + }, + { + "m":["value",161,"wikibase-entityid",{"entity-type":"item","numeric-id":229134}], + "q":[], + "g":"q189889$0354B8F0-CBCE-4CEA-BFDF-AB67ED5CADB0", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]] + }, + { + "m":["value",161,"wikibase-entityid",{"entity-type":"item","numeric-id":534006}], + "q":[], + "g":"q189889$62A8483C-8D09-4823-8D05-35B196CF0778", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]] + }, + { + "m":["value",161,"wikibase-entityid",{"entity-type":"item","numeric-id":462955}], + "q":[], + "g":"q189889$EF5A08D0-D91D-4690-8EE5-26F5C7F2F2DD", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]] + }, + { + "m":["value",161,"wikibase-entityid",{"entity-type":"item","numeric-id":313020}], + "q":[], + "g":"q189889$F6079FF9-B02A-4D61-96CE-E8F7DDAFE13D", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]] + }, + { + "m":["value",161,"wikibase-entityid",{"entity-type":"item","numeric-id":233736}], + "q":[], + "g":"q189889$C8B5DB52-3D38-41BB-869A-9A27CDC11EA0", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]] + }, + { + "m":["value",162,"wikibase-entityid",{"entity-type":"item","numeric-id":888311}], + "q":[], + "g":"q189889$2C6AAF24-9EED-49A8-BC50-D0D85F76B6F6", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]] + }, + { + "m":["value",162,"wikibase-entityid",{"entity-type":"item","numeric-id":531599}], + "q":[], + "g":"q189889$867F6D6D-C1CD-4667-A9F9-6C22B4A217B5", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]] + }, + { + "m":["value",162,"wikibase-entityid",{"entity-type":"item","numeric-id":5119320}], + "q":[], + "g":"q189889$1C66234D-54AA-4FCC-936F-0B15480D7A8E", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]] + }, + { + "m":["value",162,"wikibase-entityid",{"entity-type":"item","numeric-id":251893}], + "q":[], + "g":"q189889$8F58E0EE-38F9-46A8-AC40-5FF5AF5F5D21", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]] + }, + { + "m":["value",856,"string","http:\/\/www.miramax.com\/movie\/chicago"], + "q":[], + "g":"Q189889$CB1BA3E7-1BC8-4E39-9ACE-FB8898CE36E3", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]] + }, + { + "m":["value",107,"wikibase-entityid",{"entity-type":"item","numeric-id":386724}], + "q":[], + "g":"Q189889$974C0B5F-D58A-40C6-953A-10B3D22990D1", + "rank":1, + "refs":[] + }, + { + "m":["value",136,"wikibase-entityid",{"entity-type":"item","numeric-id":842256}], + "q":[], + "g":"Q189889$7D4DBA68-4F2D-4282-AA3F-9E14FDCCD6B6", + "rank":1, + "refs":[] + }, + { + "m":["value",646,"string","\/m\/01cmp9"], + "q":[], + "g":"Q189889$18A21686-FE5E-4A1B-BF7B-E372C9E99C52", + "rank":1, + "refs": + [ + [ + [ + "value",248, + "wikibase-entityid",{"entity-type":"item","numeric-id":15241312} + ], + [ + "value",577, + "time",{"time":"+00000002013-10-28T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"} + ] + ] + ] + }, + { + "m":["value",166,"wikibase-entityid",{"entity-type":"item","numeric-id":102427}], + "q":[], + "g":"Q189889$A3BD20F2-A1C1-4050-87C6-D603AE1D28C5", + "rank":1, + "refs":[] + } + ] +} \ No newline at end of file diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/DifferentNotations.json b/wdtk-dumpfiles/src/test/resources/testSamples/DifferentNotations.json new file mode 100644 index 000000000..195d6983f --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/DifferentNotations.json @@ -0,0 +1,26 @@ +{ + "label":{ + "en": "test", + }, + "description":{ + "en": "this is a test", + "de": null, + "fr": "c'est un test" + }, + "aliases":{ + "en":["TEST", "Test"] + }, + "links":{ + "enwiki":{"name":"test","badges":["someBadge"]} + }, + "entity":["item",1], + "claims":[ + { + "m":["value",1,"wikibase-entityid",{"entity-type":"item","numeric-id":1}], + "q":[], + "g":"foo", + "rank":1, + "refs":[] + } + ] +} diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/EmptyItem.json b/wdtk-dumpfiles/src/test/resources/testSamples/EmptyItem.json new file mode 100644 index 000000000..94b8b2b3f --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/EmptyItem.json @@ -0,0 +1,8 @@ +{ +"label":{}, +"description":{}, +"aliases":[], +"links":{}, +"entity":["item",1], +"claims":[] +} diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/EmptyProperty.json b/wdtk-dumpfiles/src/test/resources/testSamples/EmptyProperty.json new file mode 100644 index 000000000..9c7a20618 --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/EmptyProperty.json @@ -0,0 +1,7 @@ +{ +"label":{}, +"description":{}, +"aliases":{}, +"datatype":"globe-coordinate", +"entity":["property",1] +} \ No newline at end of file diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/GlobalCoordinates.json b/wdtk-dumpfiles/src/test/resources/testSamples/GlobalCoordinates.json new file mode 100644 index 000000000..6a42d6895 --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/GlobalCoordinates.json @@ -0,0 +1,72 @@ +{ + "label":{ + "en": "test", + }, + "description":{ + "en": "this is a test" + }, + "aliases":{ + "en":["TEST", "Test"] + }, + "links":{ + "enwiki":{"name":"test","badges":[]} + }, + "entity":["item",1], + "claims":[ + { + "m":["value",625,"globecoordinate",{"latitude":90,"longitude":-90,"altitude":null,"globe":"SomeIri","precision":10}], + "q":[], + "g":"q58404$3264F174-B86B-4C4C-88E9-9A71D3918987", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]] + },{ + "m":["value",625,"globecoordinate",{"latitude":51.8169,"longitude":5.2117,"altitude":null,"globe":null,"precision":1.0}], + "q":[], + "g":"q58404$3264F174-B86B-4C4C-88E9-9A71D3918987", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]] + },{ + "m":["value",625,"globecoordinate",{"latitude":51.8169,"longitude":5.2117,"altitude":null,"globe":null,"precision":0.1}], + "q":[], + "g":"q58404$3264F174-B86B-4C4C-88E9-9A71D3918987", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]] + },{ + "m":["value",625,"globecoordinate",{"latitude":51.8169,"longitude":5.2117,"altitude":null,"globe":null,"precision":1.0e-2}], + "q":[], + "g":"q58404$3264F174-B86B-4C4C-88E9-9A71D3918987", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]] + },{ + "m":["value",625,"globecoordinate",{"latitude":51.8169,"longitude":5.2117,"altitude":null,"globe":null,"precision":1.0e-3}], + "q":[], + "g":"q58404$3264F174-B86B-4C4C-88E9-9A71D3918987", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]] + },{ + "m":["value",625,"globecoordinate",{"latitude":51.8169,"longitude":5.2117,"altitude":null,"globe":null,"precision":1.66667e-4}], + "q":[], + "g":"q58404$3264F174-B86B-4C4C-88E9-9A71D3918987", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]] + },{ + "m":["value",625,"globecoordinate",{"latitude":51.8169,"longitude":5.2117,"altitude":null,"globe":null,"precision":0}], + "q":[], + "g":"q58404$3264F174-B86B-4C4C-88E9-9A71D3918987", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]] + },{ + "m":["value",625,"globecoordinate",{"latitude":51.8169,"longitude":5.2117,"altitude":null,"globe":null,"precision":0.0}], + "q":[], + "g":"q58404$3264F174-B86B-4C4C-88E9-9A71D3918987", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]] + },{ + "m":["value",625,"globecoordinate",{"latitude":51.8169,"longitude":5.2117,"altitude":null,"globe":null,"precision":null}], + "q":[], + "g":"q58404$3264F174-B86B-4C4C-88E9-9A71D3918987", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]] + } + ] +} diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/Haaften.json b/wdtk-dumpfiles/src/test/resources/testSamples/Haaften.json new file mode 100644 index 000000000..997c54ed0 --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/Haaften.json @@ -0,0 +1,83 @@ +{ +"label": + { + "pt":"Haaften", + "de":"Haaften", + "fr":"Haaften", + "en":"Haaften", + "af":"Haaften", + "nl":"Haaften", + "es":"Haaften", + "ca":"Haaften", + "oc":"Haaften" + }, +"description": + { + "fr":"localit\u00e9 des Pays-Bas", + "es":"poblaci\u00f3n de los Pa\u00edses Bajos", + "nl":"plaats in Gelderland" + }, +"aliases":[], +"links": + { + "ptwiki":{"name":"Haaften","badges":[]}, + "dewiki":{"name":"Haaften","badges":[]}, + "frwiki":{"name":"Haaften","badges":[]}, + "enwiki":{"name":"Haaften","badges":[]}, + "afwiki":{"name":"Haaften","badges":[]}, + "nlwiki":{"name":"Haaften","badges":[]} + }, +"entity": + ["item",58404], +"claims": + [ + { + "m":["value",107,"wikibase-entityid",{"entity-type":"item","numeric-id":618123}], + "q":[], + "g":"q58404$773743FD-0D4F-48D0-ACAE-028B5D37CA25", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]] + },{ + "m":["value",17,"wikibase-entityid",{"entity-type":"item","numeric-id":55}], + "q":[], + "g":"q58404$A9E1E230-51BC-4B66-A7ED-1D9390CFD84C", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]] + },{ + "m":["value",94,"string","Haaften wapen.svg"], + "q":[], + "g":"q58404$CFBC044E-5348-4EF0-AB6F-D68C15CDA79D", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]] + },{ + "m":["value",131,"wikibase-entityid",{"entity-type":"item","numeric-id":932089}], + "q":[],"g":"q58404$D2A534D4-BB3C-4DC1-87FA-9A96E268C8D1", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]] + },{ + "m":["value",373,"string","Haaften"], + "q":[], + "g":"q58404$5F0AAFD6-F88E-4223-B889-6021CC6043C6", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":48183}]]] + },{ + "m":["value",625,"globecoordinate",{"latitude":51.8169,"longitude":5.2117,"altitude":null,"globe":null,"precision":0.001}], + "q":[], + "g":"q58404$3264F174-B86B-4C4C-88E9-9A71D3918987", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]] + },{ + "m":["value",31,"wikibase-entityid",{"entity-type":"item","numeric-id":532}], + "q":[], + "g":"Q58404$9E40CB4C-E70B-45CD-89FA-D69E728708F7", + "rank":1, + "refs":[] + },{ + "m":["value",646,"string","\/m\/0f0_k6"], + "q":[], + "g":"Q58404$12E30FC1-F54F-44D4-91AD-99C453935FD4", + "rank":1, + "refs":[[["value",248,"wikibase-entityid",{"entity-type":"item","numeric-id":15241312}],["value",577,"time",{"time":"+00000002013-10-28T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}]]] + } + ] +} diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/JohnPaulII.json b/wdtk-dumpfiles/src/test/resources/testSamples/JohnPaulII.json new file mode 100644 index 000000000..e0e07c673 --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/JohnPaulII.json @@ -0,0 +1 @@ +{"label":{"pl":"Jan Pawe\u0142 II","en":"John Paul II","it":"papa Giovanni Paolo II","fr":"Jean-Paul II","ru":"\u0418\u043e\u0430\u043d\u043d \u041f\u0430\u0432\u0435\u043b II","de":"Johannes Paul II.","es":"Juan Pablo II","be-tarask":"\u042f\u043d \u041f\u0430\u0432\u0430\u043b II","nan":"Jio\u030dk-b\u014dng P\u00f3-lo\u030dk II","eo":"Johano Pa\u016dlo la 2-a","en-ca":"Pope John Paul II","en-gb":"Pope John Paul II","simple":"Pope John Paul II","nl":"Paus Johannes Paulus II","af":"Pous Johannes Paulus II","an":"Chuan-Pavlo II","ang":"Iohannes Paulus II P\u0101pa","ar":"\u064a\u0648\u062d\u0646\u0627 \u0628\u0648\u0644\u0633 \u0627\u0644\u062b\u0627\u0646\u064a","arc":"\u0726\u0710\u0726\u0710 \u071d\u0718\u071a\u0722\u0722 \u0726\u0718\u0720\u0718\u0723 \u072c\u072a\u071d\u0722\u0710","ast":"Xuan Pablu II","ay":"Juan Pawlu II","az":"II \u0130oann Pavel","bar":"Johannes Paul II.","bcl":"Papa Juan Pablo II","be":"\u042f\u043d \u041f\u0430\u0432\u0435\u043b II, \u041f\u0430\u043f\u0430 \u0420\u044b\u043c\u0441\u043a\u0456","bg":"\u0419\u043e\u0430\u043d \u041f\u0430\u0432\u0435\u043b II","br":"Yann-Baol II","bs":"Papa Ivan Pavao II","ca":"Joan Pau II","ceb":"Juan Pablo II","ckb":"\u067e\u0627\u067e \u062c\u06c6\u0646 \u067e\u06c6\u0644\u06cc \u062f\u0648\u0648\u06d5\u0645","cs":"Jan Pavel II.","csb":"Jan Pawe\u0142 II","cy":"Pab Ioan Pawl II","da":"Pave Johannes Paul 2.","el":"\u03a0\u03ac\u03c0\u03b1\u03c2 \u0399\u03c9\u03ac\u03bd\u03bd\u03b7\u03c2 \u03a0\u03b1\u03cd\u03bb\u03bf\u03c2 \u0392\u0384","et":"Johannes Paulus II","eu":"Joan Paulo II.a","fa":"\u0698\u0627\u0646 \u067e\u0644 \u062f\u0648\u0645","fi":"Johannes Paavali II","fur":"Pape Zuan Pauli II","fy":"Johannes Paulus II","ga":"P\u00e1pa Eoin P\u00f3l II","gd":"P\u00e0pa Iain P\u00f2l II","gl":"Xo\u00e1n Paulo II, papa","he":"\u05d9\u05d5\u05d7\u05e0\u05df \u05e4\u05d0\u05d5\u05dc\u05d5\u05e1 \u05d4\u05e9\u05e0\u05d9","hr":"Ivan Pavao II.","hsb":"Jan Pawo\u0142 II.","hu":"II. J\u00e1nos P\u00e1l","hy":"\u0540\u0578\u057e\u0570\u0561\u0576\u0576\u0565\u057d \u054a\u0578\u0572\u0578\u057d II","ia":"Papa Ioannes Paulus II","id":"Paus Yohanes Paulus II","ilo":"Papa Juan Pablo II","io":"Iohannes Paulus 2ma","is":"J\u00f3hannes P\u00e1ll 2.","ja":"\u30e8\u30cf\u30cd\u30fb\u30d1\u30a6\u30ed2\u4e16","jv":"Paus Yohanes Paulus II","ka":"\u10d8\u10dd\u10d0\u10dc\u10d4 \u10de\u10d0\u10d5\u10da\u10d4 II","ko":"\uad50\ud669 \uc694\ud55c \ubc14\uc624\ub85c 2\uc138","ksh":"Johannes Paul II.","ku":"Papa Y\u00fbhena Paul\u00fbs II","la":"Ioannes Paulus II","lb":"Jean-Paul II.","li":"Johannes Paulus II","ln":"P\u00e1pa Yoane Polo II","lt":"Jonas Paulius II","lv":"J\u0101nis P\u0101vils II","mk":"\u0408\u043e\u0432\u0430\u043d \u041f\u0430\u0432\u043b\u0435 II","ml":"\u0d1c\u0d4b\u0d7a \u0d2a\u0d4b\u0d7e \u0d30\u0d23\u0d4d\u0d1f\u0d3e\u0d2e\u0d7b \u0d2e\u0d3e\u0d7c\u0d2a\u0d4d\u0d2a\u0d3e\u0d2a\u0d4d\u0d2a","mn":"II \u0418\u043e\u0430\u043d\u043d \u041f\u0430\u0432\u0435\u043b","mr":"\u092a\u094b\u092a \u091c\u0949\u0928 \u092a\u0949\u0932 \u0926\u0941\u0938\u0930\u093e","ms":"Paus John Paul II","mt":"Papa \u0120wanni Pawlu II","mzn":"\u067e\u0627\u067e \u0698\u0627\u0646 \u067e\u0644 \u062f\u0648\u0645","nah":"Ioannes Paulus II","nap":"Papa Giovanni Paolo II","nds":"Johannes Paul II.","nn":"Pave Johannes Paul II","oc":"Joan Pau II","pam":"Papa Juan Pablo II","pdc":"Baapscht John Paul II","pms":"Gioann P\u00e0ul II","pt":"Papa Jo\u00e3o Paulo II","qu":"Juan Pawlu II","ro":"Papa Ioan Paul al II-lea","sah":"\u0418\u043e\u0430\u043d\u043d \u041f\u0430\u0432\u0435\u043b II","sc":"Karol J\u00f3zef Wojty\u0142a","scn":"Giuvanni Paulu II","sco":"Pape John Paul II","sh":"Ivan Pavao II.","sk":"J\u00e1n Pavol II.","sl":"Pape\u017e Janez Pavel II.","sq":"Papa Gjon Pali II","sr":"\u041f\u0430\u043f\u0430 \u0408\u043e\u0432\u0430\u043d \u041f\u0430\u0432\u043b\u0435 II","sv":"Johannes Paulus II","sw":"Papa Yohane Paulo II","szl":"J\u016fn Paul II","ta":"\u0ba4\u0bbf\u0bb0\u0bc1\u0ba4\u0bcd\u0ba4\u0ba8\u0bcd\u0ba4\u0bc8 \u0b87\u0bb0\u0ba3\u0bcd\u0b9f\u0bbe\u0bae\u0bcd \u0b85\u0bb0\u0bc1\u0bb3\u0bcd \u0b9a\u0bbf\u0ba9\u0bcd\u0ba9\u0baa\u0bcd\u0baa\u0bb0\u0bcd","th":"\u0e2a\u0e21\u0e40\u0e14\u0e47\u0e08\u0e1e\u0e23\u0e30\u0e2a\u0e31\u0e19\u0e15\u0e30\u0e1b\u0e32\u0e1b\u0e32\u0e08\u0e2d\u0e2b\u0e4c\u0e19 \u0e1b\u0e2d\u0e25\u0e17\u0e35\u0e48 2","tl":"Juan Pablo II","tr":"II. Ioannes Paulus","uk":"\u0406\u0432\u0430\u043d \u041f\u0430\u0432\u043b\u043e II","vec":"Papa Giovani Pago\u0142o II","vi":"Gi\u00e1o ho\u00e0ng Gioan Phaol\u00f4 II","vls":"Paus Johannes Paulus II","wa":"P\u00e5pe Djihan-P\u00e5 II","war":"Papa Juan Pablo II","yo":"P\u00f3p\u00f9 J\u00f2h\u00e1n\u00f9 P\u00e1\u00fal\u00f9 \u00c8kej\u00ec","zh":"\u82e5\u671b\u00b7\u4fdd\u797f\u4e8c\u4e16","zh-cn":"\u82e5\u671b\u00b7\u4fdd\u797f\u4e8c\u4e16","zh-hans":"\u82e5\u671b\u00b7\u4fdd\u797f\u4e8c\u4e16","zh-hant":"\u82e5\u671b\u00b7\u4fdd\u797f\u4e8c\u4e16","arz":"\u064a\u0648\u062d\u0646\u0627 \u0628\u0648\u0644\u0633 \u0627\u0644\u062a\u0627\u0646\u0649","uz":"Ioann Pavel II","zh-tw":"\u82e5\u671b\u00b7\u4fdd\u797f\u4e8c\u4e16","ace":"Pope John Paul II","pag":"Pope John Paul II","wo":"Pope John Paul II","ig":"Pope John Paul II","mg":"Papa Joany Paoly II","tt":"\u0418\u043e\u0430\u043d\u043d \u041f\u0430\u0432\u0435\u043b II","nb":"Johannes Paul II","gsw":"Johannes Paul II.","pt-br":"Papa Jo\u00e3o Paulo II","yue":"\u82e5\u671b\u4fdd\u797f\u4e8c\u4e16","roa-tara":"Pape Giu\u00e0nne Paule II","dsb":"Jan Pawo\u0142 II.","sgs":"Juons Paulios II","rup":"Papa Ioannis Pavlu II"},"description":{"it":"264\u00ba vescovo di Roma e papa della Chiesa cattolica","ru":"\u041f\u0430\u043f\u0430 \u0420\u0438\u043c\u0441\u043a\u0438\u0439 (16 \u043e\u043a\u0442\u044f\u0431\u0440\u044f 1978 \u2014 2 \u0430\u043f\u0440\u0435\u043b\u044f 2005)","de":"264. Papst der katholischen Kirche","es":"264\u00ba papa de la Iglesia Cat\u00f3lica","fr":"pape de l\u2019\u00c9glise catholique","eo":"Pola katolika papo (1920 - 2005)","en":"264th Pope of the Catholic Church","ilo":"Papa ti Katoliko a Simbaan","hu":"r\u00f3mai-katolikus p\u00e1pa","hr":"Papa (1920-2005)","zh-tw":"\u7b2c264\u4efb\u5929\u4e3b\u6559\u6559\u5b97","cs":"katolick\u00fd pape\u017e","uz":"Rim papasi","pl":"papie\u017c, b\u0142ogos\u0142awiony Ko\u015bcio\u0142a katolickiego","ja":"\u7b2c264\u4ee3\u30ed\u30fc\u30de\u6559\u7687","zh-hans":"\u5929\u4e3b\u6559\u7b2c264\u4efb\u6559\u5b97"},"aliases":{"ru":["\u041a\u0430\u0440\u043e\u043b\u044c \u042e\u0437\u0435\u0444 \u0412\u043e\u0439\u0442\u044b\u043b\u0430"],"es":["Karol J\u00f3zef Wojty\u0142a"],"be-tarask":["\u041a\u0430\u0440\u0430\u043b\u044c \u0412\u0430\u0439\u0442\u044b\u043b\u0430","\u042f\u043d \u041f\u0430\u0432\u0435\u043b \u0414\u0440\u0443\u0433\u0456","\u042f\u043d \u041f\u0430\u0432\u0430\u043b \u0414\u0440\u0443\u0433\u0456","\u041f\u0430\u043f\u0430 \u042f\u043d \u041f\u0430\u0432\u0430\u043b II","\u041f\u0430\u043f\u0430 \u042f\u043d \u041f\u0430\u0432\u0430\u043b \u0414\u0440\u0443\u0433\u0456"],"nan":["Iok-h\u0101n P\u00f3-l\u00f4 II"],"de":["Johannes Paul 2","Karol J\u00f3zef Wojty\u0142a","Ioannes Paulus PP. II","Karol Wojty\u0142a","Kardinal Woytila","Weihbischof Wojty\u0142a","Dr. Karol J\u00f3zef Wojty\u0142a","Papa Giovanni Paolo II","264. Papst und Bischof von Rom"],"hu":["Karol J\u00f3zef Wojty\u0142a","Ioannes Paulus PP. II","Giovanni Paolo","Jan Pawe\u0142 II"],"en":["Karol J\u00f3zef Wojty\u0142a","Karol Wojty\u0142a","Blessed John Paul","Pope John Paul II"],"it":["Karol J\u00f3zef Wojty\u0142a","Giovanni Paolo II","Karol Wojty\u0142a","beato Giovanni Paolo II","Karol Wojtyla"],"pl":["Karol Wojty\u0142a"],"zh":["\u6559\u5b97\u82e5\u671b\u4fdd\u797f"],"he":["\u05d5\u05d0\u05d9\u05d8\u05d9\u05dc\u05d4, \u05e7\u05d0\u05e8\u05d5\u05dc"],"eo":["Karol J\u00f3zef WOJTY\u0141A"]},"links":{"plwiki":{"name":"Jan Pawe\u0142 II","badges":[]},"enwiki":{"name":"Pope John Paul II","badges":[]},"simplewiki":{"name":"Pope John Paul II","badges":[]},"nlwiki":{"name":"Paus Johannes Paulus II","badges":[]},"dewiki":{"name":"Johannes Paul II.","badges":[]},"itwiki":{"name":"Papa Giovanni Paolo II","badges":[]},"frwiki":{"name":"Jean-Paul II","badges":[]},"ruwiki":{"name":"\u0418\u043e\u0430\u043d\u043d \u041f\u0430\u0432\u0435\u043b II","badges":[]},"afwiki":{"name":"Pous Johannes Paulus II","badges":[]},"anwiki":{"name":"Chuan-Pavlo II","badges":[]},"angwiki":{"name":"Iohannes Paulus II P\u0101pa","badges":[]},"arwiki":{"name":"\u064a\u0648\u062d\u0646\u0627 \u0628\u0648\u0644\u0633 \u0627\u0644\u062b\u0627\u0646\u064a","badges":[]},"arcwiki":{"name":"\u0726\u0710\u0726\u0710 \u071d\u0718\u071a\u0722\u0722 \u0726\u0718\u0720\u0718\u0723 \u072c\u072a\u071d\u0722\u0710","badges":[]},"astwiki":{"name":"Papa Xuan Pablu II","badges":[]},"aywiki":{"name":"Juan Pawlu II","badges":[]},"azwiki":{"name":"II \u0130ohann Pavel","badges":[]},"barwiki":{"name":"Johannes Paul II.","badges":[]},"bclwiki":{"name":"Papa Juan Pablo II","badges":[]},"bewiki":{"name":"\u042f\u043d \u041f\u0430\u0432\u0435\u043b II, \u041f\u0430\u043f\u0430 \u0420\u044b\u043c\u0441\u043a\u0456","badges":[]},"bgwiki":{"name":"\u0419\u043e\u0430\u043d \u041f\u0430\u0432\u0435\u043b II","badges":[]},"brwiki":{"name":"Yann-Baol II","badges":[]},"bswiki":{"name":"Papa Ivan Pavao II","badges":[]},"cawiki":{"name":"Joan Pau II","badges":[]},"cebwiki":{"name":"Juan Pablo II","badges":[]},"ckbwiki":{"name":"\u067e\u0627\u067e \u062c\u06c6\u0646 \u067e\u06c6\u0644\u06cc \u062f\u0648\u0648\u06d5\u0645","badges":[]},"cswiki":{"name":"Jan Pavel II.","badges":[]},"csbwiki":{"name":"Jan Pawe\u0142 II","badges":[]},"cywiki":{"name":"Pab Ioan Pawl II","badges":[]},"dawiki":{"name":"Pave Johannes Paul 2.","badges":[]},"elwiki":{"name":"\u03a0\u03ac\u03c0\u03b1\u03c2 \u0399\u03c9\u03ac\u03bd\u03bd\u03b7\u03c2 \u03a0\u03b1\u03cd\u03bb\u03bf\u03c2 \u0392\u0384","badges":[]},"eowiki":{"name":"Johano Pa\u016dlo la 2-a","badges":[]},"eswiki":{"name":"Juan Pablo II","badges":[]},"etwiki":{"name":"Johannes Paulus II","badges":[]},"euwiki":{"name":"Joan Paulo II.a","badges":[]},"fawiki":{"name":"\u0698\u0627\u0646 \u067e\u0644 \u062f\u0648\u0645","badges":[]},"fiwiki":{"name":"Johannes Paavali II","badges":[]},"furwiki":{"name":"Pape Zuan Pauli II","badges":[]},"fywiki":{"name":"Jehannes Paulus II","badges":[]},"gawiki":{"name":"P\u00e1pa Eoin P\u00f3l II","badges":[]},"gdwiki":{"name":"P\u00e0pa Iain P\u00f2l II","badges":[]},"glwiki":{"name":"Xo\u00e1n Paulo II, papa","badges":[]},"hewiki":{"name":"\u05d9\u05d5\u05d7\u05e0\u05df \u05e4\u05d0\u05d5\u05dc\u05d5\u05e1 \u05d4\u05e9\u05e0\u05d9","badges":[]},"hrwiki":{"name":"Ivan Pavao II.","badges":[]},"hsbwiki":{"name":"Jan Pawo\u0142 II.","badges":[]},"huwiki":{"name":"II. J\u00e1nos P\u00e1l p\u00e1pa","badges":[]},"hywiki":{"name":"\u0540\u0578\u057e\u0570\u0561\u0576\u0576\u0565\u057d \u054a\u0578\u0572\u0578\u057d II","badges":[]},"iawiki":{"name":"Papa Ioannes Paulus II","badges":[]},"idwiki":{"name":"Paus Yohanes Paulus II","badges":[]},"ilowiki":{"name":"Papa Juan Pablo II","badges":[]},"iowiki":{"name":"Iohannes Paulus 2ma","badges":[]},"iswiki":{"name":"J\u00f3hannes P\u00e1ll 2.","badges":[]},"jawiki":{"name":"\u30e8\u30cf\u30cd\u30fb\u30d1\u30a6\u30ed2\u4e16 (\u30ed\u30fc\u30de\u6559\u7687)","badges":[]},"jvwiki":{"name":"Paus Yohanes Paulus II","badges":[]},"kawiki":{"name":"\u10d8\u10dd\u10d0\u10dc\u10d4 \u10de\u10d0\u10d5\u10da\u10d4 II","badges":[]},"kowiki":{"name":"\uad50\ud669 \uc694\ud55c \ubc14\uc624\ub85c 2\uc138","badges":[]},"kshwiki":{"name":"Johannes Paul II.","badges":[]},"kuwiki":{"name":"Papa Y\u00fbhena Pawlos II","badges":[]},"lawiki":{"name":"Ioannes Paulus II","badges":[]},"lbwiki":{"name":"Jean-Paul II. (Poopst)","badges":[]},"liwiki":{"name":"Johannes Paulus II","badges":[]},"lnwiki":{"name":"P\u00e1pa Yoane Polo II","badges":[]},"ltwiki":{"name":"Jonas Paulius II","badges":[]},"lvwiki":{"name":"J\u0101nis P\u0101vils II","badges":[]},"mkwiki":{"name":"\u0408\u043e\u0432\u0430\u043d \u041f\u0430\u0432\u043b\u0435 II","badges":[]},"mlwiki":{"name":"\u0d1c\u0d4b\u0d7a \u0d2a\u0d4b\u0d7e \u0d30\u0d23\u0d4d\u0d1f\u0d3e\u0d2e\u0d7b","badges":[]},"mnwiki":{"name":"II \u0418\u043e\u0430\u043d\u043d \u041f\u0430\u0432\u0435\u043b","badges":[]},"mrwiki":{"name":"\u092a\u094b\u092a \u091c\u0949\u0928 \u092a\u0949\u0932 \u0926\u0941\u0938\u0930\u093e","badges":[]},"mswiki":{"name":"Paus John Paul II","badges":[]},"mtwiki":{"name":"Papa \u0120wanni Pawlu II","badges":[]},"mznwiki":{"name":"\u067e\u0627\u067e \u0698\u0627\u0646 \u067e\u0644 \u062f\u0648\u0645","badges":[]},"nahwiki":{"name":"Ioannes Paulus II","badges":[]},"napwiki":{"name":"Papa Giovanni Paolo II","badges":[]},"ndswiki":{"name":"Johannes Paul II.","badges":[]},"nnwiki":{"name":"Pave Johannes Paul II","badges":[]},"nowiki":{"name":"Johannes Paul II","badges":[]},"ocwiki":{"name":"Joan Pau II","badges":[]},"pamwiki":{"name":"Papa Juan Pablo II","badges":[]},"pdcwiki":{"name":"Baapscht John Paul II","badges":[]},"pmswiki":{"name":"Gioann P\u00e0ul II","badges":[]},"ptwiki":{"name":"Papa Jo\u00e3o Paulo II","badges":[]},"quwiki":{"name":"Huwan Pawlu II","badges":[]},"rowiki":{"name":"Papa Ioan Paul al II-lea","badges":[]},"sahwiki":{"name":"\u0418\u043e\u0430\u043d\u043d \u041f\u0430\u0432\u0435\u043b II","badges":[]},"scwiki":{"name":"Karol J\u00f3zef Wojty\u0142a","badges":[]},"scnwiki":{"name":"Giuvanni Paulu II","badges":[]},"scowiki":{"name":"Pape John Paul II","badges":[]},"shwiki":{"name":"Ivan Pavao II.","badges":[]},"skwiki":{"name":"J\u00e1n Pavol II.","badges":[]},"slwiki":{"name":"Pape\u017e Janez Pavel II.","badges":[]},"sqwiki":{"name":"Papa Gjon Pali II","badges":[]},"srwiki":{"name":"\u041f\u0430\u043f\u0430 \u0408\u043e\u0432\u0430\u043d \u041f\u0430\u0432\u043b\u0435 II","badges":[]},"svwiki":{"name":"Johannes Paulus II","badges":[]},"swwiki":{"name":"Papa Yohane Paulo II","badges":[]},"szlwiki":{"name":"J\u016fn Paul II","badges":[]},"tawiki":{"name":"\u0ba4\u0bbf\u0bb0\u0bc1\u0ba4\u0bcd\u0ba4\u0ba8\u0bcd\u0ba4\u0bc8 \u0b87\u0bb0\u0ba3\u0bcd\u0b9f\u0bbe\u0bae\u0bcd \u0b85\u0bb0\u0bc1\u0bb3\u0bcd \u0b9a\u0bbf\u0ba9\u0bcd\u0ba9\u0baa\u0bcd\u0baa\u0bb0\u0bcd","badges":[]},"thwiki":{"name":"\u0e2a\u0e21\u0e40\u0e14\u0e47\u0e08\u0e1e\u0e23\u0e30\u0e2a\u0e31\u0e19\u0e15\u0e30\u0e1b\u0e32\u0e1b\u0e32\u0e08\u0e2d\u0e2b\u0e4c\u0e19 \u0e1b\u0e2d\u0e25\u0e17\u0e35\u0e48 2","badges":[]},"tlwiki":{"name":"Papa Juan Pablo II","badges":[]},"trwiki":{"name":"II. Ioannes Paulus","badges":[]},"ukwiki":{"name":"\u0406\u0432\u0430\u043d \u041f\u0430\u0432\u043b\u043e II","badges":[]},"vecwiki":{"name":"Papa Giovani Pago\u0142o II","badges":[]},"viwiki":{"name":"Gi\u00e1o ho\u00e0ng Gioan Phaol\u00f4 II","badges":[]},"vlswiki":{"name":"Paus Johannes Paulus II","badges":[]},"wawiki":{"name":"P\u00e5pe Djihan-P\u00e5 II","badges":[]},"warwiki":{"name":"Papa Juan Pablo II","badges":[]},"yowiki":{"name":"P\u00f3p\u00f9 J\u00f2h\u00e1n\u00f9 P\u00e1\u00fal\u00f9 \u00c8kej\u00ec","badges":[]},"zhwiki":{"name":"\u82e5\u671b\u00b7\u4fdd\u797f\u4e8c\u4e16","badges":[]},"bat_smgwiki":{"name":"Juons Paulios II","badges":[]},"roa_rupwiki":{"name":"Papa Ioannis Pavlu II","badges":[]},"be_x_oldwiki":{"name":"\u042f\u043d \u041f\u0430\u0432\u0430\u043b II","badges":[]},"zh_min_nanwiki":{"name":"Jio\u030dk-b\u014dng P\u00f3-lo\u030dk II","badges":[]},"arzwiki":{"name":"\u064a\u0648\u062d\u0646\u0627 \u0628\u0648\u0644\u0633 \u0627\u0644\u062a\u0627\u0646\u0649","badges":[]},"uzwiki":{"name":"Ioann Pavel II","badges":[]},"acewiki":{"name":"Paus Yohanes Paulus II","badges":[]},"pagwiki":{"name":"Pope John Paul II","badges":[]},"wowiki":{"name":"Pope John Paul II","badges":[]},"igwiki":{"name":"Pope John Paul II","badges":[]},"zh_yuewiki":{"name":"\u82e5\u671b\u4fdd\u797f\u4e8c\u4e16","badges":[]},"ttwiki":{"name":"\u0418\u043e\u0430\u043d\u043d \u041f\u0430\u0432\u0435\u043b II","badges":[]},"alswiki":{"name":"Johannes Paul II.","badges":[]},"mgwiki":{"name":"Papa Joany Paoly II","badges":[]},"roa_tarawiki":{"name":"Pape Giu\u00e0nne Paule II","badges":[]},"commonswiki":{"name":"Ioannes Paulus II","badges":[]},"dsbwiki":{"name":"Jan Pawo\u0142 II.","badges":[]},"enwikisource":{"name":"Author:John Paul II","badges":[]},"eswikisource":{"name":"Juan Pablo II","badges":[]},"kowikisource":{"name":"\uc800\uc790:\uad50\ud669 \uc694\ud55c \ubc14\uc624\ub85c 2\uc138","badges":[]},"plwikisource":{"name":"Autor:Jan Pawe\u0142 II","badges":[]}},"entity":["item",989],"claims":[{"m":["somevalue",22],"q":[],"g":"Q989$a9f7dd12-48e5-ff49-7173-7bb594517c51","rank":1,"refs":[]},{"m":["novalue",40],"q":[],"g":"Q989$bbfbd327-4597-306d-eb39-7c7fa7cc9684","rank":1,"refs":[]},{"m":["value",21,"wikibase-entityid",{"entity-type":"item","numeric-id":6581097}],"q":[],"g":"q989$3C507596-D2DF-41B1-B9B7-033FC32C0B41","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":54919}]],[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]]},{"m":["value",19,"wikibase-entityid",{"entity-type":"item","numeric-id":212856}],"q":[],"g":"q989$8BF609DD-49FC-4B60-8B32-8699F9971A26","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":1551807}]]]},{"m":["value",20,"wikibase-entityid",{"entity-type":"item","numeric-id":145093}],"q":[],"g":"q989$F9E46E58-FED6-41A4-ACC1-6E1A87A527AA","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]]},{"m":["value",27,"wikibase-entityid",{"entity-type":"item","numeric-id":36}],"q":[],"g":"q989$BD254EE8-3E55-401D-8EAF-FCCF4B34FDFB","rank":1,"refs":[]},{"m":["value",27,"wikibase-entityid",{"entity-type":"item","numeric-id":237}],"q":[],"g":"q989$C4ABD847-7843-4FE1-B24A-6D0F2CBA52D5","rank":1,"refs":[]},{"m":["value",119,"wikibase-entityid",{"entity-type":"item","numeric-id":1717939}],"q":[],"g":"q989$196D772F-57AB-416D-AABC-129B8435EA32","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]]},{"m":["value",18,"string","John Paul II Medal of Freedom 2004.jpg"],"q":[],"g":"q989$0146CA06-F327-405B-AC88-668A9022BF36","rank":1,"refs":[]},{"m":["value",94,"string","John paul 2 coa.svg"],"q":[],"g":"q989$4B6FB19D-FE48-46EB-92B4-D5B8DCE37811","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":1551807}]]]},{"m":["value",103,"wikibase-entityid",{"entity-type":"item","numeric-id":809}],"q":[],"g":"q989$77976F31-AEFC-46E7-9774-02D039823212","rank":1,"refs":[]},{"m":["value",214,"string","35605"],"q":[],"g":"q989$B88A8929-5A2E-4C2C-A3D1-E47554492CB8","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]],[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":48183}]]]},{"m":["value",227,"string","118558064"],"q":[],"g":"q989$A5A6143A-1DD4-4DEA-B0A3-9AAD7C4098B3","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]],[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":48183}]]]},{"m":["value",244,"string","n78078345"],"q":[],"g":"q989$19970D6C-E80F-4F32-BFC0-79054C79827F","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]],[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":48183}]]]},{"m":["value",269,"string","029093147"],"q":[],"g":"q989$76069BF5-0E06-4A5E-909E-DDF154FD0D26","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":54919}]]]},{"m":["value",434,"string","b3e2a4cb-3e2b-4d77-b744-89dc43e8362b"],"q":[],"g":"q989$0C33423D-983C-41B1-99B6-FF0FEE40489B","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":14005}]]]},{"m":["value",39,"wikibase-entityid",{"entity-type":"item","numeric-id":29182}],"q":[["value",580,"time",{"time":"+00000001958-07-04T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}],["value",582,"time",{"time":"+00000001964-01-13T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}],["value",155,"wikibase-entityid",{"entity-type":"item","numeric-id":15291025}],["value",156,"wikibase-entityid",{"entity-type":"item","numeric-id":15291031}],["value",708,"wikibase-entityid",{"entity-type":"item","numeric-id":1510305}]],"g":"q989$9277929f-41a8-fa18-ee37-fde83931e8c3","rank":1,"refs":[]},{"m":["value",39,"wikibase-entityid",{"entity-type":"item","numeric-id":19546}],"q":[["value",580,"time",{"time":"+00000001978-10-16T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}],["value",582,"time",{"time":"+00000002005-04-02T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}],["value",155,"wikibase-entityid",{"entity-type":"item","numeric-id":37278}],["value",156,"wikibase-entityid",{"entity-type":"item","numeric-id":2494}]],"g":"q989$43E3900E-9F45-4531-8C96-912DC7A5E131","rank":1,"refs":[]},{"m":["value",39,"wikibase-entityid",{"entity-type":"item","numeric-id":45722}],"q":[["value",580,"time",{"time":"+00000001967-06-28T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}],["value",582,"time",{"time":"+00000002005-04-02T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}]],"g":"q989$eee026d5-400a-7d96-f004-2929762b3764","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":1551807}]]]},{"m":["value",39,"wikibase-entityid",{"entity-type":"item","numeric-id":49476}],"q":[["value",580,"time",{"time":"+00000001964-01-13T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}],["value",582,"time",{"time":"+00000001978-10-16T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}],["value",155,"wikibase-entityid",{"entity-type":"item","numeric-id":350963}],["value",156,"wikibase-entityid",{"entity-type":"item","numeric-id":55772}],["value",708,"wikibase-entityid",{"entity-type":"item","numeric-id":1364786}]],"g":"Q989$fd51dfeb-467f-1364-a321-46600255e83c","rank":1,"refs":[]},{"m":["value",373,"string","Ioannes Paulus II"],"q":[],"g":"q989$7FFDE92D-23CE-4A9D-B99D-44564CFCDA7D","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]]},{"m":["value",513,"string","Karol J\u00f3zef Wojty\u0142a"],"q":[],"g":"q989$2b2903a9-4da5-a01f-282d-7d62bf4c815e","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]]},{"m":["value",349,"string","00444266"],"q":[],"g":"q989$CFE9FDD7-7164-4C5A-8083-3C9450A23BD1","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":54919}]]]},{"m":["value",569,"time",{"time":"+00000001920-05-18T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}],"q":[],"g":"q989$CFBC073A-3E27-4701-8869-134304C727E7","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]]},{"m":["value",570,"time",{"time":"+00000002005-04-02T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}],"q":[],"g":"q989$772BAD03-D2EB-4D61-94F8-CC32B90932F0","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]]},{"m":["value",109,"string","Signature of John Paul II.svg"],"q":[],"g":"q989$c985ec08-4373-afdc-b8db-b4b9236ace07","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]]},{"m":["value",69,"wikibase-entityid",{"entity-type":"item","numeric-id":189441}],"q":[],"g":"q989$aaf0df06-42fd-648d-612b-887f6eb44759","rank":1,"refs":[]},{"m":["value",509,"wikibase-entityid",{"entity-type":"item","numeric-id":438971}],"q":[],"g":"q989$3d601f21-4157-aedb-95d0-a7aa6f3347eb","rank":1,"refs":[]},{"m":["value",166,"wikibase-entityid",{"entity-type":"item","numeric-id":152337}],"q":[],"g":"q989$f2d4db02-4492-a35c-a50b-b4f80e2aa79c","rank":1,"refs":[]},{"m":["value",166,"wikibase-entityid",{"entity-type":"item","numeric-id":84020}],"q":[["value",585,"time",{"time":"+00000001993-05-03T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}]],"g":"q989$cd1dd9bd-4e7e-4eba-ca8a-a7cd402ac103","rank":1,"refs":[]},{"m":["value",166,"wikibase-entityid",{"entity-type":"item","numeric-id":17144}],"q":[["value",585,"time",{"time":"+00000002004-06-04T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}]],"g":"q989$6dbf596b-425c-8eab-9b43-5eba8fa089bd","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]]},{"m":["value",166,"wikibase-entityid",{"entity-type":"item","numeric-id":721743}],"q":[["value",585,"time",{"time":"+00000002000-07-27T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}]],"g":"q989$144efd0b-421f-b1d1-bcfa-7e9d792f6c0d","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]]},{"m":["value",166,"wikibase-entityid",{"entity-type":"item","numeric-id":55697}],"q":[],"g":"q989$c404ddb5-4e6f-8ec0-054d-19e971c4f71d","rank":1,"refs":[]},{"m":["value",463,"wikibase-entityid",{"entity-type":"item","numeric-id":1633152}],"q":[],"g":"q989$c5576035-4009-dbd0-39fb-43a394176ffb","rank":1,"refs":[]},{"m":["value",140,"wikibase-entityid",{"entity-type":"item","numeric-id":9592}],"q":[],"g":"q989$1e45c08a-470e-1018-bce0-6ae5e698687d","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]]},{"m":["value",691,"string","jn19981001536"],"q":[],"g":"q989$849069FF-9C3F-478D-AF70-C91E40FCB3DC","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":54919}]]]},{"m":["value",411,"wikibase-entityid",{"entity-type":"item","numeric-id":9591034}],"q":[["value",585,"time",{"time":"+00000002011-05-01T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}]],"g":"q989$3A4AA3B2-06CB-4ED0-995E-4D1E275C2606","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]]},{"m":["value",411,"wikibase-entityid",{"entity-type":"item","numeric-id":51619}],"q":[["value",585,"time",{"time":"+00000002009-12-19T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}]],"g":"q989$8f794f27-48c3-f497-1ed8-d45097c59906","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]]},{"m":["value",411,"wikibase-entityid",{"entity-type":"item","numeric-id":869974}],"q":[["value",585,"time",{"time":"+00000002005-06-28T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}]],"g":"q989$130425c3-4c3b-1093-bea1-672103316aaf","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]]},{"m":["value",396,"string","IT\\ICCU\\CFIV\\000007"],"q":[],"g":"q989$ddc25cb9-4501-dc62-a5a2-bdf39e35d016","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":576951}]]]},{"m":["value",841,"wikibase-entityid",{"entity-type":"item","numeric-id":2957}],"q":[],"g":"q989$918c66de-414a-6599-1c41-7dc5ebc662e1","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":11920}]]]},{"m":["value",245,"string","500278046"],"q":[],"g":"q989$e8e82134-4f01-ede7-8dc5-ae58246258dc","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":54919}]]]},{"m":["value",409,"string","35879484"],"q":[],"g":"q989$275ef876-4de6-9a5f-04b5-7f5a98f776bf","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":54919}]]]},{"m":["value",646,"string","\/m\/05yfx"],"q":[],"g":"q989$1618418f-46f6-4397-530d-e4257fabefb8","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":1453477}]]]},{"m":["value",271,"string","DA02012496"],"q":[],"g":"q989$caa24030-4411-9e31-ffcc-e2a68fe33633","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10726338}]]]},{"m":["value",535,"string","10717244"],"q":[],"g":"q989$63a3aed3-4b3e-31f6-b232-79f8213ee4a0","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":63056}]]]},{"m":["value",213,"string","0000 0001 2382 6196"],"q":[],"g":"q989$ed0a3dc0-487d-70cb-9d17-4ffd0ef98287","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":423048}]]]},{"m":["value",906,"string","233162"],"q":[],"g":"Q989$83DB5AAF-B638-4E87-B01B-04B949E06B6D","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]]},{"m":["value",268,"string","120790780"],"q":[],"g":"Q989$92FB7E0D-0198-4C36-B862-9A0F661EB521","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]]},{"m":["value",31,"wikibase-entityid",{"entity-type":"item","numeric-id":5}],"q":[],"g":"Q989$FF43DD0B-1E59-4DBC-B1DF-3AA9DD95CEAB","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":206855}]]]},{"m":["value",910,"wikibase-entityid",{"entity-type":"item","numeric-id":7011508}],"q":[],"g":"Q989$B64CF0AD-803D-4ABE-86EA-1A227CFF3C69","rank":1,"refs":[]},{"m":["value",950,"string","XX1054221"],"q":[],"g":"Q989$D3FA8ABA-7B14-4DF8-8073-B9704954A878","rank":1,"refs":[]},{"m":["value",949,"string","000071770"],"q":[],"g":"Q989$C083F40D-F827-417E-BF46-6F20162CF3C5","rank":1,"refs":[]},{"m":["value",935,"string","Ioannes Paulus II"],"q":[],"g":"Q989$388EAEF0-8C7E-4E99-80A1-BBBF97F60A61","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":191168}]]]},{"m":["value",1017,"string","ADV12073924"],"q":[],"g":"Q989$7EB4CEBB-E2CB-4073-B821-03D022299994","rank":1,"refs":[]},{"m":["value",1006,"string","068224745"],"q":[],"g":"Q989$91EB5554-F8D1-454C-98AF-D6C88FF33BEE","rank":1,"refs":[]},{"m":["value",443,"string","Pl-Karol J\u00f3zef Wojty\u0142a.ogg"],"q":[],"g":"Q989$ef295d45-4387-d6a1-334d-1c063df862bf","rank":1,"refs":[]},{"m":["value",1047,"string","wojtyla"],"q":[],"g":"Q989$649A551C-77DA-48AC-9144-1395E459207D","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":8447}]]]}]} \ No newline at end of file diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/MiscErrors.json b/wdtk-dumpfiles/src/test/resources/testSamples/MiscErrors.json new file mode 100644 index 000000000..83d1175b7 --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/MiscErrors.json @@ -0,0 +1,30 @@ +{ + "label":{ + "en": "test", + }, + "description":{ + "en": "this is a test" + }, + "aliases":{ + "en":["TEST", "Test"] + }, + "links":{ + "enwiki":{"name":"test","badges":[]} + }, + "entity":["item",1], + "claims":[ + { + "m":["value",1,"unknownValueType",null], + "q":[], + "g":"foo", + "rank":1, + "refs":[] + },{ + "m":["brokenValue",1,"unknownValueType",null], + "q":[], + "g":"foo", + "rank":1, + "refs":[] + } + ] +} diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/NoEntityDocument.json b/wdtk-dumpfiles/src/test/resources/testSamples/NoEntityDocument.json new file mode 100644 index 000000000..55a96c37b --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/NoEntityDocument.json @@ -0,0 +1,23 @@ +{ + "label":{ + "en": "test", + }, + "description":{ + "en": "this is a test" + }, + "aliases":{ + "en":["TEST", "Test"] + }, + "links":{ + "enwiki":{"name":"test","badges":[]} + }, + "claims":[ + { + "m":["value",1,"wikibase-entityid",{"entity-type":"item","numeric-id":1}], + "q":[], + "g":"foo", + "rank":1, + "refs":[] + } + ] +} \ No newline at end of file diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/P625.json b/wdtk-dumpfiles/src/test/resources/testSamples/P625.json new file mode 100644 index 000000000..e5d516005 --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/P625.json @@ -0,0 +1,145 @@ +{ +"label": +{ + "en":"coordinate location", + "fr":"coordonn\u00e9es g\u00e9ographiques", + "ko":"\uc88c\ud45c", + "de":"geographische Koordinaten", + "it":"coordinate geografiche", + "uk":"\u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0456\u0447\u043d\u0456 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0438", + "ca":"coordenades", + "fi":"koordinaatit", + "fa":"\u0645\u0634\u062e\u0635\u0627\u062a \u0645\u06a9\u0627\u0646", + "nl":"geografische locatie", + "ru":"\u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b", + "sr":"\u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0441\u043a\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0435", + "sr-ec":"\u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0441\u043a\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0435", + "cs":"zem\u011bpisn\u00e9 sou\u0159adnice", + "be-tarask":"\u0433\u0435\u0430\u0433\u0440\u0430\u0444\u0456\u0447\u043d\u044b\u044f \u043a\u0430\u0430\u0440\u0434\u044b\u043d\u0430\u0442\u044b", + "he":"\u05e7\u05d5\u05d0\u05d5\u05e8\u05d3\u05d9\u05e0\u05d8\u05d5\u05ea", + "sv":"Geografiska koordinater", + "zh":"\u5730\u7406\u5750\u6807", + "nds":"geograafsch Koordinaten", + "pl":"wsp\u00f3\u0142rz\u0119dne geograficzne", + "es":"coordenadas", + "hu":"f\u00f6ldrajzi koordin\u00e1ta", + "zh-hans":"\u5730\u7406\u5750\u6807", + "zh-hant":"\u5730\u7406\u5750\u6a19", + "yi":"\u05e7\u05d0\u05d0\u05e8\u05d3\u05d9\u05e0\u05d0\u05d8\u05df", + "oc":"coordenadas geograficas", + "en-ca":"coordinate location", + "en-gb":"coordinate location", + "ja":"\u4f4d\u7f6e\u5ea7\u6a19", + "la":"coordinata", + "lv":"\u0123eogr\u0101fisk\u0101s koordin\u0101tas", + "be":"\u0433\u0435\u0430\u0433\u0440\u0430\u0444\u0456\u0447\u043d\u044b\u044f \u043a\u0430\u0430\u0440\u0434\u044b\u043d\u0430\u0442\u044b", + "el":"\u03b3\u03b5\u03c9\u03b3\u03c1\u03b1\u03c6\u03b9\u03ba\u03ad\u03c2 \u03c3\u03c5\u03bd\u03c4\u03b5\u03c4\u03b1\u03b3\u03bc\u03ad\u03bd\u03b5\u03c2", + "no":"geografisk koordinat", + "bn":"\u09b8\u09cd\u09a5\u09be\u09a8\u09be\u0999\u09cd\u0995", + "pt":"coordenadas geogr\u00e1ficas", + "id":"koordinat lokasi", + "min":"koordinat lokasi", + "da":"geografiske koordinater", + "gl":"coordenadas", + "gu":"\u0a85\u0a95\u0acd\u0ab7\u0abe\u0a82\u0ab8 \u0ab8\u0acd\u0aa5\u0ab3", + "nb":"geokoordinater", + "pt-br":"coordenadas geogr\u00e1ficas", + "zh-cn":"\u5750\u6807\u4f4d\u7f6e", + "ms":"lokasi koordinat", + "bs":"Geografske koordinate", + "nn":"geografiske koordinatar", + "mr":"\u092d\u094c\u0917\u094b\u0932\u093f\u0915 \u0917\u0941\u0923\u0915", + "th":"\u0e1e\u0e34\u0e01\u0e31\u0e14\u0e20\u0e39\u0e21\u0e34\u0e28\u0e32\u0e2a\u0e15\u0e23\u0e4c", + "ka":"\u10d2\u10d4\u10dd\u10d2\u10e0\u10d0\u10e4\u10d8\u10e3\u10da\u10d8 \u10d9\u10dd\u10dd\u10e0\u10d3\u10d8\u10dc\u10d0\u10e2\u10d4\u10d1\u10d8", + "eo":"geografiaj koordinatoj", + "sk":"zemepisn\u00e9 s\u00faradnice", + "is":"hnitu\u00f0 sta\u00f0setning", + "nds-nl":"geografiese koordinaoten", + "rm":"coordinatas", + "eu":"koordenatuak", + "sh":"koordinate lokacije", + "sco":"coordinate location", + "br":"Kenurzhienno\u00f9 geografek", + "vi":"t\u1ecda \u0111\u1ed9", + "hr":"geografske koordinate", + "mk":"\u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0441\u043a\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0438", + "et":"koordinaadid", + "ro":"coordonate", + "mg":"Famaritana jeografika", + "gsw":"Geografischi Koordinate", + "lb":"geographesch Koordinaten", + "sl":"geografske koordinate", + "tt":"\u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u043a \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043b\u0430\u0440", + "af":"Geografiese ko\u00f6rdinate", + "ilo":"lokasion ti nagsasabtan", + "zh-hk":"\u5730\u7406\u5ea7\u6a19", + "ta":"\u0b86\u0baf\u0bae\u0bc1\u0bb1\u0bc8 \u0b87\u0b9f\u0b99\u0bcd\u0b95\u0bc1\u0bb1\u0bbf\u0baa\u0bcd\u0baa\u0bc1", + "zh-tw":"\u5730\u7406\u5ea7\u6a19", + "te":"\u0c05\u0c15\u0c4d\u0c37\u0c3e\u0c02\u0c36 \u0c30\u0c47\u0c16\u0c3e\u0c02\u0c36\u0c3e\u0c32\u0c41", + "de-formal":"geographische Koordinaten", + "or":"\u0b2d\u0b42\u0b1c\u0b15\u0b4b\u0b1f\u0b3f", + "bg":"\u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0441\u043a\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0438", + "ml":"\u0d2d\u0d57\u0d2e\u0d28\u0d3f\u0d7c\u0d26\u0d4d\u0d26\u0d47\u0d36\u0d3e\u0d19\u0d4d\u0d15\u0d19\u0d4d\u0d19\u0d7e", + "hi":"\u0938\u094d\u0925\u093e\u0928 \u0915\u093e \u0938\u092e\u0928\u094d\u0935\u092f" + }, +"description": + { + "en":"coordinates of the subject", + "fr":"coordonn\u00e9es g\u00e9ographiques d'un objet", + "de":"Koordinaten des Objekts", + "it":"coordinate del soggetto", + "uk":"\u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0456\u0447\u043d\u0456 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0438 \u043e\u0431'\u0454\u043a\u0442\u0430", + "ca":"coordenades geogr\u00e0fiques", + "fa":"\u0645\u0634\u062e\u0635\u0627\u062a \u062c\u063a\u0631\u0627\u0641\u06cc\u0627\u06cc\u06cc \u0645\u06a9\u0627\u0646 \u0645\u0648\u0631\u062f\u0646\u0638\u0631", + "nl":"geografische co\u00f6rdinaten", + "he":"\u05de\u05d9\u05e7\u05d5\u05dd \u05d2\u05d9\u05d0\u05d5\u05d2\u05e8\u05e4\u05d9", + "ru":"\u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u0430", + "es":"coordenadas geogr\u00e1ficas de la entidad", + "en-ca":"coordinates of the subject", + "en-gb":"coordinates of the subject", + "ja":"\u4e3b\u8a9e\u306e\u5ea7\u6a19", + "lv":"subjekta \u0123eogr\u0101fisk\u0101s koordin\u0101tas", + "be":"\u0433\u0435\u0430\u0433\u0440\u0430\u0444\u0456\u0447\u043d\u044b\u044f \u043a\u0430\u0430\u0440\u0434\u044b\u043d\u0430\u0442\u044b \u0430\u0431'\u0435\u043a\u0442\u0430", + "fi":"kohteen maantieteelliset koordinaatit", + "no":"objektets koordinater", + "pt":"coordenadas geogr\u00e1ficas da entidade", + "id":"koordinat dari subyek", + "min":"koordinat dari subyek", + "cs":"zem\u011bpisn\u00e9 sou\u0159adnice p\u0159edm\u011btu", + "gu":"\u0ab2\u0ac7\u0a96\u0aa8\u0abe \u0ab5\u0abf\u0ab7\u0aaf\u0aa8\u0abe\u0a82 \u0a85\u0a95\u0acd\u0ab7\u0abe\u0a82\u0ab8", + "nb":"entitetens geografiske koordinater", + "da":"subjektets koordinater", + "el":"\u03b3\u03b5\u03c9\u03b3\u03c1\u03b1\u03c6\u03b9\u03ba\u03ad\u03c2 \u03c3\u03c5\u03bd\u03c4\u03b5\u03c4\u03b1\u03b3\u03bc\u03ad\u03bd\u03b5\u03c2 \u03c0\u03bf\u03c5 \u03b1\u03c6\u03bf\u03c1\u03bf\u03cd\u03bd \u03c4\u03bf \u03b1\u03bd\u03c4\u03b9\u03ba\u03b5\u03af\u03bc\u03b5\u03bd\u03bf", + "eu":"objektu baten koordenatu geografikoak", + "ko":"\uc9c0\uc810\uc758 \uc9c0\ub9ac\uc801 \uc88c\ud45c", + "mk":"\u0433\u0435\u043e\u0433\u0440\u0430\u0434\u0441\u043a\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0438 \u043d\u0430 \u0434\u0430\u0434\u0435\u043d\u0438\u043e\u0442 \u043f\u0440\u0435\u0434\u043c\u0435\u0442", + "oc":"coordenadas geograficas d'un obj\u00e8cte", + "ro":"coordonatele subiectului", + "gsw":"Koordinate vum Obj\u00e4kt", + "ilo":"dagiti nagsasabtan ti suheto", + "sv":"longitud och latitud", + "ta":"\u0b86\u0baf\u0bae\u0bc1\u0bb1\u0bc8 \u0b87\u0b9f\u0b99\u0bcd\u0b95\u0bc1\u0bb1\u0bbf\u0baa\u0bcd\u0baa\u0bc1 (coordinate location)", + "ml":"\u0d2d\u0d42\u0d2e\u0d3f\u0d2f\u0d3f\u0d32\u0d46 \u0d38\u0d4d\u0d25\u0d3e\u0d28\u0d02" + }, +"aliases": + { + "en":["coordinates","co-ordinate location","co-ordinates","coords","co-ords","location","geographic coordinate","gps coordinate","gps co-ordinate","gps coordinates","gps co-ordinates","gps location","geotag","wgs 84","wgs-84","wgs84","position","longitude","latitude","gps"], + "fr":["coordonn\u00e9es","g\u00e9olocalisation","localisation","emplacement"], + "de":["Koordinate","geografische Koordinate","Koordinaten","Position"], + "uk":["\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0438"], + "nl":["gps","co\u00f6rdinaten","locatie"], + "zh":["\u5750\u6807"], + "ru":["\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b","\u043c\u0435\u0441\u0442\u043e\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435"], + "cs":["geo","sou\u0159adnice"], + "nb":["geografiske koordinater"], + "zh-cn":["\u7ecf\u7eac\u5ea6","\u4f4d\u7f6e"], + "vi":["to\u1ea1 \u0111\u1ed9"], + "et":["geograafilised koordinaadid"], + "ja":["\u7d4c\u5ea6","\u7def\u5ea6","\u5317\u7def","\u6771\u7d4c","\u4f4d\u7f6e","\u5ea7\u6a19"], + "sv":["koordinater"], + "ml":["\u0d2d\u0d42\u0d38\u0d4d\u0d25\u0d3f\u0d30\u0d3e\u0d19\u0d4d\u0d15\u0d19\u0d4d\u0d19\u0d7e"] + }, +"claims":[], +"datatype":"globe-coordinate", +"entity":["property",625] +} \ No newline at end of file diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/SnakTypes.json b/wdtk-dumpfiles/src/test/resources/testSamples/SnakTypes.json new file mode 100644 index 000000000..f405801d2 --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/SnakTypes.json @@ -0,0 +1,41 @@ +{ + "label":{ + "en": {"0":"some old version"}, + }, + "description":{ + "en": "test" + }, + "aliases":{ + "en":["TEST", "Test"] + }, + "links":{ + "enwiki":"archaicString" + }, + "entity":["item",1], + "claims":[ + { + "m":["value",1,"wikibase-entityid",{"entity-type":"item","numeric-id":1}], + "q":[], + "g":"foo", + "rank":1, + "refs":[] + },{ + "m":["value",625,"globecoordinate",{"latitude":90,"longitude":-90,"altitude":null,"globe":"SomeIri","precision":10}], + "q":[], + "g":"q58404$3264F174-B86B-4C4C-88E9-9A71D3918987", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]] + },{ + "m":["value",94,"string","Haaften wapen.svg"], + "q":[], + "g":"q58404$CFBC044E-5348-4EF0-AB6F-D68C15CDA79D", + "rank":1, + "refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]] + },{ + "m":["value",1082,"quantity",{"amount":"+34196","unit":"1","upperBound":"+34197","lowerBound":"+34195"}], + "q":[["value",585,"time",{"time":"+00000002012-06-30T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}]], + "g":"Q15982$92592771-4450-29cb-762e-ee8636ef7d5e", + "rank":1, + "refs":[[["value",854,"string","someSource"]]]} + ] +} diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/StatementRanks.json b/wdtk-dumpfiles/src/test/resources/testSamples/StatementRanks.json new file mode 100644 index 000000000..49afd66a2 --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/StatementRanks.json @@ -0,0 +1,36 @@ +{ + "label":{ + "en": "test", + }, + "description":{ + "en": "this is a test" + }, + "aliases":{ + "en":["TEST", "Test"] + }, + "links":{ + "enwiki":{"name":"test","badges":[]} + }, + "entity":["item",1], + "claims":[ + { + "m":["value",1,"wikibase-entityid",{"entity-type":"item","numeric-id":1}], + "q":[], + "g":"foo", + "rank":1, + "refs":[] + },{ + "m":["value",1,"wikibase-entityid",{"entity-type":"item","numeric-id":1}], + "q":[], + "g":"foo", + "rank":0, + "refs":[] + },{ + "m":["value",1,"wikibase-entityid",{"entity-type":"item","numeric-id":1}], + "q":[], + "g":"foo", + "rank":2, + "refs":[] + } + ] +} diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/StringEntityItem.json b/wdtk-dumpfiles/src/test/resources/testSamples/StringEntityItem.json new file mode 100644 index 000000000..a9ff30204 --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/StringEntityItem.json @@ -0,0 +1,15 @@ +{ + "label":{ + "en": "test", + }, + "description":{ + "en": "this is a test" + }, + "aliases":{ + "en":["TEST", "Test"] + }, + "links":{ + "enwiki":{"name":"test","badges":[]} + }, + "entity": "q123", +} \ No newline at end of file diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/StringEntityProperty.json b/wdtk-dumpfiles/src/test/resources/testSamples/StringEntityProperty.json new file mode 100644 index 000000000..cf55ca5ad --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/StringEntityProperty.json @@ -0,0 +1,17 @@ +{ + "label":{ + "en": "test", + }, + "description":{ + "en": "this is a test" + }, + "aliases":{ + "en":["TEST", "Test"] + }, + "links":{ + "enwiki":{"name":"test","badges":[]} + }, + "entity": "p123", + +"datatype":"globe-coordinate" +} \ No newline at end of file diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/Tours.json b/wdtk-dumpfiles/src/test/resources/testSamples/Tours.json new file mode 100644 index 000000000..b1af72fbb --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/Tours.json @@ -0,0 +1 @@ +{"label":{"en":"Tours","fr":"Tours","de":"Tours","it":"Tours","es":"Tours","an":"Tours","ar":"\u062a\u0648\u0631","ast":"Tours","be":"\u0422\u0443\u0440","bg":"\u0422\u0443\u0440","br":"Teurgn","ca":"Tours","ceb":"Tours","cs":"Tours","cy":"Tours","da":"Tours","el":"\u03a4\u03bf\u03c5\u03c1","eo":"Tours","et":"Tours","eu":"Tours","ext":"Tours","fa":"\u062a\u0648\u0631","fi":"Tours","ga":"Tours","gd":"Tours","gl":"Tours","he":"\u05d8\u05d5\u05e8","hu":"Tours","id":"Tours","io":"Tours","ja":"\u30c8\u30a5\u30fc\u30eb","ka":"\u10e2\u10e3\u10e0\u10d8","ko":"\ud22c\ub974","la":"Turones","lt":"T\u016bras","lv":"T\u016bra","mg":"Tours","ms":"Tours","mzn":"\u062a\u0648\u0631","nl":"Tours","nn":"Tours","oc":"Tors","pl":"Tours","pms":"Tours","pnb":"\u0679\u0648\u0631\u0632","pt":"Tours","ro":"Tours","ru":"\u0422\u0443\u0440","scn":"Tours","sk":"Tours","sl":"Tours","sr":"\u0422\u0443\u0440","sv":"Tours","sw":"Tours","tr":"Tours","uk":"\u0422\u0443\u0440","vi":"Tours","vo":"Tours","war":"Tours","zh":"\u56fe\u5c14","be-tarask":"\u0422\u0443\u0440","nb":"Tours","simple":"Tours","hi":"\u091f\u0941\u0930","be-x-old":"\u0422\u0443\u0440","sh":"Tours","uz":"Tours","ta":"\u0b9f\u0bc2\u0bb0\u0bcd\u0bb8\u0bcd","pt-br":"Tours","zh-hans":"\u56fe\u5c14","zh-hant":"\u5716\u723e","de-ch":"Tours","en-ca":"Tours","en-gb":"Tours","mr":"\u0924\u0941\u0930, \u092b\u094d\u0930\u093e\u0928\u094d\u0938"},"description":{"en":"commune in Indre-et-Loire, France","fr":"ville de France","it":"comune francese","es":"ciudad francesa","de":"Hauptstadt des franz\u00f6sischen D\u00e9partements Indre-et-Loire","ru":"\u0433\u043e\u0440\u043e\u0434 \u0432\u043e \u0424\u0440\u0430\u043d\u0446\u0438\u0438","fi":"kaupunki Keski-Ranskassa","nb":"by i Frankrike","nl":"Indre-et-Loire","sr":"\u0433\u0440\u0430\u0434 \u0443 \u0424\u0440\u0430\u043d\u0446\u0443\u0441\u043a\u043e\u0458","pt-br":"cidade da Fran\u00e7a","zh-hans":"\u4f4d\u4e8e\u6cd5\u56fd\u5b89\u5fb7\u5c14-\u5362\u74e6\u5c14\u7701\u7684\u57ce\u5e02"},"aliases":[],"links":{"itwiki":{"name":"Tours","badges":[]},"frwiki":{"name":"Tours","badges":[]},"dewiki":{"name":"Tours","badges":[]},"enwiki":{"name":"Tours","badges":[]},"anwiki":{"name":"Tours","badges":[]},"arwiki":{"name":"\u062a\u0648\u0631 (\u0645\u062f\u064a\u0646\u0629)","badges":[]},"astwiki":{"name":"Tours","badges":[]},"bewiki":{"name":"\u0413\u043e\u0440\u0430\u0434 \u0422\u0443\u0440","badges":[]},"bgwiki":{"name":"\u0422\u0443\u0440 (\u0433\u0440\u0430\u0434)","badges":[]},"brwiki":{"name":"Teurgn","badges":[]},"cawiki":{"name":"Tours","badges":[]},"cebwiki":{"name":"Tours","badges":[]},"cswiki":{"name":"Tours","badges":[]},"cywiki":{"name":"Tours","badges":[]},"dawiki":{"name":"Tours","badges":[]},"elwiki":{"name":"\u03a4\u03bf\u03c5\u03c1","badges":[]},"eowiki":{"name":"Tours","badges":[]},"eswiki":{"name":"Tours","badges":[]},"etwiki":{"name":"Tours","badges":[]},"euwiki":{"name":"Tours","badges":[]},"extwiki":{"name":"Tours","badges":[]},"fawiki":{"name":"\u062a\u0648\u0631 (\u0641\u0631\u0627\u0646\u0633\u0647)","badges":[]},"fiwiki":{"name":"Tours","badges":[]},"gawiki":{"name":"Tours","badges":[]},"gdwiki":{"name":"Tours","badges":[]},"glwiki":{"name":"Tours","badges":[]},"hewiki":{"name":"\u05d8\u05d5\u05e8 (\u05e2\u05d9\u05e8)","badges":[]},"huwiki":{"name":"Tours","badges":[]},"idwiki":{"name":"Tours","badges":[]},"iowiki":{"name":"Tours","badges":[]},"jawiki":{"name":"\u30c8\u30a5\u30fc\u30eb (\u30a2\u30f3\u30c9\u30eb\uff1d\u30a8\uff1d\u30ed\u30ef\u30fc\u30eb\u770c)","badges":[]},"kawiki":{"name":"\u10e2\u10e3\u10e0\u10d8 (\u10e1\u10d0\u10e4\u10e0\u10d0\u10dc\u10d2\u10d4\u10d7\u10d8)","badges":[]},"kowiki":{"name":"\ud22c\ub974","badges":[]},"lawiki":{"name":"Turones","badges":[]},"ltwiki":{"name":"T\u016bras","badges":[]},"lvwiki":{"name":"T\u016bra","badges":[]},"mgwiki":{"name":"Tours","badges":[]},"mswiki":{"name":"Tours","badges":[]},"mznwiki":{"name":"\u062a\u0648\u0631 (\u0641\u0631\u0627\u0646\u0633\u0647)","badges":[]},"nlwiki":{"name":"Tours (Indre-et-Loire)","badges":[]},"nnwiki":{"name":"Tours","badges":[]},"nowiki":{"name":"Tours","badges":[]},"ocwiki":{"name":"Tors","badges":[]},"plwiki":{"name":"Tours","badges":[]},"pmswiki":{"name":"Tours","badges":[]},"pnbwiki":{"name":"\u0679\u0648\u0631\u0632","badges":[]},"ptwiki":{"name":"Tours","badges":[]},"rowiki":{"name":"Tours","badges":[]},"ruwiki":{"name":"\u0422\u0443\u0440 (\u0433\u043e\u0440\u043e\u0434)","badges":[]},"scnwiki":{"name":"Tours","badges":[]},"simplewiki":{"name":"Tours","badges":[]},"skwiki":{"name":"Tours","badges":[]},"slwiki":{"name":"Tours","badges":[]},"srwiki":{"name":"\u0422\u0443\u0440 (\u0433\u0440\u0430\u0434)","badges":[]},"svwiki":{"name":"Tours","badges":[]},"swwiki":{"name":"Tours","badges":[]},"trwiki":{"name":"Tours","badges":[]},"ukwiki":{"name":"\u0422\u0443\u0440 (\u043c\u0456\u0441\u0442\u043e)","badges":[]},"viwiki":{"name":"Tours","badges":[]},"vowiki":{"name":"Tours","badges":[]},"warwiki":{"name":"Tours","badges":[]},"zhwiki":{"name":"\u56fe\u5c14","badges":[]},"be_x_oldwiki":{"name":"\u0422\u0443\u0440 (\u0433\u043e\u0440\u0430\u0434)","badges":[]},"shwiki":{"name":"Tours","badges":[]},"hiwiki":{"name":"\u091f\u0941\u0930","badges":[]},"uzwiki":{"name":"Tours (Indre-et-Loire)","badges":[]},"nlwikivoyage":{"name":"Tours","badges":[]},"dewikivoyage":{"name":"Tours","badges":[]},"enwikivoyage":{"name":"Tours","badges":[]},"frwikivoyage":{"name":"Tours","badges":[]},"itwikivoyage":{"name":"Tours","badges":[]},"rowikivoyage":{"name":"Tours","badges":[]},"commonswiki":{"name":"Tours","badges":[]},"mrwiki":{"name":"\u0924\u0941\u0930, \u092b\u094d\u0930\u093e\u0928\u094d\u0938","badges":[]}},"entity":["item",288],"claims":[{"m":["value",1151,"wikibase-entityid",{"entity-type":"item","numeric-id":15647664}],"q":[],"g":"Q288$10b586af-4fcb-295c-c861-1e7c66ed518e","rank":1,"refs":[]},{"m":["value",31,"wikibase-entityid",{"entity-type":"item","numeric-id":515}],"q":[],"g":"q288$F922B432-E8A2-47D8-B539-BDAE91BB8018","rank":1,"refs":[]},{"m":["value",17,"wikibase-entityid",{"entity-type":"item","numeric-id":142}],"q":[],"g":"q288$63175B8B-940A-48BB-BF6B-93A10089B468","rank":1,"refs":[]},{"m":["value",131,"wikibase-entityid",{"entity-type":"item","numeric-id":12556}],"q":[],"g":"q288$6D5494EB-2439-4366-A24D-C40AD787232A","rank":1,"refs":[]},{"m":["value",131,"wikibase-entityid",{"entity-type":"item","numeric-id":13947}],"q":[],"g":"q288$97CB17D9-A927-4D81-B037-38E8BA60C9EE","rank":1,"refs":[]},{"m":["value",131,"wikibase-entityid",{"entity-type":"item","numeric-id":913072}],"q":[],"g":"Q288$8BE33973-914C-475F-94AB-2FBC495ECE23","rank":1,"refs":[]},{"m":["value",131,"wikibase-entityid",{"entity-type":"item","numeric-id":743594}],"q":[],"g":"Q288$77DE9FD5-F09A-4FE0-BE57-AB50757CDAA5","rank":1,"refs":[]},{"m":["value",131,"wikibase-entityid",{"entity-type":"item","numeric-id":913130}],"q":[],"g":"Q288$F875F85A-7BD6-4678-B713-68C09F4C2EFF","rank":1,"refs":[]},{"m":["value",131,"wikibase-entityid",{"entity-type":"item","numeric-id":913107}],"q":[],"g":"Q288$4E72809A-2AF9-4F3B-AD2B-1BA789F1C693","rank":1,"refs":[]},{"m":["value",131,"wikibase-entityid",{"entity-type":"item","numeric-id":913117}],"q":[],"g":"Q288$C3BE3026-02A0-4B31-8D94-EB5CEEE5C914","rank":1,"refs":[]},{"m":["value",131,"wikibase-entityid",{"entity-type":"item","numeric-id":913121}],"q":[],"g":"Q288$8F6E34B7-FE01-4B7F-92B3-137A9841F8F7","rank":1,"refs":[]},{"m":["value",131,"wikibase-entityid",{"entity-type":"item","numeric-id":913056}],"q":[],"g":"Q288$55BAA517-3C0C-4ABD-A815-F74CF7622D3F","rank":1,"refs":[]},{"m":["value",374,"string","37261"],"q":[],"g":"q288$B0CF2A97-E924-45D3-93DF-C426F5D795E4","rank":1,"refs":[[["value",248,"wikibase-entityid",{"entity-type":"item","numeric-id":156705}],["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]]},{"m":["value",132,"wikibase-entityid",{"entity-type":"item","numeric-id":484170}],"q":[],"g":"q288$F174A525-98CD-47A7-9B64-D444BA1B0412","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]]},{"m":["value",373,"string","Tours (France)"],"q":[],"g":"q288$EF67C08C-7187-4251-944E-11F86C6C864B","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":48183}]]]},{"m":["value",18,"string","Loire Indre Tours1 tango7174.jpg"],"q":[],"g":"q288$868F3D14-9522-4462-8F75-E0BBDF23D728","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":10000}]]]},{"m":["value",94,"string","Blason tours 37.svg"],"q":[],"g":"q288$495330d9-4a1f-3183-5cd1-01d837d0b2a4","rank":1,"refs":[]},{"m":["value",625,"globecoordinate",{"latitude":47.3936,"longitude":0.6892,"altitude":null,"precision":0.0001,"globe":"http:\/\/www.wikidata.org\/entity\/Q2"}],"q":[],"g":"q288$25FAE422-96C9-4613-84E4-7E8660CF7375","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":206855}]]]},{"m":["value",910,"wikibase-entityid",{"entity-type":"item","numeric-id":6577455}],"q":[],"g":"Q288$136CC24B-A74B-448B-A673-F542851733E7","rank":1,"refs":[]},{"m":["value",948,"string","Tours banner Panoramic landscape painting detail.jpg"],"q":[],"g":"Q288$8A93C6D1-22DE-41A0-BDF8-C733E8B751F3","rank":1,"refs":[]},{"m":["value",982,"string","dea069af-67b5-422c-a19a-a6915b9fe592"],"q":[],"g":"Q288$00976007-794F-4C13-A9B7-64D1F6D7D58C","rank":1,"refs":[[["value",248,"wikibase-entityid",{"entity-type":"item","numeric-id":14005}]]]},{"m":["value",646,"string","\/m\/07s3m"],"q":[],"g":"Q288$9F0ADD11-7C6D-4FF1-8775-A64A93E9618A","rank":1,"refs":[[["value",248,"wikibase-entityid",{"entity-type":"item","numeric-id":15241312}],["value",577,"time",{"time":"+00000002013-10-28T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}]]]}]} \ No newline at end of file diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/Universe.json b/wdtk-dumpfiles/src/test/resources/testSamples/Universe.json new file mode 100644 index 000000000..7dd6fecf9 --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/Universe.json @@ -0,0 +1,3 @@ +{"label":{"en":"Universe","fr":"Univers","la":"Universum","uz":"Olam","ru":"\u0412\u0441\u0435\u043b\u0435\u043d\u043d\u0430\u044f","pl":"Wszech\u015bwiat","nb":"Universet","eo":"Universo","it":"universo","es":"universo","de":"Universum","ca":"Univers","en-gb":"Universe","de-ch":"Universum","fi":"maailmankaikkeus","nn":"Universet","ja":"\u5b87\u5b99","zh-hant":"\u5b87\u5b99","hr":"Svemir","pt":"universo","simple":"Universe","hu":"vil\u00e1gegyetem","nl":"Heelal","ro":"Univers","sv":"Universum","gl":"Universo","eu":"Unibertso","mk":"\u0412\u0441\u0435\u043b\u0435\u043d\u0430","da":"Universet","br":"Hollved","et":"Universum","af":"Heelal","cy":"Bydysawd","io":"Universo","ia":"Universo","is":"Alheimurinn","no":"Universet","tr":"Evren","cs":"Vesm\u00edr","sk":"Vesm\u00edr","uk":"\u0412\u0441\u0435\u0441\u0432\u0456\u0442","an":"Universo","az":"Kainat","ast":"Universu","gn":"Arapy","bs":"Svemir","sn":"Rudunhumwe","nv":"Y\u00e1gh\u00e1hook\u00e1\u00e1n","dsb":"Uniwersum","hif":"Sansaar","fo":"Alheimurin","fy":"Hielal","ga":"An Chruinne","hak":"Y\u00ee-chhiu","id":"Alam semesta","jv":"Alam semesta","pam":"Sikluban","csb":"Swiatnica","sw":"Ulimwengu","ht":"Liniv\u00e8","ku":"Gerd\u00fbn","lv":"Visums","lt":"Visata","li":"Universum","lmo":"\u00dcnivers","ms":"Alam semesta","mwl":"Ouniberso","nah":"Cem\u0101n\u0101huac","nds-nl":"Hielal","nap":"Annevierzo","frr":"\u00c5\u00e5l","nrm":"Eunivers","nov":"Universe","oc":"Univ\u00e8rs","pfl":"Weldall","pap":"Universo","nds":"Weltruum","qu":"Ch'askancha","stq":"Al","sq":"Gjith\u00ebsia","scn":"Universu","sl":"Vesolje","sh":"Svemir","su":"Jagat","tl":"Uniberso","war":"Sangkalibutan","bat-smg":"V\u0117sata","vi":"V\u0169 tr\u1ee5","zh-min-nan":"\u00da-ti\u016b","bn":"\u09ae\u09b9\u09be\u09ac\u09bf\u09b6\u09cd\u09ac","ar":"\u0641\u0636\u0627\u0621 \u0643\u0648\u0646\u064a","arc":"\u072c\u0712\u071d\u0720","arz":"\u0643\u0648\u0646","be":"\u0421\u0443\u0441\u0432\u0435\u0442","bg":"\u0412\u0441\u0435\u043b\u0435\u043d\u0430","ckb":"\u06af\u06d5\u0631\u062f\u0648\u0648\u0646","cv":"\u00c7\u0443\u0442 \u0422\u0115\u043d\u0447\u0435","el":"\u03a3\u03cd\u03bc\u03c0\u03b1\u03bd","fa":"\u06af\u06cc\u062a\u06cc","gu":"\u0aac\u0acd\u0ab0\u0ab9\u0acd\u0aae\u0abe\u0a82\u0aa1","he":"\u05d4\u05d9\u05e7\u05d5\u05dd","hi":"\u092c\u094d\u0930\u0939\u094d\u092e\u093e\u0923\u094d\u0921","hy":"\u054f\u056b\u0565\u0566\u0565\u0580\u0584","ka":"\u10e1\u10d0\u10db\u10e7\u10d0\u10e0\u10dd","kk":"\u04d8\u043b\u0435\u043c","kn":"\u0cac\u0ccd\u0cb0\u0cb9\u0ccd\u0cae\u0cbe\u0c82\u0ca1","ko":"\uc6b0\uc8fc","lez":"\u0427\u0438\u043b\u0435\u0440-\u0446\u0430\u0432\u0430\u0440","ml":"\u0d2a\u0d4d\u0d30\u0d2a\u0d1e\u0d4d\u0d1a\u0d02","mn":"\u041e\u0440\u0447\u043b\u043e\u043d","mr":"\u0935\u093f\u0936\u094d\u0935","my":"\u1005\u1000\u103c\u101d\u1020\u102c","ne":"\u092c\u094d\u0930\u0939\u094d\u092e\u093e\u0923\u094d\u0921","pnb":"\u06a9\u0627\u0626\u0646\u0627\u062a","rue":"\u0412\u0435\u0441\u043c\u0456\u0440","sr":"\u0421\u0432\u0435\u043c\u0438\u0440","ta":"\u0b85\u0ba3\u0bcd\u0b9f\u0bae\u0bcd","te":"\u0c35\u0c3f\u0c36\u0c4d\u0c35\u0c02","tg":"\u041a\u043e\u0438\u043d\u043e\u0442","th":"\u0e40\u0e2d\u0e01\u0e20\u0e1e","tt":"\u0413\u0430\u043b\u04d9\u043c","ur":"\u06a9\u0627\u0626\u0646\u0627\u062a","xmf":"\u10dd\u10e5\u10d8\u10d0\u10dc\u10e3","yi":"\u05d0\u05d5\u05e0\u05d9\u05d5\u05d5\u05e2\u05e8\u05e1","zh":"\u5b87\u5b99","zh-classical":"\u5b87\u5b99","zh-yue":"\u5b87\u5b99","en-ca":"Universe","pt-br":"universo","yue":"\u5b87\u5b99","zh-cn":"\u5b87\u5b99","zh-hans":"\u5b87\u5b99","zh-sg":"\u5b87\u5b99","zh-my":"\u5b87\u5b99","zh-hk":"\u5b87\u5b99","zh-tw":"\u5b87\u5b99","zh-mo":"\u5b87\u5b99","de-formal":"Universum"},"description":{"la":"res quae omnem materiam et spatium continet","en":"totality of planets, stars, galaxies, intergalactic space, and all matter and energy","fr":"ensemble de tout ce qui existe","pl":"Wszystko, co fizycznie istnieje: ca\u0142a przestrze\u0144, czas, wszystkie formy materii i energii oraz prawa fizyki i sta\u0142e fizyczne okre\u015blaj\u0105ce ich zachowanie.","es":"totalidad del espacio-tiempo, la materia y la energ\u00eda existentes","de":"Bezeichnung f\u00fcr alles, was existiert","it":"insieme di tutto ci\u00f2 che esiste","eo":"La tuto de \u0109io ekzistanta, steloj, spaco, materio, energio ...","no":"alt som eksisterer av rom, materie og str\u00e5ling","nb":"alt som eksisterer av rom, materie og str\u00e5ling.","nn":"alt som eksisterer, derfor all fysisk masse og energi, planetar, stjerner, galaksar, og alt i det intergalaktiske rommet","en-gb":"The totality of planets, stars, galaxies, intergalactic space, and all matter and energy","nl":"Alle materie en energie binnen het gehele ruimte-tijdcontinu\u00fcm waarin wij bestaan","ko":"\ubb34\ud55c\ud55c \uc2dc\uac04\uacfc \ub9cc\ubb3c\uc744 \ud3ec\ud568\ud558\uace0 \uc788\ub294 \ub05d\uc5c6\ub294 \uacf5\uac04\uc758 \ucd1d\uccb4","ca":"totalitat del continu espai-temps en qu\u00e8 es troba la humanitat,","fi":"avaruuden ja siin\u00e4 olevan aineen ja energian muodostama kokonaisuus","ru":"\u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u0432 \u0430\u0441\u0442\u0440\u043e\u043d\u043e\u043c\u0438\u0438 \u0438 \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u0438","zh-hans":"\u4e00\u5207\u7a7a\u95f4\u3001\u65f6\u95f4\u3001\u7269\u8d28\u548c\u80fd\u91cf\u6784\u6210\u7684\u7edf\u4e00\u4f53","zh-hant":"\u4e00\u5207\u7a7a\u9593\u3001\u6642\u9593\u3001\u7269\u8cea\u548c\u80fd\u91cf\u69cb\u6210\u7684\u7d71\u4e00\u9ad4","zh-cn":"\u4e00\u5207\u7a7a\u95f4\u3001\u65f6\u95f4\u3001\u7269\u8d28\u548c\u80fd\u91cf\u6784\u6210\u7684\u7edf\u4e00\u4f53","zh-sg":"\u4e00\u5207\u7a7a\u95f4\u3001\u65f6\u95f4\u3001\u7269\u8d28\u548c\u80fd\u91cf\u6784\u6210\u7684\u7edf\u4e00\u4f53","zh-my":"\u4e00\u5207\u7a7a\u95f4\u3001\u65f6\u95f4\u3001\u7269\u8d28\u548c\u80fd\u91cf\u6784\u6210\u7684\u7edf\u4e00\u4f53","zh":"\u4e00\u5207\u7a7a\u95f4\u3001\u65f6\u95f4\u3001\u7269\u8d28\u548c\u80fd\u91cf\u6784\u6210\u7684\u7edf\u4e00\u4f53","zh-hk":"\u4e00\u5207\u7a7a\u9593\u3001\u6642\u9593\u3001\u7269\u8cea\u548c\u80fd\u91cf\u69cb\u6210\u7684\u7d71\u4e00\u9ad4","zh-tw":"\u4e00\u5207\u7a7a\u9593\u3001\u6642\u9593\u3001\u7269\u8cea\u548c\u80fd\u91cf\u69cb\u6210\u7684\u7d71\u4e00\u9ad4","zh-mo":"\u4e00\u5207\u7a7a\u9593\u3001\u6642\u9593\u3001\u7269\u8cea\u548c\u80fd\u91cf\u69cb\u6210\u7684\u7d71\u4e00\u9ad4","ja":"\u60d1\u661f\u30fb\u6052\u661f\u30fb\u9280\u6cb3\u30fb\u9280\u6cb3\u9593\u306e\u7a7a\u9593\u3001\u5168\u3066\u306e\u7269\u8cea\u30fb\u30a8\u30cd\u30eb\u30ae\u30fc\u306e\u7dcf\u4f53","tr":"y\u0131ld\u0131zlar, gezegenler, gaz, toz, galaksileraras\u0131 madde ve k\u0131saca her \u015fey","uk":"\u0441\u0443\u043a\u0443\u043f\u043d\u0456\u0441\u0442\u044c \u0443\u0441\u044c\u043e\u0433\u043e, \u0449\u043e \u0456\u0441\u043d\u0443\u0454: \u0447\u0430\u0441, \u043f\u0440\u043e\u0441\u0442\u0456\u0440, \u043c\u0430\u0442\u0435\u0440\u0456\u044f, \u0435\u043d\u0435\u0440\u0433\u0456\u044f","pt-br":"tudo o que existe fisicamente, a totalidade do espa\u00e7o e tempo e todas as formas de mat\u00e9ria e energia","ta":"\u0bb5\u0bc6\u0bb3\u0bbf \u0bae\u0bb1\u0bcd\u0bb1\u0bc1\u0bae\u0bcd \u0b95\u0bbe\u0bb2\u0bae\u0bcd \u0b86\u0b95\u0bbf\u0baf\u0bb5\u0bb1\u0bcd\u0bb1\u0bbf\u0ba9\u0bcd \u0bae\u0bc1\u0bb4\u0bc1\u0bae\u0bc8"},"aliases":{"pl":["Kosmos","\u015awiat","Natura","Uniwersum"],"en":["cosmos"],"es":["cosmos"],"de":["Weltall","All","Kosmos"],"fr":{"1":"Cosmos"},"eo":["Kosmo"],"it":{"2":"cosmo","3":"spazio"},"nl":["Universum","Kosmos","Cosmos"],"ca":["Hist\u00f2ria de l'univers","Macrocosmos"],"fi":["universumi"],"hu":["univerzum"],"sv":["Kosmos"],"nds":["Universum","Kosmos"],"fa":["\u062c\u0647\u0627\u0646","\u0639\u0627\u0644\u0645","\u0686\u0631\u062e \u06af\u0631\u062f\u0648\u0646","\u06a9\u06cc\u0647\u0627\u0646","\u06a9\u0627\u06cc\u0646\u0627\u062a","\u0647\u0633\u062a\u06cc"],"ta":["\u0baa\u0bbf\u0bb0\u0baa\u0b9e\u0bcd\u0b9a\u0bae\u0bcd","\u0baa\u0bc7\u0bb0\u0ba3\u0bcd\u0b9f\u0bae\u0bcd","\u0baa\u0bb2\u0bcd\u0bb2\u0ba3\u0bcd\u0b9f\u0bae\u0bcd","\u0b85\u0ba3\u0bcd\u0b9f\u0bb5\u0bc6\u0bb3\u0bbf"]},"links":{"enwiki":"Universe","dewiki":"Universum","hrwiki":"Svemir","frwiki":"Univers","lawiki":"Universum","ptwiki":"Universo","fiwiki":"Maailmankaikkeus","simplewiki":"Universe","jawiki":"\u5b87\u5b99","eswiki":"Universo","itwiki":"Universo","huwiki":"Vil\u00e1gegyetem","eowiki":"Universo","cawiki":"Univers","nlwiki":"Heelal","rowiki":"Univers","svwiki":"Universum","plwiki":"Wszech\u015bwiat","glwiki":"Universo","euwiki":"Unibertso","mkwiki":"\u0412\u0441\u0435\u043b\u0435\u043d\u0430","dawiki":"Universet","brwiki":"Hollved","etwiki":"Universum","afwiki":"Heelal","cywiki":"Bydysawd (seryddiaeth)","iowiki":"Universo","iawiki":"Universo","iswiki":"Alheimurinn","nnwiki":"Universet","nowiki":"Universet","trwiki":"Evren","uzwiki":"Olam","ruwiki":"\u0412\u0441\u0435\u043b\u0435\u043d\u043d\u0430\u044f","cswiki":"Vesm\u00edr","skwiki":"Vesm\u00edr","ukwiki":"\u0412\u0441\u0435\u0441\u0432\u0456\u0442","anwiki":"Universo","azwiki":"Kainat","astwiki":"Universu","gnwiki":"Arapy","bswiki":"Svemir","snwiki":"Rudunhumwe","nvwiki":"Y\u00e1gh\u00e1hook\u00e1\u00e1n","dsbwiki":"Uniwersum","hifwiki":"Sansaar","fowiki":"Alheimurin","fywiki":"Hielal","gawiki":"An Chruinne","hakwiki":"Y\u00ee-chhiu","idwiki":"Alam semesta","jvwiki":"Alam semesta","pamwiki":"Sikluban","csbwiki":"Swiatnica","swwiki":"Ulimwengu","htwiki":"Liniv\u00e8","kuwiki":"Gerd\u00fbn","lvwiki":"Visums","ltwiki":"Visata","liwiki":"Universum","lmowiki":"\u00dcnivers","mswiki":"Alam semesta","mwlwiki":"Ouniberso","nahwiki":"Cem\u0101n\u0101huac","nds_nlwiki":"Hielal","napwiki":"Annevierzo","frrwiki":"\u00c5\u00e5l","nrmwiki":"Eunivers","novwiki":"Universe","ocwiki":"Univ\u00e8rs","pflwiki":"Weldall","papwiki":"Universo","ndswiki":"Weltruum","quwiki":"Ch'askancha","stqwiki":"Al","sqwiki":"Gjith\u00ebsia","scnwiki":"Universu","slwiki":"Vesolje","shwiki":"Svemir","suwiki":"Jagat","tlwiki":"Uniberso","warwiki":"Sangkalibutan","bat_smgwiki":"V\u0117sata","viwiki":"V\u0169 tr\u1ee5","zh_min_nanwiki":"\u00da-ti\u016b","bnwiki":"\u09ae\u09b9\u09be\u09ac\u09bf\u09b6\u09cd\u09ac","arwiki":"\u0641\u0636\u0627\u0621 \u0643\u0648\u0646\u064a","arcwiki":"\u072c\u0712\u071d\u0720","arzwiki":"\u0643\u0648\u0646","bewiki":"\u0421\u0443\u0441\u0432\u0435\u0442","bgwiki":"\u0412\u0441\u0435\u043b\u0435\u043d\u0430","ckbwiki":"\u06af\u06d5\u0631\u062f\u0648\u0648\u0646","cvwiki":"\u00c7\u0443\u0442 \u0422\u0115\u043d\u0447\u0435","elwiki":"\u03a3\u03cd\u03bc\u03c0\u03b1\u03bd","fawiki":"\u06af\u06cc\u062a\u06cc","guwiki":"\u0aac\u0acd\u0ab0\u0ab9\u0acd\u0aae\u0abe\u0a82\u0aa1","hewiki":"\u05d4\u05d9\u05e7\u05d5\u05dd","hiwiki":"\u092c\u094d\u0930\u0939\u094d\u092e\u093e\u0923\u094d\u0921","hywiki":"\u054f\u056b\u0565\u0566\u0565\u0580\u0584","kawiki":"\u10e1\u10d0\u10db\u10e7\u10d0\u10e0\u10dd","kkwiki":"\u04d8\u043b\u0435\u043c","knwiki":"\u0cac\u0ccd\u0cb0\u0cb9\u0ccd\u0cae\u0cbe\u0c82\u0ca1","kowiki":"\uc6b0\uc8fc","lezwiki":"\u0427\u0438\u043b\u0435\u0440-\u0446\u0430\u0432\u0430\u0440","mlwiki":"\u0d2a\u0d4d\u0d30\u0d2a\u0d1e\u0d4d\u0d1a\u0d02","mnwiki":"\u041e\u0440\u0447\u043b\u043e\u043d","mrwiki":"\u0935\u093f\u0936\u094d\u0935","mywiki":"\u1005\u1000\u103c\u101d\u1020\u102c","newiki":"\u092c\u094d\u0930\u0939\u094d\u092e\u093e\u0923\u094d\u0921","pnbwiki":"\u06a9\u0627\u0626\u0646\u0627\u062a","ruewiki":"\u0412\u0435\u0441\u043c\u0456\u0440","srwiki":"\u0421\u0432\u0435\u043c\u0438\u0440","tawiki":"\u0b85\u0ba3\u0bcd\u0b9f\u0bae\u0bcd","tewiki":"\u0c35\u0c3f\u0c36\u0c4d\u0c35\u0c02","tgwiki":"\u041a\u043e\u0438\u043d\u043e\u0442","thwiki":"\u0e40\u0e2d\u0e01\u0e20\u0e1e","ttwiki":"\u0413\u0430\u043b\u04d9\u043c","urwiki":"\u06a9\u0627\u0626\u0646\u0627\u062a","xmfwiki":"\u10dd\u10e5\u10d8\u10d0\u10dc\u10e3","yiwiki":"\u05d0\u05d5\u05e0\u05d9\u05d5\u05d5\u05e2\u05e8\u05e1","zhwiki":"\u5b87\u5b99","zh_classicalwiki":"\u5b87\u5b99","zh_yuewiki":"\u5b87\u5b99","be_x_oldwiki":"\u0421\u0443\u0441\u044c\u0432\u0435\u0442","siwiki":"\u0dc0\u0dd2\u0dc1\u0dca\u0dc0\u0dba"},"entity":"q1","claims":[{"m":["value",107,"wikibase-entityid",{"entity-type":"item","numeric-id":1969448}],"q":[],"g":"q1$51394676-EAFE-40F5-90D1-1D560F0C5996","rank":1,"refs":[]}]} + +0 diff --git a/wdtk-dumpfiles/src/test/resources/testSamples/Wernigerode.json b/wdtk-dumpfiles/src/test/resources/testSamples/Wernigerode.json new file mode 100644 index 000000000..086b25763 --- /dev/null +++ b/wdtk-dumpfiles/src/test/resources/testSamples/Wernigerode.json @@ -0,0 +1 @@ +{"label":{"de":"Wernigerode","fr":"Wernigerode","en":"Wernigerode","az":"Vernigerode","ba":"\u0412\u0435\u0440\u043d\u0438\u0433\u0435\u0440\u043e\u0434\u0435","be":"\u0413\u043e\u0440\u0430\u0434 \u0412\u0435\u0440\u043d\u0456\u0433\u0435\u0440\u043e\u0434\u044d","cs":"Wernigerode","da":"Wernigerode","de-formal":"Wernigerode","en-ca":"Wernigerode","en-gb":"Wernigerode","eo":"Wernigerode","et":"Wernigerode","fa":"\u0648\u0631\u0646\u06cc\u06af\u0647 \u0631\u0648\u062f\u0647","fy":"Wernigerode","it":"Wernigerode","ja":"\u30f4\u30a7\u30eb\u30cb\u30b2\u30ed\u30fc\u30c7","kk":"\u0412\u0435\u0440\u043d\u0438\u0433\u0435\u0440\u043e\u0434\u0435","kv":"\u0412\u0435\u0440\u043d\u0438\u0433\u0435\u0440\u043e\u0434\u0435","mk":"\u0412\u0435\u0440\u043d\u0438\u0433\u0435\u0440\u043e\u0434\u0435","nl":"Wernigerode","pl":"Wernigerode","pt":"Wernigerode","pt-br":"Wernigerode","ro":"Wernigerode","ru":"\u0412\u0435\u0440\u043d\u0438\u0433\u0435\u0440\u043e\u0434\u0435","sr":"\u0412\u0435\u0440\u043d\u0438\u0433\u0435\u0440\u043e\u0434\u0435","sv":"Wernigerode","tr":"Wernigerode","uk":"\u0412\u0435\u0440\u043d\u0456\u0491\u0435\u0440\u043e\u0434\u0435","uz":"Wernigerode","vi":"Wernigerode","vo":"Wernigerode","war":"Wernigerode","zh":"\u97e6\u5c14\u5c3c\u683c\u7f57\u5fb7","es":"Wernigerode","be-x-old":"\u0412\u044d\u0440\u043d\u0456\u0433\u0435\u0440\u043e\u0434\u044d","ms":"Wernigerode","ca":"Wernigerode","oc":"Wernigerode","nb":"Wernigerode"},"description":{"de":"Stadt in Sachsen-Anhalt","it":"comune tedesco","fr":"commune allemande","en":"town in the district of Harz, Saxony-Anhalt, Germany","es":"ciudad de Sajonia-Anhalt, Alemania","nl":"stad"},"aliases":[],"links":{"dewiki":{"name":"Wernigerode","badges":[]},"azwiki":{"name":"Vernigerode","badges":[]},"bawiki":{"name":"\u0412\u0435\u0440\u043d\u0438\u0433\u0435\u0440\u043e\u0434\u0435","badges":[]},"bewiki":{"name":"\u0413\u043e\u0440\u0430\u0434 \u0412\u0435\u0440\u043d\u0456\u0433\u0435\u0440\u043e\u0434\u044d","badges":[]},"cswiki":{"name":"Wernigerode","badges":[]},"dawiki":{"name":"Wernigerode","badges":[]},"enwiki":{"name":"Wernigerode","badges":[]},"eowiki":{"name":"Wernigerode","badges":[]},"etwiki":{"name":"Wernigerode","badges":[]},"fawiki":{"name":"\u0648\u0631\u0646\u06cc\u06af\u0647\u200c\u0631\u0648\u062f\u0647","badges":[]},"frwiki":{"name":"Wernigerode","badges":[]},"fywiki":{"name":"Wernigerode","badges":[]},"itwiki":{"name":"Wernigerode","badges":[]},"jawiki":{"name":"\u30f4\u30a7\u30eb\u30cb\u30b2\u30ed\u30fc\u30c7","badges":[]},"kkwiki":{"name":"\u0412\u0435\u0440\u043d\u0438\u0433\u0435\u0440\u043e\u0434\u0435","badges":[]},"kvwiki":{"name":"\u0412\u0435\u0440\u043d\u0438\u0433\u0435\u0440\u043e\u0434\u0435","badges":[]},"mkwiki":{"name":"\u0412\u0435\u0440\u043d\u0438\u0433\u0435\u0440\u043e\u0434\u0435","badges":[]},"nlwiki":{"name":"Wernigerode (stad)","badges":[]},"nowiki":{"name":"Wernigerode","badges":[]},"plwiki":{"name":"Wernigerode","badges":[]},"ptwiki":{"name":"Wernigerode","badges":[]},"rowiki":{"name":"Wernigerode","badges":[]},"ruwiki":{"name":"\u0412\u0435\u0440\u043d\u0438\u0433\u0435\u0440\u043e\u0434\u0435","badges":[]},"srwiki":{"name":"\u0412\u0435\u0440\u043d\u0438\u0433\u0435\u0440\u043e\u0434\u0435","badges":[]},"svwiki":{"name":"Wernigerode","badges":[]},"trwiki":{"name":"Wernigerode","badges":[]},"ukwiki":{"name":"\u0412\u0435\u0440\u043d\u0456\u0491\u0435\u0440\u043e\u0434\u0435","badges":[]},"uzwiki":{"name":"Wernigerode","badges":[]},"viwiki":{"name":"Wernigerode","badges":[]},"vowiki":{"name":"Wernigerode","badges":[]},"warwiki":{"name":"Wernigerode","badges":[]},"zhwiki":{"name":"\u97e6\u5c14\u5c3c\u683c\u7f57\u5fb7","badges":[]},"be_x_oldwiki":{"name":"\u0412\u044d\u0440\u043d\u0456\u0433\u0435\u0440\u043e\u0434\u044d","badges":[]},"mswiki":{"name":"Wernigerode","badges":[]},"ocwiki":{"name":"Wernigerode","badges":[]},"enwikivoyage":{"name":"Wernigerode","badges":[]},"dewikivoyage":{"name":"Wernigerode","badges":[]},"commonswiki":{"name":"Wernigerode","badges":[]}},"entity":["item",15982],"claims":[{"m":["value",17,"wikibase-entityid",{"entity-type":"item","numeric-id":183}],"q":[],"g":"q15982$051AE120-4C3C-45CF-92A8-FCFF2E140645","rank":1,"refs":[]},{"m":["value",439,"string","15085370"],"q":[],"g":"q15982$CDE5EA68-C2AB-45C8-BEA0-FCA7A732915F","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":328}]]]},{"m":["value",373,"string","Wernigerode"],"q":[],"g":"q15982$4F6D3333-FAA5-4C4E-9367-C968DE7A26E4","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":48183}]]]},{"m":["value",94,"string","Wernigerode Wappen.svg"],"q":[],"g":"q15982$122eb560-44fb-ace4-5acb-bc26a96e6f50","rank":1,"refs":[]},{"m":["value",625,"globecoordinate",{"latitude":51.835,"longitude":10.785277777778,"altitude":null,"precision":0.00027777777777778,"globe":"http:\/\/www.wikidata.org\/entity\/Q2"}],"q":[],"g":"q15982$847C1417-7CDC-417C-B77D-0F0E4FEFBC81","rank":1,"refs":[[["value",143,"wikibase-entityid",{"entity-type":"item","numeric-id":206855}]]]},{"m":["value",910,"wikibase-entityid",{"entity-type":"item","numeric-id":7378044}],"q":[],"g":"Q15982$70977640-9BDC-4432-BD57-661563F8BDF0","rank":1,"refs":[]},{"m":["value",948,"string","Werningerode banner Schloss.jpg"],"q":[],"g":"Q15982$9E9EC41A-79F7-4E1A-A89A-85E59A72A16D","rank":1,"refs":[]},{"m":["value",998,"string","Regional\/Europe\/Germany\/States\/Saxony-Anhalt\/Localities\/Wernigerode\/"],"q":[],"g":"Q15982$8679A564-B53C-4F7C-B2CF-3D1CC5023A3F","rank":1,"refs":[]},{"m":["value",646,"string","\/m\/0855q"],"q":[],"g":"Q15982$20384F58-7A29-4D67-8581-756AEC74D7C6","rank":1,"refs":[[["value",248,"wikibase-entityid",{"entity-type":"item","numeric-id":15241312}],["value",577,"time",{"time":"+00000002013-10-28T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}]]]},{"m":["value",1082,"quantity",{"amount":"+34196","unit":"1","upperBound":"+34197","lowerBound":"+34195"}],"q":[["value",585,"time",{"time":"+00000002012-06-30T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}]],"g":"Q15982$92592771-4450-29cb-762e-ee8636ef7d5e","rank":1,"refs":[[["value",854,"string","http:\/\/www.statistik.sachsen-anhalt.de\/bevoelkerung\/bewegungen\/index.html"]]]},{"m":["value",31,"wikibase-entityid",{"entity-type":"item","numeric-id":387917}],"q":[],"g":"Q15982$F9472FAA-A4B5-47E3-9782-25C7BF1094BC","rank":1,"refs":[]}]} \ No newline at end of file