All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cz.cvut.kbss.ontodriver.owlapi.util.DefaultOntologyIriMapper Maven / Gradle / Ivy

/*
 * JOPA
 * Copyright (C) 2024 Czech Technical University in Prague
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3.0 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.
 */
package cz.cvut.kbss.ontodriver.owlapi.util;

import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLOntologyIRIMapper;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.net.URI;
import java.util.Map;

public class DefaultOntologyIriMapper implements OWLOntologyIRIMapper {

    private final Map mappings;

    public DefaultOntologyIriMapper(MappingFileParser parser) {
        this.mappings = parser.getMappings();
    }

    @Nullable
    @Override
    public IRI getDocumentIRI(@Nonnull IRI ontologyIRI) {
        return IRI.create(mappings.get(ontologyIRI.toURI()));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy