Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.IRI


                    && isClassExpressionLax(mainNode);
        }

        @Override
        public OWLObjectComplementOf translate(IRI mainNode) {
            IRI complementOfObject = getConsumer().getResourceObject(mainNode,
                    OWL_COMPLEMENT_OF, true);
            assert complementOfObject != null;
            OWLClassExpression operand = accessor
                    .translateClassExpression(complementOfObject);
            return getDataFactory().getOWLObjectComplementOf(operand);
View Full Code Here


        @Override
        public OWLObjectHasSelf translate(IRI mainNode) {
            getConsumer().consumeTriple(mainNode, RDF_TYPE.getIRI(),
                    OWL_RESTRICTION.getIRI());
            getConsumer().getLiteralObject(mainNode, OWL_HAS_SELF, true);
            IRI propertyIRI = getConsumer().getResourceObject(mainNode,
                    OWL_ON_PROPERTY, true);
            assert propertyIRI != null;
            OWLObjectPropertyExpression property = getConsumer()
                    .translateObjectPropertyExpression(propertyIRI);
            return getDataFactory().getOWLObjectHasSelf(property);
View Full Code Here

    private final Map<IRI, IRI> iriMap = new HashMap<>();

    @Override
    public IRI getConvertedIRI(@Nonnull OWLEntity entity) {
        IRI convIRI = iriMap.get(entity.getIRI());
        if (convIRI == null) {
            convIRI = convert(entity.getIRI());
            iriMap.put(entity.getIRI(), convIRI);
        }
        return convIRI;
View Full Code Here

        this.base = checkNotNull(base, "base cannot be null");
    }

    @Override
    public IRI getConvertedIRI(OWLEntity entity) {
        IRI iri = entityNameMap.get(entity);
        if (iri != null) {
            return iri;
        }
        if (entity instanceof OWLDatatype) {
            return entity.getIRI();
View Full Code Here

        if (documentIRIString == null || documentIRIString.length() == 0) {
            documentIRIString = ontologyRepository.guessDocumentIRIFromPackage(tempFile);
        }

        IRI documentIRI = IRI.create(documentIRIString);

        User user = getUser(request);
        Authorizations authorizations = getAuthorizations(request, user);
        LOGGER.info("adding ontology: %s", documentIRI.toString());
        ontologyRepository.writePackage(tempFile, documentIRI, authorizations);
        ontologyRepository.clearCache();

        tempFile.delete();
View Full Code Here

    }

    @Override
    protected int run(CommandLine cmd) throws Exception {
        File inFile = new File(this.inFileName);
        IRI documentIRI;
        if (this.documentIRIString == null) {
            String guessedIri = ontologyRepository.guessDocumentIRIFromPackage(inFile);
            documentIRI = IRI.create(guessedIri);
        } else {
            documentIRI = IRI.create(this.documentIRIString);
View Full Code Here

    }

    @Test(expected = OWLOntologyAlreadyExistsException.class)
    public void testCreateDuplicateOntologyWithIRIAndVersionIRI()
            throws OWLOntologyCreationException {
        IRI ontologyIRI = IRI("http://www.semanticweb.org/ontologies/ontology");
        IRI versionIRI = IRI("http://www.semanticweb.org/ontologies/ontology");
        m.createOntology(new OWLOntologyID(of(ontologyIRI), of(versionIRI)));
        m.createOntology(new OWLOntologyID(of(ontologyIRI), of(versionIRI)));
    }
View Full Code Here

    }

    @Test(expected = OWLOntologyDocumentAlreadyExistsException.class)
    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

    @Nonnull
    private static final String TEST_ONTOLOGY_IRI_STRING = "http://test.it/check1";

    @Test
    public void shouldFindSameHashCode() {
        IRI iri1 = IRI(TEST_ONTOLOGY_IRI_STRING);
        IRI iri2 = IRI(TEST_ONTOLOGY_IRI_STRING);
        assertEquals(iri1.hashCode(), iri2.hashCode());
        assertEquals(iri1, iri2);
    }
View Full Code Here

        assertEquals(iri1, iri2);
    }

    @Test
    public void shouldFindSameHashCodeForIDs() {
        IRI iri1 = IRI(TEST_ONTOLOGY_IRI_STRING);
        IRI iri2 = IRI(TEST_ONTOLOGY_IRI_STRING);
        assertEquals(iri1.hashCode(), iri2.hashCode());
        OWLOntologyID id1 = new OWLOntologyID(of(iri1), absent());
        OWLOntologyID id2 = new OWLOntologyID(of(iri2), absent());
        assertEquals(id1.hashCode(), id2.hashCode());
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.IRI

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.