Package edu.stanford.smi.protege.model

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


    private void migrateProjectInstance(KnowledgeBase kb, ProjectInstance pi) {
        LOGGER.info("Processing " + pi.getName());
        final Instance protegeInstance = pi.getProtegeInstance();
        final String existingName = pi.getName();

        final Slot displayNameSlot = kb.getSlot(DISPLAY_NAME_SLOT_NAME);
        protegeInstance.setOwnSlotValue(displayNameSlot, existingName);

        final ProjectId newProjectId = ProjectIdFactory.getFreshProjectId();
        pi.setName(newProjectId.getId());
        moveProjectDirectoryOnDisk(existingName, newProjectId);
View Full Code Here


            }
        }
    }

    private Slot createDisplayNameSlot(KnowledgeBase kb) {
        final Slot displayNameSlot = kb.createSlot(DISPLAY_NAME_SLOT_NAME);
        final Cls policyControlledObjectCls = kb.getCls(POLICY_CONTROLLED_OBJECT_CLS_NAME);
        policyControlledObjectCls.addDirectTemplateSlot(displayNameSlot);
        return displayNameSlot;
    }
View Full Code Here

        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

        User newUser = metaproject.createUser(userName, password);
        return AuthenticationUtil.createUserData(UserId.getUserId(newUser.getName()));
    }

    private static Slot getInTrashSlot(KnowledgeBase kb) {
        Slot inTrashSlot = kb.getSlot("inTrash");
        if (inTrashSlot == null) {
            throw new RuntimeException("inTrash slot is not defined in meta-project");
        }
        return inTrashSlot;
    }
View Full Code Here

    }

    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

        final ProjectId projectId = ProjectId.get(projectInstance.getName());
        final String description = projectInstance.getDescription();
        final User projectOwner = projectInstance.getOwner();
        final UserId ownerId = projectOwner != null ? UserId.getUserId(projectOwner.getName()) : UserId.getGuest();
        final boolean inTrash = isInTrash(projectInstance);
        final Slot displayNameSlot = projectInstance.getProtegeInstance().getKnowledgeBase().getSlot("displayName");
        final String displayName = (String) projectInstance.getProtegeInstance().getOwnSlotValue(displayNameSlot);
        return new ProjectDetails(projectId, displayName, description, ownerId, inTrash);
    }
View Full Code Here

        setPropertyValue(projectId, PROJECT_TYPE_PROPERTY_NAME, projectType.getProjectTypeName());
    }

    public String getDisplayName(ProjectId projectId) {
        ProjectInstance pi = getProjectInstance(projectId);
        Slot displayNameSlot = pi.getProtegeInstance().getKnowledgeBase().getSlot("displayName");
        if(displayNameSlot == null) {
            return projectId.getId();
        }
        else {
            return pi.getProtegeInstance().getDirectOwnSlotValue(displayNameSlot).toString();
View Full Code Here

        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

        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

TOP

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

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.