Package edu.stanford.smi.protege.model

Examples of edu.stanford.smi.protege.model.KnowledgeBase


     }
   }
  
 
  public static boolean isSuitable(Project p, Collection errors) { 
    KnowledgeBase kb = p.getKnowledgeBase();
    boolean ok = kb.getCls(ICDConstants.ICD_METACLASS) != null;
    if (!ok) { errors.add("ICD metaclass is missing"); }
    return ok;
  }
View Full Code Here


    }

    private void migrateToUUIDIfNecessary() {
        // Convert name to display name and generate a UUID for the name
        MetaProjectImpl metaProjectImpl = (MetaProjectImpl) metaProject;
        KnowledgeBase kb = metaProjectImpl.getKnowledgeBase();
        if (isInUUIDFormat(kb)) {
            return;
        }
        performUUIDMigration(metaProjectImpl, kb);
    }
View Full Code Here

        return inTrashSlot;
    }

    private static boolean isInTrash(ProjectInstance projectInstance) {
        Instance protegeInstance = projectInstance.getProtegeInstance();
        KnowledgeBase kb = protegeInstance.getKnowledgeBase();
        Slot inTrashSlot = getInTrashSlot(kb);
        Object ownSlotValue = protegeInstance.getOwnSlotValue(inTrashSlot);
        return ownSlotValue != null && ownSlotValue.equals(Boolean.TRUE);
    }
View Full Code Here

    public boolean isInTrash(ProjectId projectId) {
        try {
            READ_LOCK.lock();
            ProjectInstance pi = getProjectInstance(projectId);
            Instance instance = pi.getProtegeInstance();
            KnowledgeBase knowledgeBase = instance.getKnowledgeBase();
            Slot inTrashSlot = knowledgeBase.getSlot(IN_TRASH_SLOT_NAME);
            if(inTrashSlot == null) {
                return false;
            }
            Object val = instance.getOwnSlotValue(inTrashSlot);
            if(!(val instanceof Boolean)) {
View Full Code Here

    public void setInTrash(ProjectId projectId, boolean b) {
        try {
            WRITE_LOCK.lock();
            ProjectInstance pi = getProjectInstance(projectId);
            Instance instance = pi.getProtegeInstance();
            KnowledgeBase knowledgeBase = instance.getKnowledgeBase();
            Slot inTrashSlot = knowledgeBase.getSlot(IN_TRASH_SLOT_NAME);
            if (inTrashSlot != null) {
                instance.setOwnSlotValue(inTrashSlot, b);
            }
            save();
        }
View Full Code Here

    private void addProjectToMetaProject(ProjectId projectId, NewProjectSettings newProjectSettings) {
        MetaProject mp = getMetaProject();
        ProjectInstance pi = mp.createProject(projectId.getId());
        pi.setDescription(newProjectSettings.getProjectDescription());
        final Instance protegeInstance = pi.getProtegeInstance();
        final KnowledgeBase kb = protegeInstance.getKnowledgeBase();
        final Slot displayNameSlot = kb.getSlot("displayName");
        protegeInstance.setOwnSlotValue(displayNameSlot, newProjectSettings.getDisplayName());
        User user = mp.getUser(newProjectSettings.getProjectOwner().getUserName());
        pi.setOwner(user);
        OWLAPIMetaProjectStore.getStore().saveMetaProject(this);
    }
View Full Code Here

TOP

Related Classes of edu.stanford.smi.protege.model.KnowledgeBase

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.