This commit is contained in:
Miriam Baglioni 2024-01-18 11:18:53 +01:00
parent 5dcb7019a5
commit 3ad0d6edfc
15 changed files with 1174 additions and 1018 deletions

1
.gitignore vendored
View File

@ -30,3 +30,4 @@ spark-warehouse
/job.properties
/*/job.properties
/*/*/job.properties
/*/*/*/job.properties

View File

@ -6,11 +6,11 @@
"properties": {
"key": {
"type": "string",
"description" : "the OpenAIRE identifier of the data source"
"description": "Description of key"
},
"value": {
"type": "string",
"description" : "the name of the data source"
"description": "Description of value"
}
}
},
@ -18,10 +18,12 @@
"type": "object",
"properties": {
"provenance": {
"type" : "string"
"type": "string",
"description": "Description of provenance"
},
"trust": {
"type" : "string"
"type": "string",
"description": "Description of trust"
}
}
},
@ -30,11 +32,11 @@
"properties": {
"scheme": {
"type": "string",
"description" : "The scheme of the persistent identifier for the result (i.e. doi). If the pid is here it means the information for the pid has been collected from an authority for that pid type (i.e. Crossref/Datacite for doi). The set of authoritative pid is: doi when collected from Crossref or Datacite pmid when collected from EuroPubmed, arxiv when collected from arXiv, handle from the repositories"
"description": "Description of scheme"
},
"value": {
"type": "string",
"description" : "The value expressed in the scheme (i.e. 10.1000/182)"
"description": "Description of value"
}
}
}
@ -42,15 +44,18 @@
"type": "object",
"properties": {
"author": {
"description": "Description of author",
"type": "array",
"items": {
"type": "object",
"properties": {
"fullname": {
"type" : "string"
"type": "string",
"description": "Description of fullname"
},
"name": {
"type" : "string"
"type": "string",
"description": "Description of name"
},
"pid": {
"type": "object",
@ -60,31 +65,34 @@
"properties": {
"scheme": {
"type": "string",
"description" : "The author's pid scheme. OpenAIRE currently supports 'ORCID'"
"description": "Description of scheme"
},
"value": {
"type": "string",
"description" : "The author's pid value in that scheme (i.e. 0000-1111-2222-3333)"
}
"description": "Description of value"
}
},
"description": "Description of id"
},
"provenance": {
"allOf" : [ {
"$ref" : "#/definitions/Provenance"
}, {
"description" : "The reason why the pid was associated to the author"
} ]
"allOf": [
{"$ref": "#/definitions/Provenance"},
{"description": "Description of provenance"}
]
}
},
"description" : "The author's persistent identifiers"
"description": "Description of pid"
},
"rank": {
"type" : "integer"
"type": "integer",
"description": "Description of rank"
},
"surname": {
"type" : "string"
}
"type": "string",
"description": "Description of surname"
}
},
"description": "Description of author"
}
},
"bestaccessright": {
@ -92,253 +100,269 @@
"properties": {
"code": {
"type": "string",
"description" : "COAR access mode code: http://vocabularies.coar-repositories.org/documentation/access_rights/"
"description": "Description of code"
},
"label": {
"type": "string",
"description" : "Label for the access mode"
"description": "Description of label"
},
"scheme": {
"type": "string",
"description" : "Scheme of reference for access right code. Always set to COAR access rights vocabulary: http://vocabularies.coar-repositories.org/documentation/access_rights/"
"description": "Description of scheme"
}
},
"description" : "The openest of the access rights of this result."
"description": "Description of bestaccessright"
},
"codeRepositoryUrl": {
"type": "string",
"description" : "Only for results with type 'software': the URL to the repository with the source code"
"description": "Description of codeRepositoryUrl"
},
"collectedfrom": {
"description" : "Information about the sources from which the record has been collected",
"description": "Description of collectedfrom",
"type": "array",
"items": {
"allOf" : [ {
"$ref" : "#/definitions/CfHbKeyValue"
}, {
"description" : "Information about the sources from which the record has been collected"
} ]
"allOf": [
{"$ref": "#/definitions/CfHbKeyValue"},
{"description": "Description of collectedfrom"}
]
}
},
"contactgroup": {
"description" : "Only for results with type 'software': Information on the group responsible for providing further information regarding the resource",
"description": "Description of contactgroup",
"type": "array",
"items": {
"type": "string",
"description" : "Only for results with type 'software': Information on the group responsible for providing further information regarding the resource"
"description": "Description of contactgroup"
}
},
"contactperson": {
"description" : "Only for results with type 'software': Information on the person responsible for providing further information regarding the resource",
"description": "Description of contactperson",
"type": "array",
"items": {
"type": "string",
"description" : "Only for results with type 'software': Information on the person responsible for providing further information regarding the resource"
"description": "Description of contactperson"
}
},
"container": {
"type": "object",
"properties": {
"conferencedate": {
"type" : "string"
"type": "string",
"description": "Description of conferencedate"
},
"conferenceplace": {
"type" : "string"
"type": "string",
"description": "Description of conferenceplace"
},
"edition": {
"type": "string",
"description" : "Edition of the journal or conference proceeding"
"description": "Description of edition"
},
"ep": {
"type": "string",
"description" : "End page"
"description": "Description of ep"
},
"iss": {
"type": "string",
"description" : "Journal issue number"
"description": "Description of iss"
},
"issnLinking": {
"type" : "string"
"type": "string",
"description": "Description of issnLinking"
},
"issnOnline": {
"type" : "string"
"type": "string",
"description": "Description of issnOnline"
},
"issnPrinted": {
"type" : "string"
"type": "string",
"description": "Description of issnPrinted"
},
"name": {
"type": "string",
"description" : "Name of the journal or conference"
"description": "Description of name"
},
"sp": {
"type": "string",
"description" : "Start page"
"description": "Description of sp"
},
"vol": {
"type": "string",
"description" : "Volume"
"description": "Description of vol"
}
},
"description" : "Container has information about the conference or journal where the result has been presented or published"
"description": "Description of container"
},
"context": {
"description" : "Reference to a relevant research infrastructure, initiative or community (RI/RC) among those collaborating with OpenAIRE. Please see https://connect.openaire.eu",
"description": "Description of context",
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description" : "Code identifying the RI/RC"
"description": "Description of code"
},
"label": {
"type": "string",
"description" : "Label of the RI/RC"
"description": "Description of label"
},
"provenance": {
"description" : "Why this result is associated to the RI/RC.",
"description": "Description of provenance",
"type": "array",
"items": {
"allOf" : [ {
"$ref" : "#/definitions/Provenance"
}, {
"description" : "Why this result is associated to the RI/RC."
} ]
"allOf": [
{"$ref": "#/definitions/Provenance"},
{"description": "Description of provenance"}
]
}
}
},
"description" : "Reference to a relevant research infrastructure, initiative or community (RI/RC) among those collaborating with OpenAIRE. Please see https://connect.openaire.eu"
"description": "Description of context"
}
},
"contributor": {
"description" : "Contributors for the result",
"description": "Description of contributor",
"type": "array",
"items": {
"type": "string",
"description" : "Contributors for the result"
"description": "Description of contributor"
}
},
"country": {
"description" : "The list of countries associated to this result",
"description": "Description of country",
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description" : "ISO 3166-1 alpha-2 country code (i.e. IT)"
"description": "Description of code"
},
"label": {
"type": "string",
"description" : "The label for that code (i.e. Italy)"
"description": "Description of label"
},
"provenance": {
"allOf" : [ {
"$ref" : "#/definitions/Provenance"
}, {
"description" : "Why this result is associated to the country."
} ]
"allOf": [
{"$ref": "#/definitions/Provenance"},
{"description": "Description of provenance"}
]
}
},
"description" : "The list of countries associated to this result"
"description": "Description of country"
}
},
"coverage": {
"description": "Description of coverage",
"type": "array",
"items": {
"type" : "string"
"type": "string",
"description": "Description of coverage"
}
},
"dateofcollection": {
"type": "string",
"description" : "When OpenAIRE collected the record the last time"
"description": "Description of dateofcollection"
},
"description": {
"type" : "array",
"items" : {
"type" : "string"
}
},
"documentationUrl" : {
"description" : "Only for results with type 'software': URL to the software documentation",
"description": "Description of description",
"type": "array",
"items": {
"type": "string",
"description" : "Only for results with type 'software': URL to the software documentation"
"description": "Description of description"
}
},
"documentationUrl": {
"description": "Description of documentationUrl",
"type": "array",
"items": {
"type": "string",
"description": "Description of documentationUrl"
}
},
"embargoenddate": {
"type": "string",
"description" : "Date when the embargo ends and this result turns Open Access"
"description": "Description of embargoenddate"
},
"format": {
"description": "Description of format",
"type": "array",
"items": {
"type" : "string"
"type": "string",
"description": "Description of format"
}
},
"geolocation": {
"description" : "Geolocation information",
"description": "Description of geolocation",
"type": "array",
"items": {
"type": "object",
"properties": {
"box": {
"type" : "string"
"type": "string",
"description": "Description of box"
},
"place": {
"type" : "string"
"type": "string",
"description": "Description of place"
},
"point": {
"type" : "string"
"type": "string",
"description": "Description of point"
}
},
"description" : "Geolocation information"
"description": "Description of geolocation"
}
},
"id": {
"type": "string",
"description" : "The OpenAIRE identifiers for this result"
"description": "Description of id"
},
"indicators": {
"type": "object",
"properties": {
"bipIndicators": {
"description" : "The impact measures (i.e. popularity)",
"description": "Description of bipIndicators",
"type": "array",
"items": {
"type": "object",
"properties": {
"clazz": {
"type" : "string"
"type": "string",
"description": "Description of clazz"
},
"indicator": {
"type" : "string"
"type": "string",
"description": "Description of indicator"
},
"score": {
"type" : "string"
"type": "string",
"description": "Description of score"
}
},
"description" : "The impact measures (i.e. popularity)"
"description": "Description of bipIndicators"
}
},
"usageCounts": {
"type": "object",
"properties": {
"downloads": {
"type" : "string"
"type": "string",
"description": "Description of downloads"
},
"views": {
"type" : "string"
"type": "string",
"description": "Description of views"
}
},
"description" : "The usage counts (i.e. downloads)"
"description": "Description of usageCounts"
}
},
"description" : "Indicators computed for this result, for example UsageCount ones"
"description": "Description of indicators"
},
"instance": {
"description" : "Each instance is one specific materialisation or version of the result. For example, you can have one result with three instance: one is the pre-print, one is the post-print, one is te published version",
"description": "Description of instance",
"type": "array",
"items": {
"type": "object",
@ -348,274 +372,313 @@
"properties": {
"code": {
"type": "string",
"description" : "COAR access mode code: http://vocabularies.coar-repositories.org/documentation/access_rights/"
"description": "Description of code"
},
"label": {
"type": "string",
"description" : "Label for the access mode"
"description": "Description of label"
},
"openAccessRoute": {
"type": "string",
"enum" : [ "gold", "green", "hybrid", "bronze" ]
"enum": [
"gold",
"green",
"hybrid",
"bronze"
],
"description": "Description of openAccessRoute"
},
"scheme": {
"type": "string",
"description" : "Scheme of reference for access right code. Always set to COAR access rights vocabulary: http://vocabularies.coar-repositories.org/documentation/access_rights/"
"description": "Description of scheme"
}
},
"description" : "The accessRights for this materialization of the result"
"description": "Description of accessright"
},
"alternateIdentifier": {
"description" : "All the identifiers other than pids forged by an authorithy for the pid type (i.e. Crossref for DOIs",
"description": "Description of alternateIdentifier",
"type": "array",
"items": {
"type": "object",
"properties": {
"scheme": {
"type": "string",
"description" : "The scheme of the identifier. It can be a persistent identifier (i.e. doi). If it is present in the alternate identifiers it means it has not been forged by an authority for that pid. For example we collect metadata from an institutional repository that provides as identifier for the result also the doi"
"description": "Description of scheme"
},
"value": {
"type": "string",
"description" : "The value expressed in the scheme"
"description": "Description of value"
}
},
"description" : "All the identifiers other than pids forged by an authorithy for the pid type (i.e. Crossref for DOIs"
"description": "Description of alternateIdentifier"
}
},
"articleprocessingcharge": {
"type": "object",
"properties": {
"amount": {
"type" : "string"
"type": "string",
"description": "Description of amount"
},
"currency": {
"type" : "string"
"type": "string",
"description": "Description of currency"
}
},
"description" : "The money spent to make this book or article available in Open Access. Source for this information is the OpenAPC initiative."
"description": "Description of articleprocessingcharge"
},
"collectedfrom": {
"allOf" : [ {
"$ref" : "#/definitions/CfHbKeyValue"
}, {
"description" : "Information about the source from which the record has been collected"
} ]
"allOf": [
{"$ref": "#/definitions/CfHbKeyValue"},
{"description": "Description of collectedfrom"}
]
},
"hostedby": {
"allOf" : [ {
"$ref" : "#/definitions/CfHbKeyValue"
}, {
"description" : "Information about the source from which the instance can be viewed or downloaded."
} ]
"allOf": [
{"$ref": "#/definitions/CfHbKeyValue"},
{"description": "Description of hostedby"}
]
},
"license": {
"type" : "string"
"type": "string",
"description": "Description of license"
},
"pid": {
"description": "Description of pid",
"type": "array",
"items": {
"$ref" : "#/definitions/ResultPid"
"allOf": [
{"$ref": "#/definitions/ResultPid"},
{"description": "Description of pid"}
]
}
},
"publicationdate": {
"type": "string",
"description" : "Date of the research product"
"description": "Description of publicationdate"
},
"refereed": {
"type": "string",
"description" : "If this instance has been peer-reviewed or not. Allowed values are peerReviewed, nonPeerReviewed, UNKNOWN (as defined in https://api.openaire.eu/vocabularies/dnet:review_levels)"
"description": "Description of refereed"
},
"type": {
"type": "string",
"description" : "The specific sub-type of this instance (see https://api.openaire.eu/vocabularies/dnet:result_typologies following the links)"
"description": "Description of type"
},
"url": {
"description" : "URLs to the instance. They may link to the actual full-text or to the landing page at the hosting source. ",
"description": "Description of url",
"type": "array",
"items": {
"type": "string",
"description" : "URLs to the instance. They may link to the actual full-text or to the landing page at the hosting source. "
"description": "Description of url"
}
}
},
"description" : "Each instance is one specific materialisation or version of the result. For example, you can have one result with three instance: one is the pre-print, one is the post-print, one is te published version"
"description": "Description of instance"
}
},
"isGreen": {
"type": "boolean",
"description": "Description of isGreen"
},
"isInDiamondJournal": {
"type": "boolean",
"description": "Description of isInDiamondJournal"
},
"language": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description" : "alpha-3/ISO 639-2 code of the language"
"description": "Description of code"
},
"label": {
"type": "string",
"description" : "Language label in English"
}
"description": "Description of label"
}
},
"description": "Description of language"
},
"lastupdatetimestamp": {
"type": "integer",
"description" : "Timestamp of last update of the record in OpenAIRE"
"description": "Description of lastupdatetimestamp"
},
"maintitle": {
"type": "string",
"description" : "A name or title by which a scientific result is known. May be the title of a publication, of a dataset or the name of a piece of software."
"description": "Description of maintitle"
},
"openAccessColor": {
"type": "string",
"enum": [
"gold",
"hybrid",
"bronze"
],
"description": "Description of openAccessColor"
},
"originalId": {
"description" : "Identifiers of the record at the original sources",
"description": "Description of originalId",
"type": "array",
"items": {
"type": "string",
"description" : "Identifiers of the record at the original sources"
"description": "Description of originalId"
}
},
"pid": {
"description" : "Persistent identifiers of the result",
"description": "Description of pid",
"type": "array",
"items": {
"allOf" : [ {
"$ref" : "#/definitions/ResultPid"
}, {
"description" : "Persistent identifiers of the result"
} ]
"allOf": [
{"$ref": "#/definitions/ResultPid"},
{"description": "Description of pid"}
]
}
},
"programmingLanguage": {
"type": "string",
"description" : "Only for results with type 'software': the programming language"
"description": "Description of programmingLanguage"
},
"projects": {
"description" : "List of projects (i.e. grants) that (co-)funded the production ofn the research results",
"description": "Description of projects",
"type": "array",
"items": {
"type": "object",
"properties": {
"acronym": {
"type": "string",
"description" : "The acronym of the project"
"description": "Description of acronym"
},
"code": {
"type": "string",
"description" : "The grant agreement number"
"description": "Description of code"
},
"funder": {
"type": "object",
"properties": {
"fundingStream": {
"type": "string",
"description" : "Stream of funding (e.g. for European Commission can be H2020 or FP7)"
"description": "Description of fundingStream"
},
"jurisdiction": {
"type": "string",
"description" : "Geographical jurisdiction (e.g. for European Commission is EU, for Croatian Science Foundation is HR)"
"description": "Description of jurisdiction"
},
"name": {
"type": "string",
"description" : "The name of the funder (European Commission)"
"description": "Description of name"
},
"shortName": {
"type": "string",
"description" : "The short name of the funder (EC)"
"description": "Description of shortName"
}
},
"description" : "Information about the funder funding the project"
"description": "Description of funder"
},
"id": {
"type": "string",
"description" : "The OpenAIRE id for the project"
"description": "Description of id"
},
"provenance": {
"$ref" : "#/definitions/Provenance"
"allOf": [
{"$ref": "#/definitions/Provenance"},
{"description": "Description of provenance"}
]
},
"title": {
"type" : "string"
"type": "string",
"description": "Description of title"
},
"validated": {
"type": "object",
"properties": {
"validatedByFunder": {
"type" : "boolean"
"type": "boolean",
"description": "Description of validatedByFunder"
},
"validationDate": {
"type" : "string"
}
}
"type": "string",
"description": "Description of validationDate"
}
},
"description" : "List of projects (i.e. grants) that (co-)funded the production ofn the research results"
"description": "Description of validated"
}
},
"description": "Description of projects"
}
},
"publicationdate": {
"type": "string",
"description" : "Main date of the research product: typically the publication or issued date. In case of a research result with different versions with different dates, the date of the result is selected as the most frequent well-formatted date. If not available, then the most recent and complete date among those that are well-formatted. For statistics, the year is extracted and the result is counted only among the result of that year. Example: Pre-print date: 2019-02-03, Article date provided by repository: 2020-02, Article date provided by Crossref: 2020, OpenAIRE will set as date 2019-02-03, because its the most recent among the complete and well-formed dates. If then the repository updates the metadata and set a complete date (e.g. 2020-02-12), then this will be the new date for the result because it becomes the most recent most complete date. However, if OpenAIRE then collects the pre-print from another repository with date 2019-02-03, then this will be the “winning date” because it becomes the most frequent well-formatted date."
"description": "Description of publicationdate"
},
"publiclyFunded": {
"type": "boolean",
"description": "Description of publiclyFunded"
},
"publisher": {
"type": "string",
"description" : "The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource."
"description": "Description of publisher"
},
"size": {
"type": "string",
"description" : "Only for results with type 'dataset': the declared size of the dataset"
"description": "Description of size"
},
"source": {
"description" : "See definition of Dublin Core field dc:source",
"description": "Description of source",
"type": "array",
"items": {
"type": "string",
"description" : "See definition of Dublin Core field dc:source"
"description": "Description of source"
}
},
"subjects": {
"description" : "Keywords associated to the result",
"description": "Description of subjects",
"type": "array",
"items": {
"type": "object",
"properties": {
"provenance": {
"allOf" : [ {
"$ref" : "#/definitions/Provenance"
}, {
"description" : "Why this subject is associated to the result"
} ]
"allOf": [
{"$ref": "#/definitions/Provenance"},
{"description": "Description of provenance"}
]
},
"subject": {
"type": "object",
"properties": {
"scheme": {
"type": "string",
"description" : "OpenAIRE subject classification scheme (https://api.openaire.eu/vocabularies/dnet:subject_classification_typologies)."
"description": "Description of scheme"
},
"value": {
"type": "string",
"description" : "The value for the subject in the selected scheme. When the scheme is 'keyword', it means that the subject is free-text (i.e. not a term from a controlled vocabulary)."
}
}
"description": "Description of value"
}
},
"description" : "Keywords associated to the result"
"description": "Description of subject"
}
},
"description": "Description of subjects"
}
},
"subtitle": {
"type": "string",
"description" : "Explanatory or alternative name by which a scientific result is known."
"description": "Description of subtitle"
},
"tool": {
"description" : "Only for results with type 'other': tool useful for the interpretation and/or re-used of the research product",
"description": "Description of tool",
"type": "array",
"items": {
"type": "string",
"description" : "Only for results with type 'other': tool useful for the interpretation and/or re-used of the research product"
"description": "Description of tool"
}
},
"type": {
"type": "string",
"description" : "Type of the result: one of 'publication', 'dataset', 'software', 'other' (see also https://api.openaire.eu/vocabularies/dnet:result_typologies)"
"description": "Description of type"
},
"version": {
"type": "string",
"description" : "Version of the result"
"description": "Description of version"
}
}
}

View File

@ -5,10 +5,12 @@
"type": "object",
"properties": {
"provenance": {
"type" : "string"
"type": "string",
"description": "Description of provenance"
},
"trust": {
"type" : "string"
"type": "string",
"description": "Description of trust"
}
}
},
@ -17,11 +19,11 @@
"properties": {
"scheme": {
"type": "string",
"description" : "The scheme of the persistent identifier for the result (i.e. doi). If the pid is here it means the information for the pid has been collected from an authority for that pid type (i.e. Crossref/Datacite for doi). The set of authoritative pid is: doi when collected from Crossref or Datacite pmid when collected from EuroPubmed, arxiv when collected from arXiv, handle from the repositories"
"description": "Description of scheme"
},
"value": {
"type": "string",
"description" : "The value expressed in the scheme (i.e. 10.1000/182)"
"description": "Description of value"
}
}
}
@ -29,15 +31,18 @@
"type": "object",
"properties": {
"author": {
"description": "Description of author",
"type": "array",
"items": {
"type": "object",
"properties": {
"fullname": {
"type" : "string"
"type": "string",
"description": "Description of fullname"
},
"name": {
"type" : "string"
"type": "string",
"description": "Description of name"
},
"pid": {
"type": "object",
@ -47,31 +52,34 @@
"properties": {
"scheme": {
"type": "string",
"description" : "The author's pid scheme. OpenAIRE currently supports 'ORCID'"
"description": "Description of scheme"
},
"value": {
"type": "string",
"description" : "The author's pid value in that scheme (i.e. 0000-1111-2222-3333)"
}
"description": "Description of value"
}
},
"description": "Description of id"
},
"provenance": {
"allOf" : [ {
"$ref" : "#/definitions/Provenance"
}, {
"description" : "The reason why the pid was associated to the author"
} ]
"allOf": [
{"$ref": "#/definitions/Provenance"},
{"description": "Description of provenance"}
]
}
},
"description" : "The author's persistent identifiers"
"description": "Description of pid"
},
"rank": {
"type" : "integer"
"type": "integer",
"description": "Description of rank"
},
"surname": {
"type" : "string"
}
"type": "string",
"description": "Description of surname"
}
},
"description": "Description of author"
}
},
"bestaccessright": {
@ -79,213 +87,231 @@
"properties": {
"code": {
"type": "string",
"description" : "COAR access mode code: http://vocabularies.coar-repositories.org/documentation/access_rights/"
"description": "Description of code"
},
"label": {
"type": "string",
"description" : "Label for the access mode"
"description": "Description of label"
},
"scheme": {
"type": "string",
"description" : "Scheme of reference for access right code. Always set to COAR access rights vocabulary: http://vocabularies.coar-repositories.org/documentation/access_rights/"
"description": "Description of scheme"
}
},
"description" : "The openest of the access rights of this result."
"description": "Description of bestaccessright"
},
"codeRepositoryUrl": {
"type": "string",
"description" : "Only for results with type 'software': the URL to the repository with the source code"
"description": "Description of codeRepositoryUrl"
},
"contactgroup": {
"description" : "Only for results with type 'software': Information on the group responsible for providing further information regarding the resource",
"description": "Description of contactgroup",
"type": "array",
"items": {
"type": "string",
"description" : "Only for results with type 'software': Information on the group responsible for providing further information regarding the resource"
"description": "Description of contactgroup"
}
},
"contactperson": {
"description" : "Only for results with type 'software': Information on the person responsible for providing further information regarding the resource",
"description": "Description of contactperson",
"type": "array",
"items": {
"type": "string",
"description" : "Only for results with type 'software': Information on the person responsible for providing further information regarding the resource"
"description": "Description of contactperson"
}
},
"container": {
"type": "object",
"properties": {
"conferencedate": {
"type" : "string"
"type": "string",
"description": "Description of conferencedate"
},
"conferenceplace": {
"type" : "string"
"type": "string",
"description": "Description of conferenceplace"
},
"edition": {
"type": "string",
"description" : "Edition of the journal or conference proceeding"
"description": "Description of edition"
},
"ep": {
"type": "string",
"description" : "End page"
"description": "Description of ep"
},
"iss": {
"type": "string",
"description" : "Journal issue number"
"description": "Description of iss"
},
"issnLinking": {
"type" : "string"
"type": "string",
"description": "Description of issnLinking"
},
"issnOnline": {
"type" : "string"
"type": "string",
"description": "Description of issnOnline"
},
"issnPrinted": {
"type" : "string"
"type": "string",
"description": "Description of issnPrinted"
},
"name": {
"type": "string",
"description" : "Name of the journal or conference"
"description": "Description of name"
},
"sp": {
"type": "string",
"description" : "Start page"
"description": "Description of sp"
},
"vol": {
"type": "string",
"description" : "Volume"
"description": "Description of vol"
}
},
"description" : "Container has information about the conference or journal where the result has been presented or published"
"description": "Description of container"
},
"contributor": {
"description" : "Contributors for the result",
"description": "Description of contributor",
"type": "array",
"items": {
"type": "string",
"description" : "Contributors for the result"
"description": "Description of contributor"
}
},
"country": {
"description" : "The list of countries associated to this result",
"description": "Description of country",
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description" : "ISO 3166-1 alpha-2 country code (i.e. IT)"
"description": "Description of code"
},
"label": {
"type": "string",
"description" : "The label for that code (i.e. Italy)"
"description": "Description of label"
},
"provenance": {
"allOf" : [ {
"$ref" : "#/definitions/Provenance"
}, {
"description" : "Why this result is associated to the country."
} ]
"allOf": [
{"$ref": "#/definitions/Provenance"},
{"description": "Description of provenance"}
]
}
},
"description" : "The list of countries associated to this result"
"description": "Description of country"
}
},
"coverage": {
"description": "Description of coverage",
"type": "array",
"items": {
"type" : "string"
"type": "string",
"description": "Description of coverage"
}
},
"dateofcollection": {
"type": "string",
"description" : "When OpenAIRE collected the record the last time"
"description": "Description of dateofcollection"
},
"description": {
"type" : "array",
"items" : {
"type" : "string"
}
},
"documentationUrl" : {
"description" : "Only for results with type 'software': URL to the software documentation",
"description": "Description of description",
"type": "array",
"items": {
"type": "string",
"description" : "Only for results with type 'software': URL to the software documentation"
"description": "Description of description"
}
},
"documentationUrl": {
"description": "Description of documentationUrl",
"type": "array",
"items": {
"type": "string",
"description": "Description of documentationUrl"
}
},
"embargoenddate": {
"type": "string",
"description" : "Date when the embargo ends and this result turns Open Access"
"description": "Description of embargoenddate"
},
"format": {
"description": "Description of format",
"type": "array",
"items": {
"type" : "string"
"type": "string",
"description": "Description of format"
}
},
"geolocation": {
"description" : "Geolocation information",
"description": "Description of geolocation",
"type": "array",
"items": {
"type": "object",
"properties": {
"box": {
"type" : "string"
"type": "string",
"description": "Description of box"
},
"place": {
"type" : "string"
"type": "string",
"description": "Description of place"
},
"point": {
"type" : "string"
"type": "string",
"description": "Description of point"
}
},
"description" : "Geolocation information"
"description": "Description of geolocation"
}
},
"id": {
"type": "string",
"description" : "The OpenAIRE identifiers for this result"
"description": "Description of id"
},
"indicators": {
"type": "object",
"properties": {
"bipIndicators": {
"description" : "The impact measures (i.e. popularity)",
"description": "Description of bipIndicators",
"type": "array",
"items": {
"type": "object",
"properties": {
"class" : {
"type" : "string"
"clazz": {
"type": "string",
"description": "Description of clazz"
},
"indicator": {
"type" : "string"
"type": "string",
"description": "Description of indicator"
},
"score": {
"type" : "string"
"type": "string",
"description": "Description of score"
}
},
"description" : "The impact measures (i.e. popularity)"
"description": "Description of bipIndicators"
}
},
"usageCounts": {
"type": "object",
"properties": {
"downloads": {
"type" : "string"
"type": "string",
"description": "Description of downloads"
},
"views": {
"type" : "string"
"type": "string",
"description": "Description of views"
}
},
"description" : "The usage counts (i.e. downloads)"
"description": "Description of usageCounts"
}
},
"description" : "Indicators computed for this result, for example UsageCount ones"
"description": "Description of indicators"
},
"instance": {
"description" : "Each instance is one specific materialisation or version of the result. For example, you can have one result with three instance: one is the pre-print, one is the post-print, one is te published version",
"description": "Description of instance",
"type": "array",
"items": {
"type": "object",
@ -295,199 +321,233 @@
"properties": {
"code": {
"type": "string",
"description" : "COAR access mode code: http://vocabularies.coar-repositories.org/documentation/access_rights/"
"description": "Description of code"
},
"label": {
"type": "string",
"description" : "Label for the access mode"
"description": "Description of label"
},
"openAccessRoute": {
"type": "string",
"enum" : [ "gold", "green", "hybrid", "bronze" ]
"enum": [
"gold",
"green",
"hybrid",
"bronze"
],
"description": "Description of openAccessRoute"
},
"scheme": {
"type": "string",
"description" : "Scheme of reference for access right code. Always set to COAR access rights vocabulary: http://vocabularies.coar-repositories.org/documentation/access_rights/"
"description": "Description of scheme"
}
},
"description" : "The accessRights for this materialization of the result"
"description": "Description of accessright"
},
"alternateIdentifier": {
"description" : "All the identifiers other than pids forged by an authorithy for the pid type (i.e. Crossref for DOIs",
"description": "Description of alternateIdentifier",
"type": "array",
"items": {
"type": "object",
"properties": {
"scheme": {
"type": "string",
"description" : "The scheme of the identifier. It can be a persistent identifier (i.e. doi). If it is present in the alternate identifiers it means it has not been forged by an authority for that pid. For example we collect metadata from an institutional repository that provides as identifier for the result also the doi"
"description": "Description of scheme"
},
"value": {
"type": "string",
"description" : "The value expressed in the scheme"
"description": "Description of value"
}
},
"description" : "All the identifiers other than pids forged by an authorithy for the pid type (i.e. Crossref for DOIs"
"description": "Description of alternateIdentifier"
}
},
"articleprocessingcharge": {
"type": "object",
"properties": {
"amount": {
"type" : "string"
"type": "string",
"description": "Description of amount"
},
"currency": {
"type" : "string"
"type": "string",
"description": "Description of currency"
}
},
"description" : "The money spent to make this book or article available in Open Access. Source for this information is the OpenAPC initiative."
"description": "Description of articleprocessingcharge"
},
"license": {
"type" : "string"
"type": "string",
"description": "Description of license"
},
"pid": {
"description": "Description of pid",
"type": "array",
"items": {
"$ref" : "#/definitions/ResultPid"
"allOf": [
{"$ref": "#/definitions/ResultPid"},
{"description": "Description of pid"}
]
}
},
"publicationdate": {
"type": "string",
"description" : "Date of the research product"
"description": "Description of publicationdate"
},
"refereed": {
"type": "string",
"description" : "If this instance has been peer-reviewed or not. Allowed values are peerReviewed, nonPeerReviewed, UNKNOWN (as defined in https://api.openaire.eu/vocabularies/dnet:review_levels)"
"description": "Description of refereed"
},
"type": {
"type": "string",
"description" : "The specific sub-type of this instance (see https://api.openaire.eu/vocabularies/dnet:result_typologies following the links)"
"description": "Description of type"
},
"url": {
"description" : "URLs to the instance. They may link to the actual full-text or to the landing page at the hosting source. ",
"description": "Description of url",
"type": "array",
"items": {
"type": "string",
"description" : "URLs to the instance. They may link to the actual full-text or to the landing page at the hosting source. "
"description": "Description of url"
}
}
},
"description" : "Each instance is one specific materialisation or version of the result. For example, you can have one result with three instance: one is the pre-print, one is the post-print, one is te published version"
"description": "Description of instance"
}
},
"isGreen": {
"type": "boolean",
"description": "Description of isGreen"
},
"isInDiamondJournal": {
"type": "boolean",
"description": "Description of isInDiamondJournal"
},
"language": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description" : "alpha-3/ISO 639-2 code of the language"
"description": "Description of code"
},
"label": {
"type": "string",
"description" : "Language label in English"
}
"description": "Description of label"
}
},
"description": "Description of language"
},
"lastupdatetimestamp": {
"type": "integer",
"description" : "Timestamp of last update of the record in OpenAIRE"
"description": "Description of lastupdatetimestamp"
},
"maintitle": {
"type": "string",
"description" : "A name or title by which a scientific result is known. May be the title of a publication, of a dataset or the name of a piece of software."
"description": "Description of maintitle"
},
"openAccessColor": {
"type": "string",
"enum": [
"gold",
"hybrid",
"bronze"
],
"description": "Description of openAccessColor"
},
"originalId": {
"description" : "Identifiers of the record at the original sources",
"description": "Description of originalId",
"type": "array",
"items": {
"type": "string",
"description" : "Identifiers of the record at the original sources"
"description": "Description of originalId"
}
},
"pid": {
"description" : "Persistent identifiers of the result",
"description": "Description of pid",
"type": "array",
"items": {
"allOf" : [ {
"$ref" : "#/definitions/ResultPid"
}, {
"description" : "Persistent identifiers of the result"
} ]
"allOf": [
{"$ref": "#/definitions/ResultPid"},
{"description": "Description of pid"}
]
}
},
"programmingLanguage": {
"type": "string",
"description" : "Only for results with type 'software': the programming language"
"description": "Description of programmingLanguage"
},
"publicationdate": {
"type": "string",
"description" : "Main date of the research product: typically the publication or issued date. In case of a research result with different versions with different dates, the date of the result is selected as the most frequent well-formatted date. If not available, then the most recent and complete date among those that are well-formatted. For statistics, the year is extracted and the result is counted only among the result of that year. Example: Pre-print date: 2019-02-03, Article date provided by repository: 2020-02, Article date provided by Crossref: 2020, OpenAIRE will set as date 2019-02-03, because its the most recent among the complete and well-formed dates. If then the repository updates the metadata and set a complete date (e.g. 2020-02-12), then this will be the new date for the result because it becomes the most recent most complete date. However, if OpenAIRE then collects the pre-print from another repository with date 2019-02-03, then this will be the “winning date” because it becomes the most frequent well-formatted date."
"description": "Description of publicationdate"
},
"publiclyFunded": {
"type": "boolean",
"description": "Description of publiclyFunded"
},
"publisher": {
"type": "string",
"description" : "The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource."
"description": "Description of publisher"
},
"size": {
"type": "string",
"description" : "Only for results with type 'dataset': the declared size of the dataset"
"description": "Description of size"
},
"source": {
"description" : "See definition of Dublin Core field dc:source",
"description": "Description of source",
"type": "array",
"items": {
"type": "string",
"description" : "See definition of Dublin Core field dc:source"
"description": "Description of source"
}
},
"subjects": {
"description" : "Keywords associated to the result",
"description": "Description of subjects",
"type": "array",
"items": {
"type": "object",
"properties": {
"provenance": {
"allOf" : [ {
"$ref" : "#/definitions/Provenance"
}, {
"description" : "Why this subject is associated to the result"
} ]
"allOf": [
{"$ref": "#/definitions/Provenance"},
{"description": "Description of provenance"}
]
},
"subject": {
"type": "object",
"properties": {
"scheme": {
"type": "string",
"description" : "OpenAIRE subject classification scheme (https://api.openaire.eu/vocabularies/dnet:subject_classification_typologies)."
"description": "Description of scheme"
},
"value": {
"type": "string",
"description" : "The value for the subject in the selected scheme. When the scheme is 'keyword', it means that the subject is free-text (i.e. not a term from a controlled vocabulary)."
}
}
"description": "Description of value"
}
},
"description" : "Keywords associated to the result"
"description": "Description of subject"
}
},
"description": "Description of subjects"
}
},
"subtitle": {
"type": "string",
"description" : "Explanatory or alternative name by which a scientific result is known."
"description": "Description of subtitle"
},
"tool": {
"description" : "Only for results with type 'other': tool useful for the interpretation and/or re-used of the research product",
"description": "Description of tool",
"type": "array",
"items": {
"type": "string",
"description" : "Only for results with type 'other': tool useful for the interpretation and/or re-used of the research product"
"description": "Description of tool"
}
},
"type": {
"type": "string",
"description" : "Type of the result: one of 'publication', 'dataset', 'software', 'other' (see also https://api.openaire.eu/vocabularies/dnet:result_typologies)"
"description": "Description of type"
},
"version": {
"type": "string",
"description" : "Version of the result"
"description": "Description of version"
}
}
}

View File

@ -1,5 +1,6 @@
import java.io.IOException;
import eu.dnetlib.dhp.oa.model.Result;
import org.junit.jupiter.api.Test;
import com.fasterxml.jackson.core.JsonProcessingException;
@ -24,7 +25,7 @@ class GenerateJsonSchema {
configBuilder.forFields().withDescriptionResolver(field -> "Description of " + field.getDeclaredName());
SchemaGeneratorConfig config = configBuilder.build();
SchemaGenerator generator = new SchemaGenerator(config);
JsonNode jsonSchema = generator.generateSchema(GraphResult.class);
JsonNode jsonSchema = generator.generateSchema(CommunityResult.class);
System.out.println(jsonSchema.toString());
}
@ -41,7 +42,7 @@ class GenerateJsonSchema {
.without(Option.NONPUBLIC_NONSTATIC_FIELDS_WITHOUT_GETTERS);
SchemaGeneratorConfig config = configBuilder.build();
SchemaGenerator generator = new SchemaGenerator(config);
JsonNode jsonSchema = generator.generateSchema(Project.class);
JsonNode jsonSchema = generator.generateSchema(Result.class);
System.out.println(jsonSchema.toString());
}

View File

@ -2,6 +2,8 @@
package eu.dnetlib.dhp.oa.graph.dump;
import static eu.dnetlib.dhp.oa.graph.dump.Constants.*;
import static eu.dnetlib.dhp.oa.graph.dump.Utils.ENTITY_ID_SEPARATOR;
import static eu.dnetlib.dhp.oa.graph.dump.Utils.getEntityId;
import java.io.Serializable;
import java.util.*;
@ -29,6 +31,7 @@ import eu.dnetlib.dhp.schema.common.ModelConstants;
import eu.dnetlib.dhp.schema.oaf.*;
public class ResultMapper implements Serializable {
private static final String NULL = "null";
public static <E extends eu.dnetlib.dhp.schema.oaf.OafEntity> Result map(
E in, Map<String, String> communityMap, String dumpType)
@ -60,7 +63,7 @@ public class ResultMapper implements Serializable {
mapDescription(out, input);
mapEmbargo(out, input);
mapFormat(out, input);
out.setId(input.getId().substring(3));
out.setId(getEntityId(input.getId(), ENTITY_ID_SEPARATOR));
mapOriginalId(out, input);
mapInstance(dumpType, out, input);
mapLanguage(out, input);
@ -175,7 +178,7 @@ public class ResultMapper implements Serializable {
input
.getCollectedfrom()
.stream()
.map(cf -> CfHbKeyValue.newInstance(cf.getKey().substring(3), cf.getValue()))
.map(cf -> CfHbKeyValue.newInstance(getEntityId(cf.getKey(), ENTITY_ID_SEPARATOR), cf.getValue()))
.collect(Collectors.toList()));
}
@ -207,6 +210,7 @@ public class ResultMapper implements Serializable {
// .getProvenanceaction()
// .getClassid()
// .equalsIgnoreCase("subject:sdg"))))
.filter(s -> !s.getValue().equalsIgnoreCase(NULL))
.forEach(s -> subjectList.add(getSubject(s))));
out.setSubjects(subjectList);
@ -541,14 +545,18 @@ public class ResultMapper implements Serializable {
instance
.setCollectedfrom(
CfHbKeyValue
.newInstance(i.getCollectedfrom().getKey().substring(3), i.getCollectedfrom().getValue()));
.newInstance(
getEntityId(i.getCollectedfrom().getKey(), ENTITY_ID_SEPARATOR),
i.getCollectedfrom().getValue()));
if (Optional.ofNullable(i.getHostedby()).isPresent() &&
Optional.ofNullable(i.getHostedby().getKey()).isPresent() &&
StringUtils.isNotBlank(i.getHostedby().getKey()))
instance
.setHostedby(
CfHbKeyValue.newInstance(i.getHostedby().getKey().substring(3), i.getHostedby().getValue()));
CfHbKeyValue
.newInstance(
getEntityId(i.getHostedby().getKey(), ENTITY_ID_SEPARATOR), i.getHostedby().getValue()));
return instance;

View File

@ -37,6 +37,7 @@ import scala.Tuple2;
public class Utils {
public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
public static final String ENTITY_ID_SEPARATOR = "|";
private Utils() {
}
@ -83,6 +84,10 @@ public class Utils {
return new Gson().fromJson(sb.toString(), CommunityMap.class);
}
public static String getEntityId(String id, String separator) {
return id.substring(id.indexOf(separator) + 1);
}
public static Dataset<String> getEntitiesId(SparkSession spark, String inputPath) {
Dataset<String> dumpedIds = Utils
.readPath(spark, inputPath + "/publication", GraphResult.class)

View File

@ -67,7 +67,7 @@ public class CommunitySplit implements Serializable {
.write()
.option("compression", "gzip")
.mode(SaveMode.Overwrite)
.text(outputPath + "/" + communities.get(c).replace(" ", "_"));
.text(outputPath + "/" + c.replace(" ", "_"));
});
}

View File

@ -2,6 +2,8 @@
package eu.dnetlib.dhp.oa.graph.dump.community;
import static eu.dnetlib.dhp.common.SparkSessionSupport.runWithSparkSession;
import static eu.dnetlib.dhp.oa.graph.dump.Utils.ENTITY_ID_SEPARATOR;
import static eu.dnetlib.dhp.oa.graph.dump.Utils.getEntityId;
import java.io.Serializable;
import java.io.StringReader;
@ -110,7 +112,7 @@ public class SparkPrepareResultProject implements Serializable {
Tuple2<eu.dnetlib.dhp.schema.oaf.Project, Relation> first = it.next();
ResultProject rp = new ResultProject();
if (substring)
rp.setResultId(s.substring(3));
rp.setResultId(getEntityId(s, ENTITY_ID_SEPARATOR));
else
rp.setResultId(s);
eu.dnetlib.dhp.schema.oaf.Project p = first._1();
@ -142,7 +144,7 @@ public class SparkPrepareResultProject implements Serializable {
private static Project getProject(eu.dnetlib.dhp.schema.oaf.Project op, Relation relation) {
Project p = Project
.newInstance(
op.getId().substring(3),
getEntityId(op.getId(), ENTITY_ID_SEPARATOR),
op.getCode().getValue(),
Optional
.ofNullable(op.getAcronym())

View File

@ -2,6 +2,8 @@
package eu.dnetlib.dhp.oa.graph.dump.complete;
import static eu.dnetlib.dhp.common.SparkSessionSupport.runWithSparkSession;
import static eu.dnetlib.dhp.oa.graph.dump.Utils.ENTITY_ID_SEPARATOR;
import static eu.dnetlib.dhp.oa.graph.dump.Utils.getEntityId;
import java.io.Serializable;
import java.util.*;
@ -84,7 +86,7 @@ public class Extractor implements Serializable {
.orElse(null))
.orElse(null);
Relation r = getRelation(
value.getId().substring(3), contextId,
getEntityId(value.getId(), ENTITY_ID_SEPARATOR), contextId,
Constants.RESULT_ENTITY,
Constants.CONTEXT_ENTITY,
ModelConstants.IS_RELATED_TO, ModelConstants.RELATIONSHIP, provenance);
@ -94,7 +96,7 @@ public class Extractor implements Serializable {
hashCodes.add(r.hashCode());
}
r = getRelation(
contextId, value.getId().substring(3),
contextId, getEntityId(value.getId(), ENTITY_ID_SEPARATOR),
Constants.CONTEXT_ENTITY,
Constants.RESULT_ENTITY,
ModelConstants.IS_RELATED_TO,
@ -163,8 +165,8 @@ public class Extractor implements Serializable {
eu.dnetlib.dhp.oa.graph.dump.Constants.HARVESTED,
eu.dnetlib.dhp.oa.graph.dump.Constants.DEFAULT_TRUST));
Relation r = getRelation(
value.getId().substring(3),
cf.getKey().substring(3), Constants.RESULT_ENTITY, Constants.DATASOURCE_ENTITY,
getEntityId(value.getId(), ENTITY_ID_SEPARATOR),
getEntityId(cf.getKey(), ENTITY_ID_SEPARATOR), Constants.RESULT_ENTITY, Constants.DATASOURCE_ENTITY,
resultDatasource, ModelConstants.PROVISION,
provenance);
if (!hashCodes.contains(r.hashCode())) {
@ -174,7 +176,7 @@ public class Extractor implements Serializable {
}
r = getRelation(
cf.getKey().substring(3), value.getId().substring(3),
getEntityId(cf.getKey(), ENTITY_ID_SEPARATOR), getEntityId(value.getId(), ENTITY_ID_SEPARATOR),
Constants.DATASOURCE_ENTITY, Constants.RESULT_ENTITY,
datasourceResult, ModelConstants.PROVISION,
provenance);

View File

@ -2,6 +2,8 @@
package eu.dnetlib.dhp.oa.graph.dump.complete;
import static eu.dnetlib.dhp.common.SparkSessionSupport.runWithSparkSession;
import static eu.dnetlib.dhp.oa.graph.dump.Utils.ENTITY_ID_SEPARATOR;
import static eu.dnetlib.dhp.oa.graph.dump.Utils.getEntityId;
import java.io.Serializable;
import java.io.StringReader;
@ -216,7 +218,7 @@ public class SparkDumpEntitiesJob implements Serializable {
return null;
Datasource datasource = new Datasource();
datasource.setId(d.getId().substring(3));
datasource.setId(getEntityId(d.getId(), ENTITY_ID_SEPARATOR));
Optional
.ofNullable(d.getOriginalId())
@ -406,7 +408,7 @@ public class SparkDumpEntitiesJob implements Serializable {
Optional
.ofNullable(p.getId())
.ifPresent(id -> project.setId(id.substring(3)));
.ifPresent(id -> project.setId(getEntityId(id, ENTITY_ID_SEPARATOR)));
Optional
.ofNullable(p.getWebsiteurl())
@ -619,7 +621,7 @@ public class SparkDumpEntitiesJob implements Serializable {
Optional
.ofNullable(org.getId())
.ifPresent(value -> organization.setId(value.substring(3)));
.ifPresent(value -> organization.setId(getEntityId(value, ENTITY_ID_SEPARATOR)));
Optional
.ofNullable(org.getPid())

View File

@ -2,6 +2,8 @@
package eu.dnetlib.dhp.oa.graph.dump.complete;
import static eu.dnetlib.dhp.common.SparkSessionSupport.runWithSparkSession;
import static eu.dnetlib.dhp.oa.graph.dump.Utils.ENTITY_ID_SEPARATOR;
import static eu.dnetlib.dhp.oa.graph.dump.Utils.getEntityId;
import java.io.Serializable;
import java.util.Collections;
@ -85,11 +87,11 @@ public class SparkDumpRelationJob implements Serializable {
.map((MapFunction<Relation, eu.dnetlib.dhp.oa.model.graph.Relation>) relation -> {
eu.dnetlib.dhp.oa.model.graph.Relation relNew = new eu.dnetlib.dhp.oa.model.graph.Relation();
relNew
.setSource(relation.getSource().substring(3));
.setSource(getEntityId(relation.getSource(), ENTITY_ID_SEPARATOR));
relNew.setSourceType(ModelSupport.idPrefixEntity.get(relation.getSource().substring(0, 2)));
relNew
.setTarget(relation.getTarget().substring(3));
.setTarget(getEntityId(relation.getTarget(), ENTITY_ID_SEPARATOR));
relNew.setTargetType(ModelSupport.idPrefixEntity.get(relation.getTarget().substring(0, 2)));
relNew

View File

@ -2,6 +2,9 @@
package eu.dnetlib.dhp.oa.graph.dump.complete;
import static eu.dnetlib.dhp.common.SparkSessionSupport.runWithSparkSession;
import static eu.dnetlib.dhp.oa.graph.dump.Utils.ENTITY_ID_SEPARATOR;
import static eu.dnetlib.dhp.oa.graph.dump.Utils.getEntityId;
import static eu.dnetlib.dhp.schema.common.ModelSupport.idPrefixMap;
import java.io.Serializable;
import java.util.ArrayList;
@ -27,8 +30,10 @@ import eu.dnetlib.dhp.oa.graph.dump.Utils;
import eu.dnetlib.dhp.oa.graph.dump.community.CommunityMap;
import eu.dnetlib.dhp.oa.model.Provenance;
import eu.dnetlib.dhp.oa.model.graph.RelType;
import eu.dnetlib.dhp.schema.common.EntityType;
import eu.dnetlib.dhp.schema.common.ModelConstants;
import eu.dnetlib.dhp.schema.common.ModelSupport;
import eu.dnetlib.dhp.schema.oaf.Organization;
import eu.dnetlib.dhp.schema.oaf.Relation;
/**
@ -103,7 +108,7 @@ public class SparkOrganizationRelation implements Serializable {
.as(Encoders.bean(MergedRels.class));
mergedRelsDataset.map((MapFunction<MergedRels, MergedRels>) mergedRels -> {
if (organizationMap.containsKey(mergedRels.getOrganizationId())) {
if (organizationMap.containsKey(getEntityId(mergedRels.getOrganizationId(), ENTITY_ID_SEPARATOR))) {
return mergedRels;
}
return null;
@ -135,12 +140,13 @@ public class SparkOrganizationRelation implements Serializable {
private static Consumer<MergedRels> getMergedRelsConsumer(CommunityEntityMap organizationMap,
List<eu.dnetlib.dhp.oa.model.graph.Relation> relList, CommunityMap communityMap) {
return mergedRels -> {
String oId = mergedRels.getOrganizationId();
String oId = getEntityId(mergedRels.getOrganizationId(), ENTITY_ID_SEPARATOR);
organizationMap
.get(oId)
.forEach(community -> {
if (communityMap.containsKey(community)) {
addRelations(relList, community, mergedRels.getRepresentativeId());
addRelations(
relList, community, getEntityId(mergedRels.getRepresentativeId(), ENTITY_ID_SEPARATOR));
}
});
@ -158,8 +164,8 @@ public class SparkOrganizationRelation implements Serializable {
eu.dnetlib.dhp.oa.model.graph.Relation
.newInstance(
id, Constants.CONTEXT_ENTITY,
organization.substring(3),
ModelSupport.idPrefixEntity.get(organization.substring(0, 2)),
organization,
ModelSupport.idPrefixEntity.get(idPrefixMap.get(Organization.class)),
RelType.newInstance(ModelConstants.IS_RELATED_TO, ModelConstants.RELATIONSHIP),
Provenance
.newInstance(
@ -170,7 +176,7 @@ public class SparkOrganizationRelation implements Serializable {
.add(
eu.dnetlib.dhp.oa.model.graph.Relation
.newInstance(
organization.substring(3), ModelSupport.idPrefixEntity.get(organization.substring(0, 2)),
organization, ModelSupport.idPrefixEntity.get(idPrefixMap.get(Organization.class)),
id, Constants.CONTEXT_ENTITY,
RelType.newInstance(ModelConstants.IS_RELATED_TO, ModelConstants.RELATIONSHIP),
Provenance

View File

@ -204,10 +204,11 @@ public class ZenodoAPIClient implements Serializable {
.build();
log.info("URL: " + request.url().toString());
log.info("Headers: " + request.headers().toString());
// log.info("Headers: " + request.headers().toString());
try (Response response = httpClient.newCall(request).execute()) {
if (!response.isSuccessful())
log.info("Unexpected code " + response + response.body().string());
System.out.println("Unexpected code " + response + response.body().string());
return response.code();
}
@ -354,13 +355,14 @@ public class ZenodoAPIClient implements Serializable {
.build();
log.info("URL: " + request.url().toString());
log.info("Headers: " + request.headers().toString());
// log.info("Headers: " + request.headers().toString());
try (Response response = httpClient.newCall(request).execute()) {
if (!response.isSuccessful())
if (!response.isSuccessful()) {
log.info("Unexpected code " + response + response.body().string());
throw new IOException("Unexpected code " + response + response.body().string());
}
ZenodoModel zenodoModel = new Gson()
.fromJson(response.body().string(), ZenodoModel.class);
bucket = zenodoModel.getLinks().getBucket();

View File

@ -1,4 +1,4 @@
<workflow-app name="sub-dump_subset" xmlns="uri:oozie:workflow:0.5">
<workflow-app name="dump_country" xmlns="uri:oozie:workflow:0.5">
<parameters>
<property>
<name>sourcePath</name>

View File

@ -5,6 +5,8 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.io.FileUtils;
import org.apache.spark.SparkConf;