Package edu.stanford.bmir.protege.web.client.rpc.data

Examples of edu.stanford.bmir.protege.web.client.rpc.data.PropertyEntityData


        // Temporary - to be replaced when ontology is loaded.
        TreeNode root = new TreeNode((String) null);
        root.setId("RootPropertyNode");
        root.setHref("");
        root.setUserObject(new PropertyEntityData("RootPropertyNode", "RootPropertyNode", null));
        setTreeNodeIcon(root);

        treePanel.setRootNode(root);
        treePanel.setRootVisible(false);
View Full Code Here


    protected void onEditNotes() {
//        // TODO Auto-generated method stub
//        super.onEditNotes(value);
        String annotEntityName = null;
        PropertyEntityData property = getProperty();
        if (property.getValueType() == ValueType.Instance) {
            //FIXME This solution will not work when multiple property values are specified:
            //  it will add the comment always to the first instance.
            //  This method should be generalized OR overwritten in subclasses that can deal
            //  with multiple property values.
            EntityData firstValue = UIUtil.getFirstItem(getValues());
View Full Code Here

    private void handleChildAdded(TreeNode parentTn, final OWLEntity child, boolean shouldSelect) {
        final TreeNode childTn = findTreeNode(child.getIRI().toString());
        final TreeNode freshChild;
        if (childTn == null) {
            final PropertyEntityData entityData = createEntityDataPlaceholder(child);
            freshChild = createTreeNode(entityData);
            updateTextAsync(child, freshChild);
            parentTn.appendChild(freshChild);

        }
View Full Code Here

        getSubProperties(null, true);
        super.afterRender();
    }

    public void setTreeNodeIcon(TreeNode node) {
        PropertyEntityData entityData = (PropertyEntityData) node.getUserObject();
        PropertyType type = entityData.getPropertyType();
        if (type == PropertyType.OBJECT) {
            node.setIconCls("protege-object-property-icon");
        }
        else if (type == PropertyType.DATATYPE) {
            node.setIconCls("protege-datatype-property-icon");
View Full Code Here

        });
    }

    private PropertyEntityData createEntityDataPlaceholder(OWLEntity child) {
        String browserText = "";
        final PropertyEntityData entityData = new PropertyEntityData(child.getIRI().toString(), browserText, Collections.<EntityData>emptySet());
        final EntityType<?> entityType = child.getEntityType();
        if (entityType == EntityType.OBJECT_PROPERTY) {
            entityData.setPropertyType(PropertyType.OBJECT);
        }
        else if (entityType == EntityType.DATA_PROPERTY) {
            entityData.setPropertyType(PropertyType.DATATYPE);
        }
        else {
            entityData.setPropertyType(PropertyType.ANNOTATION);
        }
        return entityData;
    }
View Full Code Here

                    }

                    @Override
                    public void visit(OWLDataSomeValuesFrom desc) {
                        if(desc.getFiller().isDatatype()) {
                            PropertyEntityData propertyEntityData = rm.getPropertyEntityData(desc.getProperty().asOWLDataProperty());
                            propertyEntityData.setMinCardinality(1);
                            result.add(new Triple(rm.getEntityData(cls), propertyEntityData, rm.getEntityData(desc.getFiller().asOWLDatatype())));
                        }
                    }

                    @Override
                    public void visit(OWLDataHasValue desc) {
                        PropertyEntityData propertyEntityData = rm.getPropertyEntityData(desc.getProperty().asOWLDataProperty());
                        propertyEntityData.setMinCardinality(1);
                        result.add(new Triple(rm.getEntityData(cls), propertyEntityData, rm.getEntityData(desc.getValue())));
                    }

                    @Override
                    public void visit(OWLObjectMinCardinality desc) {
                        processAsExistential(desc);
                    }

                    @Override
                    public void visit(OWLObjectExactCardinality desc) {
                        desc.asIntersectionOfMinMax().accept(this);
                    }

                    private OWLObjectProperty getSimpleNamedProperty(OWLRestriction<?, OWLObjectPropertyExpression, ?> ce) {
                        return ce.getProperty().getSimplified().asOWLObjectProperty();
                    }

                    private boolean isSimpleNamedPropertyRestriction(OWLRestriction<?, OWLObjectPropertyExpression, ?> ce) {
                        return !ce.getProperty().getSimplified().isAnonymous();
                    }

                    private void processAsExistential(OWLQuantifiedRestriction<OWLClassExpression, OWLObjectPropertyExpression, OWLClassExpression> ce) {
                        if (isSimpleNamedPropertyRestriction(ce)) {
                            for(OWLClassExpression filler : ce.getFiller().asConjunctSet()) {
                                OWLEntity entityFiller = filler.accept(new OWLClassExpressionVisitorExAdapter<OWLEntity>() {
                                    @Override
                                    public OWLEntity visit(OWLClass ce) {
                                        return ce;
                                    }

                                    @Override
                                    public OWLEntity visit(OWLObjectOneOf ce) {
                                        Set<OWLIndividual> individuals = ce.getIndividuals();
                                        if(individuals.size() == 1) {
                                            OWLIndividual ind = individuals.iterator().next();
                                            if(!ind.isAnonymous()) {
                                                return ind.asOWLNamedIndividual();
                                            }
                                        }
                                        return null;
                                    }
                                });

                                if(entityFiller != null) {
                                    OWLObjectProperty property = getSimpleNamedProperty(ce);
                                    PropertyEntityData propertyEntityData = rm.getPropertyEntityData(property);
                                    propertyEntityData.setMinCardinality(1);
                                    result.add(new Triple(rm.getEntityData(cls), propertyEntityData, rm.getEntityData(entityFiller)));
                                }

                            }
                        }
View Full Code Here

        OWLNamedIndividual ind = getEntity();
        for(OWLOntology ont : getRootOntologyImportsClosure()) {
            for(OWLObjectPropertyAssertionAxiom ax : ont.getObjectPropertyAssertionAxioms(ind)) {
                if (!ax.getProperty().isAnonymous()) {
                    RenderingManager rm = getRenderingManager();
                    PropertyEntityData propData = rm.getPropertyEntityData(ax.getProperty().asOWLObjectProperty());
                    OWLIndividual object = ax.getObject();
                    EntityData valueData;
                    if(object.isAnonymous()) {
                        valueData = rm.getEntityData(object.asOWLAnonymousIndividual());
                    }
                    else {
                        valueData = rm.getEntityData(object.asOWLNamedIndividual());
                    }
                    EntityData subjectData = rm.getEntityData(ind);
                    result.add(new Triple(subjectData, propData, valueData));
                }
            }
            for(OWLDataPropertyAssertionAxiom ax : ont.getDataPropertyAssertionAxioms(ind)) {
                RenderingManager rm = getRenderingManager();
                PropertyEntityData propData = rm.getPropertyEntityData(ax.getProperty().asOWLDataProperty());
                EntityData subjectData = rm.getEntityData(ind);
                result.add(new Triple(subjectData, propData, rm.getEntityData(ax.getObject())));
            }

        }
View Full Code Here

TOP

Related Classes of edu.stanford.bmir.protege.web.client.rpc.data.PropertyEntityData

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.