Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/dspace harvest #63

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f44df39
Added initial version of dspace harvest via oaipmh.
ivanmrsulja Dec 11, 2024
00ba9e2
Refactored ETL process, everything that is crucial works now.
ivanmrsulja Dec 12, 2024
d6ae406
Refactored java code in order to make it more readable.
ivanmrsulja Dec 12, 2024
0c3490d
Added the possibility of loading through sparql api. Added support fo…
ivanmrsulja Dec 13, 2024
b00e51f
Fixed ID sanitization bug.
ivanmrsulja Dec 17, 2024
dc73c6c
Updated batch script.
ivanmrsulja Dec 17, 2024
d60844f
Updated batch script.
ivanmrsulja Dec 17, 2024
147b0c1
Fixing .bat script...
ivanmrsulja Dec 18, 2024
2d1f531
Minor fixes and documentation update.
ivanmrsulja Dec 18, 2024
01e1938
Fixing UTF encoding problems encountered on Windows systems.
ivanmrsulja Dec 18, 2024
4e56552
Minor improvements suggested in PR comments.
ivanmrsulja Dec 20, 2024
83b1f37
Fixed an error when loading UTF files on windows systems.
ivanmrsulja Dec 20, 2024
7252111
Fixed windows compatibility bugs.
ivanmrsulja Dec 23, 2024
d38cfbd
Small refactor.
ivanmrsulja Dec 23, 2024
28fc82c
Fixed more windows compatbility issues.
ivanmrsulja Dec 25, 2024
f5acb27
Fixed unescaped XML content issue.
ivanmrsulja Jan 3, 2025
e4445b5
Refined fix for unescaped XML encoded entities.
ivanmrsulja Jan 3, 2025
c6088d0
Fixed SPARQL update encoding problems.
ivanmrsulja Jan 8, 2025
0bfec99
Aligned JENA version to the one used in current VIVO. Fixed RDF autor…
ivanmrsulja Jan 8, 2025
6a65389
Switched to using final compiled regex patterns for slight performanc…
ivanmrsulja Jan 10, 2025
ffbfc71
Added javadocs.
ivanmrsulja Jan 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2010-2011 VIVO Harvester Team. For full list of contributors, please see the AUTHORS file provided.
All rights reserved.
This program and the accompanying materials are made available under the terms of the new BSD license which accompanies this distribution, and is available at http://www.opensource.org/licenses/bsd-license.html
-->
<Task>
<!--INPUT -->
<Param name="inputModel">harvested-data.model.xml</Param>

<!-- VIVO -->
<Param name="vivoModel">vivo.model.xml</Param>

<!-- OPTIONS -->
<Param name="oldNamespace">http://vivo.example.com/harvest</Param>
<!-- <Param name="newNamespace">http://vivo.cornell.edu/individual/</Param> -->
<Param name="newNamespace">http://localhost:8080/vivo-1.15/individual/</Param>
<Param name="wordiness">INFO</Param>

</Task>
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2010-2011 VIVO Harvester Team. For full list of contributors, please see the AUTHORS file provided.
All rights reserved.
This program and the accompanying materials are made available under the terms of the new BSD license which accompanies this distribution, and is available at http://www.opensource.org/licenses/bsd-license.html
-->
<!--
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
<% The diff tool is used to compare jena models and produce a result model which is the first model (minuend) %>
<% with any matching statements in the second model (subtrahend) removed from it. %>
<% ===== %>
<% This tool produces the graph-math difference of the triples between two models. It produces a model with the %>
<% triples which are in the minuend and not in the subtrahend. %>
<% Expressed mathematically as minuend - subtrahend = difference %>
<% Neither the minend nor the subtrahend are altered. %>
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
-->
<Task>
<!--INPUT -->
<!--MINUEND : for more information please see the given config file -->
<!--
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
<% <Param name="minuend"> The model described by this config file is the model which has the data which will be in %>
<% output model. %>
<% %>
<% %>
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
-->
<Param name="minuend">harvested-data.model.xml</Param>

<!--VIVO -->
<!--SUBTRAHEND : for more information please see the given config file -->
<!--
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
<% <Param name="subtrahend"> The model described by this config file contains the triples which are not goning to %>
<% be within the output model. If the triples match any within the minuend model then the output will be smaller %>
<% than the minuend. %>
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
-->
<Param name="subtrahend">previous-harvest.model.xml</Param>

<!-- OPTIONS -->
<!--DUMPFILE -->
<!--
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
<% <Param name="dumptofile"> This denotes the place for a text dump file to be produced. The default format of the %>
<% dumpfile is RDF/XML and is able to be added or removed from another model through the use of the transfer tool. %>
<% <Param name="dumptolanguage"> This denotes the language the rdf is in. Predefined values for lang are "RDF/XML", %>
<% "N-TRIPLE", "TURTLE" (or "TTL") and "N3". * null represents the default language, "RDF/XML". "RDF/XML-ABBREV" is %>
<% a synonym for "RDF/XML". %>
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
-->
<Param name="dumptofile">xmlrdf=data/vivo-additions.rdf.xml</Param>
<Param name="dumptolanguage">xmlrdf=RDF/XML</Param>
<Param name="dumptofile">ntriple=data/vivo-ntriple-additions.xml</Param>
<Param name="dumptolanguage">ntriple=N-TRIPLE</Param>

<!--OUTPUT : for more information please see the given config file -->
<!--
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
<% <Param name="output"> The model described by this config file is the model that will be produced which will %>
<% contain the data which is in the minuend but not in the subtrahend. %>
<% %>
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
-->

<!-- <Param name="output">diff-output.model.xml</Param> -->

<!--
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
<% <Param name="selective-diff"> Tells Diff to use the selectiveDiff method in execute. If any "update-types" %>
<% parameters (below) are set, this flag is implicitly set. This flag exists mostly for the case where one wishes %>
<% to use selectiveDiff without specifying update types. %>
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
-->

<!-- <Param name="selective-diff">T</Param> -->

<!--
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
<% <Param name="update-types"> Each update-types entry specifies a type allowed to be updated in the process of %>
<% a diff, meant primarily for creating subtraction models. Untested for addition models! %>
<% %>
<% Specifying any type at all will cause Diff to use the selectiveDiff() method, leading to unspecified types %>
<% being preserved. %>
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
-->

<!-- <Param name="update-types">http://xmlns.com/foaf/0.1/Person</Param> -->
<Param name="wordiness">INFO</Param>
</Task>
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2010-2011 VIVO Harvester Team. For full list of contributors, please see the AUTHORS file provided.
All rights reserved.
This program and the accompanying materials are made available under the terms of the new BSD license which accompanies this distribution, and is available at http://www.opensource.org/licenses/bsd-license.html
-->
<!--
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
<% The diff tool is used to compare jena models and produce a result model which is the first model (minuend) %>
<% with any matching statements in the second model (subtrahend) removed from it. %>
<% ===== %>
<% This tool produces the graph-math difference of the triples between two models. It produces a model with the %>
<% triples which are in the minuend and not in the subtrahend. %>
<% Expressed mathematically as minuend - subtrahend = difference %>
<% Neither the minend nor the subtrahend are altered. %>
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
-->
<Task>
<!--INPUT -->
<!--MINUEND : for more information please see the given config file -->
<!--
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
<% <Param name="minuend"> The model described by this config file is the model which has the data which will be in %>
<% output model. %>
<% %>
<% %>
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
-->
<Param name="minuend">previous-harvest.model.xml</Param>

<!--VIVO -->
<!--SUBTRAHEND : for more information please see the given config file -->
<!--
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
<% <Param name="subtrahend"> The model described by this config file contains the triples which are not goning to %>
<% be within the output model. If the triples match any within the minuend model then the output will be smaller %>
<% than the minuend. %>
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
-->
<Param name="subtrahend">harvested-data.model.xml</Param>

<!-- OPTIONS -->
<!--DUMPFILE -->
<!--
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
<% <Param name="dumptofile"> This denotes the place for a text dump file to be produced. The default format of the %>
<% dumpfile is RDF/XML and is able to be added or removed from another model through the use of the transfer tool. %>
<% <Param name="dumptolanguage"> This denotes the language the rdf is in. Predefined values for lang are "RDF/XML", %>
<% "N-TRIPLE", "TURTLE" (or "TTL") and "N3". * null represents the default language, "RDF/XML". "RDF/XML-ABBREV" is %>
<% a synonym for "RDF/XML". %>
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
-->
<Param name="dumptofile">xmlrdf=data/vivo-subtractions.rdf.xml</Param>
<Param name="dumptofile">ntriple=data/vivo-ntriple-subtractions.xml</Param>
<Param name="dumptolanguage">ntriple=N-TRIPLE</Param>

<!--OUTPUT : for more information please see the given config file -->
<!--
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
<% <Param name="output"> The model described by this config file is the model that will be produced which will %>
<% contain the data which is in the minuend but not in the subtrahend. %>
<% %>
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
-->

<!-- <Param name="output">diff-output.model.xml</Param> -->

<!--
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
<% <Param name="selective-diff"> Tells Diff to use the selectiveDiff method in execute. If any "update-types" %>
<% parameters (below) are set, this flag is implicitly set. This flag exists mostly for the case where one wishes %>
<% to use selectiveDiff without specifying update types. %>
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
-->

<!-- <Param name="selective-diff">T</Param> -->

<!--
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
<% <Param name="update-types"> Each update-types entry specifies a type allowed to be updated in the process of %>
<% a diff, meant primarily for creating subtraction models. Untested for addition models! %>
<% %>
<% Specifying any type at all will cause Diff to use the selectiveDiff() method, leading to unspecified types %>
<% being preserved. %>
<% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %>
-->

<!-- <Param name="update-types">http://xmlns.com/foaf/0.1/Person</Param> -->
<Param name="wordiness">INFO</Param>
</Task>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2010-2011 VIVO Harvester Team. For full list of contributors, please see the AUTHORS file provided.
All rights reserved.
This program and the accompanying materials are made available under the terms of the new BSD license which accompanies this distribution, and is available at http://www.opensource.org/licenses/bsd-license.html
-->
<Config>

<Param name="url">https://demo.dspace.org/server/oai/request</Param>

<!--
<Param name="url">aei.pitt.edu/cgi/oai2</Param>
<Param name="url">www4.fao.org:8080/oaicat/OAIHandler</Param>
-->
<Param name="start">2020-10-01T00:00:00Z</Param>
<Param name="end">2024-12-31T00:00:00Z</Param>
<Param name="metadataPrefix">oai_dc</Param>
<Param name="output">raw-records.config.xml</Param>
<Param name="wordiness">INFO</Param>
</Config>
Loading