package eu.dnetlib.data.proto;

import "RelMetadata.proto";
import "Dedup.proto";
import "DedupSimilarity.proto";

option java_package = "eu.dnetlib.data.proto";
option java_outer_classname = "ResultResultProtos";

message ResultResult {

	//choice of the possible subtypes
	optional Similarity similarity = 2;
	optional PublicationDataset publicationDataset = 3;
 	optional Dedup dedup = 4;
  	optional DedupSimilarity dedupSimilarity = 5;

  	optional Supplement supplement = 6;
  	optional Part part = 7;

	optional Relationship relationship = 8;

	optional SoftwareSoftware softwareSoftware = 9;
	
	message Similarity {
	
		enum RelName {
			isAmongTopNSimilarDocuments = 1;
			hasAmongTopNSimilarDocuments = 2;
		}	

		required RelMetadata relMetadata = 1;
		
		// level of similarity: coefficient from [0, 1] range,
		// the greater the number, the more similar the documents
    	optional float similarity = 2;

    	enum Type {
			STANDARD = 1;
			WEBUSAGE = 2;
    	}

		// similarity type
    	optional Type type = 3 [default = STANDARD];		
	}

	message PublicationDataset {
	
		enum RelName {
			isRelatedTo = 1;
		}		
	
		required RelMetadata relMetadata = 1;
	}

	message Supplement {

        enum RelName {
            isSupplementTo = 1;
            isSupplementedBy = 2;
        }

        required RelMetadata relMetadata = 1;
    }

	message Part {

        enum RelName {
            isPartOf = 1;
            hasPart = 2;
        }

        required RelMetadata relMetadata = 1;
    }

	message SoftwareSoftware {

		enum RelName {
			isVersionOf = 1;
		}

		required RelMetadata relMetadata = 1;
	}

	message Relationship {

		enum RelName {
			isRelatedTo = 1;
		}

		required RelMetadata relMetadata = 1;
	}
	
}
