public IRI getIRI(String s) { if (s.charAt(0) == '<') { s = s.substring(1, s.length() - 1); } IRI iri = string2IRI.get(s); if (iri == null) { iri = IRI.create(s); if (!iri.isAbsolute()) { iri = IRI.create(base.substring(0, base.lastIndexOf('/') + 1) + s); } string2IRI.put(s, iri); } return iri; }
protected void versionNotAbsolute(OWLOntologyID id) { id.getVersionIRI().filter(v -> !v.isAbsolute()).ifPresent( x -> violations.add(new OntologyVersionIRINotAbsolute(getCurrentOntology(), id))); }
protected void versionNotAbsolute(OWLOntologyID id) { id.getVersionIRI().filter(v -> !v.isAbsolute()).ifPresent( x -> violations.add(new OntologyVersionIRINotAbsolute(getCurrentOntology(), id))); }
protected void ontologyIRINotAbsolute(OWLOntologyID id) { id.getOntologyIRI().filter(o -> !o.isAbsolute()) .ifPresent(x -> violations.add(new OntologyIRINotAbsolute(getCurrentOntology(), id))); }
protected void ontologyIRINotAbsolute(OWLOntologyID id) { id.getOntologyIRI().filter(o -> !o.isAbsolute()) .ifPresent(x -> violations.add(new OntologyIRINotAbsolute(getCurrentOntology(), id))); }
protected void versionNotAbsolute(OWLOntologyID id) { id.getVersionIRI().filter(v -> !v.isAbsolute()).ifPresent( x -> violations.add(new OntologyVersionIRINotAbsolute(getCurrentOntology(), id))); }
protected void ontologyIRINotAbsolute(OWLOntologyID id) { id.getOntologyIRI().filter(o -> !o.isAbsolute()) .ifPresent(x -> violations.add(new OntologyIRINotAbsolute(getCurrentOntology(), id))); }
/** Gets the iri. * * @param s * the s * @return the iri */ public IRI getIRI(String s) { if(s.charAt(0) == '<') { s = s.substring(1, s.length() - 1); } IRI iri = string2IRI.get(s); if(iri == null) { iri = IRI.create(s); if (!iri.isAbsolute()) { iri = IRI.create(base.getNamespace().substring(0, base.getNamespace().lastIndexOf('/')+1), s); } string2IRI.put(s, iri); } return iri; }
/** Gets the iri. * * @param s * the s * @return the iri */ public IRI getIRI(String s) { if(s.charAt(0) == '<') { s = s.substring(1, s.length() - 1); } IRI iri = string2IRI.get(s); if(iri == null) { iri = IRI.create(s); if (!iri.isAbsolute()) { iri = IRI.create(base.getNamespace().substring(0, base.getNamespace().lastIndexOf('/')+1), s); } string2IRI.put(s, iri); } return iri; }
protected void relativeIRI(IRI iri) { if (!iri.isAbsolute()) { violations.add(new UseOfNonAbsoluteIRI(getCurrentOntology(), getCurrentAxiom(), iri)); } }
protected void relativeIRI(IRI iri) { if (!iri.isAbsolute()) { violations.add(new UseOfNonAbsoluteIRI(getCurrentOntology(), getCurrentAxiom(), iri)); } }
protected void relativeIRI(IRI iri) { if (!iri.isAbsolute()) { violations.add(new UseOfNonAbsoluteIRI(getCurrentOntology(), getCurrentAxiom(), iri)); } }
public Object visit(IRI iri) { if(!iri.isAbsolute()) { profileViolations.add(new UseOfNonAbsoluteIRI(getCurrentOntology(), getCurrentAxiom())); } return null; }
private static Optional<IRI> opt(@Nullable IRI i) { if (i == null || NodeID.isAnonymousNodeIRI(i)) { return emptyOptional(); } if (!i.isAbsolute()) { LOGGER.error( "Ontology IRIs must be absolute; IRI {} is relative and will be made absolute by prefixing urn:absolute: to it", i); return optional(IRI.create("urn:absolute:" + i)); } return optional(i); }
public Object visit(OWLOntology ont) { // The ontology IRI and version IRI must be absolute and must not be from the reserved vocab OWLOntologyID id = ont.getOntologyID(); if (!id.isAnonymous()) { IRI ontologyIRI = id.getOntologyIRI(); if (!ontologyIRI.isAbsolute()) { profileViolations.add(new OntologyIRINotAbsolute(ont)); } IRI versionIRI = id.getVersionIRI(); if (versionIRI != null) { if (!versionIRI.isAbsolute()) { profileViolations.add(new OntologyVersionIRINotAbsolute(ont)); } } } return null; }
private static Optional<IRI> opt(@Nullable IRI i) { if (i == null || NodeID.isAnonymousNodeIRI(i)) { return emptyOptional(); } if (!i.isAbsolute()) { LOGGER.error( "Ontology IRIs must be absolute; IRI {} is relative and will be made absolute by prefixing urn:absolute: to it", i); return optional(IRI.create("urn:absolute:" + i)); } return optional(i); }
private static Optional<IRI> opt(@Nullable IRI i) { if (i == null || NodeID.isAnonymousNodeIRI(i)) { return emptyOptional(); } if (!i.isAbsolute()) { LOGGER.error( "Ontology IRIs must be absolute; IRI {} is relative and will be made absolute by prefixing urn:absolute: to it", i); return optional(IRI.create("urn:absolute:" + i)); } return optional(i); }
@Override public void storeOntology(OWLOntology ontology, IRI documentIRI, OWLDocumentFormat ontologyFormat) throws OWLOntologyStorageException { if (!documentIRI.isAbsolute()) { throw new OWLOntologyStorageException("Document IRI must be absolute: " + documentIRI); } try ( // prepare actual output OutputStream os = prepareActualOutput(documentIRI)) { store(ontology, ontologyFormat, os); } catch (IOException e) { throw new OWLOntologyStorageException(e); } }
@Override public void storeOntology(OWLOntology ontology, IRI documentIRI, OWLDocumentFormat ontologyFormat) throws OWLOntologyStorageException { if (!documentIRI.isAbsolute()) { throw new OWLOntologyStorageException("Document IRI must be absolute: " + documentIRI); } try ( // prepare actual output OutputStream os = prepareActualOutput(documentIRI)) { store(ontology, ontologyFormat, os); } catch (IOException e) { throw new OWLOntologyStorageException(e); } }
@Override public void storeOntology(OWLOntology ontology, IRI documentIRI, OWLDocumentFormat ontologyFormat) throws OWLOntologyStorageException { if (!documentIRI.isAbsolute()) { throw new OWLOntologyStorageException("Document IRI must be absolute: " + documentIRI); } try ( // prepare actual output OutputStream os = prepareActualOutput(documentIRI)) { store(ontology, ontologyFormat, os); } catch (IOException e) { throw new OWLOntologyStorageException(e); } }