What is the best way to perform the matching between two ontologies so that I can get a similarity score between the two ontologies which can make the job of integration easy (integration of data from different RDF)
There are several ways of mapping triples to an ontology. You can do it in Protégé, use SPARQL constructs, SWRL rules or do it with a programming library like Jena and RDFlib. I would choose the approach you are most familiar with. If that is Jena, I would do that. There you can use several of Jena's mapping functions to do most of the work for you. Just check the Jena API for reference.
Personally I think the best way and the most safest way is to use Protégé, but for a quicker and more hackier solution a SPARQL contruct might work. Like this example:
CONSTRUCT {
?lexicon vso:fuelType ?fuel .
?fuel a gr:QualitativeValue .
} WHERE {
[ co:lexicon ?lexicon ;
co:confVarId "PT1628" ;
co:hasValue ?fuel ] .
}
Here I want to turn a lexicon entry into a Qualitative value object and set the lexicon to have a property fuelType to this object.