diff --git a/oaipmh-core/pom.xml b/oaipmh-core/pom.xml index 46b2b4d6593d0a2a3e8adf1013f00b90e138bf37..c2f75d2ece2fc0c802226380667a8b01cbfca09c 100644 --- a/oaipmh-core/pom.xml +++ b/oaipmh-core/pom.xml @@ -12,18 +12,18 @@ <packaging>jar</packaging> <name>DARIAHDE :: OAI-PMH DataProvider :: Core</name> <url>http://maven.apache.org</url> - + <dependencies> - <dependency> - <groupId>info.textgrid.utils</groupId> - <artifactId>httpclients</artifactId> - <version>${textgrid.httpclients.version}</version> - </dependency> - <dependency> - <groupId>org.eclipse.rdf4j</groupId> - <artifactId>rdf4j-repository-api</artifactId> - <version>3.0.2</version> -</dependency> + <dependency> + <groupId>info.textgrid.utils</groupId> + <artifactId>httpclients</artifactId> + <version>${textgrid.httpclients.version}</version> + </dependency> + <dependency> + <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-repository-api</artifactId> + <version>3.0.2</version> + </dependency> <dependency> <groupId>info.textgrid.middleware</groupId> <artifactId>crud-common</artifactId> @@ -108,12 +108,12 @@ <version>1.4.5</version> </dependency> <!-- https://mvnrepository.com/artifact/org.json/json --> -<dependency> - <groupId>org.json</groupId> - <artifactId>json</artifactId> - <version>20190722</version> -</dependency> - + <dependency> + <groupId>org.json</groupId> + <artifactId>json</artifactId> + <version>20190722</version> + </dependency> + </dependencies> <build> <pluginManagement> @@ -195,6 +195,20 @@ </args> </configuration> </execution> + <execution> + <id>generate-openaire</id> + <goals> + <goal>generate</goal> + </goals> + <configuration> + <generatePackage>info.textgrid.middleware.oaipmh.openaire</generatePackage> + <generateDirectory>${project.build.directory}/generated-sources/oaipmh/openaire</generateDirectory> + <args> + <arg>-extension</arg> + <arg>-Xnamespace-prefix</arg> + </args> + </configuration> + </execution> </executions> <dependencies> <dependency> diff --git a/oaipmh-core/src/main/resources/bindings.xjb b/oaipmh-core/src/main/resources/bindings.xjb index 2a55fe38f7582e904e20753f26bb41be5ddcf62b..e3ce56ed571038af7a5f8afae92dec47731d5e4b 100644 --- a/oaipmh-core/src/main/resources/bindings.xjb +++ b/oaipmh-core/src/main/resources/bindings.xjb @@ -1,38 +1,32 @@ <?xml version="1.0"?> <jxb:bindings version="1.0" - xmlns:jxb="http://java.sun.com/xml/ns/jaxb" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:namespace="http://jaxb2-commons.dev.java.net/namespace-prefix" - xmlns:xs="http://www.w3.org/2001/XMLSchema" - xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb https://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd - http://jaxb2-commons.dev.java.net/namespace-prefix https://raw.githubusercontent.com/Siggen/jaxb2-namespace-prefix/master/src/main/resources/prefix-namespace-schema.xsd"> - - <jxb:bindings schemaLocation="oai_pmh.xsd"> - <jxb:schemaBindings> - <jxb:package name="info.textgrid.middleware.oaipmh" /> - </jxb:schemaBindings> - <jxb:bindings> - <!-- We want no prefix for default namespace... --> - <namespace:prefix name="" /> - </jxb:bindings> - <jxb:bindings> - <!-- ...but we want prefixes for oai_dc and dc! --> - <namespace:prefix - namespaceURI="http://www.openarchives.org/OAI/2.0/oai_dc/" - name="oai_dc" /> - <namespace:prefix - namespaceURI="http://purl.org/dc/elements/1.1/" name="dc" /> - </jxb:bindings> - </jxb:bindings> - - <jxb:bindings schemaLocation="oaf-project-1.0.xsd"> - - <jxb:bindings node=".//xs:attribute[@type='qualifierType']"> - <jxb:property type="projectqualifierType"/> - </jxb:bindings> - - </jxb:bindings> - - - + xmlns:jxb="http://java.sun.com/xml/ns/jaxb" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:namespace="http://jaxb2-commons.dev.java.net/namespace-prefix" + xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb https://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd + http://jaxb2-commons.dev.java.net/namespace-prefix https://raw.githubusercontent.com/Siggen/jaxb2-namespace-prefix/master/src/main/resources/prefix-namespace-schema.xsd"> + <jxb:bindings schemaLocation="oai_pmh.xsd"> + <jxb:schemaBindings> + <jxb:package name="info.textgrid.middleware.oaipmh" /> + </jxb:schemaBindings> + <jxb:bindings> + <!-- We want no prefix for default namespace... --> + <namespace:prefix name="" /> + </jxb:bindings> + <jxb:bindings> + <!-- ...but we want prefixes for oai_dc and dc! --> + <namespace:prefix + namespaceURI="http://www.openarchives.org/OAI/2.0/oai_dc/" + name="oai_dc" /> + <namespace:prefix + namespaceURI="http://purl.org/dc/elements/1.1/" name="dc" /> + </jxb:bindings> + </jxb:bindings> + <jxb:bindings schemaLocation="openaire.xsd"> + <jxb:schemaBindings> + <jxb:package + name="info.textgrid.middleware.oaipmh.openaire" /> + </jxb:schemaBindings> + </jxb:bindings> </jxb:bindings> diff --git a/oaipmh-core/src/main/resources/oaf-1.0.xsd b/oaipmh-core/src/main/resources/oaf-1.0.xsd new file mode 100644 index 0000000000000000000000000000000000000000..952ae31ddbf10d640b11c920f116bb400f07f257 --- /dev/null +++ b/oaipmh-core/src/main/resources/oaf-1.0.xsd @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" + xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns="http://namespace.openaire.eu/oaf" + targetNamespace="http://namespace.openaire.eu/oaf"> + + <xs:annotation> + <xs:documentation>This schema describes the XML serialization of the OpenAIRE Research Graph. + For an overview of the model, please check the OpenAIRE Research Graph Data Model at https://doi.org/10.5281/zenodo.2643199 + </xs:documentation> + </xs:annotation> + + <xs:include schemaLocation="oaf-result-1.0.xsd"/> + <xs:include schemaLocation="oaf-org-1.0.xsd"/> + <xs:include schemaLocation="oaf-datasource-1.0.xsd"/> + <xs:include schemaLocation="oaf-project-1.0.xsd"/> + + <xs:element name="entity"> + <xs:complexType> + <xs:sequence> + <xs:choice> + <xs:element ref="result"/> + <xs:element ref="organization"/> + <xs:element ref="datasource"/> + <xs:element ref="project"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + </xs:element> + +</xs:schema> diff --git a/oaipmh-core/src/main/resources/oaf-common-1.0.xsd b/oaipmh-core/src/main/resources/oaf-common-1.0.xsd new file mode 100644 index 0000000000000000000000000000000000000000..8c52e22a3732c42d8f782bb065f7acfd7e525e0a --- /dev/null +++ b/oaipmh-core/src/main/resources/oaf-common-1.0.xsd @@ -0,0 +1,298 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" + xmlns="http://namespace.openaire.eu/oaf" targetNamespace="http://namespace.openaire.eu/oaf"> + + <xs:annotation> + <xs:documentation>This schema defines common types that can be re-used.</xs:documentation> + </xs:annotation> + + <xs:simpleType name="emptyType"> + <xs:restriction base="xs:string"> + <xs:length value="0"/> + </xs:restriction> + </xs:simpleType> + + <xs:simpleType name="boolOrEmptyType"> + <xs:union memberTypes="emptyType xs:boolean"/> + </xs:simpleType> + + <xs:simpleType name="stringOrEmptyType"> + <xs:union memberTypes="emptyType xs:string"/> + </xs:simpleType> + + <xs:attributeGroup name="dataInfoAttributeGroup"> + <xs:attribute name="inferred" use="optional" type="xs:boolean"> + <xs:annotation> + <xs:documentation>True if this information has been inferred by the automatic + inference algorithms run by OpenAIRE. </xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="trust" use="optional" type="xs:string"> + <xs:annotation> + <xs:documentation>Value of trust of this information in the range [0,1]. More the + value, more trustworthy is the information. </xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="inferenceprovenance" use="optional" type="xs:string"> + <xs:annotation> + <xs:documentation>Which algorithm inferred the current property. </xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="qualifierAttributeGroup"></xs:attributeGroup> + </xs:attributeGroup> + + <xs:attributeGroup name="qualifierAttributeGroup"> + <xs:attribute name="classid" use="required" type="xs:string"/> + <xs:attribute name="classname" use="required" type="xs:string"/> + <xs:attribute name="schemeid" use="required" type="xs:string"/> + <xs:attribute name="schemename" use="required" type="xs:string"/> + </xs:attributeGroup> + + <xs:complexType name="fieldType"> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attributeGroup ref="dataInfoAttributeGroup"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:complexType name="qualifierType"> + <xs:attributeGroup ref="qualifierAttributeGroup"/> + </xs:complexType> + + <xs:complexType name="dataInfoType"> + <xs:attributeGroup ref="dataInfoAttributeGroup"/> + </xs:complexType> + + <xs:complexType name="structuredPropertyElementType"> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attributeGroup ref="qualifierAttributeGroup"/> + <xs:attributeGroup ref="dataInfoAttributeGroup"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:complexType name="labeledIdElementType"> + <xs:attribute name="id" use="required"/> + <xs:attribute name="label" use="required"/> + </xs:complexType> + + <!-- <oaf:context id="egi" label="EGI" type="community"> + <oaf:category id="egi::virtual" label="EGI virtual organizations"> + <oaf:concept id="egi::virtual::2" label="alice"/> + </oaf:category> + </oaf:context> + <oaf:community id="{@id}" label="{@label}"> + <xsl:apply-templates/> + </oaf:community> + --> + <xs:complexType name="contextType"> + <xs:complexContent> + <xs:extension base="labeledIdElementType"> + <xs:sequence maxOccurs="unbounded"> + <xs:element name="category" type="categoryType"/> + </xs:sequence> + <xs:attributeGroup ref="dataInfoAttributeGroup"/> + </xs:extension> + </xs:complexContent> + </xs:complexType> + + <xs:complexType name="categoryType"> + <xs:complexContent> + <xs:extension base="labeledIdElementType"> + <xs:sequence minOccurs="0" maxOccurs="unbounded"> + <xs:element name="concept" type="conceptType"/> + </xs:sequence> + </xs:extension> + </xs:complexContent> + </xs:complexType> + + <xs:complexType name="conceptType"> + <xs:complexContent> + <xs:extension base="labeledIdElementType"> + <xs:sequence maxOccurs="unbounded" minOccurs="0"> + <xs:element name="concept" type="conceptType"/> + </xs:sequence> + </xs:extension> + </xs:complexContent> + </xs:complexType> + + <xs:complexType name="namedIdElementType"> + <xs:attribute name="id" use="required"/> + <xs:attribute name="name" use="required"/> + <xs:attributeGroup ref="dataInfoAttributeGroup"/> + </xs:complexType> + + <xs:complexType name="relsType"> + <xs:annotation> + <xs:documentation>Relationships to other entities.</xs:documentation> + </xs:annotation> + <xs:choice maxOccurs="unbounded" minOccurs="0"> + <xs:element name="rel" type="relType" minOccurs="0"/> + </xs:choice> + </xs:complexType> + + <xs:complexType name="relType"> + <xs:sequence> + <xs:choice maxOccurs="unbounded"> + <xs:element name="to" type="relToType"/> + <xs:element name="title" type="xs:string"/> + <xs:element name="websiteurl"/> + <xs:choice> + <xs:group ref="relDataSourceGroup"/> + <xs:group ref="relResultGroup"/> + <xs:group ref="relProjectGroup"/> + <xs:group ref="relOrganizationGroup"/> + <xs:group ref="fundingGroup"/> + </xs:choice> + </xs:choice> + </xs:sequence> + <xs:attributeGroup ref="dataInfoAttributeGroup"/> + </xs:complexType> + + <xs:group name="relDataSourceGroup"> + <xs:sequence> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="officialname" type="xs:string"/> + <xs:element name="datasourcetype" type="qualifierType"/> + </xs:choice> + </xs:sequence> + </xs:group> + + <xs:group name="relResultGroup"> + <xs:sequence> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="collectedfrom" type="namedIdElementType"/> + <xs:element name="url" type="xs:string"/> + <xs:element name="pid" type="structuredPropertyElementType"/> + <xs:element name="dateofacceptance" type="xs:string"/> + <xs:element name="publisher" type="xs:string"/> + <xs:element name="resulttype" type="xs:string"> + <xs:annotation> + <xs:documentation> Tells if the related record is about a publication or a + dataset. </xs:documentation> + </xs:annotation> + </xs:element> + <!-- the following fields are available only for similarity relations --> + <xs:element name="similarity" type="xs:double"> + <xs:annotation> + <xs:documentation>The similarity degree expressed in the range (0,1]. This + field is avaiable only when the to/@class is one of + {hasAmongTopNSimilarDocuments, + isAmongTopNSimilarDocuments}</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="type"> + <xs:annotation> + <xs:documentation>The similarity degree expressed in the range (0,1]. This + field is avaiable only when the to/@class is one of + {hasAmongTopNSimilarDocuments, + isAmongTopNSimilarDocuments}</xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="STANDARD"/> + <xs:enumeration value="WEBUSAGE"/> + </xs:restriction> + </xs:simpleType> + </xs:element> + </xs:choice> + </xs:sequence> + </xs:group> + + <xs:group name="relProjectGroup"> + <xs:sequence> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="code" type="xs:string"/> + <xs:element name="acronym" type="xs:string"/> + </xs:choice> + </xs:sequence> + </xs:group> + + <xs:group name="fundingGroup"> + <xs:sequence> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="contracttype" type="qualifierType"/> + <xs:element name="funding" type="fundingFlatType"/> + </xs:choice> + </xs:sequence> + </xs:group> + + <xs:group name="relOrganizationGroup"> + <xs:sequence> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="legalname" type="xs:string"/> + <xs:element name="legalshortname" type="xs:string"/> + <xs:element name="country" type="xs:string"/> + </xs:choice> + </xs:sequence> + </xs:group> + + + <xs:complexType name="relToType"> + <xs:annotation> + <xs:documentation>Information about the related entity. <p>The semantics of the + relationships is expressed by the attributes class and scheme. </p> + </xs:documentation> + </xs:annotation> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="class" use="required" type="xs:string"/> + <xs:attribute name="type" use="required" type="xs:string"> + <xs:annotation> + <xs:documentation>The type of the related entity. <p>Allowed values are: + project, organization, datasource, result, person.</p> + </xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:complexType name="fundingFlatType"> + <xs:sequence> + <xs:element name="funder" type="funderFlatType" minOccurs="1" maxOccurs="1"/> + <xs:element name="funding_level_0" type="namedFundingLevel" minOccurs="0" + maxOccurs="unbounded"/> + <xs:element name="funding_level_1" type="namedFundingLevel" minOccurs="0" + maxOccurs="unbounded"/> + <xs:element name="funding_level_2" type="namedFundingLevel" minOccurs="0" + maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="funderFlatType"> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="id" use="required" type="xs:string"/> + <xs:attribute name="shortname" use="required" type="xs:string"/> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="jurisdiction" use="optional" type="xs:string"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:complexType name="namedFundingLevel"> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="name" use="required" type="xs:string"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:complexType name="externalreferenceType"> + <xs:sequence> + <xs:element name="sitename" type="xs:string" minOccurs="0" maxOccurs="1"/> + <!--<xs:element name="label" type="xs:string" minOccurs="0" maxOccurs="1"/>--> + <xs:element name="url" type="xs:string" minOccurs="0" maxOccurs="1"/> + <xs:element name="qualifier" type="qualifierType" minOccurs="0" maxOccurs="1"/> + <xs:element name="refidentifier" type="xs:string" minOccurs="0" maxOccurs="1"/> + </xs:sequence> + <xs:attributeGroup ref="dataInfoAttributeGroup"/> + </xs:complexType> + + + <!-- REMOVE FROM HERE TO THE END --> + +</xs:schema> diff --git a/oaipmh-core/src/main/resources/oaf-org-1.0.xsd b/oaipmh-core/src/main/resources/oaf-org-1.0.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3c46fca44b6462be5fb51d116555cac23ea9d016 --- /dev/null +++ b/oaipmh-core/src/main/resources/oaf-org-1.0.xsd @@ -0,0 +1,41 @@ +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://namespace.openaire.eu/oaf" + targetNamespace="http://namespace.openaire.eu/oaf" elementFormDefault="qualified"> + + <xs:annotation> + <xs:documentation>This schema describes elements and properties of OpenAIRE entities of type organization: https://issue.openaire.research-infrastructures.eu/projects/openaire2020-wiki/wiki/Core_entity_organization</xs:documentation> + </xs:annotation> + + <xs:include schemaLocation="oaf-common-1.0.xsd"/> + + <xs:element name="organization"> + <xs:complexType> + <xs:choice maxOccurs="unbounded"> + <xs:element name="legalname" type="xs:string"/> + <xs:element name="legalshortname" type="xs:string"/> + <xs:element name="logourl" type="xs:string"/> + <xs:element name="originalId" type="xs:string"/> + <xs:element name="websiteurl" type="xs:string"/> + <xs:element name="country" type="qualifierType"> + <xs:annotation> + <xs:documentation>Countries in ISO 3166-1 alpha-2. </xs:documentation> + </xs:annotation> + </xs:element> + + <xs:element name="collectedfrom" type="namedIdElementType"> + <xs:annotation> + <xs:documentation>Identifier and name of the datasource from which this + organization has been collected from. </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="pid" type="structuredPropertyElementType"/> + <xs:element name="rels" type="relsType"> + <xs:annotation> + <xs:documentation>Relationships to other entities. </xs:documentation> + </xs:annotation> + </xs:element> + <!-- If we decide not to show deduplicated org, then we have to remove this field --> + <!-- <xs:element name="duplicates" type="mergedOrgs"/> --> + </xs:choice> + </xs:complexType> + </xs:element> +</xs:schema> diff --git a/oaipmh-core/src/main/resources/oaf-project-1.0.xsd b/oaipmh-core/src/main/resources/oaf-project-1.0.xsd new file mode 100644 index 0000000000000000000000000000000000000000..abcba4d9f63f31996226f01a18ab575541e32827 --- /dev/null +++ b/oaipmh-core/src/main/resources/oaf-project-1.0.xsd @@ -0,0 +1,111 @@ +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://namespace.openaire.eu/oaf" + targetNamespace="http://namespace.openaire.eu/oaf" elementFormDefault="qualified"> + + <xs:annotation> + <xs:documentation>This schema describes elements and properties of OpenAIRE project entity: https://issue.openaire.research-infrastructures.eu/projects/openaire2020-wiki/wiki/Core_entity_project</xs:documentation> + </xs:annotation> + + <xs:include schemaLocation="oaf-common-1.0.xsd"/> + + <xs:element name="project"> + <xs:complexType> + <xs:choice maxOccurs="unbounded"> + <xs:element name="code" type="xs:string"> + <xs:annotation> + <xs:documentation>Project code as assigned by the project's funder.</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="title" type="xs:string"/> + <xs:element name="acronym" type="xs:string"/> + <xs:element name="callidentifier" type="xs:string"> + <xs:annotation> + <xs:documentation> Identifier of the call for proposal.</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="contactfullname" type="xs:string"/> + <xs:element name="contactfax" type="xs:string"/> + <xs:element name="contactphone" type="xs:string"/> + <xs:element name="contactemail" type="xs:string"/> + <xs:element name="contracttype" type="qualifierType"/> + <xs:element name="keywords" type="xs:string"/> + <xs:element name="websiteurl" type="xs:string"/> + <xs:element name="startdate" type="xs:string"/> + <xs:element name="enddate" type="xs:string"/> + <xs:element name="duration" type="xs:string"/> + <xs:element name="ecsc39" type="boolOrEmptyType"> + <xs:annotation> + <xs:documentation>True if the project has the special clause 39. Available + only for EC FP7 funded projects. </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="oamandatepublications" type="xs:boolean"> + <xs:annotation> + <xs:documentation>True if the project's funding mandates the availability of project's publications in Open Access.</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="ecarticle29_3" type="boolOrEmptyType"> + <xs:annotation> + <xs:documentation>True if the project is under the EC Open Data Pilot. Available only for EC H2020 funded projects. </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="subjects" type="qualifierType"/> + + <xs:element name="fundingtree" type="fundingTreeType"/> + <xs:element name="originalId" type="xs:string"/> + <xs:element name="collectedfrom" type="namedIdElementType"> + <xs:annotation> + <xs:documentation>Identifier and name of the datasource from which this + project has been collected from. </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="pid" type="qualifierType"/> + <xs:element name="rels" type="relsType"> + <xs:annotation> + <xs:documentation>Relationships to other entities. </xs:documentation> + </xs:annotation> + </xs:element> + </xs:choice> + </xs:complexType> + </xs:element> + + <!-- to be removed, and replaced by ContextType --> + <xs:complexType name="fundingTreeType"> + <xs:sequence> + <xs:element name="funder" type="funderType"/> + <xs:choice maxOccurs="unbounded"> + <!-- Three-tier funding hierarchies --> + <xs:element name="funding_level_2" type="fundingType"/> + <!-- Two-tier funding hierarchies --> + <xs:element name="funding_level_1" type="fundingType"/> + <!-- No funding hierarchy --> + <xs:element name="funding_level_0" type="fundingType"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="fundingType"> + <xs:all> + <xs:element name="id" type="xs:string"/> + <xs:element name="description" type="xs:string"/> + <xs:element name="name" type="xs:string"/> + <xs:element name="class" type="xs:string"/> + <xs:element name="parent" type="fundingParentType"/> + </xs:all> + </xs:complexType> + + <xs:complexType name="fundingParentType"> + <xs:choice minOccurs="0"> + <xs:element name="funding_level_1" type="fundingType"/> + <xs:element name="funding_level_0" type="fundingType"/> + </xs:choice> + </xs:complexType> + + <xs:complexType name="funderType"> + <xs:all> + <xs:element name="id" type="xs:string"/> + <xs:element name="shortname" type="xs:string"/> + <xs:element name="name" type="xs:string"/> + <xs:element name="jurisdiction" type="xs:string"/> + </xs:all> + </xs:complexType> +</xs:schema> diff --git a/oaipmh-core/src/main/resources/oaf-result-1.0.xsd b/oaipmh-core/src/main/resources/oaf-result-1.0.xsd new file mode 100644 index 0000000000000000000000000000000000000000..2ffd39849cbb1f5da2ebfa5d7cba94ae8d21185f --- /dev/null +++ b/oaipmh-core/src/main/resources/oaf-result-1.0.xsd @@ -0,0 +1,242 @@ +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" + xmlns="http://namespace.openaire.eu/oaf" targetNamespace="http://namespace.openaire.eu/oaf"> + + <xs:annotation> + <xs:documentation>This schema describes elements and properties of the OpenAIRE Result entity. For an overview of the model, please check the OpenAIRE Research Graph Data Model at https://doi.org/10.5281/zenodo.2643199</xs:documentation> + </xs:annotation> + + <xs:include schemaLocation="oaf-common-1.0.xsd"/> + + <xs:element name="result"> + <xs:complexType> + <xs:choice maxOccurs="unbounded"> + <xs:element name="creator"> + <xs:complexType> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="name" type="xs:string"/> + <xs:attribute name="surname" type="xs:string"/> + <xs:attribute name="ORCID" type="xs:string"/> + <xs:attribute name="rank" type="xs:int"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + </xs:element> + <xs:element name="resulttype" type="qualifierType"> + <xs:annotation> + <xs:documentation> Tells if this record is about a publication or a dataset. + <p>For allowed values check: + http://api.openaire.eu/vocabularies/dnet:result_typologies </p> + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="language" type="qualifierType"/> + <xs:element name="country" type="dataInfoType"/> + <xs:element name="subject" type="structuredPropertyElementType"/> + <xs:element name="title" type="structuredPropertyElementType"> + <xs:annotation> + <xs:documentation> Title of this research result. <p>Different types of + titles are allowed: see http://api.openaire.eu/vocabularies/dnet:dataCite_title</p> + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="relevantdate" type="structuredPropertyElementType"/> + <xs:element name="description" type="xs:string"/> + <xs:element name="dateofacceptance" type="xs:string"/> + <xs:element name="publisher" type="xs:string"/> + <xs:element name="embargoenddate" type="xs:string"/> + <xs:element name="source" type="xs:string"> + <xs:annotation> + <xs:documentation>The semantics of this field is inherited from dc:source in + Dublin Core. </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="format" type="xs:string"/> + <xs:element name="contributor" type="xs:string"/> + <xs:element name="resourcetype" type="qualifierType"> + <xs:annotation> + <xs:documentation> This field is valid only if resulttype is "dataset". It + expresses the nature of the dataset. <p>For allowed values check: + http://api.openaire.eu/vocabularies/dnet:publication_resource </p> + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="coverage" type="xs:string"/> + <xs:element name="bestaccessright" type="qualifierType"> + <xs:annotation> + <xs:documentation> The best access right available for this result among the + available licenses of its children elements. <p>For allowed values + check: http://api.openaire.eu/vocabularies/dnet:access_modes </p> + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="journal" type="journalType"/> + <xs:element name="pid" type="structuredPropertyElementType"> + <xs:annotation> + <xs:documentation> Persistent identifier. <p>For allowed pid systems check: + http://api.openaire.eu/vocabularies/dnet:pid_types </p> + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="device" type="xs:string"> + <xs:annotation> + <xs:documentation> This field is valid only if resulttype is "dataset". It + contains information about the device used to generate the dataset. + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="size" type="xs:string"> + <xs:annotation> + <xs:documentation> This field is valid only if resulttype is "dataset". It + contains information about the size of the dataset. </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="version" type="xs:string"> + <xs:annotation> + <xs:documentation> This field is valid only if resulttype is "dataset". It + contains information about the version of the dataset. + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="lastmetadataupdate" type="xs:string"> + <xs:annotation> + <xs:documentation> This field is valid only if resulttype is "dataset". It + is the last update date of the metadata of the dataset. + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="metadataversionnumber" type="xs:string"> + <xs:annotation> + <xs:documentation> This field is valid only if resulttype is "dataset". It + contains information about the version of the metadata of the dataset. + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="originalId" type="xs:string" maxOccurs="unbounded"/> + <xs:element name="collectedfrom" type="namedIdElementType" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>Identifier and name of the datasource from which this + result has been collected from (e.g., "OpenDOAR"). </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="context" type="contextType"> + <xs:annotation> + <xs:documentation>Research community, initiative, infrastructure or funding agency related to this result.</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="rels" type="relsType"> + <xs:annotation> + <xs:documentation>Relationships to other entities. </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="instances" type="instancesType" minOccurs="1" maxOccurs="1"/> + <xs:element name="citations" type="citationsType" maxOccurs="1" minOccurs="0"/> + </xs:choice> + </xs:complexType> + </xs:element> + + <xs:complexType name="citationsType"> + <xs:sequence> + <xs:element name="citation" maxOccurs="unbounded" minOccurs="0"> + <xs:complexType> + <xs:sequence> + <xs:element name="rawText"/> + <xs:element name="id" minOccurs="0" maxOccurs="unbounded"> + <xs:complexType> + <xs:attribute name="value"/> + <xs:attribute name="type"/> + <xs:attribute name="confidenceLevel"/> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:sequence> + <xs:attribute name="provenance" type="xs:string"/> + <xs:attribute name="trust" type="xs:string"/> + </xs:complexType> + + <xs:complexType name="journalType"> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="eissn" use="optional"/> + <xs:attribute name="issn" use="optional"/> + <xs:attribute name="lissn" use="optional"/> + <xs:attribute name="ep" use="optional"/> + <xs:attribute name="iss" use="optional"/> + <xs:attribute name="sp" use="optional"/> + <xs:attribute name="vol" use="optional"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + <xs:complexType name="instancesType"> + <xs:sequence> + <xs:element name="instance" type="instanceType" minOccurs="1" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>Actual digital representation of the publication or dataset. + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="externalreference" type="externalreferenceType" minOccurs="0" + maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="instanceType"> + <xs:choice maxOccurs="unbounded"> + <xs:element name="license" type="fieldType"> + <xs:annotation> + <xs:documentation> License to access this actual manifestation of the + result. Typically it is a URL. OpenAIRE does not yet attempt any harmonization and reflect the original values that are available in the collected metadata records. + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="accessright" type="qualifierType"/> + <xs:element name="instancetype" type="qualifierType"> + <xs:annotation> + <xs:documentation> Type of the instance, for example: article, thesis, etc. + <p>For allowed values check: http://api.openaire.eu/vocabularies/dnet:publication_resource + </p> + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="collectedfrom" type="namedIdElementType" maxOccurs="1"> + <xs:annotation> + <xs:documentation>Datasource from which OpenAIRE collected the description of this instance.</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="hostedby" type="namedIdElementType" maxOccurs="1"> + <xs:annotation> + <xs:documentation>Datasource hosting this file. </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="webresource" type="webresourceType" minOccurs="1" + maxOccurs="unbounded"/> + <xs:element name="distributionlocation" type="xs:string" minOccurs="0"/> + <xs:element name="dateofacceptance" type="xs:string" minOccurs="0"/> + <xs:element name="processingchargeamount" type="fieldType"> + <xs:annotation> + <xs:documentation> Article/Book Processing Charge </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="processingchargecurrency" type="fieldType"> + <xs:annotation> + <xs:documentation>Currency for the value in processingchargeamount </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="refereed" type="fieldType"> + <xs:annotation> + <xs:documentation>Peer-review status</xs:documentation> + </xs:annotation> + </xs:element> + </xs:choice> + <xs:attribute name="id" use="required"/> + </xs:complexType> + + <xs:complexType name="webresourceType"> + <xs:sequence> + <xs:element name="url" type="xs:string" minOccurs="1" maxOccurs="1"/> + </xs:sequence> + </xs:complexType> + +</xs:schema>