Automatically inferring technology compatibility with an ontology and graph rewriting rules