I am creating an ontology where the case occurred, that multiple individuals have the same name. Normally, I would create the IRI based on the name. E.g.
Paul
Paul
Peter
Hans
The only way to distinguish the individuals is based on their relations.
Paul -> hasA Dog
Paul -> hasA Chick
Peter ...
Hans ...
If I create the owl as this (e.g. with Protégé) Paul would be only one individual with two relations. How could I create them as different individuals ?
If you have ever made a database where you need to identify people, you hopefully avoided using the names of the people as identifiers. You may have used numerical identifiers that you increment every time you add a new person to the DB, or a random alphanumeric code that's unique to each person, or whatever other trick that generates a unique ID. In any case, the fact that Web ontologies use IRIs does not prevent you from using any of these identification systems: you just have to make sure that you concatenate a namespace URI before the ID and that the result is a valid IRI (and if not, you can URL-encode the local identifier).
You can do this for anything: books, products, events, concepts, etc. One possible issue, though, that is specific to Web ontologies, is that you may want to make the IRI dereferenceable. That is, you may want that the IRI be used as a URL -- a Web address -- from which you can retrieve information about the identified thing. In this case, some identification systems are more appropriate than others. But then again, it is not so much a Web ontology issue: it is rather a Web development issue.
A possibility is to do as StackOverflow does for identifying and providing URLs to its questions:
https://stackoverflow.com/questions/68001203/how-to-distinguish-ontology-individuals-with-same-name
is the URL of your question. It can be an identifier for your question. Similarly, you could do:
https://yournamespace.com/people/42/paul //The one with a dog
https://yournamespace.com/people/666/paul //The one with a chick
Then there is a number that uniquely identifies the person, and a readable piece that allows people to get an idea of whom we are talking about.