. \n\n"); $config = array( 'remote_store_endpoint' => 'http://lod.openlinksw.com/sparql', ); $store = ARC2::getRemoteStore($config); $offset = 0; $q = 'SELECT * WHERE {?dbpedia_uri ?mesh_id . } LIMIT 200 OFFSET '; while ($rows = $store->query($q . $offset, 'rows')) { print("\n offset: " . $offset); foreach ($rows as $row) { fputs($output_file_handle, '<' . $row['dbpedia_uri'] . '> rdfs:seeAlso . \n"); } $offset = $offset + 200; print("\n offset: " . $offset); } fputs($output_file_handle, "\n\n"); $offset = 0; $q = 'SELECT * WHERE {?dbpedia_uri ?mesh_name . } LIMIT 200 OFFSET '; while ($rows = $store->query($q . $offset, 'rows')) { print("\n offset: " . $offset); foreach ($rows as $row) { $dbpedia_uri = $row['dbpedia_uri']; $dbpedia_uri = str_replace("/section1/Chembox_Identifiers", "", $dbpedia_uri); $mesh_name = $row['mesh_name']; $mesh_name = str_replace("+", " ", $mesh_name); $mesh_name = str_replace(" }}", "", $mesh_name); $mesh_uri = $mesh_uri_label_mapping[$mesh_name]; if ($mesh_uri == "" ) { continue; } fputs($output_file_handle, '<' . $dbpedia_uri . '> rdfs:seeAlso <' . $mesh_uri . "> . \n"); } $offset = $offset + 200; } fclose($output_file_handle); print "\n -- done -- "; ?>