package eu.dnetlib.data.proto;

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

message StringField {

 	required string value = 1;
	optional DataInfo dataInfo = 2;
}

message BoolField {

 	required bool value = 1;
	optional DataInfo dataInfo = 2;
}

message IntField {

 	required int32 value = 1;
	optional DataInfo dataInfo = 2;
}

message StructuredProperty {

	required string value = 1;
	optional Qualifier qualifier = 2;
	optional DataInfo dataInfo = 3;
}

// Generic container for identified values, e.g:
//   <oaf:hostedBy name="Publications at Bielefeld University" id="opendoar::2294"/>
//   <oaf:collectedFrom name="Publications at Bielefeld University" id="opendoar::2294"/>
message KeyValue {

	required string key = 1;
	optional string value = 2;
	
	optional DataInfo dataInfo = 3;
}

message Qualifier {

	optional string classid = 1;
	optional string classname = 2;
	optional string schemeid = 3;
	optional string schemename = 4;
	
	optional DataInfo dataInfo = 5;
}

message DataInfo {

	optional bool invisible = 6 [default = false];
	optional bool inferred = 1;
	optional bool deletedbyinference = 2;
	optional string trust = 3;
	optional string inferenceprovenance = 4;

	required Qualifier provenanceaction = 5;
}

message OAIProvenance {

	optional OriginDescription originDescription = 1;

	message OriginDescription {
		
		optional string harvestDate = 1;
		optional bool altered = 2 [default = true];
		
		optional string baseURL = 3;
		optional string identifier = 4;
		optional string datestamp = 5;
		optional string metadataNamespace = 6;
		
		optional OriginDescription originDescription = 7;		
	}
}

message ExtraInfo {

	required string name = 1;
	required string typology = 2;
	required string provenance = 3;
	optional string trust = 4;
	
	// json containing a Citation or Statistics
	optional string value = 5;

}

message Author {

	required string fullname = 1;

	optional string name = 2;
	optional string surname = 3;

	required int32 rank = 4;

	repeated KeyValue pid = 5;
	repeated StringField affiliation = 6;
}
