Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.IRI


    }

    final void parseLiteral(IRI subject, IRI predicate) {
        String literal;
        String lang = null;
        IRI datatype = null;
        Token t;
        if (jj_2_31(2)) {
            literal = parseQuotedString();
            if (jj_2_30(2)) {
                if (jj_2_28(2)) {
View Full Code Here


            } else {
                value = getIRI(obj);
            }
            anno = dataFactory.getOWLAnnotation(annoProp, value);
        } else if (obj.startsWith("<")) {
            IRI value = parseIRI();
            anno = dataFactory.getOWLAnnotation(annoProp, value);
        } else {
            OWLLiteral con = parseLiteral(null);
            anno = dataFactory.getOWLAnnotation(annoProp, con);
        }
View Full Code Here

        }
    }

    @Nonnull
    private SWRLVariable parseDVariable() {
        IRI var = parseVariable();
        return dataFactory.getSWRLVariable(var);
    }
View Full Code Here

    private SWRLBuiltInAtom parseBuiltInAtom() {
        String predicate = consumeToken();
        consumeToken(OPEN.keyword());
        SWRLBuiltInsVocabulary v = null;
        IRI iri = null;
        if (!ruleBuiltIns.containsKey(predicate)) {
            iri = getIRI(predicate);
        } else {
            v = ruleBuiltIns.get(predicate);
            iri = v.getIRI();
View Full Code Here

        // Handle legacy = character if necessart
        if (peekToken().equals("=")) {
            // Legacy
            consumeToken();
        }
        IRI iri = parseIRI();
        map.put(prefixName, iri);
        return map;
    }
View Full Code Here

public class RenameToExistingOntologyTestCase extends TestBase {

    @Test(expected = OWLOntologyRenameException.class)
    public void testRenameToExistingOntology()
            throws OWLOntologyCreationException {
        IRI ontologyAIRI = IRI("http://www.semanticweb.org/ontologies/ontologyA");
        OWLOntology onto = m.createOntology(ontologyAIRI);
        m.addAxiom(onto,
                df.getOWLDeclarationAxiom(Class(IRI("urn:test:testclass"))));
        IRI ontologyBIRI = IRI("http://www.semanticweb.org/ontologies/ontologyB");
        OWLOntology ontologyB = m.createOntology(ontologyBIRI);
        m.applyChange(new SetOntologyID(ontologyB, new OWLOntologyID(
                of(ontologyAIRI), absent())));
    }
View Full Code Here

    private static final String ONTOLOGY_A = "ImportsTestOntologyA.owl";
    private static final String ONTOLOGY_A_EMPTY = "ImportsTestOntologyAEmpty.owl";

    @Test(expected = OWLOntologyAlreadyExistsException.class)
    public void testDifferentPhysicalURISameOntologyIRI() throws Exception {
        IRI ontologyADocumentIRI = IRI
                .create(DifferentPhysicalURISameOntologyIRITestCase.class
                        .getResource('/' + ONTOLOGY_A).toURI());
        IRI ontologyADocumentIRIB = IRI
                .create(DifferentPhysicalURISameOntologyIRITestCase.class
                        .getResource('/' + ONTOLOGY_A_EMPTY).toURI());
        m.loadOntologyFromOntologyDocument(ontologyADocumentIRI);
        m.loadOntologyFromOntologyDocument(ontologyADocumentIRIB);
        fail("Expected an exception to say that the ontology already exists");
View Full Code Here

        if (ontologyIRI.toString().endsWith(".obo")) {
            String path = ontologyIRI.toURI().getPath();
            if (path != null) {
                int lastSepIndex = path.lastIndexOf('/');
                String name = path.substring(lastSepIndex + 1, path.length());
                IRI documentIRI = oboFileMap.get(name);
                if (documentIRI != null) {
                    return documentIRI;
                }
            }
        }
View Full Code Here

        try {
            // Ontology: <URI>
            br = new BufferedReader(new InputStreamReader(new FileInputStream(
                    file), "UTF-8"));
            String line = br.readLine();
            IRI ontologyIRI = null;
            while (line != null) {
                StringTokenizer tokenizer = new StringTokenizer(line, " \r\n",
                        false);
                line = br.readLine();
                while (tokenizer.hasMoreTokens()) {
View Full Code Here

    @Override
    public void startElement(String uri, String localName, String qName,
            Attributes attributes) throws SAXException {
        OntologyRootElementHandler handler = handlerMap.get(uri + localName);
        if (handler != null) {
            IRI ontologyIRI = handler.handle(attributes);
            if (ontologyIRI != null && currentFile != null) {
                addMapping(ontologyIRI, verifyNotNull(currentFile));
            }
            throw new SAXException();
        }
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.