Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why the pageId could be found, but the page couldn't be found? #143

Open
juvenilezjp opened this issue Dec 20, 2016 · 2 comments
Open

why the pageId could be found, but the page couldn't be found? #143

juvenilezjp opened this issue Dec 20, 2016 · 2 comments

Comments

@juvenilezjp
Copy link

juvenilezjp commented Dec 20, 2016

private static void DFSCategoryTree(Category category) throws WikiApiException
	{
		// TODO Auto-generated method stub
		if (!vCategories.contains(category.getTitle()))
		{
			System.out.println(category.getTitle());
			System.out.println(category.getNumberOfPages());
			vCategories.add(category);
			for (Integer pageId : category.getArticleIds())
			{
				if (!vPageIds.contains(pageId))
				{
					System.out.println("pageid is :" + pageId);
				}
			}
			for (Page page : category.getArticles())
			{
				if (!vPageIds.contains(page))
				{
					System.out.println("pageid is :" + page);
				}
			}

			for (Category sonCategory : category.getChildren())
			{
				DFSCategoryTree(sonCategory);
			}
		}
		return;
	}

output result:

2
pageid is :68994
pageid is :4569724
Exception in thread "main" de.tudarmstadt.ukp.wikipedia.api.exception.WikiPageNotFoundException: No page with page id 4569724 was found.
	at de.tudarmstadt.ukp.wikipedia.api.Page.fetchByPageId(Page.java:178)
	at de.tudarmstadt.ukp.wikipedia.api.Page.<init>(Page.java:90)
	at de.tudarmstadt.ukp.wikipedia.api.Wikipedia.getPage(Wikipedia.java:146)
	at de.tudarmstadt.ukp.wikipedia.api.Category.getArticles(Category.java:299)
	at iie.ac.cn.zjp.ShowCategoryInfo.DFSCategoryTree(ShowCategoryInfo.java:76)
	at iie.ac.cn.zjp.ShowCategoryInfo.DFSCategoryTree(ShowCategoryInfo.java:86)
	at iie.ac.cn.zjp.ShowCategoryInfo.DFSCategoryTree(ShowCategoryInfo.java:86)
	at iie.ac.cn.zjp.ShowCategoryInfo.showCategoryInfo(ShowCategoryInfo.java:49)
	at iie.ac.cn.zjp.ShowCategoryInfo.main(ShowCategoryInfo.java:104)
@juvenilezjp
Copy link
Author

And the log says:

"2016.12.21 15:08:35","1027080192","678263864","processing table text..."
"2016.12.21 15:10:06","1029177344","285370688","Text 10000"
"2016.12.21 15:11:02","1031274496","463701288","Text 20000"
"2016.12.21 15:11:38","1031274496","385796456","Text 30000"
.........
"2016.12.21 15:59:06","638058496","262472576","Text 1810000"
"2016.12.21 15:59:22","639107072","266876696","Text 1820000"
"2016.12.21 15:59:36","640155648","293868264","Text 1830000"
"2016.12.21 15:59:49","640679936","196448648","Text 1840000"
"2016.12.21 16:00:02","641728512","268223384","Text 1850000"
"2016.12.21 16:00:13","642252800","213163176","writing metadata..."
"2016.12.21 16:00:13","642252800","213163176","finished"
"2016.12.21 16:00:13","642252800","213163176","End of the application. Working time = 5763189 ms"

Bug I only get 1242768 in the Page.txt

@daxenberger
Copy link
Member

daxenberger commented Dec 21, 2016

Maybe this page is from a namespace that is not included in your JWPL database? You can check whether it is in the Page table of your local database. If not, you can use e.g. the MediaWiki API to get some more meta data (e.g. namespace) about the respective page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants