From 8772892e6059b0f6c3346f93e0f75e49724ddf49 Mon Sep 17 00:00:00 2001 From: Markus Damm Date: Fri, 29 May 2015 18:46:53 +0200 Subject: [PATCH 01/24] Created RecentChangesFetcher --- .../wikibaseapi/RecentChangesFetcher.java | 77 +++++++++++++++++++ .../wikibaseapi/RecentChangesFetcherTest.java | 13 ++++ 2 files changed, 90 insertions(+) create mode 100644 wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java create mode 100644 wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java new file mode 100644 index 000000000..bde4500de --- /dev/null +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -0,0 +1,77 @@ +package org.wikidata.wdtk.wikibaseapi; + + +import java.io.IOException; +import java.io.InputStream; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.wikidata.wdtk.util.WebResourceFetcher; +import org.wikidata.wdtk.util.WebResourceFetcherImpl; + +import java.util.Scanner; + +/** + * Simple class to fetch recent changes + * + * @author Markus Damm + * + */ +public class RecentChangesFetcher{ + + static final Logger logger = LoggerFactory + .getLogger(WikibaseDataFetcher.class); + + /** + * URL for the recent changes feed of wikidata.org. + */ + final static String WIKIDATA_RDF_FEED_URL = + "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"; + + /** + * The URL where the recent changes feed can be found. + */ + final String rdfURL; + + /** + * Object used to make web requests. Package-private so that it can be + * overwritten with a mock object in tests. + */ + WebResourceFetcher webResourceFetcher = new WebResourceFetcherImpl(); + + + /** + * Creates an object to fetch recent changes of Wikidata + */ + public RecentChangesFetcher(){ + this(WIKIDATA_RDF_FEED_URL); + } + + /** + * Creates an object to fetch recent changes + * @param rdfURL + */ + public RecentChangesFetcher(String rdfURL){ + this.rdfURL = rdfURL; + } + + + /* + * Fetches the IOStream and returns the String with the last changes. + */ + public String getStringFromIOStream(){ + String result = null; + try{ + InputStream inputStream = this.webResourceFetcher.getInputStreamForUrl(rdfURL); + Scanner scanner = new Scanner(inputStream); + result = scanner.useDelimiter("\\Z").next(); + scanner.close(); + inputStream.close(); + } + catch (IOException e){ + logger.error("Could not retrieve data from " + rdfURL + ". Error:\n" + + e.toString()); + } + return result; + } +} \ No newline at end of file diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java new file mode 100644 index 000000000..a55480a45 --- /dev/null +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -0,0 +1,13 @@ +package org.wikidata.wdtk.wikibaseapi; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class RecentChangesFetcherTest{ + @Test + public void testCreation(){ + RecentChangesFetcher rcf = new RecentChangesFetcher(); + assertEquals(rcf.rdfURL,"http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); + } +} \ No newline at end of file From 8a37efbfa3aa56076598fdce9e571a1a99b82242 Mon Sep 17 00:00:00 2001 From: Markus Damm Date: Tue, 2 Jun 2015 15:08:21 +0200 Subject: [PATCH 02/24] add first implementation of getRecentChanges(); returns a set of Strings of the property names --- .../wikibaseapi/RecentChangesFetcher.java | 172 ++++++++++++------ 1 file changed, 113 insertions(+), 59 deletions(-) diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index bde4500de..d3b349272 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -1,77 +1,131 @@ package org.wikidata.wdtk.wikibaseapi; - import java.io.IOException; import java.io.InputStream; +import java.util.HashSet; +import java.util.Scanner; +import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.wikidata.wdtk.util.WebResourceFetcher; import org.wikidata.wdtk.util.WebResourceFetcherImpl; -import java.util.Scanner; - /** - * Simple class to fetch recent changes + * Simple class to fetch recent changes * * @author Markus Damm * */ -public class RecentChangesFetcher{ - - static final Logger logger = LoggerFactory - .getLogger(WikibaseDataFetcher.class); - - /** - * URL for the recent changes feed of wikidata.org. - */ - final static String WIKIDATA_RDF_FEED_URL = - "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"; - - /** - * The URL where the recent changes feed can be found. - */ - final String rdfURL; - - /** - * Object used to make web requests. Package-private so that it can be - * overwritten with a mock object in tests. - */ - WebResourceFetcher webResourceFetcher = new WebResourceFetcherImpl(); - - - /** - * Creates an object to fetch recent changes of Wikidata - */ - public RecentChangesFetcher(){ - this(WIKIDATA_RDF_FEED_URL); - } - - /** - * Creates an object to fetch recent changes - * @param rdfURL - */ - public RecentChangesFetcher(String rdfURL){ - this.rdfURL = rdfURL; +public class RecentChangesFetcher { + + static final Logger logger = LoggerFactory + .getLogger(WikibaseDataFetcher.class); + + /** + * URL for the recent changes feed of wikidata.org. + */ + final static String WIKIDATA_RDF_FEED_URL = "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"; + + /** + * The URL where the recent changes feed can be found. + */ + final String rdfURL; + + /** + * Object used to make web requests. Package-private so that it can be + * overwritten with a mock object in tests. + */ + WebResourceFetcher webResourceFetcher = new WebResourceFetcherImpl(); + + /** + * Creates an object to fetch recent changes of Wikidata + */ + public RecentChangesFetcher() { + this(WIKIDATA_RDF_FEED_URL); + } + + /** + * Creates an object to fetch recent changes + * + * @param rdfURL + * URL of the RDF feed + */ + public RecentChangesFetcher(String rdfURL) { + this.rdfURL = rdfURL; + } + + /** + * Fetches IOStream from RDF feed and separates it into different items + * + * @return Different items of the recent changes feed or null if it does not + * exist + */ + public String[] getStringFromIOStream() { + String[] result = null; + try { + InputStream inputStream = this.webResourceFetcher + .getInputStreamForUrl(rdfURL); + Scanner scanner = new Scanner(inputStream); + String rdfString = scanner.useDelimiter("\\Z").next(); + result = rdfString.split(""); + scanner.close(); + inputStream.close(); + } catch (IOException e) { + logger.error("Could not retrieve data from " + rdfURL + + ". Error:\n" + e.toString()); } - - - /* - * Fetches the IOStream and returns the String with the last changes. - */ - public String getStringFromIOStream(){ - String result = null; - try{ - InputStream inputStream = this.webResourceFetcher.getInputStreamForUrl(rdfURL); - Scanner scanner = new Scanner(inputStream); - result = scanner.useDelimiter("\\Z").next(); - scanner.close(); - inputStream.close(); - } - catch (IOException e){ - logger.error("Could not retrieve data from " + rdfURL + ". Error:\n" - + e.toString()); - } - return result; + return result; + } + + /** + * parses a substring of the recent changes feed and collects all property + * names + * + * @param items + * substring for an item of the recent changes feed + * @return set of all property names that were changed. Hence multiple + * changes appear only once. + */ + public Set parseItemStrings(String[] items) { + Set propertyNames = new HashSet<>(); + boolean firstEntry = true; + for (String item : items) { + if (firstEntry) { + firstEntry = false; + } else { + String propertyName = parsePropertyName(item); + propertyNames.add(propertyName); + } } + return propertyNames; + } + + /** + * parses the name of the property from the item string of + * + * @param itemString + * substring for an item of the recent changes feed + * @return name of the property + */ + public String parsePropertyName(String itemString) { + String startString = ""; + String endString = ""; + int start = itemString.indexOf(startString) + startString.length(); + int end = itemString.indexOf(endString); + String propertyName = itemString.substring(start, end); + // logger.info(propertyName); + return propertyName; + } + + /** + * method to call for getting recent changes + * + * @return Set of recent Changes + */ + public Set getRecentChanges() { + String[] recentChangeString = getStringFromIOStream(); + Set recentChanges = parseItemStrings(recentChangeString); + return recentChanges; + } } \ No newline at end of file From 85e772472036b4aa9cdcfda1d90052f2c2302d30 Mon Sep 17 00:00:00 2001 From: Markus Damm Date: Tue, 2 Jun 2015 15:56:00 +0200 Subject: [PATCH 03/24] first jUnit-Test with MockObject added --- .../wikibaseapi/RecentChangesFetcher.java | 219 ++++--- .../wikibaseapi/RecentChangesFetcherTest.java | 41 +- .../src/test/resources/recentchanges.rdf | 608 ++++++++++++++++++ 3 files changed, 768 insertions(+), 100 deletions(-) create mode 100644 wdtk-wikibaseapi/src/test/resources/recentchanges.rdf diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index d3b349272..a6dfba877 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -1,4 +1,25 @@ -package org.wikidata.wdtk.wikibaseapi; +package org.wikidata.wdtk.wikibaseapi; + +/* + * #%L + * Wikidata Toolkit Wikibase API + * %% + * Copyright (C) 2014 - 2015 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.IOException; import java.io.InputStream; @@ -19,113 +40,113 @@ */ public class RecentChangesFetcher { - static final Logger logger = LoggerFactory - .getLogger(WikibaseDataFetcher.class); + static final Logger logger = LoggerFactory + .getLogger(WikibaseDataFetcher.class); - /** - * URL for the recent changes feed of wikidata.org. - */ - final static String WIKIDATA_RDF_FEED_URL = "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"; + /** + * URL for the recent changes feed of wikidata.org. + */ + final static String WIKIDATA_RDF_FEED_URL = "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"; - /** - * The URL where the recent changes feed can be found. - */ - final String rdfURL; + /** + * The URL where the recent changes feed can be found. + */ + final String rdfURL; - /** - * Object used to make web requests. Package-private so that it can be - * overwritten with a mock object in tests. - */ - WebResourceFetcher webResourceFetcher = new WebResourceFetcherImpl(); + /** + * Object used to make web requests. Package-private so that it can be + * overwritten with a mock object in tests. + */ + WebResourceFetcher webResourceFetcher = new WebResourceFetcherImpl(); - /** - * Creates an object to fetch recent changes of Wikidata - */ - public RecentChangesFetcher() { - this(WIKIDATA_RDF_FEED_URL); - } + /** + * Creates an object to fetch recent changes of Wikidata + */ + public RecentChangesFetcher() { + this(WIKIDATA_RDF_FEED_URL); + } - /** - * Creates an object to fetch recent changes - * - * @param rdfURL - * URL of the RDF feed - */ - public RecentChangesFetcher(String rdfURL) { - this.rdfURL = rdfURL; - } + /** + * Creates an object to fetch recent changes + * + * @param rdfURL + * URL of the RDF feed + */ + public RecentChangesFetcher(String rdfURL) { + this.rdfURL = rdfURL; + } - /** - * Fetches IOStream from RDF feed and separates it into different items - * - * @return Different items of the recent changes feed or null if it does not - * exist - */ - public String[] getStringFromIOStream() { - String[] result = null; - try { - InputStream inputStream = this.webResourceFetcher - .getInputStreamForUrl(rdfURL); - Scanner scanner = new Scanner(inputStream); - String rdfString = scanner.useDelimiter("\\Z").next(); - result = rdfString.split(""); - scanner.close(); - inputStream.close(); - } catch (IOException e) { - logger.error("Could not retrieve data from " + rdfURL - + ". Error:\n" + e.toString()); + /** + * Fetches IOStream from RDF feed and separates it into different items + * + * @return Different items of the recent changes feed or null if it does + * not exist + */ + public String[] getStringFromIOStream() { + String[] result = null; + try { + InputStream inputStream = this.webResourceFetcher + .getInputStreamForUrl(rdfURL); + Scanner scanner = new Scanner(inputStream); + String rdfString = scanner.useDelimiter("\\Z").next(); + result = rdfString.split(""); + scanner.close(); + inputStream.close(); + } catch (IOException e) { + logger.error("Could not retrieve data from " + rdfURL + + ". Error:\n" + e.toString()); + } + return result; } - return result; - } - /** - * parses a substring of the recent changes feed and collects all property - * names - * - * @param items - * substring for an item of the recent changes feed - * @return set of all property names that were changed. Hence multiple - * changes appear only once. - */ - public Set parseItemStrings(String[] items) { - Set propertyNames = new HashSet<>(); - boolean firstEntry = true; - for (String item : items) { - if (firstEntry) { - firstEntry = false; - } else { - String propertyName = parsePropertyName(item); - propertyNames.add(propertyName); - } + /** + * parses a substring of the recent changes feed and collects all + * property names + * + * @param items + * substring for an item of the recent changes feed + * @return set of all property names that were changed. Hence multiple + * changes appear only once. + */ + public Set parseItemStrings(String[] items) { + Set propertyNames = new HashSet<>(); + boolean firstEntry = true; + for (String item : items) { + if (firstEntry) { + firstEntry = false; + } else { + String propertyName = parsePropertyName(item); + propertyNames.add(propertyName); + } + } + return propertyNames; } - return propertyNames; - } - /** - * parses the name of the property from the item string of - * - * @param itemString - * substring for an item of the recent changes feed - * @return name of the property - */ - public String parsePropertyName(String itemString) { - String startString = ""; - String endString = ""; - int start = itemString.indexOf(startString) + startString.length(); - int end = itemString.indexOf(endString); - String propertyName = itemString.substring(start, end); - // logger.info(propertyName); - return propertyName; - } + /** + * parses the name of the property from the item string of + * + * @param itemString + * substring for an item of the recent changes feed + * @return name of the property + */ + public String parsePropertyName(String itemString) { + String startString = ""; + String endString = ""; + int start = itemString.indexOf(startString) + + startString.length(); + int end = itemString.indexOf(endString); + String propertyName = itemString.substring(start, end); + return propertyName; + } - /** - * method to call for getting recent changes - * - * @return Set of recent Changes - */ - public Set getRecentChanges() { - String[] recentChangeString = getStringFromIOStream(); - Set recentChanges = parseItemStrings(recentChangeString); - return recentChanges; - } + /** + * method to call for getting recent changes + * + * @return Set of recent Changes + */ + public Set getRecentChanges() { + String[] recentChangeString = getStringFromIOStream(); + Set recentChanges = parseItemStrings(recentChangeString); + return recentChanges; + } } \ No newline at end of file diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index a55480a45..59385cc21 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -1,8 +1,35 @@ -package org.wikidata.wdtk.wikibaseapi; +package org.wikidata.wdtk.wikibaseapi; + +/* + * #%L + * Wikidata Toolkit Wikibase API + * %% + * Copyright (C) 2014 - 2015 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.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.util.Set; import org.junit.Test; +import org.wikidata.wdtk.testing.MockWebResourceFetcher; public class RecentChangesFetcherTest{ @Test @@ -10,4 +37,16 @@ public void testCreation(){ RecentChangesFetcher rcf = new RecentChangesFetcher(); assertEquals(rcf.rdfURL,"http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); } + + @Test + public void testGetRecentChanges() throws IOException { + RecentChangesFetcher rcf = new RecentChangesFetcher(); + MockWebResourceFetcher wrf = new MockWebResourceFetcher(); + wrf.setWebResourceContentsFromResource(rcf.rdfURL, + "/recentchanges.rdf", this.getClass()); + rcf.webResourceFetcher = wrf; + Set result = rcf.getRecentChanges(); + assertTrue(result.contains("Q1876457")); + assertFalse(result.contains("Q1")); + } } \ No newline at end of file diff --git a/wdtk-wikibaseapi/src/test/resources/recentchanges.rdf b/wdtk-wikibaseapi/src/test/resources/recentchanges.rdf new file mode 100644 index 000000000..2db8b00c2 --- /dev/null +++ b/wdtk-wikibaseapi/src/test/resources/recentchanges.rdf @@ -0,0 +1,608 @@ + + + + Wikidata - Recent changes [en] + http://www.wikidata.org/wiki/Special:RecentChanges + Track the most recent changes to the wiki in this feed. + en + MediaWiki 1.26wmf7 + Tue, 02 Jun 2015 13:22:03 GMT + + Q1876457 + http://www.wikidata.org/w/index.php?title=Q1876457&diff=220987804&oldid=220928090 + http://www.wikidata.org/w/index.php?title=Q1876457&diff=220987804&oldid=220928090 + <p>‎<span dir="auto"><span class="autocomment">wbsetdescription-add:1|es: </span> obispo católico de España</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:22, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno">description / es</td><td colspan="2" class="diff-lineno">description / es</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">obispo católico de España</ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220928090:newid:220987804:lang:en --> +</table> + Tue, 02 Jun 2015 13:22:02 GMT Superzerocool http://www.wikidata.org/wiki/Talk:Q1876457 + + Q2304926 + http://www.wikidata.org/w/index.php?title=Q2304926&diff=220987803&oldid=220987439 + http://www.wikidata.org/w/index.php?title=Q2304926&diff=220987803&oldid=220987439 + <p>‎<span dir="auto"><span class="autocomment">wbsetclaim-create:2||1: </span> <a href="/wiki/Property:P856" title="‎official website‎ | ‎URL to the website of this item‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">official website</span> <span class="wb-itemlink-id">(P856)</span></span></a>: http://www.ozolnieki.lv/</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / official website</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span><a rel="nofollow" class="external free" href="http://www.ozolnieki.lv/">http://www.ozolnieki.lv/</a></span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / official website: <a rel="nofollow" class="external free" href="http://www.ozolnieki.lv/">http://www.ozolnieki.lv/</a> / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220987439:newid:220987803:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:59 GMT Kikos http://www.wikidata.org/wiki/Talk:Q2304926 + + Q20026648 + http://www.wikidata.org/w/index.php?title=Q20026648&diff=220987802&oldid=220987777 + http://www.wikidata.org/w/index.php?title=Q20026648&diff=220987802&oldid=220987777 + <p>‎<span dir="auto"><span class="autocomment">wbsetclaim-create:2||1: </span> <a href="/wiki/Property:P244" title="‎LCAuth identifier‎ | ‎identifier from the the Library of Congress Authorities (only for authority control; for single books see P1144)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">LCAuth identifier</span> <span class="wb-itemlink-id">(P244)</span></span></a>: n79100680</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / LCAuth identifier</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>n79100680</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / LCAuth identifier: n79100680 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220987777:newid:220987802:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:58 GMT Sergey kudryavtsev http://www.wikidata.org/wiki/Talk:Q20026648 + + Q137138 + http://www.wikidata.org/w/index.php?title=Q137138&diff=220987801&oldid=220987783 + http://www.wikidata.org/w/index.php?title=Q137138&diff=220987801&oldid=220987783 + <p>‎<span dir="auto"><span class="autocomment">wbsetclaim-create:2||1: </span> <a href="/wiki/Property:P269" title="‎SUDOC authorities‎ | ‎identifier for authority control in the French collaborative library catalog (see also P1025)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">SUDOC authorities</span> <span class="wb-itemlink-id">(P269)</span></span></a>: 162195001</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / SUDOC authorities</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>162195001</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / SUDOC authorities: 162195001 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220987783:newid:220987801:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:54 GMT Toto256 http://www.wikidata.org/wiki/Talk:Q137138 + + Q932690 + http://www.wikidata.org/w/index.php?title=Q932690&diff=220987800&oldid=206273244 + http://www.wikidata.org/w/index.php?title=Q932690&diff=220987800&oldid=206273244 + <p>‎<span dir="auto"><span class="autocomment">wbsetclaim-create:2||1: </span> <a href="/wiki/Property:P131" title="‎located in the administrative territorial entity‎ | ‎the item is located on the territory of the following administrative entity‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">located in the administrative territorial entity</span> <span class="wb-itemlink-id">(P131)</span></span></a>: <a href="/wiki/Q1186" title="‎Kerala‎ | ‎Indian state‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">Kerala</span> <span class="wb-itemlink-id">(Q1186)</span></span></a></span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / located in the administrative territorial entity</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span><a title="Q1186" href="/wiki/Q1186">Kerala</a></span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / located in the administrative territorial entity: <a title="Q1186" href="/wiki/Q1186">Kerala</a> / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:206273244:newid:220987800:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:53 GMT Manumg http://www.wikidata.org/wiki/Talk:Q932690 + + Q3928451 + http://www.wikidata.org/w/index.php?title=Q3928451&diff=220987799&oldid=210566815 + http://www.wikidata.org/w/index.php?title=Q3928451&diff=220987799&oldid=210566815 + <p>‎<span dir="auto"><span class="autocomment">wbsetreference-add:2|: </span> <a href="/wiki/Property:P244" title="‎LCAuth identifier‎ | ‎identifier from the the Library of Congress Authorities (only for authority control; for single books see P1144)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">LCAuth identifier</span> <span class="wb-itemlink-id">(P244)</span></span></a>: sh95003611</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan='4' style='text-align: center;' class='diff-multi' lang='en'>(One intermediate revision by the same user not shown)</td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / LCAuth identifier</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>sh95003611</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / LCAuth identifier: sh95003611 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / LCAuth identifier: sh95003611 / reference</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>imported from: <a title="Q8447" href="/wiki/Q8447">French Wikipedia</a></span></ins></div></td></tr></table> + Tue, 02 Jun 2015 13:21:53 GMT KasparBot http://www.wikidata.org/wiki/Talk:Q3928451 + + Q1193043 + http://www.wikidata.org/w/index.php?title=Q1193043&diff=220987797&oldid=220987796 + http://www.wikidata.org/w/index.php?title=Q1193043&diff=220987797&oldid=220987796 + <p>‎<span dir="auto"><span class="autocomment">wbsetaliases-add:1|en: </span> Falculea palliata</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno">aliases / en / 0</td><td colspan="2" class="diff-lineno">aliases / en / 0</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">Falculea palliata</ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220987796:newid:220987797:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:50 GMT Jarould http://www.wikidata.org/wiki/Talk:Q1193043 + + Q367539 + http://www.wikidata.org/w/index.php?title=Q367539&diff=220987795&oldid=209231784 + http://www.wikidata.org/w/index.php?title=Q367539&diff=220987795&oldid=209231784 + <p>‎<span dir="auto"><span class="autocomment">wbsetsitelink-add:1|ruwiki: </span> Фаркаш, Ференц</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno">links / ruwiki / name</td><td colspan="2" class="diff-lineno">links / ruwiki / name</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><a href="https://ru.wikipedia.org/wiki/%D0%A4%D0%B0%D1%80%D0%BA%D0%B0%D1%88,_%D0%A4%D0%B5%D1%80%D0%B5%D0%BD%D1%86" hreflang="ru" dir="auto">Фаркаш, Ференц</a></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:209231784:newid:220987795:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:50 GMT Dutcman http://www.wikidata.org/wiki/Talk:Q367539 + + Q1193043 + http://www.wikidata.org/w/index.php?title=Q1193043&diff=220987796&oldid=220987791 + http://www.wikidata.org/w/index.php?title=Q1193043&diff=220987796&oldid=220987791 + <p>‎<span dir="auto"><span class="autocomment">wbsetdescription-add:1|en: </span> bird</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan='4' style='text-align: center;' class='diff-multi' lang='en'>(One intermediate revision by the same user not shown)</td></tr><tr><td colspan="2" class="diff-lineno">aliases / es / 0</td><td colspan="2" class="diff-lineno">aliases / es / 0</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">Falculea palliata</ins></div></td></tr><tr><td colspan="2" class="diff-lineno">description / en</td><td colspan="2" class="diff-lineno">description / en</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">bird</ins></div></td></tr></table> + Tue, 02 Jun 2015 13:21:50 GMT Jarould http://www.wikidata.org/wiki/Talk:Q1193043 + + Q15451381 + http://www.wikidata.org/w/index.php?title=Q15451381&diff=220987793&oldid=214099568 + http://www.wikidata.org/w/index.php?title=Q15451381&diff=220987793&oldid=214099568 + <p>‎<span dir="auto"><span class="autocomment">wbsetsitelink-add:1|zhwiki: </span> 雲信·皮哈里</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno">links / zhwiki / name</td><td colspan="2" class="diff-lineno">links / zhwiki / name</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><a href="//zh.wikipedia.org/wiki/%E9%9B%B2%E4%BF%A1%C2%B7%E7%9A%AE%E5%93%88%E9%87%8C" hreflang="zh" dir="auto">雲信·皮哈里</a></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:214099568:newid:220987793:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:48 GMT Mkckim http://www.wikidata.org/wiki/Talk:Q15451381 + + Q1193043 + http://www.wikidata.org/w/index.php?title=Q1193043&diff=220987791&oldid=220987789 + http://www.wikidata.org/w/index.php?title=Q1193043&diff=220987791&oldid=220987789 + <p>‎<span dir="auto"><span class="autocomment">wbsetdescription-add:1|es: </span> especie de ave paseriforme</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno">description / es</td><td colspan="2" class="diff-lineno">description / es</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">especie de ave paseriforme</ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220987789:newid:220987791:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:48 GMT Jarould http://www.wikidata.org/wiki/Talk:Q1193043 + + Q20026661 + http://www.wikidata.org/w/index.php?title=Q20026661&diff=220987792&oldid=220987776 + http://www.wikidata.org/w/index.php?title=Q20026661&diff=220987792&oldid=220987776 + <p>‎<span dir="auto"><span class="autocomment">wbsetclaim-create:2||1: </span> <a href="/wiki/Property:P345" title="‎IMDb identifier‎ | ‎identifier from the Internet Movie Database (IMDb) with prefix (tt-, nm-, ch-, co-, ev-)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">IMDb identifier</span> <span class="wb-itemlink-id">(P345)</span></span></a>: nm0474977</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / IMDb identifier</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>nm0474977</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / IMDb identifier: nm0474977 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220987776:newid:220987792:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:48 GMT Väsk http://www.wikidata.org/wiki/Talk:Q20026661 + + Q18085792 + http://www.wikidata.org/w/index.php?title=Q18085792&diff=220987790&oldid=212387279 + http://www.wikidata.org/w/index.php?title=Q18085792&diff=220987790&oldid=212387279 + <p>‎<span dir="auto"><span class="autocomment">wbsetsitelink-remove:1|itwiki: </span> Killer Queen</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno">links / itwiki / name</td><td colspan="2" class="diff-lineno">links / itwiki / name</td></tr><tr><td class="diff-marker">-</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline"><a href="//it.wikipedia.org/wiki/Killer_Queen" hreflang="it" dir="auto">Killer Queen</a></del></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:212387279:newid:220987790:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:47 GMT Horcrux92 http://www.wikidata.org/wiki/Talk:Q18085792 + + Q1193043 + http://www.wikidata.org/w/index.php?title=Q1193043&diff=220987789&oldid=215974674 + http://www.wikidata.org/w/index.php?title=Q1193043&diff=220987789&oldid=215974674 + <p>‎<span dir="auto"><span class="autocomment">wbsetlabel-set:1|es: </span> vanga piquicurvo</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno">label / es</td><td colspan="2" class="diff-lineno">label / es</td></tr><tr><td class="diff-marker">-</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">Falculea palliata</del></div></td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">vanga piquicurvo</ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:215974674:newid:220987789:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:47 GMT Jarould http://www.wikidata.org/wiki/Talk:Q1193043 + + Q4438870 + http://www.wikidata.org/w/index.php?title=Q4438870&diff=220987788&oldid=220987785 + http://www.wikidata.org/w/index.php?title=Q4438870&diff=220987788&oldid=220987785 + <p>‎<span dir="auto"><span class="autocomment">wbsetreference-add:2|: </span> <a href="/wiki/Property:P268" title="‎BnF identifier‎ | ‎identifier for the subject issued by BNF (Bibliothèque nationale de France)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">BnF identifier</span> <span class="wb-itemlink-id">(P268)</span></span></a>: 12323632c</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan='4' style='text-align: center;' class='diff-multi' lang='en'>(One intermediate revision by the same user not shown)</td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / BnF identifier</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>12323632c</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / BnF identifier: 12323632c / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / BnF identifier: 12323632c / reference</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>imported from: <a title="Q8447" href="/wiki/Q8447">French Wikipedia</a></span></ins></div></td></tr></table> + Tue, 02 Jun 2015 13:21:47 GMT KasparBot http://www.wikidata.org/wiki/Talk:Q4438870 + + Q20026662 + http://www.wikidata.org/w/index.php?title=Q20026662&diff=220987786&oldid=220987773 + http://www.wikidata.org/w/index.php?title=Q20026662&diff=220987786&oldid=220987773 + <p>‎<span dir="auto"><span class="autocomment">wbsetclaim-create:2||1: </span> <a href="/wiki/Property:P31" title="‎instance of‎ | ‎this item is a specific example and a member of that class‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">instance of</span> <span class="wb-itemlink-id">(P31)</span></span></a>: <a href="/wiki/Q16970" title="‎church‎ | ‎religious building for Christian worship‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">church</span> <span class="wb-itemlink-id">(Q16970)</span></span></a></span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / instance of</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span><a title="Q16970" href="/wiki/Q16970">church</a></span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / instance of: <a title="Q16970" href="/wiki/Q16970">church</a> / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220987773:newid:220987786:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:45 GMT 89.114.10.123 http://www.wikidata.org/wiki/Talk:Q20026662 + + Q4438870 + http://www.wikidata.org/w/index.php?title=Q4438870&diff=220987785&oldid=210461074 + http://www.wikidata.org/w/index.php?title=Q4438870&diff=220987785&oldid=210461074 + <p>‎<span dir="auto"><span class="autocomment">wbsetreference-add:2|: </span> <a href="/wiki/Property:P244" title="‎LCAuth identifier‎ | ‎identifier from the the Library of Congress Authorities (only for authority control; for single books see P1144)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">LCAuth identifier</span> <span class="wb-itemlink-id">(P244)</span></span></a>: sh88002145</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan='4' style='text-align: center;' class='diff-multi' lang='en'>(One intermediate revision by the same user not shown)</td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / LCAuth identifier</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>sh88002145</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / LCAuth identifier: sh88002145 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / LCAuth identifier: sh88002145 / reference</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>imported from: <a title="Q8447" href="/wiki/Q8447">French Wikipedia</a></span></ins></div></td></tr></table> + Tue, 02 Jun 2015 13:21:45 GMT KasparBot http://www.wikidata.org/wiki/Talk:Q4438870 + + Q137138 + http://www.wikidata.org/w/index.php?title=Q137138&diff=220987783&oldid=220987747 + http://www.wikidata.org/w/index.php?title=Q137138&diff=220987783&oldid=220987747 + <p>‎<span dir="auto"><span class="autocomment">wbsetclaim-create:2||1: </span> <a href="/wiki/Property:P244" title="‎LCAuth identifier‎ | ‎identifier from the the Library of Congress Authorities (only for authority control; for single books see P1144)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">LCAuth identifier</span> <span class="wb-itemlink-id">(P244)</span></span></a>: n81087040</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / LCAuth identifier</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>n81087040</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / LCAuth identifier: n81087040 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220987747:newid:220987783:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:44 GMT Toto256 http://www.wikidata.org/wiki/Talk:Q137138 + + Q2968035 + http://www.wikidata.org/w/index.php?title=Q2968035&diff=220987782&oldid=192002089 + http://www.wikidata.org/w/index.php?title=Q2968035&diff=220987782&oldid=192002089 + <p>‎<span dir="auto"><span class="autocomment">wbsetclaim-create:2||1: </span> <a href="/wiki/Property:P373" title="‎Commons category‎ | ‎name of the Wikimedia Commons category containing files related to this item (without the prefix &quot;Category&quot;)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">Commons category</span> <span class="wb-itemlink-id">(P373)</span></span></a>: Castello Normanno (Aci Castello)</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / Commons category</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Castello Normanno (Aci Castello)</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / Commons category: Castello Normanno (Aci Castello) / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:192002089:newid:220987782:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:40 GMT Sannita http://www.wikidata.org/wiki/Talk:Q2968035 + + Q18214523 + http://www.wikidata.org/w/index.php?title=Q18214523&diff=220987781&oldid=213421635 + http://www.wikidata.org/w/index.php?title=Q18214523&diff=220987781&oldid=213421635 + <p>‎<span dir="auto"><span class="autocomment">wbsetreference-add:2|: </span> <a href="/wiki/Property:P227" title="‎GND identifier‎ | ‎identifier from an international authority file of names, subjects, and organizations (please don't use type n = name, disambiguation)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">GND identifier</span> <span class="wb-itemlink-id">(P227)</span></span></a>: 120784521</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan='4' style='text-align: center;' class='diff-multi' lang='en'>(One intermediate revision by the same user not shown)</td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / GND identifier</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>120784521</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / GND identifier: 120784521 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / GND identifier: 120784521 / reference</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>imported from: <a title="Q8447" href="/wiki/Q8447">French Wikipedia</a></span></ins></div></td></tr></table> + Tue, 02 Jun 2015 13:21:40 GMT KasparBot http://www.wikidata.org/wiki/Talk:Q18214523 + + Q4468164 + http://www.wikidata.org/w/index.php?title=Q4468164&diff=220987779&oldid=210460550 + http://www.wikidata.org/w/index.php?title=Q4468164&diff=220987779&oldid=210460550 + <p>‎<span dir="auto"><span class="autocomment">wbsetreference-add:2|: </span> <a href="/wiki/Property:P244" title="‎LCAuth identifier‎ | ‎identifier from the the Library of Congress Authorities (only for authority control; for single books see P1144)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">LCAuth identifier</span> <span class="wb-itemlink-id">(P244)</span></span></a>: sh2009004997</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan='4' style='text-align: center;' class='diff-multi' lang='en'>(One intermediate revision by the same user not shown)</td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / LCAuth identifier</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>sh2009004997</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / LCAuth identifier: sh2009004997 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / LCAuth identifier: sh2009004997 / reference</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>imported from: <a title="Q8447" href="/wiki/Q8447">French Wikipedia</a></span></ins></div></td></tr></table> + Tue, 02 Jun 2015 13:21:35 GMT KasparBot http://www.wikidata.org/wiki/Talk:Q4468164 + + Q20026648 + http://www.wikidata.org/w/index.php?title=Q20026648&diff=220987777&oldid=220987764 + http://www.wikidata.org/w/index.php?title=Q20026648&diff=220987777&oldid=220987764 + <p>‎<span dir="auto"><span class="autocomment">wbsetclaim-create:2||1: </span> <a href="/wiki/Property:P409" title="‎NLA identifier‎ | ‎identifier issued by the National Library of Australia (see also P1315 for the newer People Australia identifier)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">NLA identifier</span> <span class="wb-itemlink-id">(P409)</span></span></a>: 000035468736</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / NLA identifier</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>000035468736</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / NLA identifier: 000035468736 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220987764:newid:220987777:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:34 GMT Sergey kudryavtsev http://www.wikidata.org/wiki/Talk:Q20026648 + + Q20026661 + http://www.wikidata.org/w/index.php?title=Q20026661&diff=220987776&oldid=220987770 + http://www.wikidata.org/w/index.php?title=Q20026661&diff=220987776&oldid=220987770 + <p>‎<span dir="auto"><span class="autocomment">wbsetclaim-create:2||1: </span> <a href="/wiki/Property:P27" title="‎country of citizenship‎ | ‎the object is a country that recognizes the subject as its citizen‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">country of citizenship</span> <span class="wb-itemlink-id">(P27)</span></span></a>: <a href="/wiki/Q34" title="‎Sweden‎ | ‎constitutional monarchy in Northern Europe‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">Sweden</span> <span class="wb-itemlink-id">(Q34)</span></span></a></span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / country of citizenship</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span><a title="Q34" href="/wiki/Q34">Sweden</a></span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / country of citizenship: <a title="Q34" href="/wiki/Q34">Sweden</a> / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220987770:newid:220987776:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:33 GMT Väsk http://www.wikidata.org/wiki/Talk:Q20026661 + + Q15456522 + http://www.wikidata.org/w/index.php?title=Q15456522&diff=220987775&oldid=208049839 + http://www.wikidata.org/w/index.php?title=Q15456522&diff=220987775&oldid=208049839 + <p>‎<span dir="auto"><span class="autocomment">wbsetreference-add:2|: </span> <a href="/wiki/Property:P269" title="‎SUDOC authorities‎ | ‎identifier for authority control in the French collaborative library catalog (see also P1025)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">SUDOC authorities</span> <span class="wb-itemlink-id">(P269)</span></span></a>: 085693979</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan='4' style='text-align: center;' class='diff-multi' lang='en'>(One intermediate revision by the same user not shown)</td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / SUDOC authorities</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>085693979</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / SUDOC authorities: 085693979 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / SUDOC authorities: 085693979 / reference</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>imported from: <a title="Q8447" href="/wiki/Q8447">French Wikipedia</a></span></ins></div></td></tr></table> + Tue, 02 Jun 2015 13:21:30 GMT KasparBot http://www.wikidata.org/wiki/Talk:Q15456522 + + Q20026662 + http://www.wikidata.org/w/index.php?title=Q20026662&diff=220987773&oldid=0 + http://www.wikidata.org/w/index.php?title=Q20026662&diff=220987773&oldid=0 + <p>‎<span dir="auto"><span class="autocomment">wbeditentity-create:2|en: </span> Iglesia misercordia, Church in Porto, Portugal</span></p> +<a href="//www.wikidata.org/w/index.php?title=Q20026662&amp;diff=220987773">Show changes</a> + Tue, 02 Jun 2015 13:21:25 GMT 89.114.10.123 http://www.wikidata.org/wiki/Talk:Q20026662 + + Q18398336 + http://www.wikidata.org/w/index.php?title=Q18398336&diff=220987772&oldid=220987769 + http://www.wikidata.org/w/index.php?title=Q18398336&diff=220987772&oldid=220987769 + <p>‎<span dir="auto"><span class="autocomment">wbsetreference-add:2|: </span> <a href="/wiki/Property:P268" title="‎BnF identifier‎ | ‎identifier for the subject issued by BNF (Bibliothèque nationale de France)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">BnF identifier</span> <span class="wb-itemlink-id">(P268)</span></span></a>: 146560994</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan='4' style='text-align: center;' class='diff-multi' lang='en'>(One intermediate revision by the same user not shown)</td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / BnF identifier</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>146560994</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / BnF identifier: 146560994 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / BnF identifier: 146560994 / reference</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>imported from: <a title="Q8447" href="/wiki/Q8447">French Wikipedia</a></span></ins></div></td></tr></table> + Tue, 02 Jun 2015 13:21:25 GMT KasparBot http://www.wikidata.org/wiki/Talk:Q18398336 + + Q20026661 + http://www.wikidata.org/w/index.php?title=Q20026661&diff=220987770&oldid=220987760 + http://www.wikidata.org/w/index.php?title=Q20026661&diff=220987770&oldid=220987760 + <p>‎<span dir="auto"><span class="autocomment">wbsetclaim-create:2||1: </span> <a href="/wiki/Property:P21" title="‎sex or gender‎ | ‎Sexual identity of subject. Main: male (Q6581097), female (Q6581072), transgender female (Q1052281), transgender male (Q2449503). For animals, use male animal (Q44148), female animal (Q43445). For groups of same gender, use &quot;subclass of&quot; (P279)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">sex or gender</span> <span class="wb-itemlink-id">(P21)</span></span></a>: <a href="/wiki/Q6581097" title="‎male‎ | ‎human who is male (use with Property:P21 sex or gender). For groups of males use with subclass of (P279).‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">male</span> <span class="wb-itemlink-id">(Q6581097)</span></span></a></span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / sex or gender</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span><a title="Q6581097" href="/wiki/Q6581097">male</a></span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / sex or gender: <a title="Q6581097" href="/wiki/Q6581097">male</a> / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220987760:newid:220987770:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:23 GMT Väsk http://www.wikidata.org/wiki/Talk:Q20026661 + + Q18398336 + http://www.wikidata.org/w/index.php?title=Q18398336&diff=220987769&oldid=213588450 + http://www.wikidata.org/w/index.php?title=Q18398336&diff=220987769&oldid=213588450 + <p>‎<span dir="auto"><span class="autocomment">wbsetreference-add:2|: </span> <a href="/wiki/Property:P269" title="‎SUDOC authorities‎ | ‎identifier for authority control in the French collaborative library catalog (see also P1025)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">SUDOC authorities</span> <span class="wb-itemlink-id">(P269)</span></span></a>: 139901760</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan='4' style='text-align: center;' class='diff-multi' lang='en'>(One intermediate revision by the same user not shown)</td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / SUDOC authorities</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>139901760</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / SUDOC authorities: 139901760 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / SUDOC authorities: 139901760 / reference</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>imported from: <a title="Q8447" href="/wiki/Q8447">French Wikipedia</a></span></ins></div></td></tr></table> + Tue, 02 Jun 2015 13:21:22 GMT KasparBot http://www.wikidata.org/wiki/Talk:Q18398336 + + Q18215075 + http://www.wikidata.org/w/index.php?title=Q18215075&diff=220987767&oldid=220987763 + http://www.wikidata.org/w/index.php?title=Q18215075&diff=220987767&oldid=220987763 + <p>‎<span dir="auto"><span class="autocomment">wbsetreference-add:2|: </span> <a href="/wiki/Property:P268" title="‎BnF identifier‎ | ‎identifier for the subject issued by BNF (Bibliothèque nationale de France)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">BnF identifier</span> <span class="wb-itemlink-id">(P268)</span></span></a>: 120856735</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan='4' style='text-align: center;' class='diff-multi' lang='en'>(One intermediate revision by the same user not shown)</td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / SUDOC authorities: 029175755 / reference</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>imported from: <a title="Q8447" href="/wiki/Q8447">French Wikipedia</a></span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / BnF identifier</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>120856735</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / BnF identifier: 120856735 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / BnF identifier: 120856735 / reference</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>imported from: <a title="Q8447" href="/wiki/Q8447">French Wikipedia</a></span></ins></div></td></tr></table> + Tue, 02 Jun 2015 13:21:17 GMT KasparBot http://www.wikidata.org/wiki/Talk:Q18215075 + + Q20026648 + http://www.wikidata.org/w/index.php?title=Q20026648&diff=220987764&oldid=220987748 + http://www.wikidata.org/w/index.php?title=Q20026648&diff=220987764&oldid=220987748 + <p>‎<span dir="auto"><span class="autocomment">wbsetclaim-create:2||1: </span> <a href="/wiki/Property:P906" title="‎SELIBR‎ | ‎identifier per Libris library catalog‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">SELIBR</span> <span class="wb-itemlink-id">(P906)</span></span></a>: 137087</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / SELIBR</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>137087</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / SELIBR: 137087 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220987748:newid:220987764:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:15 GMT Sergey kudryavtsev http://www.wikidata.org/wiki/Talk:Q20026648 + + Q18215075 + http://www.wikidata.org/w/index.php?title=Q18215075&diff=220987763&oldid=213586974 + http://www.wikidata.org/w/index.php?title=Q18215075&diff=220987763&oldid=213586974 + <p>‎<span dir="auto"><span class="autocomment">wbcreateclaim-create:1|: </span> <a href="/wiki/Property:P269" title="‎SUDOC authorities‎ | ‎identifier for authority control in the French collaborative library catalog (see also P1025)‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">SUDOC authorities</span> <span class="wb-itemlink-id">(P269)</span></span></a>: 029175755</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan='4' style='text-align: center;' class='diff-multi' lang='en'>(2 intermediate revisions by the same user not shown)</td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / VIAF identifier</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>49251243</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / VIAF identifier: 49251243 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / VIAF identifier: 49251243 / reference</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>imported from: <a title="Q8447" href="/wiki/Q8447">French Wikipedia</a></span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / SUDOC authorities</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>029175755</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / SUDOC authorities: 029175755 / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr></table> + Tue, 02 Jun 2015 13:21:15 GMT KasparBot http://www.wikidata.org/wiki/Talk:Q18215075 + + Q20026661 + http://www.wikidata.org/w/index.php?title=Q20026661&diff=220987760&oldid=220987744 + http://www.wikidata.org/w/index.php?title=Q20026661&diff=220987760&oldid=220987744 + <p>‎<span dir="auto"><span class="autocomment">wbsetclaim-create:2||1: </span> <a href="/wiki/Property:P31" title="‎instance of‎ | ‎this item is a specific example and a member of that class‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">instance of</span> <span class="wb-itemlink-id">(P31)</span></span></a>: <a href="/wiki/Q5" title="‎human‎ | ‎species of the family Hominidae, unique extant species of the genus Homo‎"><span class="wb-itemlink"><span class="wb-itemlink-label" lang="en" dir="ltr">human</span> <span class="wb-itemlink-id">(Q5)</span></span></a></span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / instance of</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span><a title="Q5" href="/wiki/Q5">human</a></span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / instance of: <a title="Q5" href="/wiki/Q5">human</a> / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220987744:newid:220987760:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:12 GMT Väsk http://www.wikidata.org/wiki/Talk:Q20026661 + + Q17354242 + http://www.wikidata.org/w/index.php?title=Q17354242&diff=220987759&oldid=203428144 + http://www.wikidata.org/w/index.php?title=Q17354242&diff=220987759&oldid=203428144 + <p>‎<span dir="auto"><span class="autocomment">wbsetsitelink-add:1|commonswiki: </span> Category:Viktoriastraße (Hannover)</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno">links / commonswiki / name</td><td colspan="2" class="diff-lineno">links / commonswiki / name</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><a href="//commons.wikimedia.org/wiki/Category:Viktoriastra%C3%9Fe_(Hannover)" hreflang="en" dir="auto">Category:Viktoriastraße (Hannover)</a></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:203428144:newid:220987759:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:10 GMT Jean11 http://www.wikidata.org/wiki/Talk:Q17354242 + + Q20011808 + http://www.wikidata.org/w/index.php?title=Q20011808&diff=220987758&oldid=220987694 + http://www.wikidata.org/w/index.php?title=Q20011808&diff=220987758&oldid=220987694 + <p>‎<span dir="auto"><span class="autocomment">wbsetdescription-add:1|es: </span> activista español pro derechos de personas con discapacidad</span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno">description / es</td><td colspan="2" class="diff-lineno">description / es</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">activista español pro derechos de personas con discapacidad</ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220987694:newid:220987758:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:08 GMT Superzerocool http://www.wikidata.org/wiki/Talk:Q20011808 + + Q20000339 + http://www.wikidata.org/w/index.php?title=Q20000339&diff=220987757&oldid=220987755 + http://www.wikidata.org/w/index.php?title=Q20000339&diff=220987757&oldid=220987755 + <p>‎<span dir="auto"><span class="autocomment">wbcreateredirect:0||Q20000339|Q318417</span></span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno">redirect</td><td colspan="2" class="diff-lineno">redirect</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">Q318417</ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220987755:newid:220987757:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:02 GMT Lymantria http://www.wikidata.org/wiki/Talk:Q20000339 + + Q318417 + http://www.wikidata.org/w/index.php?title=Q318417&diff=220987756&oldid=206489112 + http://www.wikidata.org/w/index.php?title=Q318417&diff=220987756&oldid=206489112 + <p>‎<span dir="auto"><span class="autocomment">wbmergeitems-from:0||Q20000339: </span> <a href="/wiki/MediaWiki:Gadget-Merge.js" title="MediaWiki:Gadget-Merge.js">merge.js</a></span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno">label / ca</td><td colspan="2" class="diff-lineno">label / ca</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">Filip I de Macedònia</ins></div></td></tr><tr><td colspan="2" class="diff-lineno">aliases / en / 0</td><td colspan="2" class="diff-lineno">aliases / en / 0</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">Filip I de Macedònia</ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / given name</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span><a title="Q998338" href="/wiki/Q998338">Filip</a></span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno"></td><td colspan="2" class="diff-lineno">property / given name: <a title="Q998338" href="/wiki/Q998338">Filip</a> / rank</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span>Normal rank</span></ins></div></td></tr><tr><td colspan="2" class="diff-lineno">links / cawiki / name</td><td colspan="2" class="diff-lineno">links / cawiki / name</td></tr><tr><td colspan="2">&nbsp;</td><td class="diff-marker">+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><a href="//ca.wikipedia.org/wiki/Filip_I_de_Maced%C3%B2nia" hreflang="ca" dir="auto">Filip I de Macedònia</a></ins></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:206489112:newid:220987756:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:01 GMT Lymantria http://www.wikidata.org/wiki/Talk:Q318417 + + Q20000339 + http://www.wikidata.org/w/index.php?title=Q20000339&diff=220987755&oldid=220878740 + http://www.wikidata.org/w/index.php?title=Q20000339&diff=220987755&oldid=220878740 + <p>‎<span dir="auto"><span class="autocomment">wbmergeitems-to:0||Q318417: </span> <a href="/wiki/MediaWiki:Gadget-Merge.js" title="MediaWiki:Gadget-Merge.js">merge.js</a></span></p> +<table class='diff diff-contentalign-left'> + <col class='diff-marker' /> + <col class='diff-content' /> + <col class='diff-marker' /> + <col class='diff-content' /> + <tr style='vertical-align: top;' lang='en'> + <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> + <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:21, 2 June 2015</td> + </tr><tr><td colspan="2" class="diff-lineno">label / ca</td><td colspan="2" class="diff-lineno">label / ca</td></tr><tr><td class="diff-marker">-</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">Filip I de Macedònia</del></div></td></tr><tr><td colspan="2" class="diff-lineno">label / en</td><td colspan="2" class="diff-lineno">label / en</td></tr><tr><td class="diff-marker">-</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">Filip I de Macedònia</del></div></td></tr><tr><td colspan="2" class="diff-lineno">property / instance of</td><td colspan="2" class="diff-lineno"></td></tr><tr><td class="diff-marker">-</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline"><span><a title="Q5" href="/wiki/Q5">human</a></span></del></div></td><td colspan="2">&nbsp;</td></tr><tr><td colspan="2" class="diff-lineno">property / instance of: <a title="Q5" href="/wiki/Q5">human</a> / rank</td><td colspan="2" class="diff-lineno"></td></tr><tr><td class="diff-marker">-</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline"><span>Normal rank</span></del></div></td><td colspan="2">&nbsp;</td></tr><tr><td colspan="2" class="diff-lineno">property / given name</td><td colspan="2" class="diff-lineno"></td></tr><tr><td class="diff-marker">-</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline"><span><a title="Q998338" href="/wiki/Q998338">Filip</a></span></del></div></td><td colspan="2">&nbsp;</td></tr><tr><td colspan="2" class="diff-lineno">property / given name: <a title="Q998338" href="/wiki/Q998338">Filip</a> / rank</td><td colspan="2" class="diff-lineno"></td></tr><tr><td class="diff-marker">-</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline"><span>Normal rank</span></del></div></td><td colspan="2">&nbsp;</td></tr><tr><td colspan="2" class="diff-lineno">links / cawiki / name</td><td colspan="2" class="diff-lineno">links / cawiki / name</td></tr><tr><td class="diff-marker">-</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline"><a href="//ca.wikipedia.org/wiki/Filip_I_de_Maced%C3%B2nia" hreflang="ca" dir="auto">Filip I de Macedònia</a></del></div></td></tr> +<!-- diff cache key wikidatawiki:diff:version:1.11a:oldid:220878740:newid:220987755:lang:en --> +</table> + Tue, 02 Jun 2015 13:21:01 GMT Lymantria http://www.wikidata.org/wiki/Talk:Q20000339 + + \ No newline at end of file From f37e9cbb1f502a810c63e67e41d6f00cf92f889b Mon Sep 17 00:00:00 2001 From: Markus Damm Date: Tue, 2 Jun 2015 16:37:50 +0200 Subject: [PATCH 04/24] add parseTime() and corresponding test --- .../wikibaseapi/RecentChangesFetcher.java | 291 ++++++++++-------- .../wikibaseapi/RecentChangesFetcherTest.java | 54 +++- 2 files changed, 203 insertions(+), 142 deletions(-) diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index a6dfba877..35998c505 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -20,133 +20,166 @@ * #L% */ - -import java.io.IOException; -import java.io.InputStream; -import java.util.HashSet; -import java.util.Scanner; -import java.util.Set; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wikidata.wdtk.util.WebResourceFetcher; -import org.wikidata.wdtk.util.WebResourceFetcherImpl; - -/** - * Simple class to fetch recent changes - * - * @author Markus Damm - * - */ -public class RecentChangesFetcher { - - static final Logger logger = LoggerFactory - .getLogger(WikibaseDataFetcher.class); - - /** - * URL for the recent changes feed of wikidata.org. - */ - final static String WIKIDATA_RDF_FEED_URL = "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"; - - /** - * The URL where the recent changes feed can be found. - */ - final String rdfURL; - - /** - * Object used to make web requests. Package-private so that it can be - * overwritten with a mock object in tests. - */ - WebResourceFetcher webResourceFetcher = new WebResourceFetcherImpl(); - - /** - * Creates an object to fetch recent changes of Wikidata - */ - public RecentChangesFetcher() { - this(WIKIDATA_RDF_FEED_URL); - } - - /** - * Creates an object to fetch recent changes - * - * @param rdfURL - * URL of the RDF feed - */ - public RecentChangesFetcher(String rdfURL) { - this.rdfURL = rdfURL; - } - - /** - * Fetches IOStream from RDF feed and separates it into different items - * - * @return Different items of the recent changes feed or null if it does - * not exist - */ - public String[] getStringFromIOStream() { - String[] result = null; - try { - InputStream inputStream = this.webResourceFetcher - .getInputStreamForUrl(rdfURL); - Scanner scanner = new Scanner(inputStream); - String rdfString = scanner.useDelimiter("\\Z").next(); - result = rdfString.split(""); - scanner.close(); - inputStream.close(); - } catch (IOException e) { - logger.error("Could not retrieve data from " + rdfURL - + ". Error:\n" + e.toString()); - } - return result; - } - - /** - * parses a substring of the recent changes feed and collects all - * property names - * - * @param items - * substring for an item of the recent changes feed - * @return set of all property names that were changed. Hence multiple - * changes appear only once. - */ - public Set parseItemStrings(String[] items) { - Set propertyNames = new HashSet<>(); - boolean firstEntry = true; - for (String item : items) { - if (firstEntry) { - firstEntry = false; - } else { - String propertyName = parsePropertyName(item); - propertyNames.add(propertyName); - } - } - return propertyNames; - } - - /** - * parses the name of the property from the item string of - * - * @param itemString - * substring for an item of the recent changes feed - * @return name of the property - */ - public String parsePropertyName(String itemString) { - String startString = ""; - String endString = ""; - int start = itemString.indexOf(startString) - + startString.length(); - int end = itemString.indexOf(endString); - String propertyName = itemString.substring(start, end); - return propertyName; - } - - /** - * method to call for getting recent changes - * - * @return Set of recent Changes - */ - public Set getRecentChanges() { - String[] recentChangeString = getStringFromIOStream(); - Set recentChanges = parseItemStrings(recentChangeString); - return recentChanges; - } +import java.io.IOException; +import java.io.InputStream; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashSet; +import java.util.Locale; +import java.util.Scanner; +import java.util.Set; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.wikidata.wdtk.util.WebResourceFetcher; +import org.wikidata.wdtk.util.WebResourceFetcherImpl; + +/** + * Simple class to fetch recent changes + * + * @author Markus Damm + * + */ +public class RecentChangesFetcher { + + static final Logger logger = LoggerFactory + .getLogger(WikibaseDataFetcher.class); + + /** + * URL for the recent changes feed of wikidata.org. + */ + final static String WIKIDATA_RDF_FEED_URL = "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"; + + /** + * The URL where the recent changes feed can be found. + */ + final String rdfURL; + + /** + * Object used to make web requests. Package-private so that it can be + * overwritten with a mock object in tests. + */ + WebResourceFetcher webResourceFetcher = new WebResourceFetcherImpl(); + + /** + * Creates an object to fetch recent changes of Wikidata + */ + public RecentChangesFetcher() { + this(WIKIDATA_RDF_FEED_URL); + } + + /** + * Creates an object to fetch recent changes + * + * @param rdfURL + * URL of the RDF feed + */ + public RecentChangesFetcher(String rdfURL) { + this.rdfURL = rdfURL; + } + + /** + * Fetches IOStream from RDF feed and separates it into different items + * + * @return Different items of the recent changes feed or null if it does + * not exist + */ + public String[] getStringFromIOStream() { + String[] result = null; + try { + InputStream inputStream = this.webResourceFetcher + .getInputStreamForUrl(rdfURL); + Scanner scanner = new Scanner(inputStream); + String rdfString = scanner.useDelimiter("\\Z").next(); + result = rdfString.split(""); + scanner.close(); + inputStream.close(); + } catch (IOException e) { + logger.error("Could not retrieve data from " + rdfURL + + ". Error:\n" + e.toString()); + } + return result; + } + + /** + * parses a substring of the recent changes feed and collects all + * property names + * + * @param items + * substring for an item of the recent changes feed + * @return set of all property names that were changed. Hence multiple + * changes appear only once. + */ + public Set parseItemStrings(String[] items) { + Set propertyNames = new HashSet<>(); + boolean firstEntry = true; + for (String item : items) { + if (firstEntry) { + firstEntry = false; + } else { + String propertyName = parsePropertyName(item); + propertyNames.add(propertyName); + } + } + return propertyNames; + } + + /** + * parses the name of the property from the item string of the recent + * changes feed + * + * @param itemString + * substring for an item of the recent changes feed + * @return name of the property + */ + public String parsePropertyName(String itemString) { + String startString = ""; + String endString = ""; + int start = itemString.indexOf(startString) + + startString.length(); + int end = itemString.indexOf(endString); + String propertyName = itemString.substring(start, end); + return propertyName; + } + + /** + * parses the date and time of the change of a property from the item + * string of the recent changes feed + * + * @param itemString + * substring for an item of the recent changes feed + * @return date for the recent change + */ + + public Date parseTime(String itemString) { + String startString = ""; + String endString = ""; + int start = itemString.indexOf(startString) + + startString.length(); + int end = itemString.indexOf(endString); + String timeString = itemString.substring(start, end); + Date date = null; + try { + date = new SimpleDateFormat("E, d MMM yyyy HH:mm:ss Z", + Locale.ENGLISH).parse(timeString); + } + + catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return date; + } + + /** + * method to call for getting recent changes + * + * @return Set of recent Changes + */ + public Set getRecentChanges() { + String[] recentChangeString = getStringFromIOStream(); + Set recentChanges = parseItemStrings(recentChangeString); + return recentChanges; + } } \ No newline at end of file diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index 59385cc21..07a9c6277 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -21,21 +21,29 @@ */ -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.util.Set; - -import org.junit.Test; -import org.wikidata.wdtk.testing.MockWebResourceFetcher; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; +import java.util.Set; + +import org.junit.Test; +import org.wikidata.wdtk.testing.MockWebResourceFetcher; public class RecentChangesFetcherTest{ @Test - public void testCreation(){ - RecentChangesFetcher rcf = new RecentChangesFetcher(); - assertEquals(rcf.rdfURL,"http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); + public void testConstructors() { + RecentChangesFetcher rcf1 = new RecentChangesFetcher(); + RecentChangesFetcher rcf2 = new RecentChangesFetcher( + "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); + assertEquals(rcf1.rdfURL, + "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); + assertEquals(rcf2.rdfURL, + "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); } @Test @@ -47,6 +55,26 @@ public void testGetRecentChanges() throws IOException { rcf.webResourceFetcher = wrf; Set result = rcf.getRecentChanges(); assertTrue(result.contains("Q1876457")); - assertFalse(result.contains("Q1")); + assertFalse(result.contains("Q1")); + assertFalse(result.contains("Wikidata - Recent changes [en]")); + } + + @Test + public void testParsePropertyName() { + RecentChangesFetcher rcf = new RecentChangesFetcher(); + String itemString = " Q5 "; + String result = rcf.parsePropertyName(itemString); + assertEquals(result, "Q5"); + } + + @Test + public void testParseDate() { + RecentChangesFetcher rcf = new RecentChangesFetcher(); + String itemString = " Tue, 02 Jun 2015 13:21:58 GMT "; + Date result = rcf.parseTime(itemString); + String resultString = new SimpleDateFormat( + "dd.MM.yyyy HH:mm:ss", Locale.GERMANY) + .format(result); + assertEquals(resultString, "02.06.2015 15:21:58"); } } \ No newline at end of file From a673fdf5983715a322af2a94fe4b0225d9028c9c Mon Sep 17 00:00:00 2001 From: Markus Damm Date: Tue, 2 Jun 2015 16:53:52 +0200 Subject: [PATCH 05/24] add parseAuthor and corresponding test --- .../wikibaseapi/RecentChangesFetcher.java | 33 +++++++++++++++---- .../wikibaseapi/RecentChangesFetcherTest.java | 12 +++++-- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index 35998c505..485b1b754 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -118,7 +118,7 @@ public Set parseItemStrings(String[] items) { if (firstEntry) { firstEntry = false; } else { - String propertyName = parsePropertyName(item); + String propertyName = parsePropertyNameFromItemString(item); propertyNames.add(propertyName); } } @@ -133,7 +133,7 @@ public Set parseItemStrings(String[] items) { * substring for an item of the recent changes feed * @return name of the property */ - public String parsePropertyName(String itemString) { + public String parsePropertyNameFromItemString(String itemString) { String startString = ""; String endString = ""; int start = itemString.indexOf(startString) @@ -149,10 +149,9 @@ public String parsePropertyName(String itemString) { * * @param itemString * substring for an item of the recent changes feed - * @return date for the recent change + * @return date and time for the recent change */ - - public Date parseTime(String itemString) { + public Date parseTimeFromItemString(String itemString) { String startString = ""; String endString = ""; int start = itemString.indexOf(startString) @@ -166,12 +165,32 @@ public Date parseTime(String itemString) { } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + logger.error("Could not parse date from string \"" + + itemString + "\". Error:\n" + + e.toString()); } return date; } + + /** + * parses the name or the IP address of the change of a property from + * the item string of the recent changes feed + * + * @param itemString + * substring for an item of the recent changes feed + * @return name of the author (if user is registered) or the IP address + * (if user is not registered) + */ + public String parseAuthorFromItemString(String itemString) { + String startString = ""; + String endString = ""; + int start = itemString.indexOf(startString) + + startString.length(); + int end = itemString.indexOf(endString); + return itemString.substring(start, end); + } + /** * method to call for getting recent changes * diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index 07a9c6277..3167a73e6 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -63,7 +63,7 @@ public void testGetRecentChanges() throws IOException { public void testParsePropertyName() { RecentChangesFetcher rcf = new RecentChangesFetcher(); String itemString = " Q5 "; - String result = rcf.parsePropertyName(itemString); + String result = rcf.parsePropertyNameFromItemString(itemString); assertEquals(result, "Q5"); } @@ -71,10 +71,18 @@ public void testParsePropertyName() { public void testParseDate() { RecentChangesFetcher rcf = new RecentChangesFetcher(); String itemString = " Tue, 02 Jun 2015 13:21:58 GMT "; - Date result = rcf.parseTime(itemString); + Date result = rcf.parseTimeFromItemString(itemString); String resultString = new SimpleDateFormat( "dd.MM.yyyy HH:mm:ss", Locale.GERMANY) .format(result); assertEquals(resultString, "02.06.2015 15:21:58"); + } + + @Test + public void testParseAuthor() { + RecentChangesFetcher rcf = new RecentChangesFetcher(); + String itemString = " Test "; + String result = rcf.parseAuthorFromItemString(itemString); + assertEquals(result, "Test"); } } \ No newline at end of file From 85a57eb892b3e23ada7a84db0de7bf2e5941aaea Mon Sep 17 00:00:00 2001 From: Markus Damm Date: Wed, 3 Jun 2015 22:09:50 +0200 Subject: [PATCH 06/24] change datatype of testfile --- .../wdtk/wikibaseapi/RecentChangesFetcherTest.java | 9 ++++----- .../resources/{recentchanges.rdf => recentchanges.xml} | 0 2 files changed, 4 insertions(+), 5 deletions(-) rename wdtk-wikibaseapi/src/test/resources/{recentchanges.rdf => recentchanges.xml} (100%) diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index 3167a73e6..149ba39fd 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -28,7 +28,6 @@ import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; -import java.util.Locale; import java.util.Set; import org.junit.Test; @@ -51,7 +50,7 @@ public void testGetRecentChanges() throws IOException { RecentChangesFetcher rcf = new RecentChangesFetcher(); MockWebResourceFetcher wrf = new MockWebResourceFetcher(); wrf.setWebResourceContentsFromResource(rcf.rdfURL, - "/recentchanges.rdf", this.getClass()); + "/recentchanges.xml", this.getClass()); rcf.webResourceFetcher = wrf; Set result = rcf.getRecentChanges(); assertTrue(result.contains("Q1876457")); @@ -73,9 +72,9 @@ public void testParseDate() { String itemString = " Tue, 02 Jun 2015 13:21:58 GMT "; Date result = rcf.parseTimeFromItemString(itemString); String resultString = new SimpleDateFormat( - "dd.MM.yyyy HH:mm:ss", Locale.GERMANY) + "dd.MM.yyyy HH:mm:ss") .format(result); - assertEquals(resultString, "02.06.2015 15:21:58"); + assertEquals(resultString, "02.06.2015 13:21:58"); } @Test @@ -85,4 +84,4 @@ public void testParseAuthor() { String result = rcf.parseAuthorFromItemString(itemString); assertEquals(result, "Test"); } -} \ No newline at end of file +} diff --git a/wdtk-wikibaseapi/src/test/resources/recentchanges.rdf b/wdtk-wikibaseapi/src/test/resources/recentchanges.xml similarity index 100% rename from wdtk-wikibaseapi/src/test/resources/recentchanges.rdf rename to wdtk-wikibaseapi/src/test/resources/recentchanges.xml From 24c8e7c1688875586d051931345fa6c9540c18ff Mon Sep 17 00:00:00 2001 From: Markus Damm Date: Wed, 3 Jun 2015 23:44:38 +0200 Subject: [PATCH 07/24] replace Scanner in parsing of RSS feed by BufferedReader --- .../wikibaseapi/RecentChangesFetcher.java | 77 ++++++++++++------- .../wikibaseapi/RecentChangesFetcherTest.java | 5 +- 2 files changed, 51 insertions(+), 31 deletions(-) diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index 485b1b754..73b7aec4f 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -20,14 +20,15 @@ * #L% */ +import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashSet; import java.util.Locale; -import java.util.Scanner; import java.util.Set; import org.slf4j.Logger; @@ -79,28 +80,6 @@ public RecentChangesFetcher(String rdfURL) { this.rdfURL = rdfURL; } - /** - * Fetches IOStream from RDF feed and separates it into different items - * - * @return Different items of the recent changes feed or null if it does - * not exist - */ - public String[] getStringFromIOStream() { - String[] result = null; - try { - InputStream inputStream = this.webResourceFetcher - .getInputStreamForUrl(rdfURL); - Scanner scanner = new Scanner(inputStream); - String rdfString = scanner.useDelimiter("\\Z").next(); - result = rdfString.split(""); - scanner.close(); - inputStream.close(); - } catch (IOException e) { - logger.error("Could not retrieve data from " + rdfURL - + ". Error:\n" + e.toString()); - } - return result; - } /** * parses a substring of the recent changes feed and collects all @@ -192,13 +171,53 @@ public String parseAuthorFromItemString(String itemString) { } /** - * method to call for getting recent changes + * Fetches IOStream from RSS feed and return a set of recent changes. * - * @return Set of recent Changes + * @return a set recent changes from the recent changes feed */ public Set getRecentChanges() { - String[] recentChangeString = getStringFromIOStream(); - Set recentChanges = parseItemStrings(recentChangeString); - return recentChanges; + Set changes = new HashSet<>(); + try { + InputStream inputStream = this.webResourceFetcher + .getInputStreamForUrl(rdfURL); + BufferedReader bufferedReader = new BufferedReader( + new InputStreamReader(inputStream)); + String line = bufferedReader.readLine(); + while (line != null) { + if (line.contains("")) { + changes.add(parseItem(bufferedReader, + line)); + } + line = bufferedReader.readLine(); + } + inputStream.close(); + } catch (IOException e) { + logger.error("Could not retrieve data from " + rdfURL + + ". Error:\n" + e.toString()); + } + return changes; + } + + String parseItem(BufferedReader bf, String line) { + String propertyName = ""; + while (!line.contains("")) { + try { + line = bf.readLine(); + if (line.contains("")) { + propertyName = parsePropertyNameFromItemString(line); + } + // if (line.contains("<pubDate>")) { + // date = parseTimeFromItemString(line); + // } + // if (line.contains("<dc:creator>")) { + // author = parseAuthorFromItemString(line); + // } + } catch (IOException e) { + logger.error("Could not retrieve data from " + + rdfURL + ". Error:\n" + + e.toString()); + } + } + return propertyName; } -} \ No newline at end of file +} diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index 149ba39fd..a10cf28f1 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -52,8 +52,9 @@ public void testGetRecentChanges() throws IOException { wrf.setWebResourceContentsFromResource(rcf.rdfURL, "/recentchanges.xml", this.getClass()); rcf.webResourceFetcher = wrf; - Set<String> result = rcf.getRecentChanges(); - assertTrue(result.contains("Q1876457")); + Set<String> result = rcf.getRecentChanges(); + assertTrue(result.contains("Q20026648")); + assertTrue(result.contains("Q1876457")); assertFalse(result.contains("Q1")); assertFalse(result.contains("Wikidata - Recent changes [en]")); } From 0cff4a1d21d13c1ad8d0a74266abdaae7174f772 Mon Sep 17 00:00:00 2001 From: Markus Damm <nullachtfuffzn@arcor.de> Date: Fri, 5 Jun 2015 16:00:33 +0200 Subject: [PATCH 08/24] remove unnecessary public visabilites --- .../wikibaseapi/RecentChangesFetcher.java | 58 +++++++------------ .../wikibaseapi/RecentChangesFetcherTest.java | 6 +- 2 files changed, 25 insertions(+), 39 deletions(-) diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index 73b7aec4f..9cb931392 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -50,12 +50,12 @@ public class RecentChangesFetcher { /** * URL for the recent changes feed of wikidata.org. */ - final static String WIKIDATA_RDF_FEED_URL = "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"; + final static String WIKIDATA_RSS_FEED_URL = "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"; /** * The URL where the recent changes feed can be found. */ - final String rdfURL; + final String rssURL; /** * Object used to make web requests. Package-private so that it can be @@ -67,7 +67,7 @@ public class RecentChangesFetcher { * Creates an object to fetch recent changes of Wikidata */ public RecentChangesFetcher() { - this(WIKIDATA_RDF_FEED_URL); + this(WIKIDATA_RSS_FEED_URL); } /** @@ -77,33 +77,10 @@ public RecentChangesFetcher() { * URL of the RDF feed */ public RecentChangesFetcher(String rdfURL) { - this.rdfURL = rdfURL; + this.rssURL = rdfURL; } - /** - * parses a substring of the recent changes feed and collects all - * property names - * - * @param items - * substring for an item of the recent changes feed - * @return set of all property names that were changed. Hence multiple - * changes appear only once. - */ - public Set<String> parseItemStrings(String[] items) { - Set<String> propertyNames = new HashSet<>(); - boolean firstEntry = true; - for (String item : items) { - if (firstEntry) { - firstEntry = false; - } else { - String propertyName = parsePropertyNameFromItemString(item); - propertyNames.add(propertyName); - } - } - return propertyNames; - } - /** * parses the name of the property from the item string of the recent * changes feed @@ -112,7 +89,7 @@ public Set<String> parseItemStrings(String[] items) { * substring for an item of the recent changes feed * @return name of the property */ - public String parsePropertyNameFromItemString(String itemString) { + String parsePropertyNameFromItemString(String itemString) { String startString = "<title>"; String endString = ""; int start = itemString.indexOf(startString) @@ -130,7 +107,7 @@ public String parsePropertyNameFromItemString(String itemString) { * substring for an item of the recent changes feed * @return date and time for the recent change */ - public Date parseTimeFromItemString(String itemString) { + Date parseTimeFromItemString(String itemString) { String startString = ""; String endString = ""; int start = itemString.indexOf(startString) @@ -161,7 +138,7 @@ public Date parseTimeFromItemString(String itemString) { * @return name of the author (if user is registered) or the IP address * (if user is not registered) */ - public String parseAuthorFromItemString(String itemString) { + String parseAuthorFromItemString(String itemString) { String startString = ""; String endString = ""; int start = itemString.indexOf(startString) @@ -179,7 +156,7 @@ public Set getRecentChanges() { Set changes = new HashSet<>(); try { InputStream inputStream = this.webResourceFetcher - .getInputStreamForUrl(rdfURL); + .getInputStreamForUrl(rssURL); BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(inputStream)); String line = bufferedReader.readLine(); @@ -192,17 +169,26 @@ public Set getRecentChanges() { } inputStream.close(); } catch (IOException e) { - logger.error("Could not retrieve data from " + rdfURL + logger.error("Could not retrieve data from " + rssURL + ". Error:\n" + e.toString()); } return changes; } - String parseItem(BufferedReader bf, String line) { + /** + * Parses an item inside the -tag. + * + * @param bufferedReader + * reader that reads the InputStream + * @param line + * last line from the InputStream that has been read + * @return RecentChange that equals the item + */ + String parseItem(BufferedReader bufferedReader, String line) { String propertyName = ""; while (!line.contains("")) { try { - line = bf.readLine(); + line = bufferedReader.readLine(); if (line.contains("")) { propertyName = parsePropertyNameFromItemString(line); } @@ -213,8 +199,8 @@ String parseItem(BufferedReader bf, String line) { // author = parseAuthorFromItemString(line); // } } catch (IOException e) { - logger.error("Could not retrieve data from " - + rdfURL + ". Error:\n" + logger.error("Could not parse data from " + + rssURL + ". Error:\n" + e.toString()); } } diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index a10cf28f1..1d25f9ca0 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -39,9 +39,9 @@ public void testConstructors() { RecentChangesFetcher rcf1 = new RecentChangesFetcher(); RecentChangesFetcher rcf2 = new RecentChangesFetcher( "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); - assertEquals(rcf1.rdfURL, + assertEquals(rcf1.rssURL, "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); - assertEquals(rcf2.rdfURL, + assertEquals(rcf2.rssURL, "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); } @@ -49,7 +49,7 @@ public void testConstructors() { public void testGetRecentChanges() throws IOException { RecentChangesFetcher rcf = new RecentChangesFetcher(); MockWebResourceFetcher wrf = new MockWebResourceFetcher(); - wrf.setWebResourceContentsFromResource(rcf.rdfURL, + wrf.setWebResourceContentsFromResource(rcf.rssURL, "/recentchanges.xml", this.getClass()); rcf.webResourceFetcher = wrf; Set<String> result = rcf.getRecentChanges(); From 4e5506c0ef7d060fd500f5125b0b22c70fc4dc3b Mon Sep 17 00:00:00 2001 From: Markus Damm <nullachtfuffzn@arcor.de> Date: Fri, 5 Jun 2015 16:19:56 +0200 Subject: [PATCH 09/24] Edit time parsing to fix positions in line --- .../wdtk/wikibaseapi/RecentChangesFetcher.java | 11 ++++------- .../wdtk/wikibaseapi/RecentChangesFetcherTest.java | 9 +++++---- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index 9cb931392..80f19c834 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -108,15 +108,12 @@ String parsePropertyNameFromItemString(String itemString) { * @return date and time for the recent change */ Date parseTimeFromItemString(String itemString) { - String startString = "<pubDate>"; - String endString = "</pubDate>"; - int start = itemString.indexOf(startString) - + startString.length(); - int end = itemString.indexOf(endString); + int start = 17; + int end = 41; String timeString = itemString.substring(start, end); Date date = null; try { - date = new SimpleDateFormat("E, d MMM yyyy HH:mm:ss Z", + date = new SimpleDateFormat("dd MMM yyyy HH:mm:ss Z", Locale.ENGLISH).parse(timeString); } @@ -193,7 +190,7 @@ String parseItem(BufferedReader bufferedReader, String line) { propertyName = parsePropertyNameFromItemString(line); } // if (line.contains("<pubDate>")) { - // date = parseTimeFromItemString(line); + // Date date = parseTimeFromItemString(line); // } // if (line.contains("<dc:creator>")) { // author = parseAuthorFromItemString(line); diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index 1d25f9ca0..f7926dd51 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -33,7 +33,9 @@ import org.junit.Test; import org.wikidata.wdtk.testing.MockWebResourceFetcher; -public class RecentChangesFetcherTest{ +public class RecentChangesFetcherTest{ + private String dateLine = " <pubDate>Tue, 02 Jun 2015 13:22:02 GMT</pubDate> <dc:creator>Superzerocool</dc:creator> <comments>http://www.wikidata.org/wiki/Talk:Q1876457</comments> </item>"; + @Test public void testConstructors() { RecentChangesFetcher rcf1 = new RecentChangesFetcher(); @@ -70,12 +72,11 @@ public void testParsePropertyName() { @Test public void testParseDate() { RecentChangesFetcher rcf = new RecentChangesFetcher(); - String itemString = " <pubDate>Tue, 02 Jun 2015 13:21:58 GMT</pubDate> "; - Date result = rcf.parseTimeFromItemString(itemString); + Date result = rcf.parseTimeFromItemString(dateLine); String resultString = new SimpleDateFormat( "dd.MM.yyyy HH:mm:ss") .format(result); - assertEquals(resultString, "02.06.2015 13:21:58"); + assertEquals(resultString, "02.06.2015 13:22:02"); } @Test From d95069e660866997c542f9ed3f7e23fc5cc8b5a5 Mon Sep 17 00:00:00 2001 From: Markus Damm <nullachtfuffzn@arcor.de> Date: Fri, 5 Jun 2015 16:30:30 +0200 Subject: [PATCH 10/24] Edit parsing of author to a fix beginning --- .../wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java | 7 +++---- .../wdtk/wikibaseapi/RecentChangesFetcherTest.java | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index 80f19c834..3d0fd79d1 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -136,10 +136,8 @@ Date parseTimeFromItemString(String itemString) { * (if user is not registered) */ String parseAuthorFromItemString(String itemString) { - String startString = "<dc:creator>"; String endString = "</dc:creator>"; - int start = itemString.indexOf(startString) - + startString.length(); + int start = 66; int end = itemString.indexOf(endString); return itemString.substring(start, end); } @@ -193,7 +191,8 @@ String parseItem(BufferedReader bufferedReader, String line) { // Date date = parseTimeFromItemString(line); // } // if (line.contains("<dc:creator>")) { - // author = parseAuthorFromItemString(line); + // String author = + // parseAuthorFromItemString(line); // } } catch (IOException e) { logger.error("Could not parse data from " diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index f7926dd51..4d24de55d 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -82,8 +82,7 @@ public void testParseDate() { @Test public void testParseAuthor() { RecentChangesFetcher rcf = new RecentChangesFetcher(); - String itemString = " <dc:creator>Test</dc:creator> "; - String result = rcf.parseAuthorFromItemString(itemString); - assertEquals(result, "Test"); + String result = rcf.parseAuthorFromItemString(dateLine); + assertEquals(result, "Superzerocool"); } } From 858ade7565cf516eafef2b1c315156ab21f481f9 Mon Sep 17 00:00:00 2001 From: Markus Damm <nullachtfuffzn@arcor.de> Date: Sun, 7 Jun 2015 22:25:02 +0200 Subject: [PATCH 11/24] created class RecentChange --- .../wikibaseapi/RecentChangesFetcher.java | 54 +++++++++++++++++++ .../wikibaseapi/RecentChangesFetcherTest.java | 6 +-- 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index 3d0fd79d1..0d57ebdd7 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -202,4 +202,58 @@ String parseItem(BufferedReader bufferedReader, String line) { } return propertyName; } + + class RecentChange implements Comparable<RecentChange> { + /** + * author of the recent change + */ + private String author; + + /** + * property that was recently changed + */ + private String propertyName; + + /** + * date and time of the recent change + */ + private Date date; + + /** + * Returns the author of the recent change + * + * @return name (if user is registered) or the ip adress (if + * user is unregistered) of the author of the recent + * change + */ + public String getAuthor() { + return author; + } + + /** + * Returns the name of the changed property + * + * @return name of the recently changed property + */ + public String getPropertyName() { + return propertyName; + } + + /** + * Returns the date of the recent change + * + * @return date of the recent change + */ + public Date getDate() { + return date; + } + + @Override + public int compareTo(RecentChange other) { + if (this.date.after(other.date)) { + return 1; + } + return 0; + } + } } diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index 4d24de55d..de1d71d5b 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -35,6 +35,7 @@ public class RecentChangesFetcherTest{ private String dateLine = " <pubDate>Tue, 02 Jun 2015 13:22:02 GMT</pubDate> <dc:creator>Superzerocool</dc:creator> <comments>http://www.wikidata.org/wiki/Talk:Q1876457</comments> </item>"; + private String titleLine = " <title>Q1876457"; @Test public void testConstructors() { @@ -64,9 +65,8 @@ public void testGetRecentChanges() throws IOException { @Test public void testParsePropertyName() { RecentChangesFetcher rcf = new RecentChangesFetcher(); - String itemString = " Q5 "; - String result = rcf.parsePropertyNameFromItemString(itemString); - assertEquals(result, "Q5"); + String result = rcf.parsePropertyNameFromItemString(titleLine); + assertEquals(result, "Q1876457"); } @Test From c4c32d35ef6cc346ad41e6bf994df56f836684e4 Mon Sep 17 00:00:00 2001 From: Markus Damm Date: Sun, 7 Jun 2015 22:51:13 +0200 Subject: [PATCH 12/24] Fix for testParseDate() --- .../wdtk/wikibaseapi/RecentChangesFetcherTest.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index de1d71d5b..ea326f930 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -26,8 +26,10 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Locale; import java.util.Set; import org.junit.Test; @@ -70,13 +72,14 @@ public void testParsePropertyName() { } @Test - public void testParseDate() { + public void testParseDate() throws ParseException { RecentChangesFetcher rcf = new RecentChangesFetcher(); Date result = rcf.parseTimeFromItemString(dateLine); - String resultString = new SimpleDateFormat( - "dd.MM.yyyy HH:mm:ss") - .format(result); - assertEquals(resultString, "02.06.2015 13:22:02"); + Date actualDate = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss Z", + Locale.ENGLISH) + .parse("02.06.2015 13:22:02 GMT"); + assertEquals(actualDate.compareTo(result), 0); + } @Test From 7198237508b9fb7ec215e96128119f81eee08e21 Mon Sep 17 00:00:00 2001 From: Markus Damm Date: Sun, 7 Jun 2015 22:54:09 +0200 Subject: [PATCH 13/24] Put RecentChange to own file and removed as inner class from RecentChangesFetcher --- .../wdtk/wikibaseapi/RecentChange.java | 63 +++++++++++++++++++ .../wikibaseapi/RecentChangesFetcher.java | 52 --------------- 2 files changed, 63 insertions(+), 52 deletions(-) create mode 100644 wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java new file mode 100644 index 000000000..6272e8869 --- /dev/null +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java @@ -0,0 +1,63 @@ +package org.wikidata.wdtk.wikibaseapi; + +import java.util.Date; + +/** + * Simple class for saving recent changes + * + * @author Markus Damm + * + */ + +public class RecentChange implements Comparable { + /** + * author of the recent change + */ + private String author; + + /** + * property that was recently changed + */ + private String propertyName; + + /** + * date and time of the recent change + */ + private Date date; + + /** + * Returns the author of the recent change + * + * @return name (if user is registered) or the ip adress (if user is + * unregistered) of the author of the recent change + */ + public String getAuthor() { + return author; + } + + /** + * Returns the name of the changed property + * + * @return name of the recently changed property + */ + public String getPropertyName() { + return propertyName; + } + + /** + * Returns the date of the recent change + * + * @return date of the recent change + */ + public Date getDate() { + return date; + } + + @Override + public int compareTo(RecentChange other) { + if (this.date.after(other.date)) { + return 1; + } + return 0; + } +} \ No newline at end of file diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index 0d57ebdd7..7735d1619 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -203,57 +203,5 @@ String parseItem(BufferedReader bufferedReader, String line) { return propertyName; } - class RecentChange implements Comparable { - /** - * author of the recent change - */ - private String author; - /** - * property that was recently changed - */ - private String propertyName; - - /** - * date and time of the recent change - */ - private Date date; - - /** - * Returns the author of the recent change - * - * @return name (if user is registered) or the ip adress (if - * user is unregistered) of the author of the recent - * change - */ - public String getAuthor() { - return author; - } - - /** - * Returns the name of the changed property - * - * @return name of the recently changed property - */ - public String getPropertyName() { - return propertyName; - } - - /** - * Returns the date of the recent change - * - * @return date of the recent change - */ - public Date getDate() { - return date; - } - - @Override - public int compareTo(RecentChange other) { - if (this.date.after(other.date)) { - return 1; - } - return 0; - } - } } From a244f0fc71d5942a72865add58aaaee66e6fbe71 Mon Sep 17 00:00:00 2001 From: Markus Damm Date: Sun, 7 Jun 2015 23:02:30 +0200 Subject: [PATCH 14/24] add Constructor to RecentChange --- .../wdtk/wikibaseapi/RecentChange.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java index 6272e8869..c8b6e2859 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java @@ -25,6 +25,22 @@ public class RecentChange implements Comparable { */ private Date date; + /** + * Constructor + * + * @param propertyName + * name of the changed property + * @param date + * date of the recent change + * @param author + * name of the author of the recent change + */ + public RecentChange(String propertyName, Date date, String author) { + this.propertyName = propertyName; + this.date = date; + this.author = author; + } + /** * Returns the author of the recent change * @@ -58,6 +74,9 @@ public int compareTo(RecentChange other) { if (this.date.after(other.date)) { return 1; } + if (this.date.before(other.date)) { + return -1; + } return 0; } } \ No newline at end of file From 78ff331ddd5933aee5581699470d3e4875146fb0 Mon Sep 17 00:00:00 2001 From: Markus Damm Date: Sun, 7 Jun 2015 23:36:19 +0200 Subject: [PATCH 15/24] added RecentChangesTest --- .../wdtk/wikibaseapi/RecentChange.java | 13 ++++ .../wikibaseapi/RecentChangesFetcher.java | 60 +++++++++++-------- .../wdtk/wikibaseapi/RecentChangeTest.java | 29 +++++++++ .../wikibaseapi/RecentChangesFetcherTest.java | 30 ++++++---- 4 files changed, 98 insertions(+), 34 deletions(-) create mode 100644 wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java index c8b6e2859..629f9c7da 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java @@ -69,6 +69,19 @@ public Date getDate() { return date; } + @Override + public boolean equals(Object other) { + if (other instanceof RecentChange) { + RecentChange o = (RecentChange) other; + if (this.propertyName.equals(o.propertyName) + && (this.date.equals(o.date)) + && (this.author.equals(o.author))) { + return true; + } + } + return false; + } + @Override public int compareTo(RecentChange other) { if (this.date.after(other.date)) { diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index 7735d1619..8c2a5770c 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -27,9 +27,9 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; -import java.util.HashSet; import java.util.Locale; import java.util.Set; +import java.util.TreeSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -48,14 +48,19 @@ public class RecentChangesFetcher { .getLogger(WikibaseDataFetcher.class); /** - * URL for the recent changes feed of wikidata.org. + * URL prefix for the recent changes feed of wikidata.org. */ - final static String WIKIDATA_RSS_FEED_URL = "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"; + final static String WIKIDATA_RSS_FEED_URL_PREFIX = "http://www.wikidata.org/"; + + /** + * URL suffix for RSS recent changes feed + */ + final static String RSS_FEED_URL_SUFFIX = "w/api.php?action=feedrecentchanges&format=json&feedformat=rss"; /** * The URL where the recent changes feed can be found. */ - final String rssURL; + final String rssUrl; /** * Object used to make web requests. Package-private so that it can be @@ -67,17 +72,19 @@ public class RecentChangesFetcher { * Creates an object to fetch recent changes of Wikidata */ public RecentChangesFetcher() { - this(WIKIDATA_RSS_FEED_URL); + this(WIKIDATA_RSS_FEED_URL_PREFIX); } /** * Creates an object to fetch recent changes * - * @param rdfURL - * URL of the RDF feed + * @param rdfUrlPrefix + * Prefix of an URL of the RSS recent changes feed, e.g. + * http://www.wikidata.org/ for wikidata, the suffix is + * added in this constructor */ - public RecentChangesFetcher(String rdfURL) { - this.rssURL = rdfURL; + public RecentChangesFetcher(String rdfUrlPrefix) { + this.rssUrl = rdfUrlPrefix + RSS_FEED_URL_SUFFIX; } @@ -147,11 +154,11 @@ String parseAuthorFromItemString(String itemString) { * * @return a set recent changes from the recent changes feed */ - public Set getRecentChanges() { - Set changes = new HashSet<>(); + public Set getRecentChanges() { + Set changes = new TreeSet<>(); try { InputStream inputStream = this.webResourceFetcher - .getInputStreamForUrl(rssURL); + .getInputStreamForUrl(rssUrl); BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(inputStream)); String line = bufferedReader.readLine(); @@ -164,7 +171,7 @@ public Set getRecentChanges() { } inputStream.close(); } catch (IOException e) { - logger.error("Could not retrieve data from " + rssURL + logger.error("Could not retrieve data from " + rssUrl + ". Error:\n" + e.toString()); } return changes; @@ -179,28 +186,33 @@ public Set getRecentChanges() { * last line from the InputStream that has been read * @return RecentChange that equals the item */ - String parseItem(BufferedReader bufferedReader, String line) { - String propertyName = ""; + RecentChange parseItem(BufferedReader bufferedReader, String line) { + String propertyName = null; + String author = null; + Date date = null; while (!line.contains("")) { try { line = bufferedReader.readLine(); + if (line.contains("")) { propertyName = parsePropertyNameFromItemString(line); } - // if (line.contains("<pubDate>")) { - // Date date = parseTimeFromItemString(line); - // } - // if (line.contains("<dc:creator>")) { - // String author = - // parseAuthorFromItemString(line); - // } + if (line.contains("<pubDate>")) { + date = parseTimeFromItemString(line); + } + if (line.contains("<dc:creator>")) { + author = parseAuthorFromItemString(line); + } } catch (IOException e) { logger.error("Could not parse data from " - + rssURL + ". Error:\n" + + rssUrl + ". Error:\n" + e.toString()); } } - return propertyName; + if (propertyName == null || author == null || date == null) { + throw new NullPointerException(); + } + return new RecentChange(propertyName, date, author); } diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java new file mode 100644 index 000000000..b58f4661f --- /dev/null +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java @@ -0,0 +1,29 @@ +package org.wikidata.wdtk.wikibaseapi; + +import static org.junit.Assert.assertTrue; + +import java.util.Date; +import java.util.Set; +import java.util.TreeSet; + +import org.junit.Test; + +public class RecentChangeTest { + @Test + public void testEquals() { + RecentChange rc1 = new RecentChange("a", new Date(), "b"); + RecentChange rc2 = new RecentChange("a", new Date(), "b"); + assertTrue(rc1.equals(rc2)); + } + + @Test + public void testContainsSet() { + RecentChange rc1 = new RecentChange("a", new Date(), "b"); + RecentChange rc2 = new RecentChange("a", new Date(), "b"); + Set<RecentChange> rcs = new TreeSet<>(); + rcs.add(rc1); + assertTrue(rcs.contains(rc1)); + assertTrue(rcs.contains(rc2)); + } + +} \ No newline at end of file diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index ea326f930..025b61efe 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -43,25 +43,35 @@ public class RecentChangesFetcherTest{ public void testConstructors() { RecentChangesFetcher rcf1 = new RecentChangesFetcher(); RecentChangesFetcher rcf2 = new RecentChangesFetcher( + "http://www.wikidata.org/"); + assertEquals(rcf1.rssUrl, "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); - assertEquals(rcf1.rssURL, - "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); - assertEquals(rcf2.rssURL, + assertEquals(rcf2.rssUrl, "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); } @Test - public void testGetRecentChanges() throws IOException { + public void testGetRecentChanges() throws IOException, ParseException { RecentChangesFetcher rcf = new RecentChangesFetcher(); MockWebResourceFetcher wrf = new MockWebResourceFetcher(); - wrf.setWebResourceContentsFromResource(rcf.rssURL, + wrf.setWebResourceContentsFromResource(rcf.rssUrl, "/recentchanges.xml", this.getClass()); rcf.webResourceFetcher = wrf; - Set<String> result = rcf.getRecentChanges(); - assertTrue(result.contains("Q20026648")); - assertTrue(result.contains("Q1876457")); - assertFalse(result.contains("Q1")); - assertFalse(result.contains("Wikidata - Recent changes [en]")); + Set<RecentChange> result = rcf.getRecentChanges(); + RecentChange rc1 = new RecentChange( + "Q1876457", + new SimpleDateFormat("dd.MM.yyyy HH:mm:ss Z", + Locale.ENGLISH) + .parse("02.06.2015 13:22:02 GMT"), + "Superzerocool"); + assertTrue(result.contains(rc1)); + // assertTrue(result.contains("Q20026648")); + // assertTrue(result.contains("Q1876457")); + // assertFalse(result.contains("Q1")); + RecentChange rc2 = new RecentChange( + "Wikidata - Recent changes [en]", new Date(), + ""); + assertFalse(result.contains(rc2)); } @Test From 55387266a8037dd77b26269bb147a77ec496cff5 Mon Sep 17 00:00:00 2001 From: Markus Damm <nullachtfuffzn@arcor.de> Date: Sun, 7 Jun 2015 23:51:06 +0200 Subject: [PATCH 16/24] add test for Comparable-interface of RecentChange --- .../wdtk/wikibaseapi/RecentChangeTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java index b58f4661f..144f43cf1 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java @@ -1,7 +1,10 @@ package org.wikidata.wdtk.wikibaseapi; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.Date; import java.util.Set; import java.util.TreeSet; @@ -26,4 +29,18 @@ public void testContainsSet() { assertTrue(rcs.contains(rc2)); } + @Test + public void testComparable() throws ParseException { + SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy"); + RecentChange rc1 = new RecentChange("", + sdf.parse("31.12.2014"), ""); + RecentChange rc2 = new RecentChange("", + sdf.parse("31.12.2014"), ""); + RecentChange rc3 = new RecentChange("", + sdf.parse("01.01.2015"), ""); + assertEquals(rc1.compareTo(rc2), 0); + assertEquals(rc2.compareTo(rc3), -1); + assertEquals(rc3.compareTo(rc2), 1); + } + } \ No newline at end of file From b22ca4038fbfa6d8e6e9a7b7b76dda760651b670 Mon Sep 17 00:00:00 2001 From: Markus Damm <nullachtfuffzn@arcor.de> Date: Mon, 8 Jun 2015 00:04:22 +0200 Subject: [PATCH 17/24] expand test for equal RecentChange --- .../java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java index 144f43cf1..57cf99d7c 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java @@ -1,6 +1,7 @@ package org.wikidata.wdtk.wikibaseapi; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.text.ParseException; @@ -16,7 +17,9 @@ public class RecentChangeTest { public void testEquals() { RecentChange rc1 = new RecentChange("a", new Date(), "b"); RecentChange rc2 = new RecentChange("a", new Date(), "b"); + RecentChange rc3 = new RecentChange("c", new Date(), "b"); assertTrue(rc1.equals(rc2)); + assertFalse(rc3.equals(rc2)); } @Test From 250a4517d662a00ac44ad3ac58c396759bc36970 Mon Sep 17 00:00:00 2001 From: Markus Damm <nullachtfuffzn@arcor.de> Date: Wed, 10 Jun 2015 13:44:10 +0200 Subject: [PATCH 18/24] correct style guide --- .../wdtk/wikibaseapi/RecentChange.java | 13 ++-- .../wikibaseapi/RecentChangesFetcher.java | 62 +++++++++---------- .../wdtk/wikibaseapi/RecentChangeTest.java | 3 +- 3 files changed, 37 insertions(+), 41 deletions(-) diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java index 629f9c7da..9e2f5a181 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java @@ -9,7 +9,8 @@ * */ -public class RecentChange implements Comparable<RecentChange> { +class RecentChange implements Comparable<RecentChange> { + /** * author of the recent change */ @@ -35,7 +36,7 @@ public class RecentChange implements Comparable<RecentChange> { * @param author * name of the author of the recent change */ - public RecentChange(String propertyName, Date date, String author) { + RecentChange(String propertyName, Date date, String author) { this.propertyName = propertyName; this.date = date; this.author = author; @@ -47,7 +48,7 @@ public RecentChange(String propertyName, Date date, String author) { * @return name (if user is registered) or the ip adress (if user is * unregistered) of the author of the recent change */ - public String getAuthor() { + String getAuthor() { return author; } @@ -56,7 +57,7 @@ public String getAuthor() { * * @return name of the recently changed property */ - public String getPropertyName() { + String getPropertyName() { return propertyName; } @@ -65,7 +66,7 @@ public String getPropertyName() { * * @return date of the recent change */ - public Date getDate() { + Date getDate() { return date; } @@ -92,4 +93,4 @@ public int compareTo(RecentChange other) { } return 0; } -} \ No newline at end of file +} diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index 8c2a5770c..fffeb6924 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -50,12 +50,12 @@ public class RecentChangesFetcher { /** * URL prefix for the recent changes feed of wikidata.org. */ - final static String WIKIDATA_RSS_FEED_URL_PREFIX = "http://www.wikidata.org/"; + static final String WIKIDATA_RSS_FEED_URL_PREFIX = "http://www.wikidata.org/"; /** * URL suffix for RSS recent changes feed */ - final static String RSS_FEED_URL_SUFFIX = "w/api.php?action=feedrecentchanges&format=json&feedformat=rss"; + static final String RSS_FEED_URL_SUFFIX = "w/api.php?action=feedrecentchanges&format=json&feedformat=rss"; /** * The URL where the recent changes feed can be found. @@ -87,6 +87,33 @@ public RecentChangesFetcher(String rdfUrlPrefix) { this.rssUrl = rdfUrlPrefix + RSS_FEED_URL_SUFFIX; } + /** + * Fetches IOStream from RSS feed and return a set of recent changes. + * + * @return a set recent changes from the recent changes feed + */ + public Set<RecentChange> getRecentChanges() { + Set<RecentChange> changes = new TreeSet<>(); + try { + InputStream inputStream = this.webResourceFetcher + .getInputStreamForUrl(rssUrl); + BufferedReader bufferedReader = new BufferedReader( + new InputStreamReader(inputStream)); + String line = bufferedReader.readLine(); + while (line != null) { + if (line.contains("<item>")) { + changes.add(parseItem(bufferedReader, + line)); + } + line = bufferedReader.readLine(); + } + inputStream.close(); + } catch (IOException e) { + logger.error("Could not retrieve data from " + rssUrl + + ". Error:\n" + e.toString()); + } + return changes; + } /** * parses the name of the property from the item string of the recent @@ -132,7 +159,6 @@ Date parseTimeFromItemString(String itemString) { return date; } - /** * parses the name or the IP address of the change of a property from * the item string of the recent changes feed @@ -149,34 +175,6 @@ String parseAuthorFromItemString(String itemString) { return itemString.substring(start, end); } - /** - * Fetches IOStream from RSS feed and return a set of recent changes. - * - * @return a set recent changes from the recent changes feed - */ - public Set<RecentChange> getRecentChanges() { - Set<RecentChange> changes = new TreeSet<>(); - try { - InputStream inputStream = this.webResourceFetcher - .getInputStreamForUrl(rssUrl); - BufferedReader bufferedReader = new BufferedReader( - new InputStreamReader(inputStream)); - String line = bufferedReader.readLine(); - while (line != null) { - if (line.contains("<item>")) { - changes.add(parseItem(bufferedReader, - line)); - } - line = bufferedReader.readLine(); - } - inputStream.close(); - } catch (IOException e) { - logger.error("Could not retrieve data from " + rssUrl - + ". Error:\n" + e.toString()); - } - return changes; - } - /** * Parses an item inside the <item>-tag. * @@ -214,6 +212,4 @@ RecentChange parseItem(BufferedReader bufferedReader, String line) { } return new RecentChange(propertyName, date, author); } - - } diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java index 57cf99d7c..261d1dcf8 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java @@ -45,5 +45,4 @@ public void testComparable() throws ParseException { assertEquals(rc2.compareTo(rc3), -1); assertEquals(rc3.compareTo(rc2), 1); } - -} \ No newline at end of file +} From c8ced9e132b311aec6406de955b34b5281d80705 Mon Sep 17 00:00:00 2001 From: Markus Damm <nullachtfuffzn@arcor.de> Date: Thu, 11 Jun 2015 17:07:55 +0200 Subject: [PATCH 19/24] fix of API URL --- .../wdtk/wikibaseapi/RecentChangesFetcher.java | 4 ++-- .../wdtk/wikibaseapi/RecentChangesFetcherTest.java | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index fffeb6924..6c4acc7d9 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -50,12 +50,12 @@ public class RecentChangesFetcher { /** * URL prefix for the recent changes feed of wikidata.org. */ - static final String WIKIDATA_RSS_FEED_URL_PREFIX = "http://www.wikidata.org/"; + static final String WIKIDATA_RSS_FEED_URL_PREFIX = "http://www.wikidata.org/w/api.php?"; /** * URL suffix for RSS recent changes feed */ - static final String RSS_FEED_URL_SUFFIX = "w/api.php?action=feedrecentchanges&format=json&feedformat=rss"; + static final String RSS_FEED_URL_SUFFIX = "action=feedrecentchanges&format=json&feedformat=rss"; /** * The URL where the recent changes feed can be found. diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index 025b61efe..a879e5a47 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -43,7 +43,7 @@ public class RecentChangesFetcherTest{ public void testConstructors() { RecentChangesFetcher rcf1 = new RecentChangesFetcher(); RecentChangesFetcher rcf2 = new RecentChangesFetcher( - "http://www.wikidata.org/"); + "http://www.wikidata.org/w/api.php?"); assertEquals(rcf1.rssUrl, "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); assertEquals(rcf2.rssUrl, @@ -65,13 +65,15 @@ public void testGetRecentChanges() throws IOException, ParseException { .parse("02.06.2015 13:22:02 GMT"), "Superzerocool"); assertTrue(result.contains(rc1)); - // assertTrue(result.contains("Q20026648")); - // assertTrue(result.contains("Q1876457")); - // assertFalse(result.contains("Q1")); - RecentChange rc2 = new RecentChange( + RecentChange rc2 = new RecentChange("", new Date(), ""); + RecentChange rc3 = new RecentChange("Q1", new Date(), ""); + RecentChange rc4 = new RecentChange( "Wikidata - Recent changes [en]", new Date(), ""); - assertFalse(result.contains(rc2)); + + assertFalse(result.contains(rc2)); + assertFalse(result.contains(rc3)); + assertFalse(result.contains(rc4)); } @Test From fd6fa61f03b75ccf5da968cf1e76816979607740 Mon Sep 17 00:00:00 2001 From: Markus Damm <nullachtfuffzn@arcor.de> Date: Thu, 11 Jun 2015 17:58:42 +0200 Subject: [PATCH 20/24] add buildUrl --- .../wikibaseapi/RecentChangesFetcher.java | 42 ++++++++++++++++++- .../wikibaseapi/RecentChangesFetcherTest.java | 12 +++++- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index 6c4acc7d9..aaed9df75 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -50,12 +50,17 @@ public class RecentChangesFetcher { /** * URL prefix for the recent changes feed of wikidata.org. */ - static final String WIKIDATA_RSS_FEED_URL_PREFIX = "http://www.wikidata.org/w/api.php?"; + static final String WIKIDATA_RSS_FEED_URL_PREFIX = "http://www.wikidata.org/w/api.php"; /** * URL suffix for RSS recent changes feed */ - static final String RSS_FEED_URL_SUFFIX = "action=feedrecentchanges&format=json&feedformat=rss"; + static final String RSS_FEED_URL_SUFFIX = "?action=feedrecentchanges&format=json&feedformat=rss"; + + /** + * URL suffix for the parameter "from" in the RSS recent changes feed + */ + static final String URL_FROM_DATE_SUFFIX = "&from="; /** * The URL where the recent changes feed can be found. @@ -107,6 +112,7 @@ public Set<RecentChange> getRecentChanges() { } line = bufferedReader.readLine(); } + bufferedReader.close(); inputStream.close(); } catch (IOException e) { logger.error("Could not retrieve data from " + rssUrl @@ -115,6 +121,38 @@ public Set<RecentChange> getRecentChanges() { return changes; } + /** + * Builds an URL for the recent change feed which contains the from + * parameter + * + * @param from + * earliest Date for recent changes that are fetched + * @return URL for the RSS recent changes feed + */ + String buildUrl(Date from) { + String urlDateString = new SimpleDateFormat("yyyyMMddHHmmss") + .format(from); + return rssUrl + URL_FROM_DATE_SUFFIX + urlDateString; + } + + /** + * Returns the InputStream for the recent changes feed for a given URL. + * + * @param url + * URL of the recent changes feed + * @return InputStream for the recent changes feed + */ + InputStream getInputStream(String url) { + try { + return this.webResourceFetcher + .getInputStreamForUrl(url); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return null; + } + /** * parses the name of the property from the item string of the recent * changes feed diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index a879e5a47..b0af29340 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -43,7 +43,7 @@ public class RecentChangesFetcherTest{ public void testConstructors() { RecentChangesFetcher rcf1 = new RecentChangesFetcher(); RecentChangesFetcher rcf2 = new RecentChangesFetcher( - "http://www.wikidata.org/w/api.php?"); + "http://www.wikidata.org/w/api.php"); assertEquals(rcf1.rssUrl, "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); assertEquals(rcf2.rssUrl, @@ -99,5 +99,15 @@ public void testParseAuthor() { RecentChangesFetcher rcf = new RecentChangesFetcher(); String result = rcf.parseAuthorFromItemString(dateLine); assertEquals(result, "Superzerocool"); + } + + @Test + public void testBuildUrl() throws ParseException { + RecentChangesFetcher rcf = new RecentChangesFetcher(); + String url = "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss&from=20150611154713"; + Date date = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss") + .parse("11.06.2015 15:47:13"); + String result = rcf.buildUrl(date); + assertEquals(url, result); } } From 2fb42cf271c62575dc39eae7336f44eb5ae6c57b Mon Sep 17 00:00:00 2001 From: Markus Damm <nullachtfuffzn@arcor.de> Date: Thu, 11 Jun 2015 18:45:30 +0200 Subject: [PATCH 21/24] Overload getRecentChanges --- .../wikibaseapi/RecentChangesFetcher.java | 54 ++++++++++--------- .../wikibaseapi/RecentChangesFetcherTest.java | 28 +++++++++- 2 files changed, 56 insertions(+), 26 deletions(-) diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index aaed9df75..5cb2b3a15 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -60,7 +60,7 @@ public class RecentChangesFetcher { /** * URL suffix for the parameter "from" in the RSS recent changes feed */ - static final String URL_FROM_DATE_SUFFIX = "&from="; + static final String URL_FROM_DATE_PARAMETER = "&from="; /** * The URL where the recent changes feed can be found. @@ -93,15 +93,40 @@ public RecentChangesFetcher(String rdfUrlPrefix) { } /** - * Fetches IOStream from RSS feed and return a set of recent changes. + * Fetches IOStream from RSS recent changes feed and returns a set of + * recent changes. * - * @return a set recent changes from the recent changes feed + * @return a set of recent changes from the recent changes feed */ public Set<RecentChange> getRecentChanges() { + return getRecentChanges(rssUrl); + } + + /** + * Fetches IOStream from RSS recent changes feed and no recent change is + * before the date. + * + * @param from + * earliest possible date for a recent change + * @return a set of recent changes from the recent changes feed + */ + public Set<RecentChange> getRecentChanges(Date from) { + return getRecentChanges(buildUrl(from)); + } + + /** + * Fetches IOStream from RSS recent changes feed and returns a set of + * recent changes. + * + * @param url + * URL of the RSS recent changes feed + * @return a set of recent changes from the recent changes feed + */ + Set<RecentChange> getRecentChanges(String url) { Set<RecentChange> changes = new TreeSet<>(); try { InputStream inputStream = this.webResourceFetcher - .getInputStreamForUrl(rssUrl); + .getInputStreamForUrl(url); BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(inputStream)); String line = bufferedReader.readLine(); @@ -132,25 +157,7 @@ public Set<RecentChange> getRecentChanges() { String buildUrl(Date from) { String urlDateString = new SimpleDateFormat("yyyyMMddHHmmss") .format(from); - return rssUrl + URL_FROM_DATE_SUFFIX + urlDateString; - } - - /** - * Returns the InputStream for the recent changes feed for a given URL. - * - * @param url - * URL of the recent changes feed - * @return InputStream for the recent changes feed - */ - InputStream getInputStream(String url) { - try { - return this.webResourceFetcher - .getInputStreamForUrl(url); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; + return rssUrl + URL_FROM_DATE_PARAMETER + urlDateString; } /** @@ -229,7 +236,6 @@ RecentChange parseItem(BufferedReader bufferedReader, String line) { while (!line.contains("</item>")) { try { line = bufferedReader.readLine(); - if (line.contains("<title>")) { propertyName = parsePropertyNameFromItemString(line); } diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index b0af29340..c83775e54 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -38,6 +38,8 @@ public class RecentChangesFetcherTest{ private String dateLine = " <pubDate>Tue, 02 Jun 2015 13:22:02 GMT</pubDate> <dc:creator>Superzerocool</dc:creator> <comments>http://www.wikidata.org/wiki/Talk:Q1876457</comments> </item>"; private String titleLine = " <title>Q1876457"; + + private String urlForFrom = "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss&from=20150611154713"; @Test public void testConstructors() { @@ -75,6 +77,29 @@ public void testGetRecentChanges() throws IOException, ParseException { assertFalse(result.contains(rc3)); assertFalse(result.contains(rc4)); } + + @Test + public void testGetRecentChangesForUrl() throws IOException, + ParseException { + RecentChangesFetcher rcf = new RecentChangesFetcher(); + MockWebResourceFetcher wrf = new MockWebResourceFetcher(); + wrf.setWebResourceContentsFromResource(urlForFrom, + "/recentchanges.xml", this.getClass()); + rcf.webResourceFetcher = wrf; + Date date = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss") + .parse("11.06.2015 15:47:13"); + Set result = rcf.getRecentChanges(date); + assertFalse(result.isEmpty()); + } + + @Test + public void testGetRecentChangesWithFromParamenter() throws IOException { + RecentChangesFetcher rcf = new RecentChangesFetcher(); + MockWebResourceFetcher wrf = new MockWebResourceFetcher(); + wrf.setWebResourceContentsFromResource(rcf.rssUrl, + "/recentchanges.xml", this.getClass()); + rcf.webResourceFetcher = wrf; + } @Test public void testParsePropertyName() { @@ -104,10 +129,9 @@ public void testParseAuthor() { @Test public void testBuildUrl() throws ParseException { RecentChangesFetcher rcf = new RecentChangesFetcher(); - String url = "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss&from=20150611154713"; Date date = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss") .parse("11.06.2015 15:47:13"); String result = rcf.buildUrl(date); - assertEquals(url, result); + assertEquals(urlForFrom, result); } } From 27aafc8aa6c24fcbb5582255544f2392355d78bc Mon Sep 17 00:00:00 2001 From: Markus Damm Date: Thu, 16 Jul 2015 20:56:06 +0200 Subject: [PATCH 22/24] Edit URL to HTPPS since WebResourceFetcher does not support http redirects --- .../wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java | 2 +- .../wdtk/wikibaseapi/RecentChangesFetcherTest.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index 5cb2b3a15..63dfbd82f 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -50,7 +50,7 @@ public class RecentChangesFetcher { /** * URL prefix for the recent changes feed of wikidata.org. */ - static final String WIKIDATA_RSS_FEED_URL_PREFIX = "http://www.wikidata.org/w/api.php"; + static final String WIKIDATA_RSS_FEED_URL_PREFIX = "https://www.wikidata.org/w/api.php"; /** * URL suffix for RSS recent changes feed diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index c83775e54..d9a560ffc 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -39,17 +39,17 @@ public class RecentChangesFetcherTest{ private String dateLine = " Tue, 02 Jun 2015 13:22:02 GMT Superzerocool http://www.wikidata.org/wiki/Talk:Q1876457 "; private String titleLine = " Q1876457"; - private String urlForFrom = "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss&from=20150611154713"; + private String urlForFrom = "https://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss&from=20150611154713"; @Test public void testConstructors() { RecentChangesFetcher rcf1 = new RecentChangesFetcher(); RecentChangesFetcher rcf2 = new RecentChangesFetcher( - "http://www.wikidata.org/w/api.php"); + "https://www.wikidata.org/w/api.php"); assertEquals(rcf1.rssUrl, - "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); + "https://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); assertEquals(rcf2.rssUrl, - "http://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); + "https://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); } @Test From d5d07615512c4c59e86bba816292f6fae7e49b11 Mon Sep 17 00:00:00 2001 From: Markus Damm Date: Mon, 21 Sep 2015 18:03:54 +0200 Subject: [PATCH 23/24] Adapt RecentChangesFetcher to ApiConnector --- .../wikibaseapi/RecentChangesFetcher.java | 178 +++++++++--------- .../wikibaseapi/RecentChangesFetcherTest.java | 96 ++++------ 2 files changed, 125 insertions(+), 149 deletions(-) diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java index 63dfbd82f..a39e24752 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcher.java @@ -27,14 +27,14 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.HashMap; import java.util.Locale; +import java.util.Map; import java.util.Set; import java.util.TreeSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.wikidata.wdtk.util.WebResourceFetcher; -import org.wikidata.wdtk.util.WebResourceFetcherImpl; /** * Simple class to fetch recent changes @@ -48,58 +48,38 @@ public class RecentChangesFetcher { .getLogger(WikibaseDataFetcher.class); /** - * URL prefix for the recent changes feed of wikidata.org. + * Connection to WikiBase API */ - static final String WIKIDATA_RSS_FEED_URL_PREFIX = "https://www.wikidata.org/w/api.php"; - - /** - * URL suffix for RSS recent changes feed - */ - static final String RSS_FEED_URL_SUFFIX = "?action=feedrecentchanges&format=json&feedformat=rss"; - - /** - * URL suffix for the parameter "from" in the RSS recent changes feed - */ - static final String URL_FROM_DATE_PARAMETER = "&from="; - - /** - * The URL where the recent changes feed can be found. - */ - final String rssUrl; - - /** - * Object used to make web requests. Package-private so that it can be - * overwritten with a mock object in tests. - */ - WebResourceFetcher webResourceFetcher = new WebResourceFetcherImpl(); + static ApiConnection apiConnection; /** * Creates an object to fetch recent changes of Wikidata */ public RecentChangesFetcher() { - this(WIKIDATA_RSS_FEED_URL_PREFIX); + this(ApiConnection.URL_WIKIDATA_API); } /** * Creates an object to fetch recent changes * - * @param rdfUrlPrefix - * Prefix of an URL of the RSS recent changes feed, e.g. - * http://www.wikidata.org/ for wikidata, the suffix is - * added in this constructor + * @param apiBaseUrl + * base URI to the API, e.g., + * "https://www.wikidata.org/w/api.php/" */ - public RecentChangesFetcher(String rdfUrlPrefix) { - this.rssUrl = rdfUrlPrefix + RSS_FEED_URL_SUFFIX; + public RecentChangesFetcher(String apiBaseUrl) { + RecentChangesFetcher.apiConnection = new ApiConnection(apiBaseUrl); } /** - * Fetches IOStream from RSS recent changes feed and returns a set of - * recent changes. + * Fetches IOStream from RSS recent changes feed and returns a set of recent + * changes. * * @return a set of recent changes from the recent changes feed + * @throws IOException + * if an error occured while connecting to Wikibase API */ public Set getRecentChanges() { - return getRecentChanges(rssUrl); + return getRecentChanges(getParameters()); } /** @@ -107,57 +87,83 @@ public Set getRecentChanges() { * before the date. * * @param from - * earliest possible date for a recent change + * earliest possible date for a recent change * @return a set of recent changes from the recent changes feed */ public Set getRecentChanges(Date from) { - return getRecentChanges(buildUrl(from)); + return getRecentChanges(getParameters(from)); } + Set getRecentChanges(Map parameters){ + Set recentChanges = new TreeSet<>(); + try { + recentChanges = parseInputStream(apiConnection.sendRequest("POST", + parameters)); + } catch (IOException e) { + logger.error("Could not retrieve data from " + + apiConnection.apiBaseUrl + + apiConnection.getQueryString(parameters) + ". Error:\n" + + e.toString()); + } + return recentChanges; + } + /** - * Fetches IOStream from RSS recent changes feed and returns a set of - * recent changes. + * Parses a given RSS feed as an InputSteam and returns the recent changes. + * The InputStream will be closed at the end of this method. * - * @param url - * URL of the RSS recent changes feed - * @return a set of recent changes from the recent changes feed + * @param inputStream + * given RSS recent changes feed + * @return set of recent changes + * @throws IOException + * if an error occurred while parsing the RSS feed */ - Set getRecentChanges(String url) { + Set parseInputStream(InputStream inputStream) + throws IOException { Set changes = new TreeSet<>(); - try { - InputStream inputStream = this.webResourceFetcher - .getInputStreamForUrl(url); - BufferedReader bufferedReader = new BufferedReader( - new InputStreamReader(inputStream)); - String line = bufferedReader.readLine(); - while (line != null) { - if (line.contains("")) { - changes.add(parseItem(bufferedReader, - line)); - } - line = bufferedReader.readLine(); + + BufferedReader bufferedReader = new BufferedReader( + new InputStreamReader(inputStream)); + String line = bufferedReader.readLine(); + while (line != null) { + if (line.contains("")) { + changes.add(parseItem(bufferedReader, line)); } - bufferedReader.close(); - inputStream.close(); - } catch (IOException e) { - logger.error("Could not retrieve data from " + rssUrl - + ". Error:\n" + e.toString()); + line = bufferedReader.readLine(); } + bufferedReader.close(); + inputStream.close(); return changes; } /** - * Builds an URL for the recent change feed which contains the from - * parameter + * Builds a map of parameters for a recent changes request + * + * @return map of parameters for a recent changes request + */ + Map getParameters() { + Map params = new HashMap<>(); + params.put("action", "feedrecentchanges"); + params.put("format", "json"); + params.put("feedformat", "rss"); + + return params; + } + + /** + * Builds a map of parameters for a recent changes request and adds the + * parameter "from" which defines the earliest possible date of a recent + * change * * @param from - * earliest Date for recent changes that are fetched - * @return URL for the RSS recent changes feed + * earliest date for a recent change that are requested + * @return map of parameters for a recent changes request */ - String buildUrl(Date from) { - String urlDateString = new SimpleDateFormat("yyyyMMddHHmmss") - .format(from); - return rssUrl + URL_FROM_DATE_PARAMETER + urlDateString; + Map getParameters(Date from) { + Map params = getParameters(); + params.put("from", new SimpleDateFormat("yyyyMMddHHmmss").format(from)); + + return params; } /** @@ -165,25 +171,23 @@ String buildUrl(Date from) { * changes feed * * @param itemString - * substring for an item of the recent changes feed + * substring for an item of the recent changes feed * @return name of the property */ String parsePropertyNameFromItemString(String itemString) { - String startString = ""; String endString = ""; - int start = itemString.indexOf(startString) - + startString.length(); + int start = 10; int end = itemString.indexOf(endString); String propertyName = itemString.substring(start, end); return propertyName; } /** - * parses the date and time of the change of a property from the item - * string of the recent changes feed + * Parses the date and time of the change of a property from the item string + * of the recent changes feed * * @param itemString - * substring for an item of the recent changes feed + * substring for an item of the recent changes feed * @return date and time for the recent change */ Date parseTimeFromItemString(String itemString) { @@ -197,21 +201,20 @@ Date parseTimeFromItemString(String itemString) { } catch (ParseException e) { - logger.error("Could not parse date from string \"" - + itemString + "\". Error:\n" - + e.toString()); + logger.error("Could not parse date from string \"" + itemString + + "\". Error:\n" + e.toString()); } return date; } /** - * parses the name or the IP address of the change of a property from - * the item string of the recent changes feed + * Parses the name or the IP address of the change of a property from the + * item string of the recent changes feed * * @param itemString - * substring for an item of the recent changes feed - * @return name of the author (if user is registered) or the IP address - * (if user is not registered) + * substring for an item of the recent changes feed + * @return name of the author (if user is registered) or the IP address (if + * user is not registered) */ String parseAuthorFromItemString(String itemString) { String endString = ""; @@ -219,14 +222,14 @@ String parseAuthorFromItemString(String itemString) { int end = itemString.indexOf(endString); return itemString.substring(start, end); } - + /** * Parses an item inside the -tag. * * @param bufferedReader - * reader that reads the InputStream + * reader that reads the InputStream * @param line - * last line from the InputStream that has been read + * last line from the InputStream that has been read * @return RecentChange that equals the item */ RecentChange parseItem(BufferedReader bufferedReader, String line) { @@ -247,11 +250,12 @@ RecentChange parseItem(BufferedReader bufferedReader, String line) { } } catch (IOException e) { logger.error("Could not parse data from " - + rssUrl + ". Error:\n" + + apiConnection.apiBaseUrl + ". Error:\n" + e.toString()); } } if (propertyName == null || author == null || date == null) { + // This should actually not happen throw new NullPointerException(); } return new RecentChange(propertyName, date, author); diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java index d9a560ffc..ee2424214 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangesFetcherTest.java @@ -20,7 +20,6 @@ * #L% */ - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -30,77 +29,60 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; +import java.util.Map; import java.util.Set; import org.junit.Test; -import org.wikidata.wdtk.testing.MockWebResourceFetcher; - -public class RecentChangesFetcherTest{ +import org.wikidata.wdtk.util.CompressionType; + +public class RecentChangesFetcherTest { private String dateLine = " Tue, 02 Jun 2015 13:22:02 GMT Superzerocool http://www.wikidata.org/wiki/Talk:Q1876457 "; private String titleLine = " Q1876457"; - private String urlForFrom = "https://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss&from=20150611154713"; - - @Test - public void testConstructors() { - RecentChangesFetcher rcf1 = new RecentChangesFetcher(); - RecentChangesFetcher rcf2 = new RecentChangesFetcher( - "https://www.wikidata.org/w/api.php"); - assertEquals(rcf1.rssUrl, - "https://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); - assertEquals(rcf2.rssUrl, - "https://www.wikidata.org/w/api.php?action=feedrecentchanges&format=json&feedformat=rss"); - } - - @Test - public void testGetRecentChanges() throws IOException, ParseException { - RecentChangesFetcher rcf = new RecentChangesFetcher(); - MockWebResourceFetcher wrf = new MockWebResourceFetcher(); - wrf.setWebResourceContentsFromResource(rcf.rssUrl, - "/recentchanges.xml", this.getClass()); - rcf.webResourceFetcher = wrf; + @Test + public void testGetRecentChanges() throws IOException, ParseException { + RecentChangesFetcher rcf = new RecentChangesFetcher(); + MockApiConnection mac = new MockApiConnection(); + + mac.setWebResourceFromPath(rcf.getParameters(), this.getClass(), + "/recentchanges.xml", CompressionType.NONE); + + RecentChangesFetcher.apiConnection = mac; + Set result = rcf.getRecentChanges(); - RecentChange rc1 = new RecentChange( - "Q1876457", - new SimpleDateFormat("dd.MM.yyyy HH:mm:ss Z", - Locale.ENGLISH) - .parse("02.06.2015 13:22:02 GMT"), - "Superzerocool"); + RecentChange rc1 = new RecentChange("Q1876457", + new SimpleDateFormat("dd.MM.yyyy HH:mm:ss Z", Locale.ENGLISH) + .parse("02.06.2015 13:22:02 GMT"), "Superzerocool"); assertTrue(result.contains(rc1)); + RecentChange rc2 = new RecentChange("", new Date(), ""); RecentChange rc3 = new RecentChange("Q1", new Date(), ""); - RecentChange rc4 = new RecentChange( - "Wikidata - Recent changes [en]", new Date(), - ""); + RecentChange rc4 = new RecentChange("Wikidata - Recent changes [en]", + new Date(), ""); assertFalse(result.contains(rc2)); assertFalse(result.contains(rc3)); - assertFalse(result.contains(rc4)); + assertFalse(result.contains(rc4)); } - + @Test - public void testGetRecentChangesForUrl() throws IOException, + public void testGetRecentChangesWithFromParamenter() throws IOException, ParseException { RecentChangesFetcher rcf = new RecentChangesFetcher(); - MockWebResourceFetcher wrf = new MockWebResourceFetcher(); - wrf.setWebResourceContentsFromResource(urlForFrom, - "/recentchanges.xml", this.getClass()); - rcf.webResourceFetcher = wrf; - Date date = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss") - .parse("11.06.2015 15:47:13"); + MockApiConnection mac = new MockApiConnection(); + Map params = rcf.getParameters(); + params.put("from", "20150611154713"); + mac.setWebResourceFromPath(params, this.getClass(), + "/recentchanges.xml", CompressionType.NONE); + RecentChangesFetcher.apiConnection = mac; + + + Date date = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss").parse("11.06.2015 15:47:13"); Set result = rcf.getRecentChanges(date); + assertFalse(result.isEmpty()); } - @Test - public void testGetRecentChangesWithFromParamenter() throws IOException { - RecentChangesFetcher rcf = new RecentChangesFetcher(); - MockWebResourceFetcher wrf = new MockWebResourceFetcher(); - wrf.setWebResourceContentsFromResource(rcf.rssUrl, - "/recentchanges.xml", this.getClass()); - rcf.webResourceFetcher = wrf; - } - @Test public void testParsePropertyName() { RecentChangesFetcher rcf = new RecentChangesFetcher(); @@ -113,8 +95,7 @@ public void testParseDate() throws ParseException { RecentChangesFetcher rcf = new RecentChangesFetcher(); Date result = rcf.parseTimeFromItemString(dateLine); Date actualDate = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss Z", - Locale.ENGLISH) - .parse("02.06.2015 13:22:02 GMT"); + Locale.ENGLISH).parse("02.06.2015 13:22:02 GMT"); assertEquals(actualDate.compareTo(result), 0); } @@ -125,13 +106,4 @@ public void testParseAuthor() { String result = rcf.parseAuthorFromItemString(dateLine); assertEquals(result, "Superzerocool"); } - - @Test - public void testBuildUrl() throws ParseException { - RecentChangesFetcher rcf = new RecentChangesFetcher(); - Date date = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss") - .parse("11.06.2015 15:47:13"); - String result = rcf.buildUrl(date); - assertEquals(urlForFrom, result); - } } From 6621906a5d2a5578710269b6ffa149b8c624f271 Mon Sep 17 00:00:00 2001 From: MonKey Date: Sat, 26 Sep 2015 10:17:54 +0800 Subject: [PATCH 24/24] Fix URI Format --- .../wdtk/rdf/values/StringValueConverter.java | 12 +++++++--- .../wdtk/wikibaseapi/RecentChange.java | 23 ++++++++++++++++++- .../wdtk/wikibaseapi/RecentChangeTest.java | 23 ++++++++++++++++++- 3 files changed, 53 insertions(+), 5 deletions(-) diff --git a/wdtk-rdf/src/main/java/org/wikidata/wdtk/rdf/values/StringValueConverter.java b/wdtk-rdf/src/main/java/org/wikidata/wdtk/rdf/values/StringValueConverter.java index bc2375070..8005e5567 100644 --- a/wdtk-rdf/src/main/java/org/wikidata/wdtk/rdf/values/StringValueConverter.java +++ b/wdtk-rdf/src/main/java/org/wikidata/wdtk/rdf/values/StringValueConverter.java @@ -20,6 +20,8 @@ * #L% */ +import java.net.URLEncoder; +import java.io.UnsupportedEncodingException; import org.openrdf.model.Value; import org.wikidata.wdtk.datamodel.interfaces.DatatypeIdValue; import org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue; @@ -81,8 +83,12 @@ public Value getRdfValue(StringValue value, * @return URL of the page */ static String getCommonsUrl(String pageName) { - return "http://commons.wikimedia.org/wiki/File:" - + pageName.replace(' ', '_'); + try { + return "http://commons.wikimedia.org/wiki/File:" + + URLEncoder.encode(pageName.replace(' ', '_'), "UTF-8"); + } catch(UnsupportedEncodingException uee) { + logger.error("This machine does not support UTF-8 encoding"); + return null; + } } - } diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java index 9e2f5a181..3ed6a73ae 100644 --- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java +++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/RecentChange.java @@ -1,4 +1,25 @@ -package org.wikidata.wdtk.wikibaseapi; +package org.wikidata.wdtk.wikibaseapi; + +/* + * #%L + * Wikidata Toolkit Wikibase API + * %% + * Copyright (C) 2014 - 2015 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.Date; diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java index 261d1dcf8..0b540ff08 100644 --- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java +++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/RecentChangeTest.java @@ -1,4 +1,25 @@ -package org.wikidata.wdtk.wikibaseapi; +package org.wikidata.wdtk.wikibaseapi; + +/* + * #%L + * Wikidata Toolkit Wikibase API + * %% + * Copyright (C) 2014 - 2015 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.assertFalse;