Examples of AddImport


Examples of org.semanticweb.owlapi.model.AddImport

                    break;
            }

            for (OWLOntologyID ref : listToUse)
                if (!loaded.contains(ref) && !ref.equals(keymap.getReverseMapping(graphName))) {
                    changes.add(new AddImport(o, df.getOWLImportsDeclaration(ref.getOntologyIRI())));
                    loaded.add(ref);
                }
            o.getOWLOntologyManager().applyChanges(changes);
            return o;
        } else {
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

                // The key set of managedOntologies contains the ontology IRIs, not their storage keys.
                for (OWLOntologyID ontologyId : managedOntologies) {
                    // XXX some day the versionIRI will be the only physical reference for the ontology
                    IRI physIRI = IRI.create(base + OntologyUtils.encode(ontologyId));
                    changes.add(new AddImport(root, df.getOWLImportsDeclaration(physIRI)));
                }
                ontologyManager.applyChanges(changes);
            }

        }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

                if (backwardPathLength > 0) tid = tid.split("/")[0];

                IRI target = IRI.create((managed ? universalPrefix + "/" + tid + "/" : URIUtils
                        .upOne(universalPrefix) + "/")
                                        + s);
                changes.add(new AddImport(o, df.getOWLImportsDeclaration(target)));
            }
            o.getOWLOntologyManager().applyChanges(changes);
        }

        return o;
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

            OWLOntologyManager ontologyManager = target.getOWLOntologyManager();
            OWLDataFactory df = ontologyManager.getOWLDataFactory();
            // Add import declarations for attached scopes.
            for (String scopeID : attachedScopes) {
                IRI physIRI = IRI.create(scopePrefix + scopeID);
                changes.add(new AddImport(target, df.getOWLImportsDeclaration(physIRI)));
            }
            // Commit
            ontologyManager.applyChanges(changes);
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

            String s = oldImp.getIRI().toString();
            if (s.contains("::")) {
                s = s.substring(s.indexOf("::") + 2, s.length());
            }
            IRI target = IRI.create(base + s);
            changes.add(new AddImport(o, df.getOWLImportsDeclaration(target)));
        }

        // Versioning.
        OWLOntologyID id = o.getOntologyID();
        if (!id.isAnonymous() && id.getVersionIRI() == null) {
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

            String section = peekToken();
            if (section.equals(ONTOLOGY)) {
                ManchesterOWLSyntaxOntologyHeader header = parseOntologyHeader(false);
                for (OWLImportsDeclaration decl : header.getImportsDeclarations()) {
                    ont.getOWLOntologyManager().makeLoadImportRequest(decl, configuration);
                    imports.add(new AddImport(ont, decl));
                }
                for (OWLAnnotation anno : header.getAnnotations()) {
                    ontologyAnnotations.add(new AddOntologyAnnotation(ont, anno));
                }
                ontologyID = header.getOntologyID();
            }
            else if (section.equalsIgnoreCase(CLASS)) {
                axioms.addAll(parseClassFrame());
            }
            else if (section.equalsIgnoreCase(OBJECT_PROPERTY)) {
                axioms.addAll(parseObjectPropertyFrame());
            }
            else if (section.equalsIgnoreCase(DATA_PROPERTY)) {
                axioms.addAll(parseDataPropertyFrame());
            }
            else if (section.equalsIgnoreCase(INDIVIDUAL)) {
                axioms.addAll(parseIndividualFrame());
            }
            else if (section.equalsIgnoreCase(DATATYPE)) {
                axioms.addAll(parseDatatypeFrame());
            }
            else if (section.equalsIgnoreCase(ANNOTATION_PROPERTY)) {
                axioms.addAll(parseAnnotationPropertyFrame());
            }
            else if (section.equalsIgnoreCase(VALUE_PARTITION)) {
                axioms.addAll(parseValuePartitionFrame());
            }
            else if (section.equalsIgnoreCase(IMPORT)) {
                OWLImportsDeclaration decl = parseImportsDeclaration(ont);
                imports.add(new AddImport(ont, decl));
                ont.getOWLOntologyManager().makeLoadImportRequest(decl, configuration);
            }
            else if (section.equalsIgnoreCase(PREFIX)) {
                Map<String, IRI> nsMap = parsePrefixDeclaration();
                for (String ns : nsMap.keySet()) {
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

            else if (inHeader) {
                if (tag.equals(IMPORT_TAG_NAME)) {
                    IRI uri = IRI.create(value.trim());
                    OWLImportsDeclaration decl = owlOntologyManager.getOWLDataFactory().getOWLImportsDeclaration(uri);
                    owlOntologyManager.makeLoadImportRequest(decl, configuration);
                    owlOntologyManager.applyChange(new AddImport(ontology, decl));
                }
                else {
                    // Ontology annotations
                    OWLLiteral con = getDataFactory().getOWLLiteral(value);
                    OWLAnnotationProperty property = getDataFactory().getOWLAnnotationProperty(getIRI(tag));
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

    protected void addOntologyAnnotation(OWLAnnotation annotation) {
        applyChange(new AddOntologyAnnotation(ontology, annotation));
    }

    protected void addImport(OWLImportsDeclaration declaration) {
        applyChange(new AddImport(ontology, declaration));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

      } else {
        break label_2;
      }
      if (jj_2_5(2)) {
        decl = ImportsDeclaration();
        applyChange(new AddImport(ontology, decl));
        man.makeLoadImportRequest(decl, configuration);
      } else if (jj_2_6(2)) {
        anno = Annotation();
        applyChange(new AddOntologyAnnotation(ontology, anno));
        currentAnnotations.clear();
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

        changes.add(new SetOntologyID(ontology, new OWLOntologyID(newIRI, ontology.getOntologyID().getVersionIRI())));
        for (OWLOntology ont : owlOntologyManager.getOntologies()) {
            for (OWLImportsDeclaration decl : ont.getImportsDeclarations()) {
                if (decl.getIRI().equals(ontology.getOntologyID().getOntologyIRI())) {
                    changes.add(new RemoveImport(ont, decl));
                    changes.add(new AddImport(ont, owlOntologyManager.getOWLDataFactory().getOWLImportsDeclaration(newIRI)));
                }
            }
        }
        return changes;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.