Package org.ontospread.xmlbind

Examples of org.ontospread.xmlbind.Relation


        
        return concept;
    }
   
    private void createRelationsFromProperties(Iterator iterator, HashMap relationsMap) {
        Relation relation;
        for(;iterator.hasNext();){
          Statement statement = (Statement) iterator.next();
          if(statement.getObject().canAs(Individual.class)){
            if(relationsMap.containsKey(statement.getPredicate().getURI())){
              relation = (Relation) relationsMap.get(statement.getPredicate().getURI());
View Full Code Here


        }      
       
    }
   
    private void addRelation(Relation relationType, ConceptDescription conceptDescription, HashMap relationsMap){       
        Relation relation;
        if(relationsMap.containsKey(relationType.getUri())){
            relation = (Relation) relationsMap.get(relationType.getUri());
         }else{
             relation = relationType;
             relationsMap.put(relation.getUri(),relation);
         }
         relation.getConceptDescriptions().add(conceptDescription);           
    }
View Full Code Here

    private List createRelationsForInstance(String uri, TypeHierarchy hierarchy, String description, String value, Iterator it, HashMap relationsMap){
        List relations = new LinkedList();
        for(;it.hasNext();){  
            Object o = it.next();          
            OntResource withInstance =  (OntResource) o;
            Relation relation;
            if(relationsMap.containsKey(uri)){
                relation = (Relation) relationsMap.get(uri);
             }else{
                 relation = createRelationFromInstance(uri, hierarchy, description, value);
             }           
View Full Code Here

        }
        return relations;
    }

    private Relation createRelationFromInstance(String uri, TypeHierarchy hierarchy, String description, String value) {
        Relation relation = factory.createRelation();       
        relation.setDescription(description);           
        relation.setHierarchy(hierarchy);
        relation.setOnproperty(uri);
        relation.setUri(uri);
        relation.setValue(value);
        return relation;       
    }
View Full Code Here

        logger.debug("Creating relations with " + hierarchy);
        LinkedList<Relation> relations = new LinkedList<Relation>();
        while (iterator.hasNext()) { // concat . map
            OntClass relatedClass = (OntClass) iterator.next();
            if (!isOwlInternalClass(relatedClass)) {
                Relation relation = factory.createRelation();
                relation.setHierarchy(hierarchy);                 
                /* Setting description in superclass and subclass, relations overwrite this value.*/
                relation.setDescription(OntologyHelper.getPublicName(relatedClass));
                collectRelatedClassDescription(relatedClass, relation);
                relation.setUri(relation.getOnproperty());
                relations.add(relation);
                logger.debug("Added relation with hierarchy " + relation.getHierarchy() + " on property "+ relation.getOnproperty());
            } else {
                logger.debug("Discarding related class " + relatedClass.getURI());
            }
        }
        logger.debug("End relations with " + hierarchy);
View Full Code Here

TOP

Related Classes of org.ontospread.xmlbind.Relation

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.