Holy sh!t -- a planet the size of Earth almost crashed into Jupiter!
Let's start by appealing to basic common sense: if an object the size of a planet enters our solar system, it will immediately have the attention of every human on Earth. The big question will be: is that thing going to hit the Earth and destroy all life, or cause some other kind of collision that will annihilate terrestrial life? Will we lose our Moon?! How will our own orbit be affected, and what will be the new length of a year? What will we name the new month, or which month will we give up? These are all very realistic possibilities when the object is the size of a planet.
Everything that can be used to observe a space object will be pointed directly at this rogue planet -- let's call it "Sidney"1 -- for the entirety of its voyage through our system. Teams of scientists will observe Sidney in shifts around the clock -- assuming that any of them can be pried away from the 'scope in the first place.
What will they be looking for? Most important will be clues about Sidney's mass, because its position, mass, and velocity are the unknown factors in the equations that tell us about Sidney's future movement. Sidney's interactions with other bodies in our system will help us refine our estimates of Sidney's mass and composition. By the time of Sidney's near-slap with Jupiter, we will probably have been studying the rogue planet for months.
You say that this near-miss somehow compresses Sidney while also breaking off chunks of material, and that Sidney continues out of our solar system while the chunks remain.
This near-miss will not be a surprise to anyone. If something the size of Earth is on a collision course with Jupiter, we will be able to predict that fact quite easily. Planets don't fly around like cars in a drive-by shooting, popping out the shadows for some quick action and then peeling off into the darkness. The distances in space are, well, astronomical, so unless Sidney is careening through space at relativistic speeds (which is almost certainly impossible), we will have weeks or months to recognize that there is a significant chance that Sidney will collide with Jupiter. If that were to happen, the radiation created by that impact would probably kill everyone on Earth and strip the atmosphere from our planet.
This means that everybody and their dog will be watching the near-miss live on TV when it happens, because everybody will know that a collision will kill everybody on Earth within something like 15 minutes.
Once it becomes clear that this event is a near-miss instead of a life-annihilating planetary explosion, everybody will let out a huge sigh of relief. Most of humanity will be psychologically incapacitated as they process the emotional fallout of avoiding immediate, permanent extinction.
The scientists, though, will barely blink, because they know the story is not over. These are the folks who will notice that Sidney has left us some gifts, in the form of big chunks of material that were ejected, presumably as a result of Jupiter's titanic tidal tyranny.
By analyzing the trajectories of these chunks, we will be able to estimate their mass. This is how we will know they are extra-massive. This interaction will also probably produce lots of information for the spectroscopy people, and I bet some of that will give us clues as to the chemical composition of these chunks. And remember: everybody on Earth has had their eyes glued to this near-miss for the duration because it had the potential to immediately end our civilization. So we can safely assume that we captured every iota of information that could be gleaned from this near-miss event.
That is how we will know these chunks are unusually valuable.
Oh, also: lots of human society may possibly have collapsed into anarchy when a large chunk of the population concluded that Sidney was, one way or another, going to end the story of Earth within a few weeks. So that will have an impact on how and when humanity confronts the practical question of how to mine Sidney's legacy. I almost hesitate to mention it.
1 After the late, great Sidney Poitier, who played the unexpected dinner guest in Guess Who's Coming to Dinner.