sonar.links.scm is a property for setting the link to sources on Sonarqube project dashboard.
If you want to get this property from a Sonarqube project, you may use the web api api/project_links/search
For Maven builds this property may be set via pom.xml and <scm><url>.
Don’t understand what the question is !?
We only know you use Sonarqube 7.9.1 (which edition ?) for analysing Java projects.
You need to provide more details about your build chain and workflow.
Usually the Sonarqube analysis runs as part of a build.
Do you use Github ?
What is your buildtool, Maven, Gradle … ?
Do you use a buildserver, e.g. Jenkins pipelines for your builds ?
You want to use a part of scm url as value for the sonar.projectKey property ?
If the scm url in your build is e.g. https://github.com/Foo/foobar the projectKey should be foobar ?