Package org.semanticweb.owlapi.util

Examples of org.semanticweb.owlapi.util.SimpleIRIMapper


    @Test
    public void testCreateOntologyWithIRIWithMapper()
            throws OWLOntologyCreationException {
        IRI ontologyIRI = IRI("http://www.semanticweb.org/ontologies/ontology");
        IRI documentIRI = IRI("file:documentIRI");
        SimpleIRIMapper mapper = new SimpleIRIMapper(ontologyIRI, documentIRI);
        m.getIRIMappers().add(mapper);
        OWLOntology ontology = m.createOntology(ontologyIRI);
        assertNotNull("ontology should not be null", ontology);
        assertNotNull("ontology id should not be null",
                ontology.getOntologyID());
View Full Code Here


    public void testCreateOntologyWithIRIAndVersionIRIWithMapper()
            throws OWLOntologyCreationException {
        IRI ontologyIRI = IRI("http://www.semanticweb.org/ontologies/ontology");
        IRI versionIRI = IRI("http://www.semanticweb.org/ontologies/ontology/version");
        IRI documentIRI = IRI("file:documentIRI");
        SimpleIRIMapper mapper = new SimpleIRIMapper(versionIRI, documentIRI);
        m.getIRIMappers().add(mapper);
        OWLOntology ontology = m.createOntology(new OWLOntologyID(
                of(ontologyIRI), of(versionIRI)));
        assertNotNull("ontology should not be null", ontology);
        assertNotNull("ontology id should not be null",
View Full Code Here

    public void testCreateDuplicatedDocumentIRI()
            throws OWLOntologyCreationException {
        IRI ontologyIRI = IRI("http://www.semanticweb.org/ontologies/ontology");
        IRI ontologyIRI2 = IRI("http://www.semanticweb.org/ontologies/ontology2");
        IRI documentIRI = IRI("file:documentIRI");
        m.getIRIMappers().add(new SimpleIRIMapper(ontologyIRI, documentIRI));
        m.getIRIMappers().add(new SimpleIRIMapper(ontologyIRI2, documentIRI));
        m.createOntology(new OWLOntologyID(of(ontologyIRI), of((IRI) null)));
        m.createOntology(new OWLOntologyID(of(ontologyIRI2), of((IRI) null)));
    }
View Full Code Here

        // Output will be deleted on exit; to keep temporary file replace
        // previous line with the following
        // File output = File.createTempFile("saved_pizza", ".owl");
        IRI documentIRI = IRI.create(output);
        // Set up a mapping, which maps the ontology to the document IRI
        SimpleIRIMapper mapper = new SimpleIRIMapper(EXAMPLE_SAVE_IRI,
                documentIRI);
        m.getIRIMappers().add(mapper);
        // set up a mapper to read local copies of ontologies
        File localFolder = new File("materializedOntologies");
        // the manager will look up an ontology IRI by checking
View Full Code Here

        // above.
        // iri and file here are used as examples
        IRI iri = IRI
                .create("http://owl.cs.manchester.ac.uk/co-ode-files/ontologies/pizza.owl");
        File file = folder.newFile();
        manager.getIRIMappers().add(new SimpleIRIMapper(iri, IRI.create(file)));
        // Load the ontology as if we were loading it from the web (from its
        // ontology IRI)
        IRI pizzaOntologyIRI = IRI
                .create("http://owl.cs.manchester.ac.uk/co-ode-files/ontologies/pizza.owl");
        OWLOntology redirectedPizza = manager.loadOntology(pizzaOntologyIRI);
View Full Code Here

        IRI ontologyIRI = IRI
                .create("http://www.co-ode.org/ontologies/testont.owl");
        // Create the document IRI for our ontology
        IRI documentIRI = IRI.create("file:/tmp/MyOnt.owl");
        // Set up a mapping, which maps the ontology to the document IRI
        SimpleIRIMapper mapper = new SimpleIRIMapper(ontologyIRI, documentIRI);
        manager.getIRIMappers().add(mapper);
        // Now create the ontology - we use the ontology IRI (not the physical
        // URI)
        OWLOntology ontology = manager.createOntology(ontologyIRI);
        // Now we want to specify that A is a subclass of B. To do this, we add
View Full Code Here

                .create("http://www.co-ode.org/ontologies/testont.owl");
        // Create a document IRI which can be resolved to point to where our
        // ontology will be saved.
        IRI documentIRI = IRI.create("file:/tmp/SWRLTest.owl");
        // Set up a mapping, which maps the ontology to the document IRI
        SimpleIRIMapper mapper = new SimpleIRIMapper(ontologyIRI, documentIRI);
        manager.getIRIMappers().add(mapper);
        // Now create the ontology - we use the ontology IRI (not the physical
        // IRI)
        OWLOntology ontology = manager.createOntology(ontologyIRI);
        OWLDataFactory factory = manager.getOWLDataFactory();
View Full Code Here

        // specific IRI. Create a mapper that maps the Protege ontology IRI to
        // the document IRI that points to a copy in the TONES ontology
        // repository.
        IRI protegeOntologyDocumentIRI = getTONESRepositoryDocumentIRI(
                protegeOntologyIri, tonesRepositoryIri);
        OWLOntologyIRIMapper iriMapper = new SimpleIRIMapper(
                protegeOntologyIri, protegeOntologyDocumentIRI);
        // Create a new manager that we will use to load the MGED ontology
        OWLOntologyManager manager2 = OWLManager.createOWLOntologyManager();
        // Register our mapper with the manager
        manager2.getIRIMappers().add(iriMapper);
View Full Code Here

        String ns = "http://www.w3.org/2013/12/FDA-TA/tests/RenalTransplantation/";
        IRI bobsOntologyName = IRI.create(ns + "subject-bob");
        OWLNamedIndividual bobsIndividual = df.getOWLNamedIndividual(IRI
                .create(ns + "subject-bob#subjectOnImmunosuppressantA2"));
        m.getIRIMappers()
                .add(new SimpleIRIMapper(IRI.create(ns + "subject-amy"), IRI
                        .create(new File(ontologyDirectory, "subject-amy.ttl"))));
        m.getIRIMappers().add(
                new SimpleIRIMapper(bobsOntologyName, IRI.create(new File(
                        ontologyDirectory, "subject-bob.ttl"))));
        m.getIRIMappers()
                .add(new SimpleIRIMapper(IRI.create(ns + "subject-sue"), IRI
                        .create(new File(ontologyDirectory, "subject-sue.ttl"))));
        m.getIRIMappers().add(
                new SimpleIRIMapper(IRI
                        .create("http://www.w3.org/2013/12/FDA-TA/core"), IRI
                        .create(new File(ontologyDirectory, "core.ttl"))));
        OWLOntology topLevelImport = m
                .loadOntologyFromOntologyDocument(new File(ontologyDirectory,
                        "subjects.ttl"));
View Full Code Here

    private void createDebuggingOntology() throws OWLException {
        if (debuggingOntology != null) {
            owlOntologyManager.removeOntology(verifyNotNull(debuggingOntology));
        }
        IRI iri = createIRI();
        SimpleIRIMapper mapper = new SimpleIRIMapper(iri, iri);
        owlOntologyManager.getIRIMappers().add(mapper);
        debuggingOntology = owlOntologyManager.createOntology(iri);
        owlOntologyManager.getIRIMappers().remove(mapper);
        List<AddAxiom> changes = new ArrayList<>();
        for (OWLAxiom ax : debuggingAxioms) {
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.util.SimpleIRIMapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.