Search in sources :

Example 26 with Universal

use of com.runwaysdk.system.gis.geo.Universal in project geoprism-registry by terraframe.

the class ServerHierarchyType method validateUniversalRelationship.

public void validateUniversalRelationship(ServerGeoObjectType childType, ServerGeoObjectType parentType) {
    // Total hack for super types
    Universal childUniversal = childType.getUniversal();
    Universal parentUniversal = parentType.getUniversal();
    List<Term> ancestors = childUniversal.getAllAncestors(this.getUniversalType()).getAll();
    if (!ancestors.contains(parentUniversal)) {
        ServerGeoObjectType superType = childType.getSuperType();
        if (superType != null) {
            ancestors = superType.getUniversal().getAllAncestors(this.getUniversalType()).getAll();
        }
    }
    if (!ancestors.contains(parentUniversal)) {
        InvalidGeoEntityUniversalException exception = new InvalidGeoEntityUniversalException();
        exception.setChildUniversal(childUniversal.getDisplayLabel().getValue());
        exception.setParentUniversal(parentUniversal.getDisplayLabel().getValue());
        exception.apply();
        throw exception;
    }
}
Also used : InvalidGeoEntityUniversalException(com.runwaysdk.system.gis.geo.InvalidGeoEntityUniversalException) Universal(com.runwaysdk.system.gis.geo.Universal) Term(com.runwaysdk.business.ontology.Term)

Aggregations

Universal (com.runwaysdk.system.gis.geo.Universal)26 ServerGeoObjectType (net.geoprism.registry.model.ServerGeoObjectType)8 QueryFactory (com.runwaysdk.query.QueryFactory)7 LinkedList (java.util.LinkedList)7 ServerGeoObjectTypeConverter (net.geoprism.registry.conversion.ServerGeoObjectTypeConverter)6 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)5 UniversalQuery (com.runwaysdk.system.gis.geo.UniversalQuery)5 JsonObject (com.google.gson.JsonObject)3 MdGraphClassDAOIF (com.runwaysdk.dataaccess.MdGraphClassDAOIF)3 MdGeoVertexDAO (com.runwaysdk.gis.dataaccess.metadata.graph.MdGeoVertexDAO)3 JsonArray (com.google.gson.JsonArray)2 Term (com.runwaysdk.business.ontology.Term)2 MdAttributeDAOIF (com.runwaysdk.dataaccess.MdAttributeDAOIF)2 ValueOverTime (com.runwaysdk.dataaccess.graph.attributes.ValueOverTime)2 MdAttributeTerm (com.runwaysdk.system.metadata.MdAttributeTerm)2 List (java.util.List)2 Organization (net.geoprism.registry.Organization)2 GeoObjectTypeMetadata (net.geoprism.registry.model.GeoObjectTypeMetadata)2 Term (org.commongeoregistry.adapter.Term)2 GeoObjectType (org.commongeoregistry.adapter.metadata.GeoObjectType)2