Thread:Help talk:Repairing SMW's data/rebuildData.php freezes at certain page IDs

I'm having an issue with a query which generates  error with a simple semantic search based on a category. I'm trying to refresh the semanic data, but when I run  the script first froze at ID 11. I restarted the script at ID 11 and it froze again. I edited the page to remove the semantic content (it was present for testing only) and the script continued and then froze at ID 24, which does not contain any semantic data. Again, the script froze when restarted at ID 24. I executed  which deleted and recreated the tables fine, but froze again at ID 24 during the data refresh. I cannot figure out what is causing the script to freeze.

Configuration:
 * MediaWiki 1.23.7 (8136f24)
 * PHP 5.4.20 (cgi-fcgi)
 * MySQL 5.6.14
 * Semantic MediaWiki 2.0