Posts

Showing posts with the label owl-api

comparing an classes of ontologies to an xml document nodes

Image
Clash Royale CLAN TAG #URR8PPP comparing an classes of ontologies to an xml document nodes My objective is to compare an ontology to a provided XML document by searching nodes from the document having the same name as the ontology classes. To do so, I use the following code : public void freqConcept(String xmldoc,OWLClass node){ try { String filepath = xmldoc; DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); Document doc = docBuilder.parse(filepath); doc.getDocumentElement().normalize(); list = doc.getElementsByTagName(node.getIRI().getFragment()); } catch (ParserConfigurationException pce) { pce.printStackTrace(); } catch (IOException ioe) { ioe.printStackTrace(); } catch (SAXException sae) { sae.printStackTrace(); } catch (Exception e) { e.p...