diff --git a/code/index/test/nu/marginalia/ranking/domains/RankingAlgorithmWithRealDataTest.java b/code/index/test/nu/marginalia/ranking/domains/RankingAlgorithmWithRealDataTest.java index 10195f92..0f9b5ba1 100644 --- a/code/index/test/nu/marginalia/ranking/domains/RankingAlgorithmWithRealDataTest.java +++ b/code/index/test/nu/marginalia/ranking/domains/RankingAlgorithmWithRealDataTest.java @@ -8,9 +8,14 @@ import java.util.List; // Test the ranking algorithm with prod data. Will not run if the data is not available. // It's not feasible to include the data in the git repo, as it's ~6 GB of data. +// +// The data is available at +// https://downloads.marginalia.nu/link-test-data.tar.gz +// @Disabled class RankingAlgorithmWithRealDataTest { + /** Test the regular PageRank algorithm. */ @Test public void testRegularPR() { if (!TestGraphSourceForLinkData.isAvailable()) { @@ -26,6 +31,25 @@ class RankingAlgorithmWithRealDataTest { } } + /** Test the personalized PageRank algorithm. */ + @Test + public void testRegularPPR() { + if (!TestGraphSourceForLinkData.isAvailable()) { + return; + } + + var graphSource = new TestGraphSourceForLinkData(); + var results = new PageRankDomainRanker(graphSource, + List.of(1476552) // wiby.me + ) + .calculate(10, RankingResultListAccumulator::new); + + for (int i = 0; i < results.size(); i++) { + System.out.println(i + " " + graphSource.getName(results.get(i))); + } + } + + /** Test the inverted link graph pagerank algorithm */ @Test public void testInvertedLinkGraph() { if (!TestGraphSourceForInvertedLinkData.isAvailable()) { @@ -41,6 +65,7 @@ class RankingAlgorithmWithRealDataTest { } } + /** Test pagerank with similarity data */ @Test public void testSimilarityPR() { if (!TestGraphSourceForSimilarityData.isAvailable()) { @@ -56,6 +81,7 @@ class RankingAlgorithmWithRealDataTest { } } + /** Test personalized pagerank with similarity data */ @Test public void testSimilarityPPR() { if (!TestGraphSourceForSimilarityData.isAvailable()) { diff --git a/code/index/test/nu/marginalia/ranking/domains/TestGraphSourceForInvertedLinkData.java b/code/index/test/nu/marginalia/ranking/domains/TestGraphSourceForInvertedLinkData.java index a9a51fe4..45c25d02 100644 --- a/code/index/test/nu/marginalia/ranking/domains/TestGraphSourceForInvertedLinkData.java +++ b/code/index/test/nu/marginalia/ranking/domains/TestGraphSourceForInvertedLinkData.java @@ -16,6 +16,8 @@ import java.util.List; import java.util.Map; public class TestGraphSourceForInvertedLinkData implements GraphSource { + // The data is available at + // https://downloads.marginalia.nu/link-test-data.tar.gz private static Path domainDataPath = Paths.get("/home/vlofgren/Exports/Links/domains.export.tsv"); private static Path[] linksDataPaths = new Path[] { Paths.get("/home/vlofgren/Exports/Links/domain-links-1.dat"), diff --git a/code/index/test/nu/marginalia/ranking/domains/TestGraphSourceForLinkData.java b/code/index/test/nu/marginalia/ranking/domains/TestGraphSourceForLinkData.java index 03fcdb14..00839e4c 100644 --- a/code/index/test/nu/marginalia/ranking/domains/TestGraphSourceForLinkData.java +++ b/code/index/test/nu/marginalia/ranking/domains/TestGraphSourceForLinkData.java @@ -16,6 +16,9 @@ import java.util.List; import java.util.Map; public class TestGraphSourceForLinkData implements GraphSource { + // The data is available at + // https://downloads.marginalia.nu/link-test-data.tar.gz + private static Path domainDataPath = Paths.get("/home/vlofgren/Exports/Links/domains.export.tsv"); private static Path[] linksDataPaths = new Path[] { Paths.get("/home/vlofgren/Exports/Links/domain-links-1.dat"), diff --git a/code/index/test/nu/marginalia/ranking/domains/TestGraphSourceForSimilarityData.java b/code/index/test/nu/marginalia/ranking/domains/TestGraphSourceForSimilarityData.java index 4aa48fbc..cdceb6a1 100644 --- a/code/index/test/nu/marginalia/ranking/domains/TestGraphSourceForSimilarityData.java +++ b/code/index/test/nu/marginalia/ranking/domains/TestGraphSourceForSimilarityData.java @@ -15,6 +15,9 @@ import java.util.List; import java.util.Map; public class TestGraphSourceForSimilarityData implements GraphSource { + // The data is available at + // https://downloads.marginalia.nu/link-test-data.tar.gz + private static Path domainDataPath = Paths.get("/home/vlofgren/Exports/Links/domains.export.tsv"); private static Path similarityDataPath = Paths.get("/home/vlofgren/Exports/Links/neighbors.tsv");