@Nullable private IRI parseManLine(File file, String line) { Matcher matcher = manPattern.matcher(line); if (matcher.matches()) { IRI iri = IRI.create(matcher.group(1)); addMapping(iri, file); return iri; } return null; }
@Nullable private IRI parseManLine(File file, String line) { Matcher matcher = manPattern.matcher(line); if (matcher.matches()) { IRI iri = IRI.create(matcher.group(1)); addMapping(iri, file); return iri; } return null; }
@Nullable private IRI parseManLine(File file, String line) { Matcher matcher = manPattern.matcher(line); if (matcher.matches()) { IRI iri = IRI.create(matcher.group(1)); addMapping(iri, file); return iri; } return null; }
/** * Search first 100 lines for FSS style Ontology(<IRI> ... * * @param file the file to parse */ private void parseFSSFile(File file) { try (InputStream input = new FileInputStream(file); Reader reader = new InputStreamReader(input, "UTF-8"); BufferedReader br = new BufferedReader(reader)) { String line = ""; Matcher m = pattern.matcher(line); int n = 0; while ((line = br.readLine()) != null && n++ < 100) { m.reset(line); if (m.matches()) { String group = m.group(1); assert group != null; addMapping(IRI.create(group), file); break; } } } catch (IOException e) { // if we can't parse a file, then we can't map it LOGGER.debug("Exception reading file", e); } }
@Override public void startElement(@Nullable String uri, @Nullable String localName, @Nullable String qName, @Nullable Attributes attributes) throws SAXException { String tag = uri + localName; OntologyRootElementHandler handler = handlerMap.get(tag); if (handler != null) { IRI ontologyIRI = handler.handle(checkNotNull(attributes)); if (ontologyIRI != null && currentFile != null) { addMapping(ontologyIRI, verifyNotNull(currentFile)); } } if (tag.equals("http://www.w3.org/2002/07/owl#Ontology")) { throw new SAXException(); } }
/** * Search first 100 lines for FSS style Ontology(<IRI> ... * * @param file the file to parse */ private void parseFSSFile(File file) { try (InputStream input = new FileInputStream(file); Reader reader = new InputStreamReader(input, "UTF-8"); BufferedReader br = new BufferedReader(reader)) { String line = ""; Matcher m = pattern.matcher(line); int n = 0; while ((line = br.readLine()) != null && n++ < 100) { m.reset(line); if (m.matches()) { String group = m.group(1); assert group != null; addMapping(IRI.create(group), file); break; } } } catch (IOException e) { // if we can't parse a file, then we can't map it LOGGER.debug("Exception reading file", e); } }
@Override public void startElement(@Nullable String uri, @Nullable String localName, @Nullable String qName, @Nullable Attributes attributes) throws SAXException { String tag = uri + localName; OntologyRootElementHandler handler = handlerMap.get(tag); if (handler != null) { IRI ontologyIRI = handler.handle(checkNotNull(attributes)); if (ontologyIRI != null && currentFile != null) { addMapping(ontologyIRI, verifyNotNull(currentFile)); } } if (tag.equals("http://www.w3.org/2002/07/owl#Ontology")) { throw new SAXException(); } }
@Override public void startElement(@Nullable String uri, @Nullable String localName, @Nullable String qName, @Nullable Attributes attributes) throws SAXException { String tag = uri + localName; OntologyRootElementHandler handler = handlerMap.get(tag); if (handler != null) { IRI ontologyIRI = handler.handle(checkNotNull(attributes)); if (ontologyIRI != null && currentFile != null) { addMapping(ontologyIRI, verifyNotNull(currentFile)); } } if (tag.equals("http://www.w3.org/2002/07/owl#Ontology")) { throw new SAXException(); } }
/** * Search first 100 lines for FSS style Ontology(<IRI> ... * * @param file the file to parse */ private void parseFSSFile(File file) { try (InputStream input = new FileInputStream(file); Reader reader = new InputStreamReader(input, "UTF-8"); BufferedReader br = new BufferedReader(reader)) { String line = ""; Matcher m = pattern.matcher(line); int n = 0; while ((line = br.readLine()) != null && n++ < 100) { m.reset(line); if (m.matches()) { String group = m.group(1); assert group != null; addMapping(IRI.create(group), file); break; } } } catch (IOException e) { // if we can't parse a file, then we can't map it LOGGER.debug("Exception reading file", e); } }