example.asset/src/example/asset/lexicon/ExampleRelatedObsAsset.java
private void createAndSetRelatedObservations(Observation observation) throws ValidationFailedException
    {
        ObservationRef obsRefStatusChild = new ObservationRef();
        Observation childObs = createARelatedObservation("12346", ObservationSubTypeEnum.STATUS, 
                observation, RelationshipTypeEnum.PARENT);
        obsRefStatusChild.setUuid(childObs.getUuid());
        obsRefStatusChild.setRelationship(new Relationship(RelationshipTypeEnum.CHILD, 
                ""));
        
        ObservationRef obsRefAudioChild = new ObservationRef();
        Observation childObsAudio = createARelatedObservation("12347", ObservationSubTypeEnum.AUDIO_METADATA, 
                observation, RelationshipTypeEnum.PARENT);
        obsRefAudioChild.setUuid(childObsAudio.getUuid());
        obsRefAudioChild.setRelationship(new Relationship(RelationshipTypeEnum.CHILD, 
                "child uuid " + childObsAudio.getUuid().toString()));
        
        ObservationRef obsRefImageChild = new ObservationRef();
        Observation childObsImage = createARelatedObservation("12348", ObservationSubTypeEnum.IMAGE_METADATA, 
                observation, RelationshipTypeEnum.PARENT);
        obsRefImageChild.setUuid(childObsImage.getUuid());
        obsRefImageChild.setRelationship(new Relationship(RelationshipTypeEnum.CHILD, 
                "sub image"));
        
        ObservationRef obsRefVideoChild = new ObservationRef();
        Observation childObsVideo = createARelatedObservation("12349", ObservationSubTypeEnum.VIDEO_METADATA, 

                observation, RelationshipTypeEnum.PARENT);
        obsRefVideoChild.setUuid(childObsVideo.getUuid());
        obsRefVideoChild.setRelationship(new Relationship(RelationshipTypeEnum.CHILD, 
                "child uuid " + childObsVideo.getUuid().toString()));
        
        ObservationRef obsRefDetectionChild = new ObservationRef();
        Observation childObsDetection = createARelatedObservation("12350", ObservationSubTypeEnum.DETECTION, 
                observation, RelationshipTypeEnum.PARENT);
        obsRefDetectionChild.setUuid(childObsDetection.getUuid());
        obsRefDetectionChild.setRelationship(new Relationship(RelationshipTypeEnum.CHILD, 
                "child uuid " + childObsDetection.getUuid().toString()));
        
        ObservationRef obsRefOrientChild = new ObservationRef();
        Observation childObsOrient = createARelatedObservation("12351", null, 
                observation, RelationshipTypeEnum.PARENT);
        obsRefOrientChild.setUuid(childObsOrient.getUuid());
        obsRefOrientChild.setRelationship(new Relationship(RelationshipTypeEnum.CHILD, 
                "child uuid " + childObsOrient.getUuid().toString()));
        
        ObservationRef obsRefParent = new ObservationRef();
        Observation parentObs = createARelatedObservation("12352", ObservationSubTypeEnum.WEATHER, 
                observation, RelationshipTypeEnum.CHILD);
        obsRefParent.setUuid(parentObs.getUuid());
        obsRefParent.setRelationship(new Relationship(RelationshipTypeEnum.PARENT, 
                "parent uuid " + parentObs.getUuid().toString()));
        
        ObservationRef obsRefPeer = new ObservationRef();
        Observation peerObs = createARelatedObservation("12353", null, 
                observation, RelationshipTypeEnum.PEER);
        obsRefPeer.setUuid(peerObs.getUuid());
        obsRefPeer.setRelationship(new Relationship(RelationshipTypeEnum.PEER, "peer uuid " 
                + peerObs.getUuid().toString()));
        
        ObservationRef refNotFoundWithDesc = new ObservationRef();
        refNotFoundWithDesc.setRelationship(new Relationship(RelationshipTypeEnum.PEER, "sub image"));
        refNotFoundWithDesc.setUuid(UUID.randomUUID());
        
        ObservationRef refNotFoundNoDesc = new ObservationRef();
        refNotFoundNoDesc.setRelationship(new Relationship(RelationshipTypeEnum.PEER, null));
        refNotFoundNoDesc.setUuid(UUID.randomUUID());
        
        observation.withRelatedObservations(obsRefStatusChild, obsRefAudioChild, obsRefImageChild, 
                obsRefVideoChild, obsRefDetectionChild, obsRefOrientChild, 
                obsRefParent, obsRefPeer, refNotFoundWithDesc, refNotFoundNoDesc);
    }
/**
     * Creates and sets randomly generated related observations on the pased in observation.
     * @param observation
     *  the observation that requires related observations
     */
Creates and sets randomly generated related observations on the pased in observation.
@param observation
the observation that requires related observations
Creates and sets randomly generated related observations on the pased in observation . @param observation the observation that requires related observations
private void createAndSetRelatedObservations(Observation observation) throws ValidationFailedException
    {
        ObservationRef obsRefStatusChild = new ObservationRef();
        Observation childObs = createARelatedObservation("12346", ObservationSubTypeEnum.STATUS, 
                observation, RelationshipTypeEnum.PARENT);
        obsRefStatusChild.setUuid(childObs.getUuid());
        obsRefStatusChild.setRelationship(new Relationship(RelationshipTypeEnum.CHILD, 
                ""));
        ObservationRef obsRefAudioChild = new ObservationRef();
        Observation childObsAudio = createARelatedObservation("12347", ObservationSubTypeEnum.AUDIO_METADATA, 
                observation, RelationshipTypeEnum.PARENT);
        obsRefAudioChild.setUuid(childObsAudio.getUuid());
        obsRefAudioChild.setRelationship(new Relationship(RelationshipTypeEnum.CHILD, 
                "child uuid " + childObsAudio.getUuid().toString()));
        ObservationRef obsRefImageChild = new ObservationRef();
        Observation childObsImage = createARelatedObservation("12348", ObservationSubTypeEnum.IMAGE_METADATA, 
                observation, RelationshipTypeEnum.PARENT);
        obsRefImageChild.setUuid(childObsImage.getUuid());
        obsRefImageChild.setRelationship(new Relationship(RelationshipTypeEnum.CHILD, 
                "sub image"));
        ObservationRef obsRefVideoChild = new ObservationRef();
        Observation childObsVideo = createARelatedObservation("12349", ObservationSubTypeEnum.VIDEO_METADATA, 
                observation, RelationshipTypeEnum.PARENT);
        obsRefVideoChild.setUuid(childObsVideo.getUuid());
        obsRefVideoChild.setRelationship(new Relationship(RelationshipTypeEnum.CHILD, 
                "child uuid " + childObsVideo.getUuid().toString()));
        ObservationRef obsRefDetectionChild = new ObservationRef();
        Observation childObsDetection = createARelatedObservation("12350", ObservationSubTypeEnum.DETECTION, 
                observation, RelationshipTypeEnum.PARENT);
        obsRefDetectionChild.setUuid(childObsDetection.getUuid());
        obsRefDetectionChild.setRelationship(new Relationship(RelationshipTypeEnum.CHILD, 
                "child uuid " + childObsDetection.getUuid().toString()));
        ObservationRef obsRefOrientChild = new ObservationRef();
        Observation childObsOrient = createARelatedObservation("12351", null, 
                observation, RelationshipTypeEnum.PARENT);
        obsRefOrientChild.setUuid(childObsOrient.getUuid());
        obsRefOrientChild.setRelationship(new Relationship(RelationshipTypeEnum.CHILD, 
                "child uuid " + childObsOrient.getUuid().toString()));
        ObservationRef obsRefParent = new ObservationRef();
        Observation parentObs = createARelatedObservation("12352", ObservationSubTypeEnum.WEATHER, 
                observation, RelationshipTypeEnum.CHILD);
        obsRefParent.setUuid(parentObs.getUuid());
        obsRefParent.setRelationship(new Relationship(RelationshipTypeEnum.PARENT, 
                "parent uuid " + parentObs.getUuid().toString()));
        ObservationRef obsRefPeer = new ObservationRef();
        Observation peerObs = createARelatedObservation("12353", null, 
                observation, RelationshipTypeEnum.PEER);
        obsRefPeer.setUuid(peerObs.getUuid());
        obsRefPeer.setRelationship(new Relationship(RelationshipTypeEnum.PEER, "peer uuid " 
                + peerObs.getUuid().toString()));
        ObservationRef refNotFoundWithDesc = new ObservationRef();
        refNotFoundWithDesc.setRelationship(new Relationship(RelationshipTypeEnum.PEER, "sub image"));
        refNotFoundWithDesc.setUuid(UUID.randomUUID());
        ObservationRef refNotFoundNoDesc = new ObservationRef();
        refNotFoundNoDesc.setRelationship(new Relationship(RelationshipTypeEnum.PEER, null));
        refNotFoundNoDesc.setUuid(UUID.randomUUID());
        observation.withRelatedObservations(obsRefStatusChild, obsRefAudioChild, obsRefImageChild, 
                obsRefVideoChild, obsRefDetectionChild, obsRefOrientChild, 
                obsRefParent, obsRefPeer, refNotFoundWithDesc, refNotFoundNoDesc);
    }
private void createAndSetRelatedObservations ( Observation observation ) throws ValidationFailedException { ObservationRef obsRefStatusChild = new ObservationRef ( ) ; Observation childObs = createARelatedObservation ( "12346" , ObservationSubTypeEnum . STATUS , observation , RelationshipTypeEnum . PARENT ) ; obsRefStatusChild . setUuid ( childObs . getUuid ( ) ) ; obsRefStatusChild . setRelationship ( new Relationship ( RelationshipTypeEnum . CHILD , "" ) ) ; ObservationRef obsRefAudioChild = new ObservationRef ( ) ; Observation childObsAudio = createARelatedObservation ( "12347" , ObservationSubTypeEnum . AUDIO_METADATA , observation , RelationshipTypeEnum . PARENT ) ; obsRefAudioChild . setUuid ( childObsAudio . getUuid ( ) ) ; obsRefAudioChild . setRelationship ( new Relationship ( RelationshipTypeEnum . CHILD , "child uuid " + childObsAudio . getUuid ( ) . toString ( ) ) ) ; ObservationRef obsRefImageChild = new ObservationRef ( ) ; Observation childObsImage = createARelatedObservation ( "12348" , ObservationSubTypeEnum . IMAGE_METADATA , observation , RelationshipTypeEnum . PARENT ) ; obsRefImageChild . setUuid ( childObsImage . getUuid ( ) ) ; obsRefImageChild . setRelationship ( new Relationship ( RelationshipTypeEnum . CHILD , "sub image" ) ) ; ObservationRef obsRefVideoChild = new ObservationRef ( ) ; Observation childObsVideo = createARelatedObservation ( "12349" , ObservationSubTypeEnum . VIDEO_METADATA , observation , RelationshipTypeEnum . PARENT ) ; obsRefVideoChild . setUuid ( childObsVideo . getUuid ( ) ) ; obsRefVideoChild . setRelationship ( new Relationship ( RelationshipTypeEnum . CHILD , "child uuid " + childObsVideo . getUuid ( ) . toString ( ) ) ) ; ObservationRef obsRefDetectionChild = new ObservationRef ( ) ; Observation childObsDetection = createARelatedObservation ( "12350" , ObservationSubTypeEnum . DETECTION , observation , RelationshipTypeEnum . PARENT ) ; obsRefDetectionChild . setUuid ( childObsDetection . getUuid ( ) ) ; obsRefDetectionChild . setRelationship ( new Relationship ( RelationshipTypeEnum . CHILD , "child uuid " + childObsDetection . getUuid ( ) . toString ( ) ) ) ; ObservationRef obsRefOrientChild = new ObservationRef ( ) ; Observation childObsOrient = createARelatedObservation ( "12351" , null , observation , RelationshipTypeEnum . PARENT ) ; obsRefOrientChild . setUuid ( childObsOrient . getUuid ( ) ) ; obsRefOrientChild . setRelationship ( new Relationship ( RelationshipTypeEnum . CHILD , "child uuid " + childObsOrient . getUuid ( ) . toString ( ) ) ) ; ObservationRef obsRefParent = new ObservationRef ( ) ; Observation parentObs = createARelatedObservation ( "12352" , ObservationSubTypeEnum . WEATHER , observation , RelationshipTypeEnum . CHILD ) ; obsRefParent . setUuid ( parentObs . getUuid ( ) ) ; obsRefParent . setRelationship ( new Relationship ( RelationshipTypeEnum . PARENT , "parent uuid " + parentObs . getUuid ( ) . toString ( ) ) ) ; ObservationRef obsRefPeer = new ObservationRef ( ) ; Observation peerObs = createARelatedObservation ( "12353" , null , observation , RelationshipTypeEnum . PEER ) ; obsRefPeer . setUuid ( peerObs . getUuid ( ) ) ; obsRefPeer . setRelationship ( new Relationship ( RelationshipTypeEnum . PEER , "peer uuid " + peerObs . getUuid ( ) . toString ( ) ) ) ; ObservationRef refNotFoundWithDesc = new ObservationRef ( ) ; refNotFoundWithDesc . setRelationship ( new Relationship ( RelationshipTypeEnum . PEER , "sub image" ) ) ; refNotFoundWithDesc . setUuid ( UUID . randomUUID ( ) ) ; ObservationRef refNotFoundNoDesc = new ObservationRef ( ) ; refNotFoundNoDesc . setRelationship ( new Relationship ( RelationshipTypeEnum . PEER , null ) ) ; refNotFoundNoDesc . setUuid ( UUID . randomUUID ( ) ) ; observation . withRelatedObservations ( obsRefStatusChild , obsRefAudioChild , obsRefImageChild , obsRefVideoChild , obsRefDetectionChild , obsRefOrientChild , obsRefParent , obsRefPeer , refNotFoundWithDesc , refNotFoundNoDesc ) ; }
Creates and sets randomly generated related observations on the pased in observation.
Creates and sets randomly generated related observations on the pased in observation .