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

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


        return annotationValue.accept(new OWLAnnotationValueVisitorEx<EntityData>() {
            public EntityData visit(IRI iri) {
                Set<OWLEntity> entities = project.getRootOntology().getEntitiesInSignature(iri);
                if(entities.isEmpty()) {
                    // Now what?
                    return new EntityData(iri.toString(), iri.toString());
                }
                else {
                    return getEntityData(selectEntity(entities));
                }
            }
View Full Code Here


    }
   
    public EntityData getEntityData(OWLLiteral literal) {
        P3LiteralParser literalParser = new P3LiteralParser(literal);
        String p3Format = literalParser.formatP3Literal();
        EntityData entityData = new EntityData(p3Format);
        entityData.setBrowserText(p3Format);
        // The UI seems a bit inconsistent in accepting ~# sometimes it returns it and other times it doesn't and it
        // doesn't seem to accept it in places that return it.
        OWLDatatype dt = literal.getDatatype();
        if(dt.isInteger()) {
            entityData.setValueType(ValueType.Integer);
        }
        else if(dt.isBoolean()) {
            entityData.setValueType(ValueType.Boolean);
        }
        else if(dt.isDouble()) {
            entityData.setValueType(ValueType.Float);
        }
        else if(dt.isFloat()) {
            entityData.setValueType(ValueType.Float);
        }
        else if(dt.isString()) {
            entityData.setValueType(ValueType.String);
        }
        else {
            // Totally unsatisfactory
            entityData.setValueType(ValueType.Any);
        }
        return entityData;
    }
View Full Code Here

        return lexicalValue != null && (lexicalValue.equalsIgnoreCase("true") || lexicalValue.equals("1"));
    }


    public EntityData getEntityData(OWLAnonymousIndividual individual) {
        EntityData entityData = new EntityData(individual.getID().getID());
        String browserText = individual.getID().getID();
        entityData.setBrowserText(browserText);
        entityData.setValueType(ValueType.Any);
        return entityData;
    }
View Full Code Here

    @Override
    protected void displayValues(Collection<EntityData> values) {
        List<EntityData> dispValues = new ArrayList<EntityData>();
        if (values != null) {
            for (EntityData value : values) {
                EntityData displayValue = valuesToDisplayValuesMap.get(value);
                if (displayValue != null) {
                    dispValues.add(displayValue);
                }
                else {
                    GWT.log("No display text for instance property value: " + value);
View Full Code Here

        }
    }


    protected EntityData findInstanceForValue(EntityData displayValueEntityData) {
        EntityData instanceValueEntityData = null;
        //try to find the value that has the display text
        for (EntityData value : getValues()) {
            if (valuesToDisplayValuesMap.get(value).equals(displayValueEntityData)) {
                instanceValueEntityData = value;
                break;
View Full Code Here

    @Override
    protected void deletePropertyValue(EntityData subject, String propName, ValueType propValueType,
            EntityData oldEntityData, Object oldBrowserText, String operationDescription) {
       
        EntityData oldInstanceEntityData = findInstanceForValue(oldEntityData);
       
        //overwrite the oldEntityData that has been created from the display text,
        //with a (hopefully correctly identified) instance value
        if (oldInstanceEntityData != null) {
            oldEntityData = oldInstanceEntityData;  //FIXME Check this!!!
View Full Code Here

    @Override
    protected void replacePropertyValue(EntityData subject, String propName, ValueType propValueType,
            EntityData oldEntityData, EntityData newEntityData, Object oldDisplayedValue, String operationDescription) {
       
        EntityData oldInstanceEntityData = findInstanceForValue(oldEntityData);
       
        if (oldInstanceEntityData != null) {
            propertyValueUtil.replacePropertyValue(getProjectId(), oldInstanceEntityData.getName(),
                    property, null, oldEntityData.getName(), newEntityData.getName(),
                    Application.get().getUserId(), operationDescription,
                    new ReplaceInstancePropertyValueHandler(subject, oldInstanceEntityData,
                            oldEntityData, newEntityData, getValues()));
        }
View Full Code Here

    protected void onAddExistingValue() {
        String type = UIUtil.getStringConfigurationProperty(getWidgetConfiguration(), FormConstants.ONT_TYPE, null);
        if (type == null) { return} //TODO: not type specified, maybe use range of property

        SelectionUtil.selectIndividuals(getProject(), UIUtil.createCollection(new EntityData(type)), true, false, new SelectionCallback() {
            public void onSelect(Collection<EntityData> selection) {
                addExistingValues(selection);
            }
        });
    }
View Full Code Here

                    properties.get(colIndex), ValueType.valueOf(valueType),
                            oldValue == null ? null : oldValue.toString(),
                            newValue == null ? null : newValue.toString(),
                            Application.get().getUserId(),
                            getReplaceValueOperationDescription(colIndex, oldValue, newValue),
                            new ReplacePropertyValueHandler(new EntityData(newValue == null ? null : newValue.toString(), newValue == null ? null : newValue.toString())));
        }
    }
View Full Code Here

        for(String shortForm : shortForms) {
            Matcher matcher = pattern.matcher(shortForm);
            if(matcher.find()) {
                Set<OWLEntity> entities = sfp.getEntities(shortForm);
                for(OWLEntity entity : entities) {
                    EntityData entityData = rm.getEntityData(entity);
                    result.add(entityData);
                }
            }
        }
        Collections.sort(result, new Comparator<EntityData>() {
            @Override
            public int compare(EntityData entityData, EntityData entityData2) {
                String browserText1 = entityData.getBrowserText();
                String browserText2 = entityData2.getBrowserText();
                if (browserText1 == null) {
                    if(browserText2 == null) {
                        return 0;
                    }
View Full Code Here

TOP

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

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.