Knowledge representation and manipulation in knowledge-based systems typically rely on ontologies. The aim of this work is to provide a novel weak unification-based method and an automatic tool for OWL ontology merging to ensure well-coordinated task completion in the context of collaborative agents. We employ a technique based on integrating string and semantic matching with the additional consideration of structural heterogeneity of concepts. The tool is implemented in Prolog and makes use of its inherent unification mechanism. Experiments were run on an OAEI data set with a matching accuracy of 60% across 42 tests. Additionally, we ran the tool on several ontologies from the domain of robotics. producing a small, but generally accurate, set of matched concepts. These results clearly show a good capability of the method and the tool to match semantically similar concepts. The results also highlight the challenges related to the evaluation of ontology-merging algorithms without a definite ground truth.