From d7f00f0aba90cfec661e67bfd2cb344772c36d09 Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Wed, 10 Sep 2025 14:17:36 +0200 Subject: [PATCH 1/2] Bump Wikidata-Toolkit to 0.17.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8b55463..e149f58 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 2.0.12 2.22.1 - 0.16.0 + 0.17.0 From b4947f9cd834ad06a3fde2be9e4e80d41a73eeed Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Wed, 10 Sep 2025 14:21:56 +0200 Subject: [PATCH 2/2] Update examples for new checked exception --- src/examples/ClassPropertyUsageAnalyzer.java | 2 +- src/examples/EntityStatisticsProcessor.java | 2 +- src/examples/ExampleHelpers.java | 2 +- src/examples/FetchOnlineDataExample.java | 2 +- src/examples/GenderRatioProcessor.java | 2 +- src/examples/LifeExpectancyProcessor.java | 2 +- src/examples/LocalDumpFileExample.java | 4 +++- src/examples/RdfSerializationExample.java | 2 +- src/examples/TutorialExample.java | 4 +++- src/examples/WorldMapProcessor.java | 2 +- 10 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/examples/ClassPropertyUsageAnalyzer.java b/src/examples/ClassPropertyUsageAnalyzer.java index 3bfc8f1..dc703d3 100644 --- a/src/examples/ClassPropertyUsageAnalyzer.java +++ b/src/examples/ClassPropertyUsageAnalyzer.java @@ -259,7 +259,7 @@ public int compare( * which dump file to use and whether to run in offline mode, modify the * settings in {@link ExampleHelpers}. */ - public static void main(String[] args) { + public static void main(String[] args) throws IOException { ExampleHelpers.configureLogging(); ClassPropertyUsageAnalyzer.printDocumentation(); diff --git a/src/examples/EntityStatisticsProcessor.java b/src/examples/EntityStatisticsProcessor.java index 724cf92..c84ef70 100644 --- a/src/examples/EntityStatisticsProcessor.java +++ b/src/examples/EntityStatisticsProcessor.java @@ -96,7 +96,7 @@ static class UsageStatistics { * * @param args */ - public static void main(String[] args) { + public static void main(String[] args) throws IOException { ExampleHelpers.configureLogging(); EntityStatisticsProcessor.printDocumentation(); diff --git a/src/examples/ExampleHelpers.java b/src/examples/ExampleHelpers.java index 00fd43a..2b41b2e 100644 --- a/src/examples/ExampleHelpers.java +++ b/src/examples/ExampleHelpers.java @@ -117,7 +117,7 @@ public static void configureLogging() { * the object to use for processing entities in this dump */ public static void processEntitiesFromWikidataDump( - EntityDocumentProcessor entityDocumentProcessor) { + EntityDocumentProcessor entityDocumentProcessor) throws IOException { // Controller object for processing dumps: DumpProcessingController dumpProcessingController = new DumpProcessingController( diff --git a/src/examples/FetchOnlineDataExample.java b/src/examples/FetchOnlineDataExample.java index fe9b711..5b608ed 100644 --- a/src/examples/FetchOnlineDataExample.java +++ b/src/examples/FetchOnlineDataExample.java @@ -44,7 +44,7 @@ public static void main(String[] args) throws MediaWikiApiErrorException, IOExce Datamodel.SITE_WIKIDATA); System.out.println("*** Fetching data for one entity:"); - EntityDocument q42 = wbdf.getEntityDocument("Q42"); + EntityDocument q42 = wbdf.getEntityDocument("L1259271"); System.out.println(q42); if (q42 instanceof ItemDocument) { diff --git a/src/examples/GenderRatioProcessor.java b/src/examples/GenderRatioProcessor.java index bc41bdd..9f528b0 100644 --- a/src/examples/GenderRatioProcessor.java +++ b/src/examples/GenderRatioProcessor.java @@ -124,7 +124,7 @@ public int compare(SiteRecord o1, SiteRecord o2) { * results to a file. To change which dump file to use and whether to run in * offline mode, modify the settings in {@link ExampleHelpers}. */ - public static void main(String[] args) { + public static void main(String[] args) throws IOException { ExampleHelpers.configureLogging(); GenderRatioProcessor.printDocumentation(); diff --git a/src/examples/LifeExpectancyProcessor.java b/src/examples/LifeExpectancyProcessor.java index 79514a2..949184a 100644 --- a/src/examples/LifeExpectancyProcessor.java +++ b/src/examples/LifeExpectancyProcessor.java @@ -55,7 +55,7 @@ public class LifeExpectancyProcessor implements EntityDocumentProcessor { * offline mode, modify the settings in {@link ExampleHelpers}. * */ - public static void main(String[] args) { + public static void main(String[] args) throws IOException { ExampleHelpers.configureLogging(); LifeExpectancyProcessor.printDocumentation(); diff --git a/src/examples/LocalDumpFileExample.java b/src/examples/LocalDumpFileExample.java index 530a230..d311f7c 100644 --- a/src/examples/LocalDumpFileExample.java +++ b/src/examples/LocalDumpFileExample.java @@ -25,6 +25,8 @@ import org.wikidata.wdtk.dumpfiles.EntityTimerProcessor; import org.wikidata.wdtk.dumpfiles.MwLocalDumpFile; +import java.io.IOException; + /** * This class illustrates how to process local dumpfiles. It uses * {@link EntityTimerProcessor} to process a dump. @@ -39,7 +41,7 @@ public class LocalDumpFileExample { */ private final static String DUMP_FILE = "./src/resources/sample-dump-20150815.json.gz"; - public static void main(String[] args) { + public static void main(String[] args) throws IOException { ExampleHelpers.configureLogging(); LocalDumpFileExample.printDocumentation(); diff --git a/src/examples/RdfSerializationExample.java b/src/examples/RdfSerializationExample.java index adf2391..29aa786 100644 --- a/src/examples/RdfSerializationExample.java +++ b/src/examples/RdfSerializationExample.java @@ -70,7 +70,7 @@ public static void main(String[] args) throws IOException { exportOutputStream, sites, PropertyRegister.getWikidataPropertyRegister()); // Serialize simple statements (and nothing else) for all items - serializer.setTasks(RdfSerializer.TASK_ITEMS | RdfSerializer.TASK_ALL_ENTITIES + serializer.setTasks(RdfSerializer.TASK_ITEMS | RdfSerializer.TASK_SIMPLE_STATEMENTS); // Run serialization diff --git a/src/examples/TutorialExample.java b/src/examples/TutorialExample.java index d0bcfcc..c7785aa 100644 --- a/src/examples/TutorialExample.java +++ b/src/examples/TutorialExample.java @@ -20,6 +20,8 @@ * #L% */ +import java.io.IOException; + import org.wikidata.wdtk.datamodel.interfaces.EntityDocumentProcessor; import org.wikidata.wdtk.dumpfiles.DumpProcessingController; import org.wikidata.wdtk.dumpfiles.MwRevision; @@ -41,7 +43,7 @@ */ public class TutorialExample { - public static void main(String[] args) { + public static void main(String[] args) throws IOException { ExampleHelpers.configureLogging(); // Controller object for processing dumps: diff --git a/src/examples/WorldMapProcessor.java b/src/examples/WorldMapProcessor.java index 689b99e..0419878 100644 --- a/src/examples/WorldMapProcessor.java +++ b/src/examples/WorldMapProcessor.java @@ -103,7 +103,7 @@ public class WorldMapProcessor implements EntityDocumentProcessor { * * @param args */ - public static void main(String[] args) { + public static void main(String[] args) throws IOException { ExampleHelpers.configureLogging(); WorldMapProcessor.printDocumentation();