private Set<OWLOntology> parseOntologyList() { potentialKeywords.clear(); consumeToken(OPENBRACKET.keyword()); consumeToken("in"); String sep = COMMA.keyword(); Set<OWLOntology> onts = new HashSet<>(); while (COMMA.matches(sep)) { String tok = consumeToken(); if (isOntologyName(tok)) { OWLOntology ont = getOntology(tok); if (ont != null) { onts.add(ont); } } else { throw new ExceptionBuilder().withOnto().build(); } sep = consumeToken(); if (sep.equals(CLOSEBRACKET.keyword())) { break; } else if (!COMMA.matches(sep)) { throw new ExceptionBuilder().withKeyword(COMMA, CLOSEBRACKET).build(); } } return onts; }
private Set<OWLOntology> parseOntologyList() { potentialKeywords.clear(); consumeToken(OPENBRACKET.keyword()); consumeToken("in"); String sep = COMMA.keyword(); Set<OWLOntology> onts = new HashSet<>(); while (COMMA.matches(sep)) { String tok = consumeToken(); if (isOntologyName(tok)) { OWLOntology ont = getOntology(tok); if (ont != null) { onts.add(ont); } } else { throw new ExceptionBuilder().withOnto().build(); } sep = consumeToken(); if (sep.equals(CLOSEBRACKET.keyword())) { break; } else if (!COMMA.matches(sep)) { throw new ExceptionBuilder().withKeyword(COMMA, CLOSEBRACKET).build(); } } return onts; }
private Set<OWLOntology> parseOntologyList() { potentialKeywords.clear(); consumeToken(OPENBRACKET.keyword()); consumeToken("in"); String sep = COMMA.keyword(); Set<OWLOntology> onts = new HashSet<>(); while (COMMA.matches(sep)) { String tok = consumeToken(); if (isOntologyName(tok)) { OWLOntology ont = getOntology(tok); if (ont != null) { onts.add(ont); } } else { throw new ExceptionBuilder().withOnto().build(); } sep = consumeToken(); if (sep.equals(CLOSEBRACKET.keyword())) { break; } else if (!COMMA.matches(sep)) { throw new ExceptionBuilder().withKeyword(COMMA, CLOSEBRACKET).build(); } } return onts; }
private Set<OWLOntology> parseOntologyList() { potentialKeywords.clear(); consumeToken(OPENBRACKET.keyword()); consumeToken("in"); String sep = COMMA.keyword(); Set<OWLOntology> onts = new HashSet<>(); while (COMMA.matches(sep)) { String tok = consumeToken(); if (isOntologyName(tok)) { OWLOntology ont = getOntology(tok); if (ont != null) { onts.add(ont); } } else { throw new ExceptionBuilder().withOnto().build(); } sep = consumeToken(); if (sep.equals(CLOSEBRACKET.keyword())) { break; } else if (!COMMA.matches(sep)) { throw new ExceptionBuilder().withKeyword(COMMA, CLOSEBRACKET).build(); } } return onts; }
protected void handleImport(Set<OWLImportsDeclaration> imports) { String tok; consumeToken(); tok = peekToken(); Optional<IRI> importedIRI = emptyOptional(); if (tok.startsWith("<")) { importedIRI = optional(parseIRI()); } else if (isOntologyName(tok)) { consumeToken(); OWLOntology ont = getOntology(tok); if (ont != null) { importedIRI = ont.getOntologyID().getOntologyIRI(); } } else { consumeToken(); throw new ExceptionBuilder().withOnto().withKeyword("<$ONTOLOGYYURI$>").build(); } if (!importedIRI.isPresent()) { throw new ExceptionBuilder().withOnto().withKeyword("Imported IRI is null").build(); } IRI importedOntologyIRI = importedIRI.get(); imports.add(df.getOWLImportsDeclaration(importedOntologyIRI)); }
protected void handleImport(Set<OWLImportsDeclaration> imports) { String tok; consumeToken(); tok = peekToken(); Optional<IRI> importedIRI = emptyOptional(); if (tok.startsWith("<")) { importedIRI = optional(parseIRI()); } else if (isOntologyName(tok)) { consumeToken(); OWLOntology ont = getOntology(tok); if (ont != null) { importedIRI = ont.getOntologyID().getOntologyIRI(); } } else { consumeToken(); throw new ExceptionBuilder().withOnto().withKeyword("<$ONTOLOGYYURI$>").build(); } if (!importedIRI.isPresent()) { throw new ExceptionBuilder().withOnto().withKeyword("Imported IRI is null").build(); } IRI importedOntologyIRI = importedIRI.get(); imports.add(df.getOWLImportsDeclaration(importedOntologyIRI)); }
protected void handleImport(Set<OWLImportsDeclaration> imports) { String tok; consumeToken(); tok = peekToken(); Optional<IRI> importedIRI = emptyOptional(); if (tok.startsWith("<")) { importedIRI = optional(parseIRI()); } else if (isOntologyName(tok)) { consumeToken(); OWLOntology ont = getOntology(tok); if (ont != null) { importedIRI = ont.getOntologyID().getOntologyIRI(); } } else { consumeToken(); throw new ExceptionBuilder().withOnto().withKeyword("<$ONTOLOGYYURI$>").build(); } if (!importedIRI.isPresent()) { throw new ExceptionBuilder().withOnto().withKeyword("Imported IRI is null").build(); } IRI importedOntologyIRI = importedIRI.get(); imports.add(df.getOWLImportsDeclaration(importedOntologyIRI)); }
protected void handleImport(Set<OWLImportsDeclaration> imports) { String tok; consumeToken(); tok = peekToken(); Optional<IRI> importedIRI = emptyOptional(); if (tok.startsWith("<")) { importedIRI = optional(parseIRI()); } else if (isOntologyName(tok)) { consumeToken(); OWLOntology ont = getOntology(tok); if (ont != null) { importedIRI = ont.getOntologyID().getOntologyIRI(); } } else { consumeToken(); throw new ExceptionBuilder().withOnto().withKeyword("<$ONTOLOGYYURI$>").build(); } if (!importedIRI.isPresent()) { throw new ExceptionBuilder().withOnto().withKeyword("Imported IRI is null").build(); } IRI importedOntologyIRI = importedIRI.get(); imports.add(df.getOWLImportsDeclaration(importedOntologyIRI)); }