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

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


            for(OWLAnnotationAssertionAxiom ax : ontology.getAnnotationAssertionAxioms(entity.getIRI())) {
                RenderingManager rm = getRenderingManager();
                EntityData subjectData = rm.getEntityData(entity);
                PropertyEntityData propData = rm.getPropertyEntityData(ax.getProperty());
                EntityData valueData = rm.getEntityData(ax.getValue());
                Triple triple = new Triple(subjectData, propData, valueData);
                result.add(triple);
            }
        }
        return result;
    }
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

                        }
                        final OWLObjectPropertyExpression property = axiom.getProperty();
                        if(property.isAnonymous()) {
                            return;
                        }
                        result.add(new Triple(rm.getEntityData(domain.asOWLClass()), rm.getPropertyEntityData(property.asOWLObjectProperty()), null));
                    }

                    @Override
                    public void visit(OWLObjectPropertyRangeAxiom axiom) {
                        final OWLClassExpression range = axiom.getRange();
                        if(range.isAnonymous()) {
                            return;
                        }
                        final OWLObjectPropertyExpression property = axiom.getProperty();
                        if(property.isAnonymous()) {
                            return;
                        }
                        result.add(new Triple(null, rm.getPropertyEntityData(property.asOWLObjectProperty()), rm.getEntityData(range.asOWLClass())));
                    }
                });
            }

        }
View Full Code Here

                    }
                    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())));
            }

        }
        return result;
    }
View Full Code Here

TOP

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

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.