diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/.gitignore b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/.gitignore new file mode 100644 index 000000000..58265e5d8 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/.gitignore @@ -0,0 +1,2 @@ +/data +/logs diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/resources/harvester-dspace.conf b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/resources/harvester-dspace.conf new file mode 100644 index 000000000..d82c69567 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/resources/harvester-dspace.conf @@ -0,0 +1,11 @@ +type = OAI +filePrefix=d7_ +harvestTotalCount=5 +uriPrefix = https://dspace7.org/resource/ +endpoint = https://api7.dspace.org/server/oai/request +etl.dir.extract=data_src_dspace7/extract +etl.dir.transform=data_src_dspace7/transform +startDate=2024-06-15 +endDate=2025-01-01 +set=com_10673_1190 +metadataFormat=DC diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/resources/harvester-sample.conf b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/resources/harvester-sample.conf new file mode 100644 index 000000000..3c162655a --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/resources/harvester-sample.conf @@ -0,0 +1,43 @@ +# Specifies the type of the data source or harvesting mechanism. +# "OAI" refers to OAI-PMH protocol which is supported in all DSpace versions +# "RESTv7" is also supported if you are harvesting from DSpace7+ +type = OAI + +# A prefix to add to files during the processing to ensure uniqueness or identification. +# This could help in managing files for different datasets or harvesting jobs. +filePrefix = d7_ + +# The maximum number of pages to harvest during the operation. +# This is useful for testing or limiting the size of the operation. +harvestTotalCount = 5 + +# The base URI prefix used to construct resource identifiers. +uriPrefix = https://dspace7.org/resource/ + +# The endpoint URL of the OAI-PMH or REST server from which metadata is harvested. +# This is the entry point for the OAI-PMH protocol requests. +endpoint = https://api7.dspace.org/server/oai/request + +# Directory where extracted data will be stored. +etl.dir.extract = data_src_dspace7/extract + +# Directory where transformed data will be stored after applying processing or mapping. +# This ensures separation of raw and processed data. +etl.dir.transform = data_src_dspace7/transform + +# Start date for the metadata harvesting process. +# Records modified or created on or after this date will be included. +startDate = 2024-06-15 + +# End date for the metadata harvesting process. +# Records modified or created before or on this date will be included. +endDate = 2025-01-01 + +# The specific OAI-PMH set to harvest from. +# Sets are used to group records in an OAI-PMH repository, e.g., by collection or subject. +set = com_10673_1190 + +# The metadata format to use for harvesting. +# "DC" stands for Dublin Core +# "DIM" stands for DSpace Internal Model +metadataFormat = DC diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/resources/mapping_data/.gitignore b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/resources/mapping_data/.gitignore new file mode 100644 index 000000000..ce1e3fe45 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/resources/mapping_data/.gitignore @@ -0,0 +1,5 @@ +/list-of-all-expertises_demodspace.data +/list-of-all-expertises.data +/list-of-all-persons.data +/list-of-itemsType.data +/all_combined.nt diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/resources/mapping_data/dspace_vivo_url_mapping_list.data b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/resources/mapping_data/dspace_vivo_url_mapping_list.data new file mode 100644 index 000000000..231009d2a --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/resources/mapping_data/dspace_vivo_url_mapping_list.data @@ -0,0 +1,46 @@ +"abstract" +"animation" +"article" +"bachelorthesis" +"book" +"book chapter" +"booklet" +"conferenceobject" +"conference proceeding" +"conference proceedings" +"consensus study report" +"consensus study report (concise)" +"dataset" +"doctoralthesis" +"editorial" +"erratum" +"forum proceedings" +"image" +"image, 3-d" +"info:eu-repo/semantics/article" +"info:eu-repo/semantics/publishedversion" +"journal article" +"learning object" +"magazine" +"masterthesis" +"meeting proceedings" +"other" +"peer review report" +"policy brief" +"policymakers’ booklet" +"presentation" +"proceedings report" +"recording, musical" +"report" +"research article" +"retraction" +"review article" +"software" +"statement" +"survey report" +"symposium proceedings" +"technical report" +"thesis" +"video" +"workshop proceedings" +"text" \ No newline at end of file diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/resources/query/header.sparql b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/resources/query/header.sparql new file mode 100644 index 000000000..b8b3ef44e --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/resources/query/header.sparql @@ -0,0 +1,29 @@ +PREFIX bibo: +PREFIX c4o: +PREFIX cito: +PREFIX dc: +PREFIX dcterms: +PREFIX event: +PREFIX fabio: +PREFIX foaf: +PREFIX geo: +PREFIX obo: +PREFIX ocrer: +PREFIX ocresd: +PREFIX ocresp: +PREFIX ocresst: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX ro: +PREFIX scires: +PREFIX skos: +PREFIX swo: +PREFIX swrlb: +PREFIX swrl: +PREFIX vann: +PREFIX vcard: +PREFIX vitro: +PREFIX vitro-public: +PREFIX vivo: +PREFIX xsd: \ No newline at end of file diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/.gitignore b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/.gitignore new file mode 100644 index 000000000..f7ae9edf3 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/.gitignore @@ -0,0 +1,4 @@ +/*.json +/data/ +/ETL-migration.sh +etl.properties diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/.gitkeep b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/00-env.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/00-env.sh new file mode 100755 index 000000000..c0fdfda84 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/00-env.sh @@ -0,0 +1,92 @@ +#!/bin/bash + +################################################################### +# Script Name : 00-env.sh +# Description : This file is used to define the environment variables +# needed to run the extract/transform/load (ETL) +# process of dspace2vivo +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +# Scripts root directory +export LOC_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +################################################################### +## Root variables +source cleanup.sh +export DEPLOY=$(cd $LOC_SCRIPT_DIR/../../../../../build; pwd -P) +export LIB=$DEPLOY/dependency + +export VIVO_APP_NAME=vivo + +export VIVO_URL=http://localhost:8080/$VIVO_APP_NAME +export PATH=$CATALINA_HOME/bin:$SOLR_DIR/bin:$DSPACE_HOME/bin:$PATH + +################################################################### +## Extract username and password +export RUNTIME_PROP=etl.properties +if test -f "$RUNTIME_PROP"; then + [ -v ROOT_PASSWD ] || export ROOT_PASSWD=$(grep 'rootUser.password' < $RUNTIME_PROP | tr -d ' ' | cut -f 2 -d '=') + [ -v ROOT_USER ] || export ROOT_USER=$(grep 'rootUser.emailAddress' < $RUNTIME_PROP | tr -d ' ' | cut -f 2 -d '=') + [ -v JENA_PATH ] || export JENA_PATH=$(grep 'jenaPath' < $RUNTIME_PROP | tr -d ' ' | cut -f 2 -d '=') + [ -v GRAPH_NAME ] || export GRAPH_NAME=$(grep 'graphName=' < $RUNTIME_PROP | tr -d ' ' | cut -f 2 -d '=') + alias vivo_passwd="echo $ROOT_PASSWD" + alias vivo_user="echo $ROOT_USER" + alias jena_path="echo $JENA_PATH" + alias vivo_graph="echo $GRAPH_NAME" +fi + +################################################################### +## Variables for dspace backend/frontend runtime + +# "rest" section +export DSPACE_REST_SSL=false +export DSPACE_REST_HOST=localhost +export DSPACE_REST_PORT=8080 +export DSPACE_REST_NAMESPACE=/server + +################################################################### +# Executable and script path needed to run dspace2VIVO +PATH=$LOC_SCRIPT_DIR:$PATH + +################################################################### +# Working directory of scripts +export WORKDIR=$(cd $LOC_SCRIPT_DIR/../; pwd -P) + +################################################################### +# Directory of resources needed to configure the expected operation of the scripts +#export RESSOURCESDIR=$(cd $WORKDIR/src/main/resources ; pwd -P) +export RESSOURCESDIR=$(cd $WORKDIR/resources ; pwd -P) + +################################################################### +# Directory containing the correspondence files between DSpace values and VIVO values +export MAPPING_DATA_DIR=$(cd $RESSOURCESDIR/mapping_data ; pwd -P) + +################################################################### +# Resource directories after compilation. This directory is modified at each compilation (Do not edit) +export RESSOURCES_TARGET_DIR=$(cd $WORKDIR/../../../../build/classes ; pwd -P) + +################################################################### +# Directory containing the queries necessary for the execution of SPARQL +export QUERY_DIR=$(cd $RESSOURCESDIR/query ; pwd -P) + +################################################################### +# Repositories containing transient data from the extract/transform/load process +export DATA_DIR=$(cd $WORKDIR/data ; pwd -P) + +################################################################### +# Data transition sub-directories for each step of the ETL process +export ETL_DIR_EXTRACT=$DATA_DIR/extract +export ETL_DIR_TRANSFORM=$DATA_DIR/transform +export ETL_DIR_TRANSFORM_DOC_TYPE=$(cd ${ETL_DIR_TRANSFORM}_doc_type ; pwd -P) +export ETL_DIR_TRANSFORM_PERSON=$(cd ${ETL_DIR_TRANSFORM}_person ; pwd -P) +export ETL_DIR_TRANSFORM_EXPERTISES=$(cd ${ETL_DIR_TRANSFORM}_expertises ; pwd -P) +export ETL_DIR_TRANSFORM_PERSON_EXPERTISES=$(cd ${ETL_DIR_TRANSFORM}_person_expertises ; pwd -P) + +################################################################### +# Setup Jena environment +cd $JENA_PATH +export JENA_HOME="$(pwd)" +export PATH="$PATH:$(pwd)/bin" diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/ETL-migration-DSpace-VIVO.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/ETL-migration-DSpace-VIVO.sh new file mode 100755 index 000000000..e32a1cd85 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/ETL-migration-DSpace-VIVO.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : This script encapsulates the functions call allowing the migration of DSpace Demo(6&7) data into VIVO +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + +$SCRIPT_DIR/create-all-transformation-directory.sh +unset ROOT_USER +unset ROOT_PASSWD +unset JENA_PATH +unset GRAPH_NAME +source $SCRIPT_DIR/00-env.sh +cd $SCRIPT_DIR + +################################################################## +# Clean and setup up data directories and properties +cp $RESSOURCESDIR/*.conf $RESSOURCES_TARGET_DIR +flush_data_dspace.sh 2>/dev/null + +################################################################### +# Extract dspace data +./extract-dspace.sh + +################################################################### +# Produce all list +echo run produce-list-of-expertise.sh +produce-list-of-expertise.sh + +########################### +echo run produce-list-of-itemtype.sh +produce-list-of-itemtype.sh + +########################### +echo run produce-list-of-persons.sh +produce-list-of-persons.sh + +################################################################### +# Process transformation and load to VIVO +load-data-to-vivo.sh + +transform-map-vivo-doc-type.sh +load-data-doc_type-to-vivo.sh ; vivo-recomputeIndex.sh + +transform-map-vivo-person.sh +load-data-person-to-vivo.sh ; vivo-recomputeIndex.sh + +transform-map-vivo-expertises.sh +load-data-expertises-to-vivo.sh ; vivo-recomputeIndex.sh + +transform-map-expertise-and-item-to-a-person-to-vivo.sh +load-data-person-expertise-to-vivo.sh ; vivo-recomputeIndex.sh + +################################################################### +# Done ETL Process +echo "Done!" diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/clean-all-transformation-directory.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/clean-all-transformation-directory.sh new file mode 100755 index 000000000..99b78ed1f --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/clean-all-transformation-directory.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + +cd $ETL_DIR_EXTRACT; rm -f * +cd $ETL_DIR_TRANSFORM; rm -f * +cd $ETL_DIR_TRANSFORM_DOC_TYPE; rm -f * +cd $ETL_DIR_TRANSFORM_PERSON; rm -f * +cd $ETL_DIR_TRANSFORM_EXPERTISES; rm -f * +cd $ETL_DIR_TRANSFORM_PERSON_EXPERTISES; rm -f * diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/cleanup.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/cleanup.sh new file mode 100755 index 000000000..0f491a575 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/cleanup.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### + +# Create a temporary directory to hold the downloaded contents, and make sure +# it's removed later, unless the user set KEEP_BATCH_FILE_CONTENTS. +cleanup () { + if [ -z "${KEEP_BATCH_FILE_CONTENTS}" ] \ + && [ -n "${TMPDIR}" ] \ + && [ "${TMPDIR}" != "/" ]; then + rm -r "${TMPDIR}" + fi +} +trap 'cleanup' EXIT HUP INT QUIT TERM +# mktemp arguments are not very portable. We make a temporary directory with +# portable arguments, then use a consistent filename within. +TMPDIR="$(mktemp -d -t tmp.XXXXXXXXX)" || error_exit "Failed to create temp directory." diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/create-all-transformation-directory.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/create-all-transformation-directory.sh new file mode 100755 index 000000000..122cb3116 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/create-all-transformation-directory.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export LOC_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +DATA_ROOT="$( cd $LOC_SCRIPT_DIR/../ && pwd -P)" + +rm -fr $DATA_ROOT/data + +mkdir -p $DATA_ROOT/data +cd $DATA_ROOT/data +mkdir -p extract transform transform_doc_type transform_person transform_expertises transform_person_expertises diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/etl.example.properties b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/etl.example.properties new file mode 100644 index 000000000..5e8817cc9 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/etl.example.properties @@ -0,0 +1,13 @@ +# The email address of the root VIVO user +rootUser.emailAddress=vivo_root@mydomain.edu + +# The password for the root VIVO user +rootUser.password=admin + +# The file system path to the Apache Jena installation directory. +# This path is used to locate the necessary tools and libraries for interacting with RDF data. +jenaPath=/opt/apache-jena-4.10.0 + +# The URI identifying the desired import graph in the RDF dataset. +# In this case, it refers to the default graph of the Vitro knowledge base. +graphName=http://vitro.mannlib.cornell.edu/default/vitro-kb-2 diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/extract-dspace.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/extract-dspace.sh new file mode 100755 index 000000000..8f7bcaf3c --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/extract-dspace.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh +cd $WORKDIR +CLASSPATH=$(find "$LIB" -name '*.jar' -printf '%p:' | sed 's/:$//') +export PRJ_CP=$WORKDIR/../../../../build/classes:$WORKDIR/../../../../build/dependency/*: +export JVM_ARGS="" + + +echo $PRJ_CP | tr ':' '\n' +echo "============================================" + +cp $WORKDIR/resources/harvester-dspace.conf $WORKDIR/../../../../build/classes/harvester.conf +java $JVM_ARGS -cp "$PRJ_CP" org.vivoweb.harvester.extractdspace.ExtractDSpace + diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/flush_data_dspace.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/flush_data_dspace.sh new file mode 100755 index 000000000..1c2994ca9 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/flush_data_dspace.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh +cd $DATA_DIR + +find . -type d -exec sh -c 'cd $0 ; rm * 2> /dev/null ; echo rm files in $(pwd -P)' {} \; diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-capitalize-each-fisrt-caracter.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-capitalize-each-fisrt-caracter.sh new file mode 100755 index 000000000..d35e9107f --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-capitalize-each-fisrt-caracter.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : Arguments ars stdin and stdout +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +sed -e "s/\b\(.\)/\u\1/g" <&0 | tr -d '"' | func-clean-begin-ending-whitespace.sh diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-clean-begin-ending-whitespace.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-clean-begin-ending-whitespace.sh new file mode 100755 index 000000000..6f5c5c67b --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-clean-begin-ending-whitespace.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : Arguments ars stdin and stdout +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +awk '{$1=$1};1' <&0 diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-encode_string_to_expertise.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-encode_string_to_expertise.sh new file mode 100755 index 000000000..b0155f26b --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-encode_string_to_expertise.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : Standardizes the way to encode an expertise +# Args : Arguments ars stdin and stdout +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +# +# Traduit la chaine de caractères et fait des sauts de lignes au ',;' +tr ',;' '\n' <&0 | tr -d '"' | func-clean-begin-ending-whitespace.sh | func-capitalize-each-fisrt-caracter.sh diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-encode_string_to_i18n_lowercase.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-encode_string_to_i18n_lowercase.sh new file mode 100755 index 000000000..9242dcc56 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-encode_string_to_i18n_lowercase.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : put all in lowercase (also special caracters (ex. É to é) +# Args : Arguments ars stdin and stdout +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +awk '{print tolower($0);}' <&0 | awk '{$1=$1};1' diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-encode_string_to_uid.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-encode_string_to_uid.sh new file mode 100755 index 000000000..c1f6e18d5 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-encode_string_to_uid.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : Arguments ars stdin and stdout +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +recode -f utf8..flat <&0 | tr '[:upper:]' '[:lower:]' | tr '[[:punct:]][[:blank:]]' '_' | tr -s '_' diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-encode_string_to_vivo-URI.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-encode_string_to_vivo-URI.sh new file mode 100755 index 000000000..64cbc936d --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-encode_string_to_vivo-URI.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : Arguments ars stdin and stdout +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +echo "http://dspacevivo.vivoweb.org/individual/$(func-encode_string_to_uid.sh <&0)" diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-remove-brace-to-uri.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-remove-brace-to-uri.sh new file mode 100755 index 000000000..c37b8c868 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-remove-brace-to-uri.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : Arguments ars stdin and stdout +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +tr -d '<>' <&0 diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-skip-first-line.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-skip-first-line.sh new file mode 100755 index 000000000..f73982595 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-skip-first-line.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : Arguments ars stdin and stdout +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +sed 1d <&0 diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-sort-list.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-sort-list.sh new file mode 100755 index 000000000..ee69d4369 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/func-sort-list.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : Arguments ars stdin and stdout +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +sort <&0 | uniq | grep "\S" diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/load-data-doc_type-to-vivo.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/load-data-doc_type-to-vivo.sh new file mode 100755 index 000000000..fabd5213c --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/load-data-doc_type-to-vivo.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + +cd $ETL_DIR_TRANSFORM_DOC_TYPE +for f in *.ntriples +do + fileName=$(realpath $f) + echo "Processing $f" + cat $fileName | grep -v '^\.$' >> $TMPDIR/all.ntriples +# grep terms/type $fileName +done +echo "Loading all files to VIVO" +sparql-load-a-graph-to-vivo.sh -f $TMPDIR/all.ntriples diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/load-data-expertises-to-vivo.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/load-data-expertises-to-vivo.sh new file mode 100755 index 000000000..92a22a898 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/load-data-expertises-to-vivo.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + +cd $ETL_DIR_TRANSFORM_EXPERTISES +for f in *.ntriples +do + fileName=$(realpath $f) + echo "Processing $f" + cat $fileName | grep -v '^\.$' >> $TMPDIR/all.ntriples +# grep terms/type $fileName +done +echo "Loading all files to VIVO" +sparql-load-a-graph-to-vivo.sh -f $TMPDIR/all.ntriples diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/load-data-person-expertise-to-vivo.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/load-data-person-expertise-to-vivo.sh new file mode 100755 index 000000000..f8025dcd6 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/load-data-person-expertise-to-vivo.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + +cd $ETL_DIR_TRANSFORM_PERSON_EXPERTISES +for f in *.ntriples +do + fileName=$(realpath $f) + echo "Processing $f" + cat $fileName | grep -v '^\.$' | grep -v "^\ ." | grep -v "^> ." >> $TMPDIR/all.ntriples + done +echo "Loading all files to VIVO" +sparql-load-a-graph-to-vivo.sh -f $TMPDIR/all.ntriples diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/load-data-person-to-vivo.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/load-data-person-to-vivo.sh new file mode 100755 index 000000000..559a07a16 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/load-data-person-to-vivo.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + +cd $ETL_DIR_TRANSFORM_PERSON +rm .ntriples _.ntriples +for f in *.ntriples +do + fileName=$(realpath $f) + echo "Processing $f" + cat $fileName | grep -v '^\.$' >> $TMPDIR/all.ntriples + +done +echo "Loading all files to VIVO" +sparql-load-a-graph-to-vivo.sh -f $TMPDIR/all.ntriples +echo "Done!" diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/load-data-to-vivo.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/load-data-to-vivo.sh new file mode 100755 index 000000000..78dbd940e --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/load-data-to-vivo.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + +cd $WORKDIR/data/transform +for f in *.ntriples +do + fileName=$(realpath $f) + echo "Processing $f" + cat $fileName >> $TMPDIR/all.ntriples +# grep terms/type $fileName +done +echo "Loading all files to VIVO" +sparql-load-a-graph-to-vivo.sh -f $TMPDIR/all.ntriples +head -10 $TMPDIR/all.ntriples diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/map-document-with-author-to-vivo.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/map-document-with-author-to-vivo.sh new file mode 100755 index 000000000..af0079288 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/map-document-with-author-to-vivo.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + +EXPERTISE=$1 +#### +# Invert first and second name separated by first occurance of ',' + Capitalize first car of each name + remove first and last blank caracter +EXPERTISE_LABEL=$(echo $EXPERTISE | cut -f2 -d ',' | func-clean-begin-ending-whitespace.sh ) + +NAME=$(echo $2 | tr -d '"'| func-encode_string_to_i18n_lowercase.sh | func-capitalize-each-fisrt-caracter.sh ) +FIRST_NAME=$(echo $NAME | cut -f2 -d ',' | func-clean-begin-ending-whitespace.sh) +SECOND_NAME=$(echo $NAME | cut -f1 -d ',' | func-clean-begin-ending-whitespace.sh ) +FULL_NAME="$FIRST_NAME $SECOND_NAME" + +echo " EXPERTISE_LABEL=($EXPERTISE_LABEL) FULL_NAME=($FULL_NAME)" + +if [ -z "${FULL_NAME}" ]; then +echo "FULL_NAME is empty" +exit 0 +fi +if [ -z "${EXPERTISE_LABEL}" ]; then +echo "EXPERTISE_LABEL is empty" +exit 0 +fi + +EXPERTISE_URI="$(echo $EXPERTISE_LABEL | func-encode_string_to_vivo-URI.sh)" +PERS_URI="$(echo $FULL_NAME | func-encode_string_to_vivo-URI.sh)" +############################################################ +# Build query +############################################################ +GET_TYPE_QUERY=$TMPDIR/$(basename $0).sparql +cat < $GET_TYPE_QUERY +<$PERS_URI> <$EXPERTISE_URI> . +<$EXPERTISE_URI> <$PERS_URI> . +EOF +NAME_PRAGMA=$(echo $NAME | func-encode_string_to_uid.sh ) +EXPERTISE_PRAGMA=$(echo $EXPERTISE_LABEL | func-encode_string_to_uid.sh ) +cat $GET_TYPE_QUERY > $ETL_DIR_TRANSFORM_PERSON_EXPERTISES/${EXPERTISE_PRAGMA}-${NAME_PRAGMA}.ntriples diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/map-expertise-and-item-to-a-person-to-vivo.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/map-expertise-and-item-to-a-person-to-vivo.sh new file mode 100755 index 000000000..4ded3689a --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/map-expertise-and-item-to-a-person-to-vivo.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + +EXPERTISE=$1 +#### +# Invert first and second name separated by first occurance of ',' + Capitalize first car of each name + remove first and last blank caracter +EXPERTISE_LABEL=$(echo $EXPERTISE | cut -f2 -d ',' | func-clean-begin-ending-whitespace.sh ) + +NAME=$(echo $2 | tr -d '"'| func-encode_string_to_i18n_lowercase.sh | func-capitalize-each-fisrt-caracter.sh ) +#FIRST_NAME=$(echo $NAME | cut -f2 -d ',' | func-clean-begin-ending-whitespace.sh) +#SECOND_NAME=$(echo $NAME | cut -f1 -d ',' | func-clean-begin-ending-whitespace.sh ) +#FULL_NAME="$FIRST_NAME $SECOND_NAME" + +echo " EXPERTISE_LABEL=($EXPERTISE_LABEL) NAME=($NAME)" + +if [ -z "${NAME}" ]; then +echo "NAME is empty" +exit 0 +fi +if [ -z "${EXPERTISE_LABEL}" ]; then +echo "EXPERTISE_LABEL is empty" +exit 0 +fi + +EXPERTISE_URI="$(echo $EXPERTISE_LABEL | func-encode_string_to_vivo-URI.sh)" +PERS_URI="$(echo $NAME | func-encode_string_to_vivo-URI.sh)" +ITEM_URI="$3" + +AUTHORSHIP_URI="$(echo ${NAME}_${ITEM_URI} | func-encode_string_to_vivo-URI.sh)" + +############################################################ +# Build query +############################################################ +GET_TYPE_QUERY=$TMPDIR/$(basename $0).sparql +cat < $GET_TYPE_QUERY +$(cat $QUERY_DIR/header.sparql) + +construct { + +<$AUTHORSHIP_URI> + a owl:Thing , obo:BFO_0000001 , obo:BFO_0000020 , vivo:Authorship , vivo:Relationship , obo:BFO_0000002 ; + vitro:mostSpecificType vivo:Authorship ; + vivo:rank 1 ; + vivo:relates <$PERS_URI> , <$ITEM_URI> . +<$ITEM_URI> vivo:relatedBy <$AUTHORSHIP_URI> , <$PERS_URI> . +<$PERS_URI> + vivo:relatedBy <$AUTHORSHIP_URI> ; + vivo:relates <$ITEM_URI> . +<$PERS_URI> <$EXPERTISE_URI> . +<$EXPERTISE_URI> <$PERS_URI> . +} where {} +EOF +NAME_PRAGMA=$(echo $NAME | func-encode_string_to_uid.sh ) +EXPERTISE_PRAGMA=$(echo $EXPERTISE_LABEL | func-encode_string_to_uid.sh ) +sparql --query=$GET_TYPE_QUERY --results=nt 2>/dev/null > $ETL_DIR_TRANSFORM_PERSON_EXPERTISES/${EXPERTISE_PRAGMA}-${NAME_PRAGMA}.ntriples diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/map-expertise-to-vivo.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/map-expertise-to-vivo.sh new file mode 100755 index 000000000..f78d1c3c8 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/map-expertise-to-vivo.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + +EXPERTISE=$1 +#### +# Invert first and second name separated by first occurance of ',' + Capitalize first car of each name + remove first and last blank caracter +EXPERTISE_LABEL=$(echo $EXPERTISE | cut -f2 -d ',' | func-clean-begin-ending-whitespace.sh ) +PRAGMA=$(echo $EXPERTISE_LABEL | func-encode_string_to_uid.sh ) +echo " EXPERTISE=($EXPERTISE) EXPERTISE_LABEL=($EXPERTISE_LABEL) PRAGMA=($PRAGMA)" >&2 +EXPERTISE_URI="http://dspacevivo.vivoweb.org/individual/$PRAGMA" +############################################################ +# Build query +############################################################ +GET_TYPE_QUERY=$TMPDIR/$(basename $0).sparql +cat <> $GET_TYPE_QUERY +$(cat $QUERY_DIR/header.sparql) + +construct { + +<$EXPERTISE_URI> + a owl:Thing , skos:Concept ; + rdfs:label "$EXPERTISE_LABEL"@en-US ; + vitro:mostSpecificType skos:Concept . + +} where {} +EOF + +sparql --query=$GET_TYPE_QUERY --results=nt 2>/dev/null > $ETL_DIR_TRANSFORM_EXPERTISES/$PRAGMA.ntriples diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/map-name-to-vivo-person.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/map-name-to-vivo-person.sh new file mode 100755 index 000000000..5cefca567 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/map-name-to-vivo-person.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + +NAME=$(echo $1 | tr -d '"'| func-encode_string_to_i18n_lowercase.sh | func-capitalize-each-fisrt-caracter.sh ) +#### +# Invert first and second name separated by first occurance of ',' + Capitalize first car of each name + remove first and last blank caracter +FIRST_NAME=$(echo $NAME | cut -f2 -d ',' | func-clean-begin-ending-whitespace.sh) +SECOND_NAME=$(echo $NAME | cut -f1 -d ',' | func-clean-begin-ending-whitespace.sh ) +FULL_NAME="$FIRST_NAME $SECOND_NAME" +PRAGMA=$(echo $NAME | func-encode_string_to_uid.sh ) + + echo " NAME=($NAME) FIRST_NAME=($FIRST_NAME) SECOND_NAME=($SECOND_NAME) FULL_NAME=($FULL_NAME) PRAGMA=($PRAGMA)" >&2 +PERS_URI=$(echo "$NAME" | func-encode_string_to_vivo-URI.sh) +############################################################ +# Build query +############################################################ +GET_TYPE_QUERY=$TMPDIR/$(basename $0).sparql +cat <> $GET_TYPE_QUERY +$(cat $QUERY_DIR/header.sparql) + +construct { + +<${PERS_URI}> + a owl:Thing , obo:BFO_0000002 , obo:BFO_0000004 , obo:BFO_0000001 , foaf:Agent , foaf:Person ; + rdfs:label "$FULL_NAME "@en-US ; + obo:ARG_2000028 <${PERS_URI}-vcard> ; + vitro:mostSpecificType foaf:Person . + +<${PERS_URI}-vcard> + a obo:BFO_0000001 , obo:BFO_0000031 , vcard:Individual , obo:ARG_2000379 , obo:BFO_0000002 , obo:IAO_0000030 , owl:Thing , vcard:Kind ; + obo:ARG_2000029 <${PERS_URI}> ; + vitro:mostSpecificType vcard:Individual ; + vcard:hasName <${PERS_URI}-vcard-name> . +<${PERS_URI}-vcard-name> + a owl:Thing , vcard:Identification , vcard:Addressing , vcard:Explanatory , vcard:Communication , vcard:Name ; + vitro:mostSpecificType vcard:Name ; + vcard:familyName "$SECOND_NAME"@en-US ; + vcard:givenName "$FIRST_NAME"@en-US . + +} where {} +EOF +sparql --query=$GET_TYPE_QUERY --results=TTL --results=nt 2>/dev/null > $ETL_DIR_TRANSFORM_PERSON/$PRAGMA.ntriples diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/map-vivo-doc-type.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/map-vivo-doc-type.sh new file mode 100755 index 000000000..8e1f7d514 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/map-vivo-doc-type.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : Allows associating a DSpace docunent type to a VIVO Document +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh +inputGraph=$ETL_DIR_TRANSFORM/$1 + +### +# Remove trim leading and trailing whitespace plus " caracter to docValue +docValues="$(grep terms/type $inputGraph | cut -d ' ' -f 3- | tr -d '.' | func-encode_string_to_i18n_lowercase.sh | tr -d '\"' | func-clean-begin-ending-whitespace.sh | cut -f 1 -d '^')" +while read docValue; do + VIVO_URI=$(grep -i "\"$docValue\"" < $MAPPING_DATA_DIR/dspace_vivo_url_mapping_list.data | cut -d '"' -f 3 | xargs) + echo " Result docValue=($docValue) ($VIVO_URI) ($1)" >&2 + ############################################################ + # Build query + ############################################################ + GET_TYPE_QUERY=$TMPDIR/$(basename $0).sparql + cat < $GET_TYPE_QUERY + $(cat $QUERY_DIR/header.sparql) + + construct { + ?s a $VIVO_URI . + ?s vitro:mostSpecificType $VIVO_URI + + } + where { + ?s dc:type ?o . + } +EOF + + cp $inputGraph /$TMPDIR/$1.nt + sparql --data=/$TMPDIR/$1.nt --query=$GET_TYPE_QUERY --results=ntriples 2>/dev/null +done <<< " $docValues" diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/produce-list-of-expertise.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/produce-list-of-expertise.sh new file mode 100755 index 000000000..ce4d8e8c1 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/produce-list-of-expertise.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh +cd $ETL_DIR_TRANSFORM + +############################################################ +# Build query +############################################################ +GET_TYPE_QUERY=$TMPDIR/$(basename $0).sparql +cat <> $GET_TYPE_QUERY +$(cat $QUERY_DIR/header.sparql) + +select ?o +where { + ?s dc:subject ?o +} +EOF + + +cat *.ntriples > $TMPDIR/all.nt +sparql --data=$TMPDIR/all.nt --query=$GET_TYPE_QUERY --results=TSV 2>/dev/null | sed 1d | func-encode_string_to_expertise.sh | func-sort-list.sh > $MAPPING_DATA_DIR/list-of-all-expertises.data +cat $MAPPING_DATA_DIR/list-of-all-expertises.data +wc -l $MAPPING_DATA_DIR/list-of-all-expertises.data diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/produce-list-of-itemtype.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/produce-list-of-itemtype.sh new file mode 100755 index 000000000..de3cd7f59 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/produce-list-of-itemtype.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh +cd $ETL_DIR_TRANSFORM +grep terms/type *.ntriples | cut -d ' ' -f 3- | tr -d '.' | func-encode_string_to_i18n_lowercase.sh | func-sort-list.sh | func-skip-first-line.sh> $MAPPING_DATA_DIR/list-of-itemsType.data +cat $MAPPING_DATA_DIR/list-of-itemsType.data diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/produce-list-of-persons.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/produce-list-of-persons.sh new file mode 100755 index 000000000..74ea6ca62 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/produce-list-of-persons.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### + +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh +cd $ETL_DIR_TRANSFORM + +############################################################ +# Build query +############################################################ +GET_TYPE_QUERY=$TMPDIR/$(basename $0).sparql +cat <> $GET_TYPE_QUERY +$(cat $QUERY_DIR/header.sparql) + +select ?o +where { + ?s dc:creator ?o . +} +EOF + +combined_data=$(cat *.ntriples) +echo "$combined_data" > "$MAPPING_DATA_DIR/all_combined.nt" + +# Use the variable directly as input to the `sparql` command +sparql --data="$MAPPING_DATA_DIR/all_combined.nt" --query="$GET_TYPE_QUERY" --results=TSV 2>/dev/null | sed 1d | func-sort-list.sh > "$MAPPING_DATA_DIR/list-of-all-persons.data" +cat $MAPPING_DATA_DIR/list-of-all-persons.data +wc -l $MAPPING_DATA_DIR/list-of-all-persons.data diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/sparql-load-a-graph-to-vivo.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/sparql-load-a-graph-to-vivo.sh new file mode 100755 index 000000000..60cf91a7b --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/sparql-load-a-graph-to-vivo.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : see: https://wiki.lyrasis.org/display/VIVODOC110x/SPARQL+Update+API +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh +############################################################ +# Process the input options. Add options as needed. # +############################################################ +# Do help +Help() +{ + # Display Help + echo "Usage: $0 [-s (loading sample-data) | -f graph-filename | -h help]]" +} +# Get the options +while getopts "hsf:" option; do + case $option in + h) # display Help + Help + exit;; + s) # Sample ontoogy + FILE_NAME=$RESSOURCES/sample-graph.ttl;; + f) # Enter a Fisrt Name + FILE_NAME=$(realpath $OPTARG);; + \?) # Invalid option + echo "Error: Invalid option" + Help + exit;; + esac +done +# Evaluate mandatory options +if [ -z ${FILE_NAME} ] ; then + echo "Missing arguments" + Help + exit 1 +fi + +############################################################ +# Build query +############################################################ +TMP_FILE="/tmp/${BASHPID}_tmp_data.ntriples" +cat $FILE_NAME > $TMP_FILE +QUERY=$(cat < into graph <$GRAPH_NAME> +EOF +) + +############################################################ +# Send query +############################################################ + +curl -s -d "email=$ROOT_USER" -d "password=$ROOT_PASSWD" -d "$QUERY" "$VIVO_URL/api/sparqlUpdate" 2>/dev/null +rm $TMP_FILE diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/transform-map-expertise-and-item-to-a-person-to-vivo.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/transform-map-expertise-and-item-to-a-person-to-vivo.sh new file mode 100755 index 000000000..981cf8147 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/transform-map-expertise-and-item-to-a-person-to-vivo.sh @@ -0,0 +1,91 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : Allows associating a DSpace subject to a VIVO Expertise +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + +CREATOR_QUERY=$TMPDIR/creator.sparql +EXPERTISE_QUERY=$TMPDIR/expertise.sparql +ITEM_URI_QUERY=$TMPDIR/item.sparql +cat < $CREATOR_QUERY +$(cat $QUERY_DIR/header.sparql) +select ?aut + where { + ?s dc:creator ?aut . + } +EOF +cat < $ITEM_URI_QUERY +$(cat $QUERY_DIR/header.sparql) +select DISTINCT ?s + where { + ?s dc:creator ?aut . + } +EOF + +cat < $EXPERTISE_QUERY +$(cat $QUERY_DIR/header.sparql) +select ?sub + where { + ?s dc:subject ?sub . + } +EOF +cd $ETL_DIR_TRANSFORM +NBR_FILE=$(ls *.ntriples | wc -l) +for f in *.ntriples +do + ((LOOP_CTR=LOOP_CTR+1)) + fileName=$(realpath $f) + echo "($LOOP_CTR/$NBR_FILE) Processing $f" + BN=$(basename $f .ntriples) + cp $fileName $TMPDIR/$BN.nt + # Extract list of expertises + LIST_OF_EXPERT=$(sparql --data=$TMPDIR/$BN.nt --query=$EXPERTISE_QUERY --results=TSV 2>/dev/null | func-skip-first-line.sh | func-encode_string_to_expertise.sh) + if [ -z "${LIST_OF_EXPERT}" ]; then + echo " LIST_OF_EXPERTISE is empty" + continue + fi + # if list of expertises exist, then extract list of persons + LIST_OF_PERSON=$(sparql --data=$TMPDIR/$BN.nt --query=$CREATOR_QUERY --results=TSV 2>/dev/null | func-skip-first-line.sh | tr -d '"' | func-clean-begin-ending-whitespace.sh) + if [ -z "${LIST_OF_PERSON}" ]; then + echo " LIST_OF_PERSON is empty" + continue + fi + # if list of expertises exist and the extract list of persons exist, the extract de URI of the ITEM + ITEM_URI=$(sparql --data=$TMPDIR/$BN.nt --query=$ITEM_URI_QUERY --results=TSV 2>/dev/null | func-skip-first-line.sh | func-remove-brace-to-uri.sh) + while read aPerson; do + while read anExpertise; do + map-expertise-and-item-to-a-person-to-vivo.sh "$anExpertise" "$aPerson" $ITEM_URI & + sleep 0.25 + done <<< " $LIST_OF_EXPERT" + done <<< " $LIST_OF_PERSON" + wait +done + +################################################################### +# Execution end +exit 0 + +cd $ETL_DIR_TRANSFORM_EXPERTISES +NBR_FILE=$(cat $MAPPING_DATA_DIR/list-of-all-expertises.data | wc -l) +while read name; do + ((LOOP_CTR=LOOP_CTR+1)) + echo "($LOOP_CTR/$NBR_FILE) Processing $name" + map-expertise-to-a-person-to-vivo.sh "$name" & + ((j=j+1)) + if [ $j = "15" ] + then + wait; ((j=0)) ; echo "($LOOP_CTR/$NBR_FILE)====================" ; sleep 0.1 + else + sleep 0.10 + fi +done < $MAPPING_DATA_DIR/list-of-all-expertises.data +wait +echo "$(basename $0) Done" >&2 diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/transform-map-vivo-doc-type.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/transform-map-vivo-doc-type.sh new file mode 100755 index 000000000..e4a9d47a2 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/transform-map-vivo-doc-type.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : Allows associating a DSpace docunent type to a VIVO Document +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh +cd $WORKDIR/data/transform +NBR_FILE=$(ls -al *.ntriples | wc -l) + +for f in *.ntriples +do + ((LOOP_CTR=LOOP_CTR+1)) + fileName=$(realpath $f) + echo "Processing ($LOOP_CTR/$NBR_FILE) $f" + (map-vivo-doc-type.sh $f > $ETL_DIR_TRANSFORM_DOC_TYPE/$f )& + ((j=j+1)) + if [ $j = "10" ] + then + wait; ((j=0)) ; echo =========; sleep 0.1 + + else + sleep 0.2 + fi +done +wait +echo "$(basename $0) Done" >&2 diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/transform-map-vivo-expertises.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/transform-map-vivo-expertises.sh new file mode 100755 index 000000000..bc35fc6fe --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/transform-map-vivo-expertises.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : Allows associating a DSpace subject to a VIVO Expertise +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + +cd $ETL_DIR_TRANSFORM_EXPERTISES +NBR_FILE=$(cat $MAPPING_DATA_DIR/list-of-all-expertises.data | wc -l) +while read name; do + ((LOOP_CTR=LOOP_CTR+1)) + echo "($LOOP_CTR/$NBR_FILE) Processing $name" + map-expertise-to-vivo.sh "$name" & + ((j=j+1)) + if [ $j = "10" ] + then + wait; ((j=0)) ; echo "($LOOP_CTR/$NBR_FILE)====================" ; sleep 0.1 + else + sleep 0.20 + fi +done < $MAPPING_DATA_DIR/list-of-all-expertises.data +wait +echo "$(basename $0) Done" >&2 diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/transform-map-vivo-person.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/transform-map-vivo-person.sh new file mode 100755 index 000000000..87f1fc004 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/transform-map-vivo-person.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : Allows associating a DSpace docunent type to a VIVO Document +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + +cd $ETL_DIR_TRANSFORM_PERSON +NBR_FILE=$(cat $MAPPING_DATA_DIR/list-of-all-persons.data | wc -l) +while read name; do + ((LOOP_CTR=LOOP_CTR+1)) + echo "($LOOP_CTR/$NBR_FILE) Processing $name" + map-name-to-vivo-person.sh "$name" & + ((j=j+1)) + if [ $j = "10" ] + then + wait; ((j=0)) ; echo "($LOOP_CTR/$NBR_FILE)====================" ; sleep 0.1 + else + sleep 0.20 + fi +done < $MAPPING_DATA_DIR/list-of-all-persons.data +wait +echo "$(basename $0) Done" >&2 diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/transformation-map-dc_type.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/transformation-map-dc_type.sh new file mode 100755 index 000000000..78f7be98a --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/transformation-map-dc_type.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + +############################################################ +# Build query +############################################################ +GET_TYPE_QUERY=$TMPDIR/$(basename $0).sparql +cat <> $GET_TYPE_QUERY +$(cat $QUERY_DIR/header.sparql) + +select * +where { + ?s dc:type ?o . +} +EOF + +fileName=$(realpath $1) +riot --output=RDFXML $fileName > /$TMPDIR/$1.rdf 2>/dev/null +sparql --data=$TMPDIR/$1.rdf --query=$GET_TYPE_QUERY --results=TSV diff --git a/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/vivo-recomputeIndex.sh b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/vivo-recomputeIndex.sh new file mode 100755 index 000000000..8c72656c0 --- /dev/null +++ b/example-scripts/bash-scripts/full-harvest-examples/dspace-examples/script/vivo-recomputeIndex.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +################################################################### +# Script Name : +# Description : Recompute vivo solr index +# Args : +# Author : Michel Héon PhD +# Institution : Université du Québec à Montréal +# Copyright : Université du Québec à Montréal (c) 2022 +# Email : heon.michel@uqam.ca +################################################################### +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)" +source $SCRIPT_DIR/00-env.sh + + +############################################################ +# Send command +############################################################ + +curl -s -d "email=$ROOT_USER" -d "password=$ROOT_PASSWD" -d "$QUERY" "$VIVO_URL/SearchIndex" 2>/dev/null diff --git a/pom.xml b/pom.xml index 4890197ee..61a99397d 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.vivoweb @@ -28,6 +28,9 @@ UTF-8 + 3.17.0 + 2.12.1 + 2.0.2 @@ -139,7 +142,7 @@ perm /usr/share/vivo/harvester/scripts - --> + --> ${project.basedir}/example-datamaps directory @@ -183,28 +186,28 @@ - + @@ -212,6 +215,68 @@ + + jakarta.validation + jakarta.validation-api + ${validation-api-version} + + + org.apache.jena + jena-arq + ${jena.version} + + + org.apache.jena + jena-cmds + ${jena.version} + + + org.apache.jena + apache-jena + ${jena.version} + pom + + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + ${jackson.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson.version} + + + javax.annotation + javax.annotation-api + 1.3.2 + + + org.jsoup + jsoup + 1.7.3 + + + com.konghq + unirest-java + 3.13.8 + org.slf4j slf4j-api @@ -227,23 +292,23 @@ compile - org.apache.activemq + org.apache.activemq activemq-all - 5.4.3 - + 5.4.3 + - org.slf4j - slf4j-api + org.slf4j + slf4j-api - junit - junit - 4.13.1 - test - + junit + junit + 4.13.1 + test + commons-vfs @@ -251,7 +316,7 @@ 1.0 jar - + commons-collections commons-collections 3.2.2 @@ -275,20 +340,20 @@ 1.2.19 - com.hp.hpl.jena - Gloze - 1.01-beta2 + gloze + 1.0 + system + ${basedir}/lib/gloze.jar - --> - - com.hp.hpl.jena - gloze - 1.0 - system - ${basedir}/lib/gloze.jar - gov.nih.nln.ncbi eutils @@ -342,100 +407,100 @@ org.dlese.dpc.oai.harvester dlese-project-tools - 3.0 + 3.0 system ${basedir}/lib/DLESETools.jar - + - com.hp.hpl.jena - sdb - 1.3.3 - jar - compile + org.apache.jena + jena-core + pom + 3.4.0 + slf4j-log4j12 org.slf4j - slf4j-api org.slf4j - - - - - - com.hp.hpl.jena - tdb - 0.8.9 - - slf4j-api - org.slf4j ---> - - - - - org.apache.jena - jena-core - pom - 3.4.0 - - - - slf4j-log4j12 - org.slf4j - - - org.slf4j - slf4j-api - - - - org.apache.jena jena-arq @@ -467,19 +532,19 @@ - + org.apache.jena jena-sdb 3.4.0 - + slf4j-log4j12 org.slf4j - org.slf4j - slf4j-api + org.slf4j + slf4j-api @@ -599,27 +664,27 @@ provided true - - org.skife.csv - csv - 1.0 - ${basedir}/lib/csv-1.0.jar - system - - - com.jayway.jsonpath - json-path - 0.9.1 - - - org.apache.httpcomponents - httpclient - 4.5.13 - - - org.apache.httpcomponents - httpcore - 4.4.6 - + + org.skife.csv + csv + 1.0 + ${basedir}/lib/csv-1.0.jar + system + + + com.jayway.jsonpath + json-path + 0.9.1 + + + org.apache.httpcomponents + httpclient + 4.5.13 + + + org.apache.httpcomponents + httpcore + 4.4.6 + diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/ExtractDSpace.java b/src/main/java/org/vivoweb/harvester/extractdspace/ExtractDSpace.java new file mode 100644 index 000000000..835759bd7 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/ExtractDSpace.java @@ -0,0 +1,30 @@ +package org.vivoweb.harvester.extractdspace; + +import java.io.IOException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.vivoweb.harvester.extractdspace.transformation.harvester.HarvesterRunner; + +public class ExtractDSpace { + + private static final Logger logger = LoggerFactory.getLogger(ExtractDSpace.class); + + public static void main(String[] args) throws IOException { + + logger.info("Testing Dspace Harvester..."); + HarvesterRunner runner = new HarvesterRunner(); + logger.info("Init Dspace Harvester..."); + runner.init(); + logger.info("Harvesting Items..."); + runner.setOutputDir("./data/transform/"); + runner.harvestItems(); + logger.info("Harvesting Communities..."); + //runner.harvestCommunities(); + logger.info("Harvesting Collections..."); + //runner.harvestCollections(); + logger.info("Harvesting Repositories..."); + //runner.harvestRepositories(); + logger.info("... DONE"); + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/model/Collection.java b/src/main/java/org/vivoweb/harvester/extractdspace/model/Collection.java new file mode 100644 index 000000000..7bdccddb1 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/model/Collection.java @@ -0,0 +1,228 @@ +package org.vivoweb.harvester.extractdspace.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +public class Collection { + @JsonProperty("dspaceType") + private final String dspaceType = "collection"; + + @JsonProperty("id") + private String id = null; + + @JsonProperty("uri") + private String uri = null; + + @JsonProperty("url") + private String url = null; + + @JsonProperty("hasItem") + private List hasItem = null; + + @JsonProperty("isPartOfCommunityID") + private List isPartOfCommunityID = null; + + @JsonProperty("listOfStatements") + private List listOfStatements = null; + + @JsonProperty("listOfStatementLiterals") + private List listOfStatementLiterals = null; + + + @JsonProperty("dspaceType") + public String getDspaceType() { + return dspaceType; + } + + + public Collection id(String id) { + this.id = id; + return this; + } + + @JsonProperty("id") + @NotNull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Collection uri(String uri) { + this.uri = uri; + return this; + } + + @JsonProperty("uri") + @NotNull + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + + public Collection url(String url) { + this.url = url; + return this; + } + + @JsonProperty("url") + @NotNull + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public Collection hasItem(List hasItem) { + this.hasItem = hasItem; + return this; + } + + public Collection addHasItemItem(Item hasItemItem) { + if (this.hasItem == null) { + this.hasItem = new ArrayList<>(); + } + this.hasItem.add(hasItemItem); + return this; + } + + @JsonProperty("hasItem") + @Valid + public List getHasItem() { + return hasItem; + } + + public void setHasItem(List hasItem) { + this.hasItem = hasItem; + } + + public Collection isPartOfCommunityID(List isPartOfCommunityID) { + this.isPartOfCommunityID = isPartOfCommunityID; + return this; + } + + public Collection addIsPartOfCommunityIDItem(String isPartOfCommunityIDItem) { + if (this.isPartOfCommunityID == null) { + this.isPartOfCommunityID = new ArrayList<>(); + } + this.isPartOfCommunityID.add(isPartOfCommunityIDItem); + return this; + } + + @JsonProperty("isPartOfCommunityID") + public List getIsPartOfCommunityID() { + return isPartOfCommunityID; + } + + public void setIsPartOfCommunityID(List isPartOfCommunityID) { + this.isPartOfCommunityID = isPartOfCommunityID; + } + + public Collection listOfStatements(List listOfStatements) { + this.listOfStatements = listOfStatements; + return this; + } + + public Collection addListOfStatementsItem(Statement listOfStatementsItem) { + if (this.listOfStatements == null) { + this.listOfStatements = new ArrayList<>(); + } + this.listOfStatements.add(listOfStatementsItem); + return this; + } + + @JsonProperty("listOfStatements") + @Valid + public List getListOfStatements() { + return listOfStatements; + } + + public void setListOfStatements(List listOfStatements) { + this.listOfStatements = listOfStatements; + } + + public Collection listOfStatementLiterals(List listOfStatementLiterals) { + this.listOfStatementLiterals = listOfStatementLiterals; + return this; + } + + public Collection addListOfStatementLiteralsItem(StatementLiteral listOfStatementLiteralsItem) { + if (this.listOfStatementLiterals == null) { + this.listOfStatementLiterals = new ArrayList<>(); + } + this.listOfStatementLiterals.add(listOfStatementLiteralsItem); + return this; + } + + @JsonProperty("listOfStatementLiterals") + @Valid + public List getListOfStatementLiterals() { + return listOfStatementLiterals; + } + + public void setListOfStatementLiterals(List listOfStatementLiterals) { + this.listOfStatementLiterals = listOfStatementLiterals; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Collection collection = (Collection) o; + return Objects.equals(this.id, collection.id) && Objects.equals(this.uri, collection.uri) && + Objects.equals(this.url, collection.url) && + Objects.equals(this.hasItem, collection.hasItem) && + Objects.equals(this.isPartOfCommunityID, collection.isPartOfCommunityID) && + Objects.equals(this.listOfStatements, collection.listOfStatements) && + Objects.equals(this.listOfStatementLiterals, collection.listOfStatementLiterals); + } + + @Override + public int hashCode() { + return Objects.hash(dspaceType, id, uri, url, hasItem, isPartOfCommunityID, + listOfStatements, listOfStatementLiterals); + } + + @Override + public String toString() { + + return "class Collection {\n" + + " dspaceType: " + toIndentedString(dspaceType) + "\n" + + " id: " + toIndentedString(id) + "\n" + + " uri: " + toIndentedString(uri) + "\n" + + " url: " + toIndentedString(url) + "\n" + + " hasItem: " + toIndentedString(hasItem) + "\n" + + " isPartOfCommunityID: " + toIndentedString(isPartOfCommunityID) + + "\n" + + " listOfStatements: " + toIndentedString(listOfStatements) + "\n" + + " listOfStatementLiterals: " + toIndentedString(listOfStatementLiterals) + + "\n" + + "}"; + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/model/Community.java b/src/main/java/org/vivoweb/harvester/extractdspace/model/Community.java new file mode 100644 index 000000000..28e125a15 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/model/Community.java @@ -0,0 +1,285 @@ +package org.vivoweb.harvester.extractdspace.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +public class Community { + @JsonProperty("dspaceType") + private final String dspaceType = "community"; + + @JsonProperty("id") + private String id = null; + + @JsonProperty("uri") + private String uri = null; + + @JsonProperty("url") + private String url = null; + + @JsonProperty("hasCollection") + private List hasCollection = null; + + @JsonProperty("hasSubCommunity") + private List hasSubCommunity = null; + + @JsonProperty("isSubcommunityOfID") + private List isSubcommunityOfID = null; + + @JsonProperty("isPartOfRepositoryID") + private List isPartOfRepositoryID = null; + + @JsonProperty("listOfStatements") + private List listOfStatements = null; + + @JsonProperty("listOfStatementLiterals") + private List listOfStatementLiterals = null; + + @JsonProperty("dspaceType") + public String getDspaceType() { + return dspaceType; + } + + + public Community id(String id) { + this.id = id; + return this; + } + + @JsonProperty("id") + @NotNull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Community uri(String uri) { + this.uri = uri; + return this; + } + + @JsonProperty("uri") + @NotNull + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + + public Community url(String url) { + this.url = url; + return this; + } + + @JsonProperty("url") + @NotNull + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public Community hasCollection(List hasCollection) { + this.hasCollection = hasCollection; + return this; + } + + public Community addHasCollectionItem(Collection hasCollectionItem) { + if (this.hasCollection == null) { + this.hasCollection = new ArrayList<>(); + } + this.hasCollection.add(hasCollectionItem); + return this; + } + + @JsonProperty("hasCollection") + @Valid + public List getHasCollection() { + return hasCollection; + } + + public void setHasCollection(List hasCollection) { + this.hasCollection = hasCollection; + } + + public Community hasSubCommunity(List hasSubCommunity) { + this.hasSubCommunity = hasSubCommunity; + return this; + } + + public Community addHasSubCommunityItem(Community hasSubCommunityItem) { + if (this.hasSubCommunity == null) { + this.hasSubCommunity = new ArrayList<>(); + } + this.hasSubCommunity.add(hasSubCommunityItem); + return this; + } + + @JsonProperty("hasSubCommunity") + @Valid + public List getHasSubCommunity() { + return hasSubCommunity; + } + + public void setHasSubCommunity(List hasSubCommunity) { + this.hasSubCommunity = hasSubCommunity; + } + + public Community isSubcommunityOfID(List isSubcommunityOfID) { + this.isSubcommunityOfID = isSubcommunityOfID; + return this; + } + + public Community addIsSubcommunityOfIDItem(String isSubcommunityOfIDItem) { + if (this.isSubcommunityOfID == null) { + this.isSubcommunityOfID = new ArrayList<>(); + } + this.isSubcommunityOfID.add(isSubcommunityOfIDItem); + return this; + } + + @JsonProperty("isSubcommunityOfID") + public List getIsSubcommunityOfID() { + return isSubcommunityOfID; + } + + public void setIsSubcommunityOfID(List isSubcommunityOfID) { + this.isSubcommunityOfID = isSubcommunityOfID; + } + + public Community isPartOfRepositoryID(List isPartOfRepositoryID) { + this.isPartOfRepositoryID = isPartOfRepositoryID; + return this; + } + + public Community addIsPartOfRepositoryIDItem(String isPartOfRepositoryIDItem) { + if (this.isPartOfRepositoryID == null) { + this.isPartOfRepositoryID = new ArrayList<>(); + } + this.isPartOfRepositoryID.add(isPartOfRepositoryIDItem); + return this; + } + + @JsonProperty("isPartOfRepositoryID") + public List getIsPartOfRepositoryID() { + return isPartOfRepositoryID; + } + + public void setIsPartOfRepositoryID(List isPartOfRepositoryID) { + this.isPartOfRepositoryID = isPartOfRepositoryID; + } + + public Community listOfStatements(List listOfStatements) { + this.listOfStatements = listOfStatements; + return this; + } + + public Community addListOfStatementsItem(Statement listOfStatementsItem) { + if (this.listOfStatements == null) { + this.listOfStatements = new ArrayList<>(); + } + this.listOfStatements.add(listOfStatementsItem); + return this; + } + + @JsonProperty("listOfStatements") + @Valid + public List getListOfStatements() { + return listOfStatements; + } + + public void setListOfStatements(List listOfStatements) { + this.listOfStatements = listOfStatements; + } + + public Community listOfStatementLiterals(List listOfStatementLiterals) { + this.listOfStatementLiterals = listOfStatementLiterals; + return this; + } + + public Community addListOfStatementLiteralsItem(StatementLiteral listOfStatementLiteralsItem) { + if (this.listOfStatementLiterals == null) { + this.listOfStatementLiterals = new ArrayList<>(); + } + this.listOfStatementLiterals.add(listOfStatementLiteralsItem); + return this; + } + + @JsonProperty("listOfStatementLiterals") + @Valid + public List getListOfStatementLiterals() { + return listOfStatementLiterals; + } + + public void setListOfStatementLiterals(List listOfStatementLiterals) { + this.listOfStatementLiterals = listOfStatementLiterals; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Community community = (Community) o; + return Objects.equals(this.id, community.id) && Objects.equals(this.uri, community.uri) && + Objects.equals(this.url, community.url) && + Objects.equals(this.hasCollection, community.hasCollection) && + Objects.equals(this.hasSubCommunity, community.hasSubCommunity) && + Objects.equals(this.isSubcommunityOfID, community.isSubcommunityOfID) && + Objects.equals(this.isPartOfRepositoryID, community.isPartOfRepositoryID) && + Objects.equals(this.listOfStatements, community.listOfStatements) && + Objects.equals(this.listOfStatementLiterals, community.listOfStatementLiterals); + } + + @Override + public int hashCode() { + return Objects.hash(dspaceType, id, uri, url, hasCollection, hasSubCommunity, + isSubcommunityOfID, isPartOfRepositoryID, listOfStatements, listOfStatementLiterals); + } + + + @Override + public String toString() { + + return "class Community {\n" + + " dspaceType: " + toIndentedString(dspaceType) + "\n" + + " id: " + toIndentedString(id) + "\n" + + " uri: " + toIndentedString(uri) + "\n" + + " url: " + toIndentedString(url) + "\n" + + " hasCollection: " + toIndentedString(hasCollection) + "\n" + + " hasSubCommunity: " + toIndentedString(hasSubCommunity) + "\n" + + " isSubcommunityOfID: " + toIndentedString(isSubcommunityOfID) + + "\n" + + " isPartOfRepositoryID: " + toIndentedString(isPartOfRepositoryID) + + "\n" + + " listOfStatements: " + toIndentedString(listOfStatements) + "\n" + + " listOfStatementLiterals: " + toIndentedString(listOfStatementLiterals) + + "\n" + + "}"; + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/model/Error.java b/src/main/java/org/vivoweb/harvester/extractdspace/model/Error.java new file mode 100644 index 000000000..9d99bdda8 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/model/Error.java @@ -0,0 +1,82 @@ +package org.vivoweb.harvester.extractdspace.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; +import javax.validation.constraints.NotNull; + +public class Error { + @JsonProperty("code") + private Integer code = null; + + @JsonProperty("message") + private String message = null; + + + public Error code(Integer code) { + this.code = code; + return this; + } + + @JsonProperty("code") + @NotNull + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public Error message(String message) { + this.message = message; + return this; + } + + @JsonProperty("message") + @NotNull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Error error = (Error) o; + return Objects.equals(this.code, error.code) && + Objects.equals(this.message, error.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, message); + } + + @Override + public String toString() { + + return "class Error {\n" + + " code: " + toIndentedString(code) + "\n" + + " message: " + toIndentedString(message) + "\n" + + "}"; + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/model/Item.java b/src/main/java/org/vivoweb/harvester/extractdspace/model/Item.java new file mode 100644 index 000000000..a782b2966 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/model/Item.java @@ -0,0 +1,227 @@ +package org.vivoweb.harvester.extractdspace.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +public class Item { + @JsonProperty("dspaceType") + private final String dspaceType = "item"; + + @JsonProperty("id") + private String id = null; + + @JsonProperty("uri") + private String uri = null; + + @JsonProperty("url") + private String url = null; + + @JsonProperty("dspaceBitstreamURLs") + private List dspaceBitstreamURLs = null; + + @JsonProperty("dspaceIsPartOfCollectionID") + private List dspaceIsPartOfCollectionID = null; + + @JsonProperty("listOfStatements") + private List listOfStatements = null; + + @JsonProperty("listOfStatementLiterals") + private List listOfStatementLiterals = null; + + @JsonProperty("dspaceType") + public String getDspaceType() { + return dspaceType; + } + + + public Item id(String id) { + this.id = id; + return this; + } + + @JsonProperty("id") + @NotNull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Item uri(String uri) { + this.uri = uri; + return this; + } + + @JsonProperty("uri") + @NotNull + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + + public Item url(String url) { + this.url = url; + return this; + } + + @JsonProperty("url") + @NotNull + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public Item dspaceBitstreamURLs(List dspaceBitstreamURLs) { + this.dspaceBitstreamURLs = dspaceBitstreamURLs; + return this; + } + + public Item addDspaceBitstreamURLsItem(String dspaceBitstreamURLsItem) { + if (this.dspaceBitstreamURLs == null) { + this.dspaceBitstreamURLs = new ArrayList<>(); + } + this.dspaceBitstreamURLs.add(dspaceBitstreamURLsItem); + return this; + } + + @JsonProperty("dspaceBitstreamURLs") + public List getDspaceBitstreamURLs() { + return dspaceBitstreamURLs; + } + + public void setDspaceBitstreamURLs(List dspaceBitstreamURLs) { + this.dspaceBitstreamURLs = dspaceBitstreamURLs; + } + + public Item dspaceIsPartOfCollectionID(List dspaceIsPartOfCollectionID) { + this.dspaceIsPartOfCollectionID = dspaceIsPartOfCollectionID; + return this; + } + + public Item addDspaceIsPartOfCollectionIDItem(String dspaceIsPartOfCollectionIDItem) { + if (this.dspaceIsPartOfCollectionID == null) { + this.dspaceIsPartOfCollectionID = new ArrayList<>(); + } + this.dspaceIsPartOfCollectionID.add(dspaceIsPartOfCollectionIDItem); + return this; + } + + @JsonProperty("dspaceIsPartOfCollectionID") + public List getDspaceIsPartOfCollectionID() { + return dspaceIsPartOfCollectionID; + } + + public void setDspaceIsPartOfCollectionID(List dspaceIsPartOfCollectionID) { + this.dspaceIsPartOfCollectionID = dspaceIsPartOfCollectionID; + } + + public Item listOfStatements(List listOfStatements) { + this.listOfStatements = listOfStatements; + return this; + } + + public Item addListOfStatementsItem(Statement listOfStatementsItem) { + if (this.listOfStatements == null) { + this.listOfStatements = new ArrayList<>(); + } + this.listOfStatements.add(listOfStatementsItem); + return this; + } + + @JsonProperty("listOfStatements") + @Valid + public List getListOfStatements() { + return listOfStatements; + } + + public void setListOfStatements(List listOfStatements) { + this.listOfStatements = listOfStatements; + } + + public Item listOfStatementLiterals(List listOfStatementLiterals) { + this.listOfStatementLiterals = listOfStatementLiterals; + return this; + } + + public Item addListOfStatementLiteralsItem(StatementLiteral listOfStatementLiteralsItem) { + if (this.listOfStatementLiterals == null) { + this.listOfStatementLiterals = new ArrayList<>(); + } + this.listOfStatementLiterals.add(listOfStatementLiteralsItem); + return this; + } + + @JsonProperty("listOfStatementLiterals") + @Valid + public List getListOfStatementLiterals() { + return listOfStatementLiterals; + } + + public void setListOfStatementLiterals(List listOfStatementLiterals) { + this.listOfStatementLiterals = listOfStatementLiterals; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Item item = (Item) o; + return Objects.equals(this.id, item.id) && Objects.equals(this.uri, item.uri) && + Objects.equals(this.url, item.url) && + Objects.equals(this.dspaceBitstreamURLs, item.dspaceBitstreamURLs) && + Objects.equals(this.dspaceIsPartOfCollectionID, item.dspaceIsPartOfCollectionID) && + Objects.equals(this.listOfStatements, item.listOfStatements) && + Objects.equals(this.listOfStatementLiterals, item.listOfStatementLiterals); + } + + @Override + public int hashCode() { + return Objects.hash(dspaceType, id, uri, url, dspaceBitstreamURLs, + dspaceIsPartOfCollectionID, listOfStatements, listOfStatementLiterals); + } + + @Override + public String toString() { + + return "class Item {\n" + + " dspaceType: " + toIndentedString(dspaceType) + "\n" + + " id: " + toIndentedString(id) + "\n" + + " uri: " + toIndentedString(uri) + "\n" + + " url: " + toIndentedString(url) + "\n" + + " dspaceBitstreamURLs: " + toIndentedString(dspaceBitstreamURLs) + + "\n" + + " dspaceIsPartOfCollectionID: " + + toIndentedString(dspaceIsPartOfCollectionID) + "\n" + + " listOfStatements: " + toIndentedString(listOfStatements) + "\n" + + " listOfStatementLiterals: " + toIndentedString(listOfStatementLiterals) + + "\n" + + "}"; + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/model/Repository.java b/src/main/java/org/vivoweb/harvester/extractdspace/model/Repository.java new file mode 100644 index 000000000..4cdb68f71 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/model/Repository.java @@ -0,0 +1,178 @@ +package org.vivoweb.harvester.extractdspace.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +public class Repository { + @JsonProperty("dspaceType") + private final String dspaceType = "repository"; + + @JsonProperty("id") + private String id = null; + + @JsonProperty("uri") + private String uri = null; + + @JsonProperty("hasCommunity") + private List hasCommunity = null; + + @JsonProperty("listOfStatements") + private List listOfStatements = null; + + @JsonProperty("listOfStatementLiterals") + private List listOfStatementLiterals = null; + + @JsonProperty("dspaceType") + public String getDspaceType() { + return dspaceType; + } + + public Repository id(String id) { + this.id = id; + return this; + } + + @JsonProperty("id") + @NotNull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Repository uri(String uri) { + this.uri = uri; + return this; + } + + @JsonProperty("uri") + @NotNull + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + + public Repository hasCommunity(List hasCommunity) { + this.hasCommunity = hasCommunity; + return this; + } + + public Repository addHasCommunityItem(Community hasCommunityItem) { + if (this.hasCommunity == null) { + this.hasCommunity = new ArrayList<>(); + } + this.hasCommunity.add(hasCommunityItem); + return this; + } + + @JsonProperty("hasCommunity") + @Valid + public List getHasCommunity() { + return hasCommunity; + } + + public void setHasCommunity(List hasCommunity) { + this.hasCommunity = hasCommunity; + } + + public Repository listOfStatements(List listOfStatements) { + this.listOfStatements = listOfStatements; + return this; + } + + public Repository addListOfStatementsItem(Statement listOfStatementsItem) { + if (this.listOfStatements == null) { + this.listOfStatements = new ArrayList<>(); + } + this.listOfStatements.add(listOfStatementsItem); + return this; + } + + @JsonProperty("listOfStatements") + @Valid + public List getListOfStatements() { + return listOfStatements; + } + + public void setListOfStatements(List listOfStatements) { + this.listOfStatements = listOfStatements; + } + + public Repository listOfStatementLiterals(List listOfStatementLiterals) { + this.listOfStatementLiterals = listOfStatementLiterals; + return this; + } + + public Repository addListOfStatementLiteralsItem(StatementLiteral listOfStatementLiteralsItem) { + if (this.listOfStatementLiterals == null) { + this.listOfStatementLiterals = new ArrayList<>(); + } + this.listOfStatementLiterals.add(listOfStatementLiteralsItem); + return this; + } + + @JsonProperty("listOfStatementLiterals") + @Valid + public List getListOfStatementLiterals() { + return listOfStatementLiterals; + } + + public void setListOfStatementLiterals(List listOfStatementLiterals) { + this.listOfStatementLiterals = listOfStatementLiterals; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Repository repository = (Repository) o; + return Objects.equals(this.id, repository.id) && Objects.equals(this.uri, repository.uri) && + Objects.equals(this.hasCommunity, repository.hasCommunity) && + Objects.equals(this.listOfStatements, repository.listOfStatements) && + Objects.equals(this.listOfStatementLiterals, repository.listOfStatementLiterals); + } + + @Override + public int hashCode() { + return Objects.hash(dspaceType, id, uri, hasCommunity, listOfStatements, + listOfStatementLiterals); + } + + @Override + public String toString() { + + return "class Repository {\n" + + " dspaceType: " + toIndentedString(dspaceType) + "\n" + + " id: " + toIndentedString(id) + "\n" + + " uri: " + toIndentedString(uri) + "\n" + + " hasCommunity: " + toIndentedString(hasCommunity) + "\n" + + " listOfStatements: " + toIndentedString(listOfStatements) + "\n" + + " listOfStatementLiterals: " + toIndentedString(listOfStatementLiterals) + + "\n" + + "}"; + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/model/Statement.java b/src/main/java/org/vivoweb/harvester/extractdspace/model/Statement.java new file mode 100644 index 000000000..2e0f827d8 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/model/Statement.java @@ -0,0 +1,110 @@ +package org.vivoweb.harvester.extractdspace.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; +import javax.validation.constraints.NotNull; + +public class Statement { + @JsonProperty("dspaceType") + private final String dspaceType = "statement"; + + @JsonProperty("subjectUri") + private String subjectUri = null; + + @JsonProperty("predicateUri") + private String predicateUri = null; + + @JsonProperty("objectUri") + private String objectUri = null; + + @JsonProperty("dspaceType") + public String getDspaceType() { + return dspaceType; + } + + public Statement subjectUri(String subjectUri) { + this.subjectUri = subjectUri; + return this; + } + + @JsonProperty("subjectUri") + @NotNull + public String getSubjectUri() { + return subjectUri; + } + + public void setSubjectUri(String subjectUri) { + this.subjectUri = subjectUri; + } + + public Statement predicateUri(String predicateUri) { + this.predicateUri = predicateUri; + return this; + } + + @JsonProperty("predicateUri") + @NotNull + public String getPredicateUri() { + return predicateUri; + } + + public void setPredicateUri(String predicateUri) { + this.predicateUri = predicateUri; + } + + public Statement objectUri(String objectUri) { + this.objectUri = objectUri; + return this; + } + + @JsonProperty("objectUri") + @NotNull + public String getObjectUri() { + return objectUri; + } + + public void setObjectUri(String objectUri) { + this.objectUri = objectUri; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Statement statement = (Statement) o; + return Objects.equals(this.subjectUri, statement.subjectUri) && + Objects.equals(this.predicateUri, statement.predicateUri) && + Objects.equals(this.objectUri, statement.objectUri); + } + + @Override + public int hashCode() { + return Objects.hash(dspaceType, subjectUri, predicateUri, objectUri); + } + + @Override + public String toString() { + + return "class Statement {\n" + + " dspaceType: " + toIndentedString(dspaceType) + "\n" + + " subjectUri: " + toIndentedString(subjectUri) + "\n" + + " predicateUri: " + toIndentedString(predicateUri) + "\n" + + " objectUri: " + toIndentedString(objectUri) + "\n" + + "}"; + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/model/StatementLiteral.java b/src/main/java/org/vivoweb/harvester/extractdspace/model/StatementLiteral.java new file mode 100644 index 000000000..7a5a5b326 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/model/StatementLiteral.java @@ -0,0 +1,130 @@ +package org.vivoweb.harvester.extractdspace.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; +import javax.validation.constraints.NotNull; + +public class StatementLiteral { + @JsonProperty("dspaceType") + private final String dspaceType = "statementLiteral"; + + @JsonProperty("subjectUri") + private String subjectUri = null; + + @JsonProperty("predicateUri") + private String predicateUri = null; + + @JsonProperty("objectLiteral") + private String objectLiteral = null; + + @JsonProperty("literalType") + private String literalType = null; + + @JsonProperty("dspaceType") + public String getDspaceType() { + return dspaceType; + } + + public StatementLiteral subjectUri(String subjectUri) { + this.subjectUri = subjectUri; + return this; + } + + @JsonProperty("subjectUri") + @NotNull + public String getSubjectUri() { + return subjectUri; + } + + public void setSubjectUri(String subjectUri) { + this.subjectUri = subjectUri; + } + + public StatementLiteral predicateUri(String predicateUri) { + this.predicateUri = predicateUri; + return this; + } + + @JsonProperty("predicateUri") + @NotNull + public String getPredicateUri() { + return predicateUri; + } + + public void setPredicateUri(String predicateUri) { + this.predicateUri = predicateUri; + } + + public StatementLiteral objectLiteral(String objectLiteral) { + this.objectLiteral = objectLiteral; + return this; + } + + @JsonProperty("objectLiteral") + @NotNull + public String getObjectLiteral() { + return objectLiteral; + } + + public void setObjectLiteral(String objectLiteral) { + this.objectLiteral = objectLiteral; + } + + public StatementLiteral literalType(String literalType) { + this.literalType = literalType; + return this; + } + + @JsonProperty("literalType") + @NotNull + public String getLiteralType() { + return literalType; + } + + public void setLiteralType(String literalType) { + this.literalType = literalType; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StatementLiteral statementLiteral = (StatementLiteral) o; + return Objects.equals(this.subjectUri, statementLiteral.subjectUri) && + Objects.equals(this.predicateUri, statementLiteral.predicateUri) && + Objects.equals(this.objectLiteral, statementLiteral.objectLiteral) && + Objects.equals(this.literalType, statementLiteral.literalType); + } + + @Override + public int hashCode() { + return Objects.hash(dspaceType, subjectUri, predicateUri, objectLiteral, literalType); + } + + @Override + public String toString() { + + return "class StatementLiteral {\n" + + " dspaceType: " + toIndentedString(dspaceType) + "\n" + + " subjectUri: " + toIndentedString(subjectUri) + "\n" + + " predicateUri: " + toIndentedString(predicateUri) + "\n" + + " objectLiteral: " + toIndentedString(objectLiteral) + "\n" + + " literalType: " + toIndentedString(literalType) + "\n" + + "}"; + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/model/util/DSpaceObjectMapperHelper.java b/src/main/java/org/vivoweb/harvester/extractdspace/model/util/DSpaceObjectMapperHelper.java new file mode 100644 index 000000000..19617ee41 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/model/util/DSpaceObjectMapperHelper.java @@ -0,0 +1,26 @@ +package org.vivoweb.harvester.extractdspace.model.util; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.vivoweb.harvester.extractdspace.model.Item; +import org.vivoweb.harvester.extractdspace.model.Repository; + +/** + * @author heon + */ +public class DSpaceObjectMapperHelper { + + public static void main(String[] args) { + + } + + public static String map(Repository repo) throws JsonProcessingException { + ObjectMapper mapper = new ObjectMapper(); + return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(repo); + } + + public static String map(Item item) throws JsonProcessingException { + ObjectMapper mapper = new ObjectMapper(); + return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(item); + } +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/model/util/DSpaceStatementHelper.java b/src/main/java/org/vivoweb/harvester/extractdspace/model/util/DSpaceStatementHelper.java new file mode 100644 index 000000000..e4c1ad52e --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/model/util/DSpaceStatementHelper.java @@ -0,0 +1,26 @@ +package org.vivoweb.harvester.extractdspace.model.util; + +import org.vivoweb.harvester.extractdspace.model.Statement; +import org.vivoweb.harvester.extractdspace.model.StatementLiteral; + +public class DSpaceStatementHelper { + + public static StatementLiteral createStatementLiteral(String supject, String predicate, + String literal, + String literaltype) { + StatementLiteral aStatement = new StatementLiteral(); + aStatement.setSubjectUri(supject); + aStatement.setPredicateUri(predicate); + aStatement.setObjectLiteral(literal); + aStatement.setLiteralType(literaltype); + return aStatement; + } + + public static Statement createStatement(String supject, String predicate, String object) { + Statement aStatement = new Statement(); + aStatement.setSubjectUri(supject); + aStatement.setPredicateUri(predicate); + aStatement.setObjectUri(object); + return aStatement; + } +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/ConsoleApplication.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/ConsoleApplication.java new file mode 100644 index 000000000..8f7f4bba4 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/ConsoleApplication.java @@ -0,0 +1,39 @@ +package org.vivoweb.harvester.extractdspace.transformation; + +import java.io.IOException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.vivoweb.harvester.extractdspace.transformation.harvester.HarvesterRunner; + +public class ConsoleApplication { + + private static final Logger logger = LoggerFactory.getLogger(ConsoleApplication.class); + + public static void main(String[] args) throws IOException { + + logger.info("Testing Dspace Harvester..."); + logger.info("PARAMS..."); + + HarvesterRunner runner = new HarvesterRunner(); + if (args.length > 1) { + logger.info("Configuration file {}", args[0]); + runner.setPathConfigFile(args[0]); + logger.info("Output directory {}", args[1]); + runner.setOutputDir(args[1]); + } else { + logger.info("Loading sample configuration (Dspace 7 Demo)"); + logger.info("Showing results in std output"); + } + logger.info("Init Dspace Harvester..."); + runner.init(); + logger.info("Harvesting Items..."); + runner.harvestItems(); + logger.info("Harvesting Communities..."); + //runner.harvestCommunities(); + logger.info("Harvesting Collections..."); + //runner.harvestCollections(); + logger.info("Harvesting Repositories..."); + //runner.harvestRepositories(); + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/DspaceItemParser.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/DspaceItemParser.java new file mode 100644 index 000000000..08178a9e8 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/DspaceItemParser.java @@ -0,0 +1,182 @@ +/** + * + */ + +package org.vivoweb.harvester.extractdspace.transformation; + +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import org.apache.jena.datatypes.xsd.XSDDatatype; +import org.apache.jena.rdf.model.Literal; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.ResourceFactory; +import org.apache.jena.shared.PrefixMapping; +import org.apache.jena.vocabulary.OWL; +import org.apache.jena.vocabulary.RDF; +import org.apache.jena.vocabulary.RDFS; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.vivoweb.harvester.extractdspace.model.Item; +import org.vivoweb.harvester.extractdspace.model.Statement; +import org.vivoweb.harvester.extractdspace.model.StatementLiteral; +import org.vivoweb.harvester.extractdspace.model.util.DSpaceObjectMapperHelper; +import org.vivoweb.harvester.extractdspace.model.util.DSpaceStatementHelper; +import org.vivoweb.harvester.extractdspace.vocab.dspace.DSPACE; +import org.vivoweb.harvester.extractdspace.vocab.util.ParserHelper; +import org.vivoweb.harvester.extractdspace.vocab.vitro.VITRO; +import org.vivoweb.harvester.extractdspace.vocab.vivo.BIBO; +import org.vivoweb.harvester.extractdspace.vocab.vivo.OBO; +import org.vivoweb.harvester.extractdspace.vocab.vivo.VCARD; +import org.vivoweb.harvester.extractdspace.vocab.vivo.VIVO; + +/** + * @author heon + */ +public class DspaceItemParser { + + private static final Logger logger = LoggerFactory.getLogger(DspaceItemParser.class); + + public static void main(String[] args) throws JsonProcessingException { + Item anItem = new Item(); + anItem.setId("123456789_68"); + String itemUri = + "http://dspacevivo.vivoweb.org/individual/123456789_68"; + anItem.setUri(itemUri); + anItem.setUrl("http://localhost:8080/server/rdf/resource/123456789/68"); + List arrayList = new ArrayList(); + arrayList.add("http://localhost:4000/bitstream/123456789/68/1/bubble-chart-line.png"); + anItem.setDspaceBitstreamURLs(arrayList); + anItem.addDspaceIsPartOfCollectionIDItem("123456789_62"); + anItem.addListOfStatementLiteralsItem( + DSpaceStatementHelper.createStatementLiteral(itemUri, "dc:date", "2022-04-02T06:28:50Z", + "xsd:dateTime")); + anItem.addListOfStatementLiteralsItem( + DSpaceStatementHelper.createStatementLiteral(itemUri, "dcterms:available", + "2022-04-02T06:28:50Z", "xsd:dateTime")); + anItem.addListOfStatementLiteralsItem( + DSpaceStatementHelper.createStatementLiteral(itemUri, "dcterms:hasPart", + "http://localhost:4000/bitstream/123456789/68/1/bubble-chart-line.png", + "xsd:anyURI")); + anItem.addListOfStatementLiteralsItem( + DSpaceStatementHelper.createStatementLiteral(itemUri, "dcterms:isPartOf", + "http://localhost:8080/server/rdf/resource/123456789/62", "xsd:anyURI")); + anItem.addListOfStatementLiteralsItem( + DSpaceStatementHelper.createStatementLiteral(itemUri, "dcterms:issued", "2022", null)); + anItem.addListOfStatementLiteralsItem( + DSpaceStatementHelper.createStatementLiteral(itemUri, "dcterms:title", "Test thesis", + null)); + anItem.addListOfStatementLiteralsItem( + DSpaceStatementHelper.createStatementLiteral(itemUri, "bibo:uri", + "http://localhost:4000/handle/123456789/68", "xsd:anyURI")); + DspaceItemParser parser = new DspaceItemParser(); + String prettyRepo = DSpaceObjectMapperHelper.map(anItem); + logger.info(prettyRepo); + Model repoModel = parser.parse(anItem); + ParserHelper.dumpStdoutModel(repoModel); + } + + public Model parse(Item anItem) { + Model model = ModelFactory.createDefaultModel(); + PrefixMapping prefixMapping = ParserHelper.getVIVOPrefixes(); + model.setNsPrefixes(prefixMapping); + Resource anItemURI = ResourceFactory.createResource(anItem.getUri()); + Resource anItemURI_vcard = ResourceFactory.createResource(anItem.getUri() + "-vcard"); + Resource anItemURI_vcard_url = + ResourceFactory.createResource(anItem.getUri() + "-vcard-url"); + + model.add(anItemURI, RDF.type, OBO.BFO_0000031); + model.add(anItemURI, RDF.type, OBO.IAO_0000030); + model.add(anItemURI, RDF.type, OBO.BFO_0000001); + model.add(anItemURI, RDF.type, OBO.BFO_0000002); + model.add(anItemURI, RDF.type, OWL.Thing); + model.add(anItemURI, RDF.type, BIBO.Document); + model.add(anItemURI, VITRO.mostSpecificType, BIBO.Document); + model.add(anItemURI, OBO.ARG_2000028, anItemURI_vcard); + try { + Literal biteStream = + ResourceFactory.createTypedLiteral(anItem.getDspaceBitstreamURLs().get(0), + XSDDatatype.XSDanyURI); + model.add(anItemURI, DSPACE.hasBitstream, biteStream); + } catch (Exception ignored) { + } + + model.add(anItemURI_vcard, RDF.type, VCARD.Kind); + model.add(anItemURI_vcard, RDF.type, OBO.BFO_0000031); + model.add(anItemURI_vcard, RDF.type, OBO.BFO_0000002); + model.add(anItemURI_vcard, RDF.type, OWL.Thing); + model.add(anItemURI_vcard, RDF.type, OBO.BFO_0000001); + model.add(anItemURI_vcard, RDF.type, OBO.ARG_2000379); + model.add(anItemURI_vcard, RDF.type, OBO.IAO_0000030); + model.add(anItemURI_vcard, OBO.ARG_2000029, anItemURI); + model.add(anItemURI_vcard, VCARD.hasURL, anItemURI_vcard_url); + + model.add(anItemURI_vcard_url, RDF.type, VCARD.Addressing); + model.add(anItemURI_vcard_url, RDF.type, VCARD.URL); + model.add(anItemURI_vcard_url, RDF.type, VCARD.Identification); + model.add(anItemURI_vcard_url, RDF.type, VCARD.Communication); + model.add(anItemURI_vcard_url, RDF.type, VCARD.Explanatory); + model.add(anItemURI_vcard_url, RDF.type, OWL.Thing); + + model.add(anItemURI_vcard_url, VITRO.mostSpecificType, VCARD.URL); + model.add(anItemURI_vcard_url, VIVO.rank, + ResourceFactory.createTypedLiteral("1", XSDDatatype.XSDnonNegativeInteger)); + + try { + model.add(anItemURI_vcard_url, VCARD.url, + ResourceFactory.createTypedLiteral(anItem.getUrl(), XSDDatatype.XSDanyURI)); + + } catch (Exception e) { + logger.info("Item : (" + anItem.getId() + ") has no URL"); + } + + List statements = anItem.getListOfStatements(); + if (statements != null) { + for (Statement statement : statements) { + String subj = + Objects.requireNonNull(prefixMapping.expandPrefix(statement.getSubjectUri())); + String pred = + Objects.requireNonNull(prefixMapping.expandPrefix(statement.getPredicateUri())); + String obj = + Objects.requireNonNull(prefixMapping.expandPrefix(statement.getObjectUri())); + + model.add(model.createResource(subj), model.createProperty(pred), + model.createResource(obj)); + } + } + + List stmtls = anItem.getListOfStatementLiterals(); + if (stmtls != null) { + for (StatementLiteral statement : stmtls) { + String subj = + Objects.requireNonNull(prefixMapping.expandPrefix(statement.getSubjectUri())); + String pred = + Objects.requireNonNull(prefixMapping.expandPrefix(statement.getPredicateUri())); + String obj = Objects.requireNonNull(statement.getObjectLiteral()); + + String lType = statement.getLiteralType(); + Literal aLiteral; + if (lType != null && !lType.isEmpty()) { + XSDDatatype dataType = ParserHelper.parseDataType(lType); + aLiteral = ResourceFactory.createTypedLiteral(obj, dataType); + } else { + aLiteral = ResourceFactory.createPlainLiteral(obj); + } + + if (pred.contains("title") && pred.contains("terms")) { + model.add(model.createResource(subj), RDFS.label, aLiteral); + } else if (pred.contains("description") && pred.contains("terms")) { + model.add(model.createResource(subj), BIBO.abstract_, aLiteral); + } else if (pred.contains("subject")) { + model.add(model.createResource(subj), VIVO.freetextKeyword, aLiteral); + } + model.add(model.createResource(subj), model.createProperty(pred), aLiteral); + } + } + + return model; + } +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/DspaceRepositoryParser.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/DspaceRepositoryParser.java new file mode 100644 index 000000000..ceb285036 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/DspaceRepositoryParser.java @@ -0,0 +1,125 @@ +/** + * + */ + +package org.vivoweb.harvester.extractdspace.transformation; + +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.List; +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import org.apache.jena.datatypes.xsd.XSDDatatype; +import org.apache.jena.rdf.model.Literal; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.ResourceFactory; +import org.apache.jena.shared.PrefixMapping; +import org.apache.jena.vocabulary.OWL; +import org.apache.jena.vocabulary.RDF; +import org.apache.jena.vocabulary.XSD; +import org.vivoweb.harvester.extractdspace.model.Repository; +import org.vivoweb.harvester.extractdspace.model.Statement; +import org.vivoweb.harvester.extractdspace.model.StatementLiteral; +import org.vivoweb.harvester.extractdspace.vocab.dspace.DSPACE; +import org.vivoweb.harvester.extractdspace.vocab.util.ParserHelper; +import org.vivoweb.harvester.extractdspace.vocab.vitro.VITRO; +import org.vivoweb.harvester.extractdspace.vocab.vivo.BIBO; +import org.vivoweb.harvester.extractdspace.vocab.vivo.OBO; +import org.vivoweb.harvester.extractdspace.vocab.vivo.VCARD; +import org.vivoweb.harvester.extractdspace.vocab.vivo.VIVO; + +/** + * @author heon + */ +public class DspaceRepositoryParser { + + public static void main(String[] args) throws JsonProcessingException { + Repository repo = new Repository(); + repo.setId("123456789_0"); + repo.setUri("http://localhost:8080/server/rdf/resource/123456789/0"); + Statement stmt = new Statement(); + stmt.setSubjectUri("dspace:123456789_0"); + stmt.setPredicateUri("dcterms:hasPart"); + stmt.setObjectUri("http://localhost:8080/server/rdf/resource/123456789/1"); + StatementLiteral stmtLit = new StatementLiteral(); + stmtLit.setSubjectUri("dspace:123456789_0"); + stmtLit.setPredicateUri("rdf:label"); + stmtLit.setObjectLiteral("a repository for testing"); + stmtLit.setLiteralType(XSD.xstring.getURI()); + + repo.addListOfStatementsItem(stmt); + repo.addListOfStatementLiteralsItem(stmtLit); + } + + private Model parse(Repository repo) { + Model model = ModelFactory.createDefaultModel(); + PrefixMapping prefixMapping = ParserHelper.getVIVOPrefixes(); + model.setNsPrefixes(prefixMapping); + Resource orgdURI = ResourceFactory.createResource(DSPACE.getURI() + repo.getId()); + Resource orgdURI_vcard = + ResourceFactory.createResource(DSPACE.getURI() + repo.getId() + "-vcard"); + Resource orgdURI_vcard_url = + ResourceFactory.createResource(DSPACE.getURI() + repo.getId() + "-vcard-url"); + + model.add(orgdURI, RDF.type, OBO.BFO_0000031); + model.add(orgdURI, RDF.type, OBO.IAO_0000030); + model.add(orgdURI, RDF.type, OBO.BFO_0000001); + model.add(orgdURI, RDF.type, OBO.BFO_0000002); + model.add(orgdURI, RDF.type, OWL.Thing); + model.add(orgdURI, RDF.type, BIBO.Document); + model.add(orgdURI, RDF.type, DSPACE.Repository); + model.add(orgdURI, VITRO.mostSpecificType, DSPACE.Repository); + model.add(orgdURI, OBO.ARG_2000028, orgdURI_vcard); + List stmts = repo.getListOfStatements(); + + for (Statement statement : stmts) { + @NotNull + String subj = prefixMapping.expandPrefix(statement.getSubjectUri()); + @NotNull + String pred = prefixMapping.expandPrefix(statement.getPredicateUri()); + @NotNull + String obj = prefixMapping.expandPrefix(statement.getObjectUri()); + model.add(model.createResource(subj), model.createProperty(pred), + model.createResource(obj)); + } + + @Valid List stmtls = repo.getListOfStatementLiterals(); + for (StatementLiteral statement : stmtls) { + @NotNull + String subj = prefixMapping.expandPrefix(statement.getSubjectUri()); + @NotNull + String pred = prefixMapping.expandPrefix(statement.getPredicateUri()); + @NotNull + String obj = statement.getObjectLiteral(); + Literal aLiteral = ResourceFactory.createTypedLiteral(obj, XSDDatatype.XSDstring); + model.add(model.createResource(subj), model.createProperty(pred), aLiteral); + } + + model.add(orgdURI_vcard, RDF.type, VCARD.Kind); + model.add(orgdURI_vcard, RDF.type, OBO.BFO_0000031); + model.add(orgdURI_vcard, RDF.type, OBO.BFO_0000002); + model.add(orgdURI_vcard, RDF.type, OWL.Thing); + model.add(orgdURI_vcard, RDF.type, OBO.BFO_0000001); + model.add(orgdURI_vcard, RDF.type, OBO.ARG_2000379); + model.add(orgdURI_vcard, RDF.type, OBO.IAO_0000030); + model.add(orgdURI_vcard, OBO.ARG_2000029, orgdURI); + model.add(orgdURI_vcard, VCARD.hasURL, orgdURI_vcard_url); + + model.add(orgdURI_vcard_url, RDF.type, VCARD.Addressing); + model.add(orgdURI_vcard_url, RDF.type, VCARD.URL); + model.add(orgdURI_vcard_url, RDF.type, VCARD.Identification); + model.add(orgdURI_vcard_url, RDF.type, VCARD.Communication); + model.add(orgdURI_vcard_url, RDF.type, VCARD.Explanatory); + model.add(orgdURI_vcard_url, RDF.type, OWL.Thing); + + model.add(orgdURI_vcard_url, VITRO.mostSpecificType, VCARD.URL); + model.add(orgdURI_vcard_url, VIVO.rank, + ResourceFactory.createTypedLiteral("1", XSDDatatype.XSDnonNegativeInteger)); + model.add(orgdURI_vcard_url, VCARD.url, ResourceFactory.createResource(repo.getUri())); + + ParserHelper.dumpStdoutModel(model); + return null; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/DspaceHarvester.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/DspaceHarvester.java new file mode 100644 index 000000000..18fc463e2 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/DspaceHarvester.java @@ -0,0 +1,31 @@ +package org.vivoweb.harvester.extractdspace.transformation.harvester; + +import java.util.Iterator; +import java.util.Properties; +import org.vivoweb.harvester.extractdspace.model.Collection; +import org.vivoweb.harvester.extractdspace.model.Community; +import org.vivoweb.harvester.extractdspace.model.Item; +import org.vivoweb.harvester.extractdspace.model.Repository; + +public abstract class DspaceHarvester { + + protected Properties conf; + + public DspaceHarvester(Properties conf) { + this.conf = conf; + } + + public Properties getConf() { + return conf; + } + + public abstract void connect(); + + public abstract Iterator harvestItems(); + + public abstract Iterator harvestCommunity(); + + public abstract Iterator harvestCollection(); + + public abstract Iterator harvestRepository(); +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/HarvesterRunner.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/HarvesterRunner.java new file mode 100644 index 000000000..400ca8e3d --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/HarvesterRunner.java @@ -0,0 +1,143 @@ +package org.vivoweb.harvester.extractdspace.transformation.harvester; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Iterator; +import java.util.Properties; +import org.apache.jena.rdf.model.Model; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.vivoweb.harvester.extractdspace.model.Collection; +import org.vivoweb.harvester.extractdspace.model.Community; +import org.vivoweb.harvester.extractdspace.model.Item; +import org.vivoweb.harvester.extractdspace.model.Repository; +import org.vivoweb.harvester.extractdspace.transformation.DspaceItemParser; +import org.vivoweb.harvester.extractdspace.transformation.harvester.config.HarvesterConfiguration; +import org.vivoweb.harvester.extractdspace.transformation.harvester.oai.DspaceOAI; +import org.vivoweb.harvester.extractdspace.transformation.harvester.restv7.RESTv7Harvester; +import org.vivoweb.harvester.extractdspace.vocab.util.ParserHelper; + +public class HarvesterRunner { + + private static final Logger logger = LoggerFactory.getLogger(HarvesterRunner.class); + private DspaceHarvester dh = null; + private String pathConfigFile = null; + private String outputDir = null; + private DspaceItemParser dspaceVioItemparser = null; + + public String getPathConfigFile() { + return this.pathConfigFile; + } + + public void setPathConfigFile(String pathConfigFile) { + this.pathConfigFile = pathConfigFile; + } + + public String getOutputDir() { + return this.outputDir; + } + + public void setOutputDir(String outputDir) { + this.outputDir = outputDir; + } + + public void init() throws IOException { + logger.info("Creating DspaceVivoParser"); + dspaceVioItemparser = new DspaceItemParser(); + Properties conf = HarvesterConfiguration.getConf(); + if (pathConfigFile != null) { + logger.info("Reading configuration from: {}", getPathConfigFile()); + conf = HarvesterConfiguration.getConf(getPathConfigFile()); + } else { + logger.warn("No configuration file provided"); + } + switch (conf.getProperty("type")) { + case "RESTv7": + logger.info("Connecting to REST endpoint"); + dh = new RESTv7Harvester(conf); + break; + case "OAI": + logger.info("Connecting to OAI-PMH endpoint"); + dh = new DspaceOAI(conf); + break; + } + dh.connect(); + } + + public void harvestItems() { + Iterator harvestItemsItr = dh.harvestItems(); + int count = 0; + if (harvestItemsItr != null) { + while (harvestItemsItr.hasNext()) { + count++; + Item next = harvestItemsItr.next(); + logger.info("new Item harvested..."); + logger.info(" " + count); + Model repoModel = dspaceVioItemparser.parse(next); + String stringModel = ParserHelper.dumpModelNtriples(repoModel); + if (this.outputDir != null) { + String filename = this.outputDir + next.getId().replace("/", "_") + ".ntriples"; + try (PrintWriter out = new PrintWriter(filename)) { + out.println(stringModel); + logger.info("Saving file {}", filename); + } catch (FileNotFoundException ex) { + logger.warn("Error saving file {}", filename); + } + } else { + logger.info(stringModel); + } + + } + } + } + + public void harvestCollections() throws JsonProcessingException { + ObjectMapper mp = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT); + Iterator harvestCollection = dh.harvestCollection(); + int count = 0; + if (harvestCollection != null) { + while (harvestCollection.hasNext()) { + count++; + Collection next = harvestCollection.next(); + logger.info("new Collection harvested..."); + logger.info(" " + count); + logger.info(mp.writeValueAsString(next)); + } + } + } + + public void harvestCommunities() throws JsonProcessingException { + ObjectMapper mp = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT); + Iterator harvestCommunity = dh.harvestCommunity(); + int count = 0; + if (harvestCommunity != null) { + while (harvestCommunity.hasNext()) { + count++; + Community next = harvestCommunity.next(); + logger.info("new Community harvested..."); + logger.info(" " + count); + logger.info(mp.writeValueAsString(next)); + } + } + } + + public void harvestRepositories() throws JsonProcessingException { + ObjectMapper mp = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT); + Iterator harvestRepository = dh.harvestRepository(); + int count = 0; + if (harvestRepository != null) { + while (harvestRepository.hasNext()) { + count++; + Repository next = harvestRepository.next(); + logger.info("new Repository harvested..."); + logger.info(" " + count); + logger.info(mp.writeValueAsString(next)); + } + } + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/config/HarvesterConfiguration.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/config/HarvesterConfiguration.java new file mode 100644 index 000000000..9f86f7a1b --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/config/HarvesterConfiguration.java @@ -0,0 +1,32 @@ +package org.vivoweb.harvester.extractdspace.transformation.harvester.config; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Properties; + +public class HarvesterConfiguration { + + private static final String routeConfig = "harvester.conf"; + + public static Properties getConf() throws IOException { + Properties props = new Properties(); + String resourceName = routeConfig; + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + try (InputStream resourceStream = loader.getResourceAsStream(resourceName)) { + props.load(resourceStream); + } + return props; + } + + public static Properties getConf(String pathConfigFile) throws IOException { + Properties props = new Properties(); + try (InputStream resourceStream = Files.newInputStream(Paths.get(pathConfigFile))) { + props.load(resourceStream); + } + return props; + + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/CollectionItr.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/CollectionItr.java new file mode 100644 index 000000000..22a39cff8 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/CollectionItr.java @@ -0,0 +1,94 @@ +package org.vivoweb.harvester.extractdspace.transformation.harvester.oai; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import org.vivoweb.harvester.extractdspace.model.Collection; +import org.vivoweb.harvester.extractdspace.model.Item; + +public class CollectionItr implements Iterator { + + private final DspaceOAI dspaceHarvester; + private List oaiPage = null; + private final Item nextCollection = null; + + public CollectionItr(DspaceOAI hr) { + this.dspaceHarvester = hr; + } + + @Override + public boolean hasNext() { + if (oaiPage != null && !oaiPage.isEmpty()) { + return true; + } + OAIPMHResponse oaipmhResponse; + boolean hasNext = false; + boolean iterate = false; + if (!this.dspaceHarvester.isEmpty()) { + String responseXML = null; + do { + try { + responseXML = this.dspaceHarvester.getHttpClient() + .doRequest(this.dspaceHarvester.getBaseURI(), + this.dspaceHarvester.getVerb(), this.dspaceHarvester.getSet(), + this.dspaceHarvester.getFrom(), this.dspaceHarvester.getUntil(), + this.dspaceHarvester.getMetadata(), + this.dspaceHarvester.getResumptionToken(), + this.dspaceHarvester.getIdentifier()); + + oaipmhResponse = new OAIPMHResponse(responseXML, dspaceHarvester.getConf()); + oaiPage = oaipmhResponse.modelCollections(); + + for (Collection col : oaiPage) { + String id = col.getId(); + + col.setHasItem(new ArrayList()); + Iterator harvestItemsItr = this.dspaceHarvester.harvestItems(); + this.dspaceHarvester.setSet(id); + while (harvestItemsItr.hasNext()) { + col.getHasItem().add(harvestItemsItr.next()); + + } + this.dspaceHarvester.getRecoverSets() + .removeIf(element -> (element.startsWith("col"))); + col.setIsPartOfCommunityID(this.dspaceHarvester.getRecoverSets()); + + } + } catch (Exception ex) { + return hasNext; + } + + Optional resumptionToken = oaipmhResponse.getResumptionToken(); + if (resumptionToken.isPresent() && !resumptionToken.get().isEmpty()) { + this.dspaceHarvester.setResumptionToken(resumptionToken.get()); + } else { + this.dspaceHarvester.setResumptionToken(null); + this.dspaceHarvester.setEmpty(true); + + } + + if (!oaiPage.isEmpty()) { + hasNext = true; + iterate = false; + } else if (this.dspaceHarvester.getResumptionToken() != null) { + iterate = true; + } else { + hasNext = false; + iterate = false; + } + + } while (iterate); + + } + return hasNext; + } + + @Override + public Collection next() { + Collection get = oaiPage.get(0); + oaiPage.remove(get); + return get; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/CommunityItr.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/CommunityItr.java new file mode 100644 index 000000000..7b25dfa0e --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/CommunityItr.java @@ -0,0 +1,103 @@ +package org.vivoweb.harvester.extractdspace.transformation.harvester.oai; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import org.vivoweb.harvester.extractdspace.model.Collection; +import org.vivoweb.harvester.extractdspace.model.Community; +import org.vivoweb.harvester.extractdspace.model.Item; + +public class CommunityItr implements Iterator { + + private final DspaceOAI dspaceHarvester; + private List oaiPage = null; + private final Item nextCommunity = null; + + public CommunityItr(DspaceOAI hr) { + this.dspaceHarvester = hr; + } + + @Override + public boolean hasNext() { + if (oaiPage != null && !oaiPage.isEmpty()) { + return true; + } + OAIPMHResponse oaipmhResponse; + boolean hasNext = false; + boolean iterate = false; + if (!this.dspaceHarvester.isEmpty()) { + String responseXML = null; + do { + try { + responseXML = this.dspaceHarvester.getHttpClient() + .doRequest(this.dspaceHarvester.getBaseURI(), + this.dspaceHarvester.getVerb(), this.dspaceHarvester.getSet(), + this.dspaceHarvester.getFrom(), this.dspaceHarvester.getUntil(), + this.dspaceHarvester.getMetadata(), + this.dspaceHarvester.getResumptionToken(), + this.dspaceHarvester.getIdentifier()); + + oaipmhResponse = new OAIPMHResponse(responseXML, dspaceHarvester.getConf()); + + oaiPage = oaipmhResponse.modelCommunity(); + + HashMap> hmCollection = + new HashMap>(); + Iterator CollectionItr = this.dspaceHarvester.harvestCollection(); + while (CollectionItr.hasNext()) { + Collection cl = CollectionItr.next(); + for (String comId : cl.getIsPartOfCommunityID()) { + if (!hmCollection.containsKey(comId)) { + hmCollection.put(comId, new ArrayList()); + + } + hmCollection.get(comId).add(cl); + } + + } + + for (Community com : oaiPage) { + String id = com.getId(); + com.setHasCollection(hmCollection.get(id)); + + } + } catch (Exception ex) { + return hasNext; + } + + Optional resumptionToken = oaipmhResponse.getResumptionToken(); + if (resumptionToken.isPresent() && !resumptionToken.get().isEmpty()) { + this.dspaceHarvester.setResumptionToken(resumptionToken.get()); + } else { + this.dspaceHarvester.setResumptionToken(null); + this.dspaceHarvester.setEmpty(true); + + } + + if (!oaiPage.isEmpty()) { + hasNext = true; + iterate = false; + } else if (this.dspaceHarvester.getResumptionToken() != null) { + iterate = true; + } else { + hasNext = false; + iterate = false; + } + + } while (iterate); + + } + return hasNext; + } + + @Override + public Community next() { + Community get = oaiPage.get(0); + oaiPage.remove(get); + + return get; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/DspaceOAI.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/DspaceOAI.java new file mode 100644 index 000000000..868d98a39 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/DspaceOAI.java @@ -0,0 +1,250 @@ +package org.vivoweb.harvester.extractdspace.transformation.harvester.oai; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Iterator; +import java.util.List; +import java.util.Objects; +import java.util.Properties; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.vivoweb.harvester.extractdspace.model.Collection; +import org.vivoweb.harvester.extractdspace.model.Community; +import org.vivoweb.harvester.extractdspace.model.Item; +import org.vivoweb.harvester.extractdspace.model.Repository; +import org.vivoweb.harvester.extractdspace.transformation.harvester.DspaceHarvester; + +public class DspaceOAI extends DspaceHarvester { + + private static final Logger LOG = LoggerFactory.getLogger(DspaceOAI.class); + private static final String NO_TOKEN = null; + private String resumptionToken = NO_TOKEN; + private URI baseURI; + private String verb; + private String metadata; + private String until; + private String from; + private String set; + private String identifier; + private OAIPMHHttpClient httpClient; + private boolean empty = false; + private List recoverSets; + + public DspaceOAI(Properties prprts) { + super(prprts); + } + + @Override + public void connect() { + try { + this.baseURI = new URI(this.conf.getProperty("endpoint")); + } catch (URISyntaxException ex) { + } + this.httpClient = new OAIPMHHttpClient(); + } + + private void loadConfigurationProperties() { + this.until = this.conf.getProperty("endDate"); + this.from = this.conf.getProperty("startDate"); + + String metadataFormat = this.conf.getProperty("metadataFormat"); + if (metadataFormat == null || metadataFormat.isEmpty()) { + metadataFormat = "DC"; + } + + switch (metadataFormat.trim().toUpperCase()) { + case "DC": + this.metadata = "xoai"; + break; + case "DIM": + this.metadata = "dim"; + break; + default: + LOG.error("Unsupported metadata format: {}", metadataFormat); + System.exit(1); + } + + String set = this.conf.getProperty("set"); + if (Objects.nonNull(set) && !set.trim().isEmpty()) { + this.set = this.conf.getProperty("set"); + } + } + + @Override + public Iterator harvestItems() { + this.verb = "ListRecords"; + this.metadata = "xoai"; + this.until = null; + this.from = null; + this.set = null; + this.identifier = null; + this.recoverSets = null; + loadConfigurationProperties(); + + if (OAIPMHVerb.valueOf(verb) == OAIPMHVerb.ListMetadataFormats || + OAIPMHVerb.valueOf(verb) == OAIPMHVerb.ListSets + || OAIPMHVerb.valueOf(verb) == OAIPMHVerb.Identify) { + this.metadata = null; + this.until = null; + this.from = null; + this.set = null; + this.identifier = null; + } + return new ItemItr(this); + } + + public List getRecoverSets() { + return recoverSets; + } + + public void setRecoverSets(List recoverSets) { + this.recoverSets = recoverSets; + } + + @Override + public Iterator harvestCollection() { + this.verb = "ListSets"; + this.metadata = null; + this.until = null; + this.from = null; + this.set = null; + this.identifier = null; + loadConfigurationProperties(); + + if (OAIPMHVerb.valueOf(verb) == OAIPMHVerb.ListMetadataFormats || + OAIPMHVerb.valueOf(verb) == OAIPMHVerb.ListSets + || OAIPMHVerb.valueOf(verb) == OAIPMHVerb.Identify) { + this.metadata = null; + this.until = null; + this.from = null; + this.set = null; + this.identifier = null; + } + return new CollectionItr(this); + } + + @Override + public Iterator harvestCommunity() { + this.verb = "ListSets"; + this.metadata = null; + this.until = null; + this.from = null; + this.set = null; + this.identifier = null; + loadConfigurationProperties(); + + if (OAIPMHVerb.valueOf(verb) == OAIPMHVerb.ListMetadataFormats || + OAIPMHVerb.valueOf(verb) == OAIPMHVerb.ListSets + || OAIPMHVerb.valueOf(verb) == OAIPMHVerb.Identify) { + this.metadata = null; + this.until = null; + this.from = null; + this.set = null; + this.identifier = null; + } + return new CommunityItr(this); + } + + @Override + public Iterator harvestRepository() { + this.verb = "Identify"; + this.metadata = null; + this.until = null; + this.from = null; + this.set = null; + this.identifier = null; + loadConfigurationProperties(); + + if (OAIPMHVerb.valueOf(verb) == OAIPMHVerb.ListMetadataFormats || + OAIPMHVerb.valueOf(verb) == OAIPMHVerb.ListSets + || OAIPMHVerb.valueOf(verb) == OAIPMHVerb.Identify) { + this.metadata = null; + this.until = null; + this.from = null; + this.set = null; + this.identifier = null; + } + return new RepositoryItr(this); + } + + public String getResumptionToken() { + return resumptionToken; + } + + public void setResumptionToken(String resumptionToken) { + this.resumptionToken = resumptionToken; + } + + public URI getBaseURI() { + return baseURI; + } + + public void setBaseURI(URI baseURI) { + this.baseURI = baseURI; + } + + public String getVerb() { + return verb; + } + + public void setVerb(String verb) { + this.verb = verb; + } + + public String getMetadata() { + return metadata; + } + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + public String getUntil() { + return until; + } + + public void setUntil(String until) { + this.until = until; + } + + public String getFrom() { + return from; + } + + public void setFrom(String from) { + this.from = from; + } + + public String getSet() { + return set; + } + + public void setSet(String set) { + this.set = set; + } + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public OAIPMHHttpClient getHttpClient() { + return httpClient; + } + + public void setHttpClient(OAIPMHHttpClient httpClient) { + this.httpClient = httpClient; + } + + public boolean isEmpty() { + return empty; + } + + public void setEmpty(boolean empty) { + this.empty = empty; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/ItemItr.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/ItemItr.java new file mode 100644 index 000000000..7e3fb8f9e --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/ItemItr.java @@ -0,0 +1,88 @@ +package org.vivoweb.harvester.extractdspace.transformation.harvester.oai; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import org.vivoweb.harvester.extractdspace.model.Item; + +public class ItemItr implements Iterator { + + private final DspaceOAI dspaceHarvester; + private List oaiPage = null; + private final Item nextItem = null; + private boolean finalValue; + private List setsList = null; + + public ItemItr(DspaceOAI hr) { + this.dspaceHarvester = hr; + this.finalValue = false; + setsList = new ArrayList<>(); + } + + @Override + public boolean hasNext() { + if (oaiPage != null && !oaiPage.isEmpty()) { + return true; + } + OAIPMHResponse oaipmhResponse; + boolean hasNext = false; + boolean iterate = false; + if (!finalValue) { + String responseXML; + do { + try { + responseXML = this.dspaceHarvester.getHttpClient() + .doRequest(this.dspaceHarvester.getBaseURI(), + this.dspaceHarvester.getVerb(), this.dspaceHarvester.getSet(), + this.dspaceHarvester.getFrom(), this.dspaceHarvester.getUntil(), + this.dspaceHarvester.getMetadata(), + this.dspaceHarvester.getResumptionToken(), + this.dspaceHarvester.getIdentifier()); + + oaipmhResponse = new OAIPMHResponse(responseXML, dspaceHarvester.getConf()); + oaiPage = oaipmhResponse.modelItemsxoai(); + this.dspaceHarvester.setRecoverSets(new ArrayList<>()); + for (String spec : oaipmhResponse.getSetSpec()) { + if (!this.dspaceHarvester.getRecoverSets().contains(spec)) { + this.dspaceHarvester.getRecoverSets().add(spec); + } + + } + } catch (Exception ex) { + return hasNext; + } + + Optional resumptionToken = oaipmhResponse.getResumptionToken(); + if (resumptionToken.isPresent() && !resumptionToken.get().isEmpty()) { + this.dspaceHarvester.setResumptionToken(resumptionToken.get()); + } else { + this.dspaceHarvester.setResumptionToken(null); + finalValue = true; + + } + + if (!oaiPage.isEmpty()) { + hasNext = true; + iterate = false; + } else if (this.dspaceHarvester.getResumptionToken() != null) { + iterate = true; + } else { + iterate = false; + } + + } while (iterate); + + } + return hasNext; + } + + @Override + public Item next() { + Item get = oaiPage.get(0); + oaiPage.remove(get); + + return get; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/OAIPMHHttpClient.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/OAIPMHHttpClient.java new file mode 100644 index 000000000..99837f620 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/OAIPMHHttpClient.java @@ -0,0 +1,127 @@ +package org.vivoweb.harvester.extractdspace.transformation.harvester.oai; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.security.KeyManagementException; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.RequestLine; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.ResponseHandler; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.client.utils.URLEncodedUtils; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.conn.ssl.TrustSelfSignedStrategy; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.ssl.SSLContextBuilder; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class OAIPMHHttpClient { + + private static final Logger LOG = LoggerFactory.getLogger(OAIPMHHttpClient.class); + + private boolean ignoreSSLWarnings; + + public String doRequest( + URI baseURI, String verb, String set, String from, String until, String metadataPrefix, + String token, + String identifier) + throws IOException, URISyntaxException { + + try (CloseableHttpClient httpclient = getCloseableHttpClient()) { + URIBuilder builder = new URIBuilder(); + builder.setScheme(baseURI.getScheme()) + .setHost(baseURI.getHost()) + .setPort(baseURI.getPort()) + .setPath(baseURI.getPath()) + .addParameter("verb", verb) + .addParameters(URLEncodedUtils.parse(baseURI, Charset.defaultCharset())); + + if (identifier != null) { + builder.addParameter("identifier", identifier); + } + + if (token != null) { + builder.addParameter("resumptionToken", token); + } else { + if (metadataPrefix != null) { + builder.addParameter("metadataPrefix", metadataPrefix); + } + if (set != null) { + builder.addParameter("set", set); + } + if (from != null) { + builder.addParameter("from", from); + } + if (until != null) { + builder.addParameter("until", until); + } + } + + HttpGet httpget = new HttpGet(builder.build()); + + RequestLine requestLine = httpget.getRequestLine(); + + LOG.info("Executing request: {} ", requestLine); + + // Create a custom response handler + ResponseHandler responseHandler = new ResponseHandler() { + + @Override + public String handleResponse(final HttpResponse response) throws IOException { + int status = response.getStatusLine().getStatusCode(); + if (status >= 200 && status < 300) { + HttpEntity entity = response.getEntity(); + if (entity == null) { + throw new IOException("No response received"); + } + return EntityUtils.toString(entity, StandardCharsets.UTF_8); + } else { + throw new ClientProtocolException("Unexpected response status: " + status); + } + } + + }; + String responseBody = httpclient.execute(httpget, responseHandler); + +// LOG.debug("Response received: {}", responseBody); + + return responseBody; + } + } + + protected CloseableHttpClient getCloseableHttpClient() throws IOException { + if (isIgnoreSSLWarnings()) { + try { + SSLContextBuilder builder = new SSLContextBuilder(); + builder.loadTrustMaterial(null, new TrustSelfSignedStrategy()); + SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory( + builder.build()); + return HttpClients.custom().setSSLSocketFactory( + sslsf).build(); + } catch (KeyManagementException | KeyStoreException | NoSuchAlgorithmException ex) { + throw new IOException("The HTTP Client could not be started", ex); + } + } else { + return HttpClients.createDefault(); + } + } + + public boolean isIgnoreSSLWarnings() { + return ignoreSSLWarnings; + } + + public void setIgnoreSSLWarnings(boolean ignoreSSLWarnings) { + this.ignoreSSLWarnings = ignoreSSLWarnings; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/OAIPMHResponse.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/OAIPMHResponse.java new file mode 100644 index 000000000..fe0eea5f7 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/OAIPMHResponse.java @@ -0,0 +1,530 @@ +package org.vivoweb.harvester.extractdspace.transformation.harvester.oai; + +import com.google.common.collect.Lists; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.Properties; +import javax.xml.namespace.NamespaceContext; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; +import org.apache.commons.io.IOUtils; +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.parser.Parser; +import org.jsoup.select.Elements; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.vivoweb.harvester.extractdspace.model.Collection; +import org.vivoweb.harvester.extractdspace.model.Community; +import org.vivoweb.harvester.extractdspace.model.Item; +import org.vivoweb.harvester.extractdspace.model.Repository; +import org.vivoweb.harvester.extractdspace.model.StatementLiteral; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +public class OAIPMHResponse { + + private static final Logger LOG = LoggerFactory.getLogger(OAIPMHResponse.class); + private static final String XSLT_DC_FILENAME = "aoi_dc.xslt"; + private static final String XSLT_DIM_FILENAME = "aoi_dim.xslt"; + private final List setSpec; + private String rawResponse; + private Document xmlResponse; + private Properties prop; + + public OAIPMHResponse(String rawResponse) { + this.rawResponse = rawResponse; + this.setSpec = new ArrayList<>(); + parse(); + } + + public OAIPMHResponse(String rawResponse, Properties p) { + this.rawResponse = rawResponse; + parse(); + this.prop = p; + this.setSpec = new ArrayList<>(); + } + + private static Document parse(String text) { + return Jsoup.parse(text, "", Parser.xmlParser()); + } + + public static String nodeToXML(Node node) throws TransformerException { + StringWriter sw = new StringWriter(); + Transformer t = TransformerFactory.newInstance().newTransformer(); + t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); + t.setOutputProperty(OutputKeys.INDENT, "yes"); + t.transform(new DOMSource(node), new StreamResult(sw)); + return sw.toString(); + } + + private void parse() { + this.xmlResponse = Jsoup.parse(rawResponse, "", Parser.xmlParser()); + } + + public Optional getResumptionToken() { + Optional resumptionToken = Optional.empty(); + Elements elementsByTag = xmlResponse.getElementsByTag("resumptionToken"); + if (!elementsByTag.isEmpty()) { + if (elementsByTag.size() > 1) { + LOG.warn("Multiple 'resumptionToken' tags detected, taking the first one."); + } + Element xmlTag = elementsByTag.get(0); + resumptionToken = Optional.of(xmlTag.text().trim()); + } + return resumptionToken; + } + + public String getRawResponse() { + return rawResponse; + } + + public void setRawResponse(String rawResponse) { + this.rawResponse = rawResponse; + } + + public Document getXmlResponse() { + return xmlResponse; + } + + public void setXmlResponse(Document xmlResponse) { + this.xmlResponse = xmlResponse; + } + + public Collection modelCollection() { + Collection col = new Collection(); + col.setId(""); + col.setIsPartOfCommunityID(new ArrayList<>()); + col.setListOfStatementLiterals(new ArrayList<>()); + col.setUri(""); + col.setUrl(""); + col.setHasItem(new ArrayList<>()); + + return col; + } + + public Item modelItem(Document metadataDoc, Document headerDoc, String metadataFormat) { + Item item = new Item(); + item.setDspaceIsPartOfCollectionID(new ArrayList<>()); + item.setListOfStatementLiterals(new ArrayList<>()); + + // Process header + processHeader(headerDoc, item); + + // Determine metadata tag + String metadataTag = determineMetadataTag(metadataFormat); + + // Process metadata + processMetadata(metadataDoc, metadataTag, item); + + return item; + } + + private void processHeader(Document headerDoc, Item item) { + Elements headerElements = headerDoc.getElementsByTag("header"); + if (headerElements.isEmpty()) { + return; + } + + for (Element element : headerElements.get(0).children()) { + String tagName = element.tagName(); + String text = element.text(); + + switch (tagName) { + case "identifier": + item.setId(parseIdentifier(text)); + break; + case "setSpec": + handleSetSpec(text, item); + break; + } + } + } + + private String determineMetadataTag(String metadataFormat) { + return (metadataFormat != null && metadataFormat.trim().equalsIgnoreCase("DIM")) + ? "dim:dim" + : "oai_dc"; + } + + private void processMetadata(Document metadataDoc, String metadataTag, Item item) { + Elements metadataElements = metadataDoc.getElementsByTag(metadataTag); + if (metadataElements.isEmpty()) { + return; + } + + String itemId = item.getId(); + String uriPrefix = this.prop.getProperty("uriPrefix"); + String itemUri = uriPrefix + itemId.replace("/", "_"); + item.setUri(itemUri); + + for (Element element : metadataElements.get(0).children()) { + String text = element.text(); + String tagName = element.tagName(); + + if ("oai_dc".equals(metadataTag)) { + handleOaiDcMetadata(item, text, tagName, itemUri); + } else { + handleDimMetadata(item, element, text, itemUri); + } + } + } + + private void handleSetSpec(String text, Item item) { + item.getDspaceIsPartOfCollectionID().add(text); + } + + private String parseIdentifier(String identifier) { + String[] parts = identifier.split(":"); + return parts.length > 2 ? parts[2] : identifier; + } + + private void handleOaiDcMetadata(Item item, String text, String tagName, String uri) { + switch (tagName) { + case "dc:identifier": + item.setUrl(text); + break; + case "dc:bundle": + addToBitstreamURLs(item, text); + break; + case "dc:date": + addStatementLiteral(item, uri, tagName, text, "xsd:dateTime", true); + break; + default: + addStatementLiteral(item, uri, tagName, text, "xsd:string", true); + } + } + + private void handleDimMetadata(Item item, Element element, String text, String uri) { + String elementName = element.attr("element"); + String literalType = "xsd:string"; + + if ("date".equals(elementName)) { + literalType = "xsd:dateTime"; + } + + if ("identifier".equals(elementName)) { + item.setUrl(text); + } else if ("bundle".equals(elementName)) { + addToBitstreamURLs(item, text); + } else { + addStatementLiteral(item, uri, elementName, text, literalType, false); + } + } + + private void addToBitstreamURLs(Item item, String url) { + if (item.getDspaceBitstreamURLs() == null) { + item.setDspaceBitstreamURLs(new ArrayList<>()); + } + item.getDspaceBitstreamURLs().add(url); + } + + private void addStatementLiteral(Item item, String subjectUri, String predicate, + String objectLiteral, String literalType, boolean isDC) { + StatementLiteral statement = new StatementLiteral(); + statement.setSubjectUri(subjectUri); + + if (isDC) { + statement.setPredicateUri(predicate.replace("dc:", "http://purl.org/dc/terms/")); + } else { + statement.setPredicateUri("http://purl.org/dc/terms/" + predicate); + } + statement.setObjectLiteral(objectLiteral); + statement.setLiteralType(literalType); + + item.getListOfStatementLiterals().add(statement); + } + + public String urlToUri(String url, String id) { + String pragma = id.replace("/", "_"); + String uri = url.replaceAll(id, pragma); + return uri; + } + + public List getSetSpec() { + return setSpec; + } + + public List modelItems() { + List response = Lists.newArrayList(); + Document result = this.xmlResponse; + Elements list = result.getElementsByTag("record"); + + for (Element e : list) { + + Item resp = new Item(); + String id = e.getElementsByTag("identifier").text(); + resp.setId(id); + + Element meta = e.getElementsByTag("metadata").first().child(0); + resp.setListOfStatementLiterals(new ArrayList<>()); + for (Element s : meta.children()) { + + if ("dc:bundle".equals(s.tagName())) { + if (resp.getDspaceBitstreamURLs() == null) { + resp.setDspaceBitstreamURLs(Lists.newArrayList()); + } + resp.getDspaceBitstreamURLs().add(s.text()); + } else { + + StatementLiteral statementLiteral = new StatementLiteral(); + statementLiteral.setSubjectUri(id); + statementLiteral.setPredicateUri( + s.tagName().replace("dc:", "http://purl.org/dc/terms/")); + statementLiteral.setObjectLiteral(s.text()); + statementLiteral.setLiteralType(null); + resp.getListOfStatementLiterals().add(statementLiteral); + } + + } + response.add(resp); + //resp.setDspaceBitstreamURL(rawResponse); + } + + return response; + } + + public org.w3c.dom.Document parsexml(String st) + throws SAXException, ParserConfigurationException, IOException { + DocumentBuilderFactory domFact = DocumentBuilderFactory.newInstance(); + domFact.setNamespaceAware(true); + DocumentBuilder builder = domFact.newDocumentBuilder(); + + org.w3c.dom.Document doc = builder.parse(new ByteArrayInputStream(st.getBytes())); + return doc; + + } + + public List modelItemsxoai() + throws TransformerException, XPathExpressionException, SAXException, + ParserConfigurationException, IOException { + InputStream toInputStream1 = IOUtils.toInputStream(this.rawResponse); + DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = builderFactory.newDocumentBuilder(); + org.w3c.dom.Document xmlDocument = builder.parse(toInputStream1); + return extracttransform(xmlDocument); + } + + public List modelCommunity() { + List lcom = new ArrayList<>(); + + Document doc = this.xmlResponse; + Elements list = doc.getElementsByTag("set"); + for (Element e : list) { + Community com = new Community(); + String id = e.getElementsByTag("setSpec").text(); + String name = e.getElementsByTag("setName").text(); + if (id.contains("com_")) { + com.setId(id); + String uri = this.prop.getProperty("uriPrefix") + "handle" + + id.replace("com_", "/").replace("_", "/"); + com.setUri(uri); + lcom.add(com); + + } + + } + + return lcom; + } + + public List modelRepository() { + List lrepo = new ArrayList<>(); + + Document doc = this.xmlResponse; + Elements list = doc.getElementsByTag("Identify"); + for (Element e : list) { + Repository repo = new Repository(); + String uri = e.getElementsByTag("baseURL").text(); + repo.setUri(uri); + String id = e.getElementsByTag("repositoryIdentifier").text(); + repo.setId(id); + repo.setListOfStatementLiterals(new ArrayList<>()); + Elements elements = e.children(); + for (Element echild : elements) { + String tagname = echild.tagName(); + String textValue = echild.text(); + + StatementLiteral statementLiteral = new StatementLiteral(); + statementLiteral.setSubjectUri(uri); + statementLiteral.setPredicateUri("http://purl.org/dc/terms/" + tagname); + statementLiteral.setObjectLiteral(textValue); + statementLiteral.setLiteralType(null); + repo.getListOfStatementLiterals().add(statementLiteral); + + } + + lrepo.add(repo); + + } + + return lrepo; + } + + public List modelCollections() { + List lcol = new ArrayList<>(); + + Document doc = this.xmlResponse; + Elements list = doc.getElementsByTag("set"); + for (Element e : list) { + Collection col = new Collection(); + String id = e.getElementsByTag("setSpec").text(); + String name = e.getElementsByTag("setName").text(); + if (id.contains("col_")) { + col.setId(id); + String uri = this.prop.getProperty("uriPrefix") + "/handle" + + id.replace("col_", "/").replace("_", "/"); + col.setUri(uri); + lcol.add(col); + } + + } + + return lcol; + } + + public List modelItemCollections() { + List litems = new ArrayList<>(); + Document doc = this.xmlResponse; + Elements list = doc.getElementsByTag("identifier"); + for (Element e : list) { + String completeId = e.text(); + + String[] parts = completeId.split(":"); + String id = parts[parts.length - 1]; + litems.add(id); + + } + + return litems; + } + + public List modelSetSpec() { + List lspec = new ArrayList<>(); + Document doc = this.xmlResponse; + Elements list = doc.getElementsByTag("header"); + for (Element e : list) { + Elements listspec = e.getElementsByTag("setSpec"); + for (Element spec : listspec) { + String idspec = spec.text(); + lspec.add(idspec); + } + + } + + return lspec; + } + + public List extracttransform(org.w3c.dom.Document xmlDocument) + throws XPathExpressionException, TransformerException { + List resp = Lists.newArrayList(); + XPath xPath = XPathFactory.newInstance().newXPath(); + xPath.setNamespaceContext(new NamespaceContext() { + @Override + public String getNamespaceURI(String prefix) { + switch (prefix) { + case "oai20": + return "http://www.openarchives.org/OAI/2.0/"; + case "marc": + return "http://www.loc.gov/MARC21/slim"; + case "oai_cerif_openaire": + return "https://www.openaire.eu/cerif-profile/1.1/"; + case "dc": + return "http://purl.org/dc/elements/1.1/"; + case "aoi_dc": + return "http://www.openarchives.org/OAI/2.0/oai_dc/"; + } + return null; + } + + @Override + public String getPrefix(String namespaceURI) { + return null; + } + + @Override + public Iterator getPrefixes(String namespaceURI) { + return null; + } + }); + + String metadataFormat = prop.getProperty("metadataFormat"); + if (metadataFormat == null || metadataFormat.isEmpty()) { + metadataFormat = "DC"; + } + + String xslFilename = null; + if (metadataFormat.trim().equalsIgnoreCase("DC")) { + xslFilename = XSLT_DC_FILENAME; + } else if ((metadataFormat.trim().equalsIgnoreCase("DIM"))) { + xslFilename = XSLT_DIM_FILENAME; + } else { + LOG.error("Unsupported metadata format: {}", metadataFormat); + System.exit(1); + } + + String expression = "/OAI-PMH/ListRecords/record/metadata" + + (xslFilename.equals(XSLT_DC_FILENAME) ? "/metadata" : ""); + NodeList nodeList = + (NodeList) xPath.compile(expression).evaluate(xmlDocument, XPathConstants.NODESET); + + String expressionHead = "/OAI-PMH/ListRecords/record/header"; + NodeList headers = + (NodeList) xPath.compile(expressionHead).evaluate(xmlDocument, XPathConstants.NODESET); + + for (int i = 0; i < nodeList.getLength(); i++) { + Node item = nodeList.item(i); + String nodeToXML = nodeToXML(item); + String ApplyXSLT = ApplyXSLT(nodeToXML, xslFilename); + Item it = + modelItem(parse(ApplyXSLT), parse(nodeToXML(headers.item(i))), metadataFormat); + resp.add(it); + } + return resp; + } + + public String ApplyXSLT(String xmlIn, String xsl) + throws TransformerException { + StreamSource xmlInSource = new StreamSource(new StringReader(xmlIn)); + + InputStream in = this.getClass().getClassLoader().getResourceAsStream(xsl); + + Transformer tf = TransformerFactory.newInstance().newTransformer(new StreamSource(in)); + StringWriter xmlOutWriter = new StringWriter(); + tf.transform(xmlInSource, new StreamResult(xmlOutWriter)); + return xmlOutWriter.toString(); + } + + public void renameNamespaceRecursive(Node node, String namespace) { + org.w3c.dom.Document document = node.getOwnerDocument(); + if (node.getNodeType() == Node.ELEMENT_NODE) { + document.renameNode(node, namespace, node.getNodeName()); + } + NodeList list = node.getChildNodes(); + for (int i = 0; i < list.getLength(); ++i) { + renameNamespaceRecursive(list.item(i), namespace); + } + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/OAIPMHVerb.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/OAIPMHVerb.java new file mode 100644 index 000000000..de56fbd4c --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/OAIPMHVerb.java @@ -0,0 +1,10 @@ +package org.vivoweb.harvester.extractdspace.transformation.harvester.oai; + +public enum OAIPMHVerb { + ListRecords, + Identify, + ListIdentifiers, + ListMetadataFormats, + GetRecord, + ListSets +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/RepositoryItr.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/RepositoryItr.java new file mode 100644 index 000000000..a93d023ff --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/oai/RepositoryItr.java @@ -0,0 +1,87 @@ +package org.vivoweb.harvester.extractdspace.transformation.harvester.oai; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import org.vivoweb.harvester.extractdspace.model.Community; +import org.vivoweb.harvester.extractdspace.model.Item; +import org.vivoweb.harvester.extractdspace.model.Repository; + +public class RepositoryItr implements Iterator { + + private final DspaceOAI dspaceHarvester; + private List oaiPage = null; + private final Item nextRepository = null; + + public RepositoryItr(DspaceOAI hr) { + this.dspaceHarvester = hr; + } + + @Override + public boolean hasNext() { + if (oaiPage != null && !oaiPage.isEmpty()) { + return true; + } + OAIPMHResponse oaipmhResponse; + boolean hasNext = false; + boolean iterate = false; + if (!this.dspaceHarvester.isEmpty()) { + String responseXML; + do { + try { + responseXML = this.dspaceHarvester.getHttpClient() + .doRequest(this.dspaceHarvester.getBaseURI(), + this.dspaceHarvester.getVerb(), this.dspaceHarvester.getSet(), + this.dspaceHarvester.getFrom(), this.dspaceHarvester.getUntil(), + this.dspaceHarvester.getMetadata(), + this.dspaceHarvester.getResumptionToken(), + this.dspaceHarvester.getIdentifier()); + + oaipmhResponse = new OAIPMHResponse(responseXML, dspaceHarvester.getConf()); + + oaiPage = oaipmhResponse.modelRepository(); + + Iterator CommunityItr = this.dspaceHarvester.harvestCommunity(); + Repository base = oaiPage.get(0); + base.setHasCommunity(new ArrayList()); + while (CommunityItr.hasNext()) { + Community com = CommunityItr.next(); + base.getHasCommunity().add(com); + + } + + } catch (Exception ex) { + return hasNext; + } + + Optional resumptionToken = oaipmhResponse.getResumptionToken(); + if (resumptionToken.isPresent() && !resumptionToken.get().isEmpty()) { + this.dspaceHarvester.setResumptionToken(resumptionToken.get()); + } else { + this.dspaceHarvester.setResumptionToken(null); + this.dspaceHarvester.setEmpty(true); + + } + + if (!oaiPage.isEmpty()) { + hasNext = true; + } else if (this.dspaceHarvester.getResumptionToken() != null) { + iterate = true; + } + + } while (iterate); + + } + return hasNext; + } + + @Override + public Repository next() { + Repository get = oaiPage.get(0); + oaiPage.remove(get); + + return get; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/restv7/ItemItr.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/restv7/ItemItr.java new file mode 100644 index 000000000..93c3d6d77 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/restv7/ItemItr.java @@ -0,0 +1,50 @@ +package org.vivoweb.harvester.extractdspace.transformation.harvester.restv7; + +import java.util.Iterator; +import java.util.List; +import kong.unirest.JsonNode; +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONObject; +import org.apache.jena.ext.com.google.common.collect.Lists; +import org.vivoweb.harvester.extractdspace.model.Item; + +public class ItemItr implements Iterator { + + private int page = 0; + private final int size = 20; + private final List restPage = Lists.newArrayList(); + private final Item nextItem = null; + private final RESTv7Harvester endpoint; + + public ItemItr(RESTv7Harvester endpoint) { + this.endpoint = endpoint; + } + + @Override + public boolean hasNext() { + if (!restPage.isEmpty()) { + return true; + } + JsonNode body = this.endpoint.getItemsPage(this.page, this.size); + this.page++; + boolean hasNext = body.getObject().has("_embedded"); + if (hasNext) { + JSONArray jsonArray = body.getObject().getJSONObject("_embedded").getJSONArray("items"); + for (int i = 0; i < jsonArray.length(); i++) { + JSONObject jsonObject = jsonArray.getJSONObject(i); + Item item = this.endpoint.getItem(jsonObject); + restPage.add(item); + } + + } + return !restPage.isEmpty(); + } + + @Override + public Item next() { + Item get = restPage.get(0); + restPage.remove(get); + return get; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/restv7/RESTv7Harvester.java b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/restv7/RESTv7Harvester.java new file mode 100644 index 000000000..8cea770eb --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/transformation/harvester/restv7/RESTv7Harvester.java @@ -0,0 +1,224 @@ +package org.vivoweb.harvester.extractdspace.transformation.harvester.restv7; + +import com.google.common.collect.Lists; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; +import kong.unirest.HttpResponse; +import kong.unirest.JsonNode; +import kong.unirest.Unirest; +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.vivoweb.harvester.extractdspace.model.Collection; +import org.vivoweb.harvester.extractdspace.model.Community; +import org.vivoweb.harvester.extractdspace.model.Item; +import org.vivoweb.harvester.extractdspace.model.Repository; +import org.vivoweb.harvester.extractdspace.model.Statement; +import org.vivoweb.harvester.extractdspace.model.StatementLiteral; +import org.vivoweb.harvester.extractdspace.transformation.harvester.DspaceHarvester; + +public class RESTv7Harvester extends DspaceHarvester { + + private static final Logger log = LoggerFactory.getLogger(RESTv7Harvester.class); + private String csrfToken = null; + private String authToken = null; + + public RESTv7Harvester(Properties prprts) { + super(prprts); + } + + private HttpResponse updateCSRF(HttpResponse i) { + List get = i.getHeaders().get("DSPACE-XSRF-TOKEN"); + if (!get.isEmpty()) { + this.csrfToken = get.get(0); + } + return i; + } + + @Override + public void connect() { + updateCSRF(Unirest.get(this.conf.getProperty("endpoint") + "/authn/status").asJson()); + this.authToken = updateCSRF(Unirest.post(this.conf.getProperty("endpoint") + "/authn/login") + .header("Content-Type", "application/x-www-form-urlencoded") + .header("X-XSRF-TOKEN", this.csrfToken) + .field("user", this.conf.getProperty("username")) + .field("password", this.conf.getProperty("password")) + .asJson()).getHeaders().get("Authorization").get(0); + } + + public JsonNode getItemsPage(int page, int size) { + return updateCSRF(Unirest.get(this.conf.getProperty("endpoint") + + "/discover/browses/title/items?sort=dc.title,ASC&size=" + size + "&page=" + page) + .header("X-XSRF-TOKEN", this.csrfToken) + .header("Authorization", this.authToken) + .asJson()).getBody(); + } + + @Override + public Iterator harvestItems() { + return new ItemItr((this)); + } + + private JsonNode calllinks(String link) { + return updateCSRF(Unirest.get(link) + .header("X-XSRF-TOKEN", this.csrfToken) + .header("Authorization", this.authToken) + .asJson()).getBody(); + + } + + public Item getItem(JSONObject jsonObject) { + Item resp = new Item(); + resp.setId(jsonObject.getString("id")); + resp.setUri(jsonObject.getString("handle")); + resp.setUri(this.conf.getProperty("uriPrefix") + jsonObject.getString("handle")); + resp.setUrl(jsonObject.getJSONObject("_links").getJSONObject("self").getString("href")); + + JsonNode collectionLink = calllinks( + jsonObject.getJSONObject("_links").getJSONObject("owningCollection").getString("href")); + + resp.dspaceIsPartOfCollectionID(Lists.newArrayList()); + resp.getDspaceIsPartOfCollectionID().add(collectionLink.getObject().getString("handle")); + + resp.setListOfStatements(Lists.newArrayList()); + resp.setListOfStatementLiterals(Lists.newArrayList()); + List metadataMapping = + metadataMapping(resp.getUri(), jsonObject.getJSONObject("metadata")); + for (Object obj : metadataMapping) { + if (obj instanceof StatementLiteral) { + resp.getListOfStatementLiterals().add((StatementLiteral) obj); + } else { + resp.getListOfStatements().add((Statement) obj); + } + } + + return resp; + + } + + @Override + public Iterator harvestCommunity() { + //TODO + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Iterator harvestCollection() { + //TODO + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Iterator harvestRepository() { + //TODO + throw new UnsupportedOperationException("Not supported yet."); + } + + //DC 2 RDF Mapping + public List metadataMapping(String uri, JSONObject metadata) { + List responseList = Lists.newArrayList(); + for (String key : metadata.keySet()) { + JSONArray jsonArray = metadata.getJSONArray(key); + for (int i = 0; i < jsonArray.length(); i++) { + JSONObject jsonObject = jsonArray.getJSONObject(i); + //Skip nulls + if (jsonObject.get("value") == null) { + continue; + } + String property = null; + String datatype = "xsd:string"; + switch (key) { + case "dc.title": + property = "http://purl.org/dc/terms/title"; + break; + case "dc.identifier.uri": + property = "http://purl.org/dc/terms/uri"; + break; + case "dc.description": + property = "http://purl.org/dc/terms/description"; + break; + case "dc.description.abstract": + property = "http://purl.org/dc/terms/abstract"; + break; + case "dc.description.tableofcontents": + property = "http://purl.org/dc/terms/tableofcontents"; + break; + case "dc.contributor.author": + property = "http://purl.org/dc/terms/contributor"; + break; + case "dc.contributor.other": + property = "http://purl.org/dc/terms/contributor"; + break; + case "dc.contributor": + property = "http://purl.org/dc/terms/contributor"; + break; + case "dc.creator": + property = "http://purl.org/dc/terms/creator"; + break; + case "dc.source": + property = "http://purl.org/dc/terms/source"; + break; + case "dc.subject": + property = "http://purl.org/dc/terms/subject"; + break; + case "dc.language": + property = "http://purl.org/dc/terms/language"; + break; + case "dc.publisher": + property = "http://purl.org/dc/terms/publisher"; + break; + case "dc.identifier": + property = "http://purl.org/dc/terms/identifier"; + break; + case "dc.date": + property = "http://purl.org/dc/terms/date"; + datatype = "xsd:dateTime"; + break; + case "dc.format": + property = "http://purl.org/dc/terms/format"; + break; + case "dc.rights": + property = "http://purl.org/dc/terms/rights"; + break; + case "dc.relation": + property = "http://purl.org/dc/terms/relation"; + break; + case "dc.date.accessioned": + property = "http://purl.org/dc/terms/accessioned"; + datatype = "xsd:dateTime"; + break; + case "dc.date.available": + property = "http://purl.org/dc/terms/available"; + datatype = "xsd:dateTime"; + break; + case "dc.date.issued": + property = "http://purl.org/dc/terms/issued"; + datatype = "xsd:dateTime"; + break; + case "dc.language.iso": + property = "http://purl.org/dc/terms/language"; + break; + case "dc.type": + property = "http://purl.org/dc/terms/type"; + break; + + } + if (property == null) { + log.warn("Property without mapping:'" + key + "'"); + continue; + } + StatementLiteral statementLiteral = new StatementLiteral(); + statementLiteral.setSubjectUri(uri); + statementLiteral.setPredicateUri(property); + statementLiteral.setObjectLiteral(jsonObject.getString("value")); + statementLiteral.setLiteralType(datatype); + responseList.add(statementLiteral); + + } + } + + return responseList; + } +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/vocab/dspace/DSPACE.java b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/dspace/DSPACE.java new file mode 100644 index 000000000..33049a8f5 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/dspace/DSPACE.java @@ -0,0 +1,45 @@ +package org.vivoweb.harvester.extractdspace.vocab.dspace; + +import org.apache.jena.ontology.DatatypeProperty; +import org.apache.jena.ontology.ObjectProperty; +import org.apache.jena.ontology.OntClass; +import org.apache.jena.ontology.OntModel; +import org.apache.jena.ontology.OntModelSpec; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; + +public class DSPACE { + public static final String NS = "http://vivoweb.org/ontology/dspace#"; + public static final String VERSION_INFO = + "Created by Michel Héon PhD; Université du Québec à Montréal; heon.michel@uqam.ca"; + private static final OntModel M_MODEL = + ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null); + public static final Resource NAMESPACE = M_MODEL.createResource(NS); + public static final ObjectProperty hasCollection = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/dspace#hasCollection"); + public static final ObjectProperty hasCommunity = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/dspace#hasCommunity"); + public static final ObjectProperty hasItem = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/dspace#hasItem"); + public static final ObjectProperty isPartOfCollection = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/dspace#isPartOfCollection"); + public static final ObjectProperty isPartOfCommunity = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/dspace#isPartOfCommunity"); + public static final ObjectProperty isPartOfRepository = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/dspace#isPartOfRepository"); + public static final DatatypeProperty hasBitstream = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/dspace#hasBitstream"); + public static final OntClass Collection = + M_MODEL.createClass("http://vivoweb.org/ontology/dspace#Collection"); + public static final OntClass Community = + M_MODEL.createClass("http://vivoweb.org/ontology/dspace#Community"); + public static final OntClass Item = + M_MODEL.createClass("http://vivoweb.org/ontology/dspace#Item"); + public static final OntClass Repository = + M_MODEL.createClass("http://vivoweb.org/ontology/dspace#Repository"); + + public static String getURI() { + return NS; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/vocab/util/ParserHelper.java b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/util/ParserHelper.java new file mode 100644 index 000000000..9607f6f14 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/util/ParserHelper.java @@ -0,0 +1,134 @@ +package org.vivoweb.harvester.extractdspace.vocab.util; + + +import org.apache.commons.io.output.ByteArrayOutputStream; +import org.apache.jena.datatypes.xsd.XSDDatatype; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.riot.Lang; +import org.apache.jena.riot.RDFDataMgr; +import org.apache.jena.shared.PrefixMapping; +import org.apache.jena.shared.impl.PrefixMappingImpl; +import org.vivoweb.harvester.extractdspace.vocab.dspace.DSPACE; + +public class ParserHelper { + public static String SparqlPrefix = + "PREFIX crdc: \n" + + " PREFIX ocrer: \n" + + " PREFIX p3: \n" + + " PREFIX owl: \n" + + " PREFIX scires: \n" + + " PREFIX xsd: \n" + + " PREFIX swrlb: \n" + + " PREFIX skos: \n" + + " PREFIX rdfs: \n" + + " PREFIX ocresd: \n" + + " PREFIX swo: \n" + + " PREFIX cito: \n" + + " PREFIX geo: \n" + + " PREFIX ocresst: \n" + + " PREFIX dcterms: \n" + + " PREFIX vivo: \n" + + " PREFIX text: \n" + + " PREFIX event: \n" + + " PREFIX vann: \n" + + " PREFIX foaf: \n" + + " PREFIX c4o: \n" + + " PREFIX fabio: \n" + + " PREFIX swrl: \n" + + " PREFIX vcard: \n" + + " PREFIX crdc-data: \n" + + " PREFIX vitro: \n" + + " PREFIX vitro-public: \n" + + " PREFIX rdf: \n" + + " PREFIX ocresp: \n" + + " PREFIX bibo: \n" + + " PREFIX obo: \n" + + " PREFIX dspace: \n" + + " PREFIX dc: \n" + + " PREFIX ro: \n"; + + public static PrefixMapping getVIVOPrefixes() { + PrefixMappingImpl globalPrefixMapping = new PrefixMappingImpl(); + globalPrefixMapping.setNsPrefix("rdfs", "http://www.w3.org/2000/01/rdf-schema#"); + globalPrefixMapping.setNsPrefix("owl", "http://www.w3.org/2002/07/owl#"); + globalPrefixMapping.setNsPrefix("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); + globalPrefixMapping.setNsPrefix("rdfs", "http://www.w3.org/2000/01/rdf-schema#"); + globalPrefixMapping.setNsPrefix("xsd", "http://www.w3.org/2001/XMLSchema#"); + globalPrefixMapping.setNsPrefix("obo", "http://purl.obolibrary.org/obo/"); + globalPrefixMapping.setNsPrefix("study_protocol", + "http://purl.org/net/OCRe/study_protocol.owl#"); + globalPrefixMapping.setNsPrefix("ns", "http://www.w3.org/2003/06/sw-vocab-status/ns#"); + globalPrefixMapping.setNsPrefix("skos", "http://www.w3.org/2004/02/skos/core#"); + globalPrefixMapping.setNsPrefix("geopolitical", + "http://aims.fao.org/aos/geopolitical.owl#"); + globalPrefixMapping.setNsPrefix("vitro", "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#"); + globalPrefixMapping.setNsPrefix("vitro-public", + "http://vitro.mannlib.cornell.edu/ns/vitro/public#"); + globalPrefixMapping.setNsPrefix("skos2", "http://www.w3.org/2008/05/skos#"); + globalPrefixMapping.setNsPrefix("core", "http://vivoweb.org/ontology/core#"); + globalPrefixMapping.setNsPrefix("vivo", "http://vivoweb.org/ontology/core#"); + globalPrefixMapping.setNsPrefix("terms", "http://purl.org/dc/terms/"); + globalPrefixMapping.setNsPrefix("statistics", "http://purl.org/net/OCRe/statistics.owl#"); + globalPrefixMapping.setNsPrefix("scires", + "http://vivoweb.org/ontology/scientific-research#"); + globalPrefixMapping.setNsPrefix("swrlb", "http://www.w3.org/2003/11/swrlb#"); + globalPrefixMapping.setNsPrefix("swrl", "http://www.w3.org/2003/11/swrl#"); + globalPrefixMapping.setNsPrefix("ocresd", "http://purl.org/net/OCRe/study_design.owl#"); + globalPrefixMapping.setNsPrefix("swo", "http://www.ebi.ac.uk/efo/swo/"); + globalPrefixMapping.setNsPrefix("cito", "http://purl.org/spar/cito/"); + globalPrefixMapping.setNsPrefix("geo", "http://aims.fao.org/aos/geopolitical.owl#"); + globalPrefixMapping.setNsPrefix("ocresst", "http://purl.org/net/OCRe/statistics.owl#"); + globalPrefixMapping.setNsPrefix("dcterms", "http://purl.org/dc/terms/"); + globalPrefixMapping.setNsPrefix("text", "http://jena.apache.org/text#"); + globalPrefixMapping.setNsPrefix("event", "http://purl.org/NET/c4dm/event.owl#"); + globalPrefixMapping.setNsPrefix("vann", "http://purl.org/vocab/vann/"); + globalPrefixMapping.setNsPrefix("foaf", "http://xmlns.com/foaf/0.1/"); + globalPrefixMapping.setNsPrefix("c4o", "http://purl.org/spar/c4o/"); + globalPrefixMapping.setNsPrefix("fabio", "http://purl.org/spar/fabio/"); + globalPrefixMapping.setNsPrefix("vcard", "http://www.w3.org/2006/vcard/ns#"); + globalPrefixMapping.setNsPrefix("ocresp", "http://purl.org/net/OCRe/study_protocol.owl#"); + globalPrefixMapping.setNsPrefix("bibo", "http://purl.org/ontology/bibo/"); + globalPrefixMapping.setNsPrefix("sfnc", "http://vivoweb.org/sparql/function#"); + globalPrefixMapping.setNsPrefix("crdc-ccrd-data", + "http://purl.org/uqam.ca/vocabulary/crdc-ccrd/individual#"); + globalPrefixMapping.setNsPrefix("crdc-data", + "http://purl.org/uqam.ca/vocabulary/crdc-ccrd/individual#"); + globalPrefixMapping.setNsPrefix("crdc-ccrd", + "http://purl.org/uqam.ca/vocabulary/crdc_ccrd#"); + globalPrefixMapping.setNsPrefix("dc", "http://purl.org/dc/elements/1.1/"); + globalPrefixMapping.setNsPrefix("dspace", DSPACE.NS); + return globalPrefixMapping; + } + + public static String dumpModel(Model aModel) { + ByteArrayOutputStream modelString = new ByteArrayOutputStream(); + RDFDataMgr.write(modelString, aModel, Lang.TURTLE); + return new String(modelString.toByteArray()); + } + + public static void dumpStdoutModel(Model aModel) { + RDFDataMgr.write(System.out, aModel, Lang.TURTLE); + } + + public static String dumpModelNtriples(Model aModel) { + ByteArrayOutputStream modelString = new ByteArrayOutputStream(); + RDFDataMgr.write(modelString, aModel, Lang.NTRIPLES); + return new String(modelString.toByteArray()); + } + + public static void dumpStdoutModelNtriples(Model aModel) { + RDFDataMgr.write(System.out, aModel, Lang.NTRIPLES); + } + + public static XSDDatatype parseDataType(String literalType) { + String lt = + literalType.replace("xsd:", "").replace("http://www.w3.org/2001/XMLSchema#", ""); + return new XSDDatatype(lt); + } + + public static void main(String[] args) { + XSDDatatype val = ParserHelper.parseDataType("xsd:string"); + System.out.println(val); + + } +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vitro/VITRO.java b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vitro/VITRO.java new file mode 100644 index 000000000..6581479ca --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vitro/VITRO.java @@ -0,0 +1,195 @@ +/* CVS $Id: $ */ + +package org.vivoweb.harvester.extractdspace.vocab.vitro; + +import org.apache.jena.ontology.AnnotationProperty; +import org.apache.jena.ontology.DatatypeProperty; +import org.apache.jena.ontology.ObjectProperty; +import org.apache.jena.ontology.OntClass; +import org.apache.jena.ontology.OntModel; +import org.apache.jena.ontology.OntModelSpec; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; + +/** + * Vocabulary definitions from /home/heon/01-SPRINT/00-PROJET-DSPACE-VIVO/00-GIT/DSpace-VIVO/bundles/org.vivoweb.dspacevivo.model.ontologie/src/main/resources/vitro-0.7.ttl + * + * @author Auto-generated by schemagen on 30 mars 2022 06:31 + */ +public class VITRO { + /** + *

The namespace of the vocabulary as a string

+ */ + public static final String NS = "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#"; + /** + *

The ontology's owl:versionInfo as a string

+ */ + public static final String VERSION_INFO = "0.7"; + /** + *

The ontology model that holds the vocabulary terms

+ */ + private static final OntModel M_MODEL = + ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null); + /** + *

The namespace of the vocabulary as a resource

+ */ + public static final Resource NAMESPACE = M_MODEL.createResource(NS); + public static final ObjectProperty rootTab = + M_MODEL.createObjectProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#rootTab"); + public static final DatatypeProperty aboutText = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#aboutText"); + public static final DatatypeProperty acknowledgeText = M_MODEL.createDatatypeProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#acknowledgeText"); + public static final DatatypeProperty bannerHeight = M_MODEL.createDatatypeProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#bannerHeight"); + public static final DatatypeProperty bannerImage = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#bannerImage"); + public static final DatatypeProperty bannerWidth = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#bannerWidth"); + public static final DatatypeProperty contactMail = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#contactMail"); + public static final DatatypeProperty copyrightAnchor = M_MODEL.createDatatypeProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#copyrightAnchor"); + public static final DatatypeProperty copyrightURL = M_MODEL.createDatatypeProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#copyrightURL"); + public static final DatatypeProperty displayLimit = M_MODEL.createDatatypeProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#displayLimit"); + public static final DatatypeProperty displayRank = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#displayRank"); + public static final DatatypeProperty firstTime = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#firstTime"); + public static final DatatypeProperty hidden = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#hidden"); + public static final DatatypeProperty imageThumbWidth = M_MODEL.createDatatypeProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#imageThumbWidth"); + public static final DatatypeProperty loginCount = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#loginCount"); + public static final DatatypeProperty logotypeHeight = M_MODEL.createDatatypeProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#logotypeHeight"); + public static final DatatypeProperty logotypeImage = M_MODEL.createDatatypeProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#logotypeImage"); + public static final DatatypeProperty logotypeWidth = M_MODEL.createDatatypeProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#logotypeWidth"); + public static final DatatypeProperty md5password = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#md5password"); + public static final DatatypeProperty modTime = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#modTime"); + public static final DatatypeProperty moniker = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#moniker"); + public static final DatatypeProperty namespaceURI = M_MODEL.createDatatypeProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#namespaceURI"); + public static final DatatypeProperty oldpassword = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#oldpassword"); + public static final DatatypeProperty roleURI = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#roleURI"); + public static final DatatypeProperty rootBreadCrumbAnchor = M_MODEL.createDatatypeProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#rootBreadCrumbAnchor"); + public static final DatatypeProperty rootBreadCrumbURL = M_MODEL.createDatatypeProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#rootBreadCrumbURL"); + public static final DatatypeProperty rootLogotypeImage = M_MODEL.createDatatypeProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#rootLogotypeImage"); + public static final DatatypeProperty shortHand = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#shortHand"); + public static final DatatypeProperty themeDir = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#themeDir"); + public static final DatatypeProperty urlPrefix = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#urlPrefix"); + public static final DatatypeProperty username = + M_MODEL.createDatatypeProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#username"); + public static final AnnotationProperty customDisplayViewAnnot = + M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#customDisplayViewAnnot"); + public static final AnnotationProperty customEntryFormAnnot = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#customEntryFormAnnot"); + public static final AnnotationProperty customShortViewAnnot = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#customShortViewAnnot"); + public static final AnnotationProperty descriptionAnnot = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#descriptionAnnot"); + public static final AnnotationProperty displayLimitAnnot = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#displayLimitAnnot"); + public static final AnnotationProperty displayRankAnnot = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#displayRankAnnot"); + public static final AnnotationProperty editing = + M_MODEL.createAnnotationProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#editing"); + public static final AnnotationProperty exampleAnnot = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#exampleAnnot"); + public static final AnnotationProperty extendedLinkedData = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#extendedLinkedData"); + public static final AnnotationProperty forceStubDeletionAnnot = + M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#forceStubDeletionAnnot"); + public static final AnnotationProperty fullPropertyNameAnnot = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#fullPropertyNameAnnot"); + public static final AnnotationProperty harvestId = + M_MODEL.createAnnotationProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#harvestId"); + public static final AnnotationProperty hiddenAnnot = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#hiddenAnnot"); + public static final AnnotationProperty hiddenFromDisplayBelowRoleLevelAnnot = + M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#hiddenFromDisplayBelowRoleLevelAnnot"); + public static final AnnotationProperty hiddenFromPublishBelowRoleLevelAnnot = + M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#hiddenFromPublishBelowRoleLevelAnnot"); + public static final AnnotationProperty inClassGroup = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#inClassGroup"); + public static final AnnotationProperty inPropertyGroupAnnot = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#inPropertyGroupAnnot"); + public static final AnnotationProperty individualSortDirectionAnnot = + M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#individualSortDirectionAnnot"); + public static final AnnotationProperty isExternalId = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#isExternalId"); + public static final AnnotationProperty isMenuPageIntersectionClass = + M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#isMenuPageIntersectionClass"); + public static final AnnotationProperty modTimeAnnot = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#modTimeAnnot"); + public static final AnnotationProperty mostSpecificType = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType"); + public static final AnnotationProperty objectIndividualSortProperty = + M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#objectIndividualSortProperty"); + public static final AnnotationProperty offerCreateNewOptionAnnot = + M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#offerCreateNewOptionAnnot"); + public static final AnnotationProperty oldId = + M_MODEL.createAnnotationProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#oldId"); + public static final AnnotationProperty originalId = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#originalId"); + public static final AnnotationProperty prohibitedFromUpdateBelowRoleLevelAnnot = + M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#prohibitedFromUpdateBelowRoleLevelAnnot"); + public static final AnnotationProperty publicDescriptionAnnot = + M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#publicDescriptionAnnot"); + public static final AnnotationProperty selectFromExistingAnnot = + M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#selectFromExistingAnnot"); + public static final AnnotationProperty shortDef = + M_MODEL.createAnnotationProperty("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#shortDef"); + public static final AnnotationProperty shortDefAnnot = M_MODEL.createAnnotationProperty( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#shortDefAnnot"); + public static final OntClass Application = + M_MODEL.createClass("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#Application"); + public static final OntClass ClassGroup = + M_MODEL.createClass("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#ClassGroup"); + public static final OntClass Namespace = + M_MODEL.createClass("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#Namespace"); + public static final OntClass Portal = + M_MODEL.createClass("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#Portal"); + public static final OntClass PropertyGroup = + M_MODEL.createClass("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#PropertyGroup"); + public static final OntClass User = + M_MODEL.createClass("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#User"); + + /** + *

The namespace of the vocabulary as a string

+ * + * @return namespace as String + * @see #NS + */ + public static String getURI() { + return NS; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/BIBO.java b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/BIBO.java new file mode 100644 index 000000000..af66cf772 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/BIBO.java @@ -0,0 +1,529 @@ +package org.vivoweb.harvester.extractdspace.vocab.vivo; + +import org.apache.jena.ontology.DatatypeProperty; +import org.apache.jena.ontology.ObjectProperty; +import org.apache.jena.ontology.OntClass; +import org.apache.jena.ontology.OntModel; +import org.apache.jena.ontology.OntModelSpec; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; + +public class BIBO { + /** + *

The namespace of the vocabulary as a string

+ */ + public static final String NS = "http://purl.org/ontology/bibo/"; + /** + *

The ontology model that holds the vocabulary terms

+ */ + private static final OntModel M_MODEL = + ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null); + /** + *

The namespace of the vocabulary as a resource

+ */ + public static final Resource NAMESPACE = M_MODEL.createResource(NS); + /** + *

A legal decision that affirms a ruling.

+ */ + public static final ObjectProperty affirmedBy = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/affirmedBy"); + /** + *

Critical or explanatory note for a Document.

+ */ + public static final ObjectProperty annotates = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/annotates"); + public static final ObjectProperty citedBy = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/citedBy"); + public static final ObjectProperty cites = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/cites"); + /** + *

A court associated with a legal document; for example, that which issues a + * decision.

+ */ + public static final ObjectProperty court = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/court"); + /** + *

The thesis degree.

+ */ + public static final ObjectProperty degree = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/degree"); + /** + *

A Film director.

+ */ + public static final ObjectProperty director = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/director"); + public static final ObjectProperty distributor = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/distributor"); + /** + *

An agent that is interviewed by another agent.

+ */ + public static final ObjectProperty interviewee = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/interviewee"); + /** + *

An agent that interview another agent.

+ */ + public static final ObjectProperty interviewer = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/interviewer"); + /** + *

An entity responsible for issuing often informally published documents such + * as press releases, reports, etc.

+ */ + public static final ObjectProperty issuer = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/issuer"); + public static final ObjectProperty performer = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/performer"); + /** + *

Relates a document to an event; for example, a paper to a conference.

+ */ + public static final ObjectProperty presentedAt = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/presentedAt"); + /** + *

Relates an event to associated documents; for example, conference to a paper.

+ */ + public static final ObjectProperty presents = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/presents"); + /** + *

An agent that receives a communication document.

+ */ + public static final ObjectProperty recipient = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/recipient"); + public static final ObjectProperty reproducedIn = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/reproducedIn"); + /** + *

A legal decision that reverses a ruling.

+ */ + public static final ObjectProperty reversedBy = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/reversedBy"); + public static final ObjectProperty reviewOf = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/reviewOf"); + public static final ObjectProperty status = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/status"); + /** + *

A legal decision on appeal that takes action on a case (affirming it, reversing + * it, etc.).

+ */ + public static final ObjectProperty subsequentLegalDecision = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/subsequentLegalDecision"); + /** + *

Relates a document to some transcribed original.

+ */ + public static final ObjectProperty transcriptOf = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/transcriptOf"); + /** + *

Relates a translated document to the original document.

+ */ + public static final ObjectProperty translationOf = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/translationOf"); + public static final ObjectProperty translator = + M_MODEL.createObjectProperty("http://purl.org/ontology/bibo/translator"); + /** + *

A summary of the resource.

+ */ + public static final DatatypeProperty abstract_ = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/abstract"); + /** + *

Amazon Standard Identification Number

+ */ + public static final DatatypeProperty asin = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/asin"); + /** + *

An chapter number

+ */ + public static final DatatypeProperty chapter = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/chapter"); + /** + *

An identifier of serials, still in use by libraries, but replaced by ISSN + * for any new work

+ */ + public static final DatatypeProperty coden = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/coden"); + /** + *

Digital Object Identifier

+ */ + public static final DatatypeProperty doi = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/doi"); + /** + *

European Article Number/Uniform Commercier Code 13

+ */ + public static final DatatypeProperty eanucc13 = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/eanucc13"); + /** + *

The name defining a special edition of a document. Normally its a literal + * value composed of a version number and words.

+ */ + public static final DatatypeProperty edition = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/edition"); + /** + *

The electronic ISSN number of a periodical.

+ */ + public static final DatatypeProperty eissn = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/eissn"); + /** + *

Global Trade Item Number 14

+ */ + public static final DatatypeProperty gtin14 = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/gtin14"); + public static final DatatypeProperty identifier = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/identifier"); + public static final DatatypeProperty isbn10 = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/isbn10"); + public static final DatatypeProperty isbn13 = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/isbn13"); + /** + *

International Standard Serial Number

+ */ + public static final DatatypeProperty issn = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/issn"); + public static final DatatypeProperty issue = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/issue"); + /** + *

Library of Congress Control Number

+ */ + public static final DatatypeProperty lccn = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/lccn"); + /** + *

A description (often numeric) that locates an item within a containing document + * or collection.

+ */ + public static final DatatypeProperty locator = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/locator"); + public static final DatatypeProperty numPages = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/numPages"); + public static final DatatypeProperty number = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/number"); + /** + *

OCLC Identifier

+ */ + public static final DatatypeProperty oclcnum = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/oclcnum"); + /** + *

Ending page number within a continuous page range.

+ */ + public static final DatatypeProperty pageEnd = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/pageEnd"); + /** + *

Starting page number within a continuous page range.

+ */ + public static final DatatypeProperty pageStart = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/pageStart"); + /** + *

PubMed Identifier

+ */ + public static final DatatypeProperty pmid = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/pmid"); + /** + *

The prefix of a name

+ */ + public static final DatatypeProperty prefixName = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/prefixName"); + /** + *

An section number

+ */ + public static final DatatypeProperty section = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/section"); + /** + *

A short description of the resource.

+ */ + public static final DatatypeProperty shortDescription = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/shortDescription"); + /** + *

Serial Item and Contribution Identifier

+ */ + public static final DatatypeProperty sici = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/sici"); + /** + *

Universal Product Code

+ */ + public static final DatatypeProperty upc = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/upc"); + public static final DatatypeProperty uri = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/uri"); + public static final DatatypeProperty volume = + M_MODEL.createDatatypeProperty("http://purl.org/ontology/bibo/volume"); + /** + *

A scholarly academic article, typically published in a journal.

+ */ + public static final OntClass AcademicArticle = + M_MODEL.createClass("http://purl.org/ontology/bibo/AcademicArticle"); + /** + *

A written composition in prose, usually nonfiction, on a specific topic, forming + * an independent part of a book or other publication, as a newspaper or magazine.

+ */ + public static final OntClass Article = + M_MODEL.createClass("http://purl.org/ontology/bibo/Article"); + /** + *

An audio document; aka record.

+ */ + public static final OntClass AudioDocument = + M_MODEL.createClass("http://purl.org/ontology/bibo/AudioDocument"); + /** + *

An audio-visual document; film, video, and so forth.

+ */ + public static final OntClass AudioVisualDocument = + M_MODEL.createClass("http://purl.org/ontology/bibo/AudioVisualDocument"); + /** + *

Draft legislation presented for discussion to a legal body.

+ */ + public static final OntClass Bill = M_MODEL.createClass("http://purl.org/ontology/bibo/Bill"); + /** + *

A written or printed work of fiction or nonfiction, usually on sheets of paper + * fastened or bound together within covers.

+ */ + public static final OntClass Book = M_MODEL.createClass("http://purl.org/ontology/bibo/Book"); + /** + *

A section of a book.

+ */ + public static final OntClass BookSection = + M_MODEL.createClass("http://purl.org/ontology/bibo/BookSection"); + /** + *

A written argument submitted to a court.

+ */ + public static final OntClass Brief = M_MODEL.createClass("http://purl.org/ontology/bibo/Brief"); + /** + *

A chapter of a book.

+ */ + public static final OntClass Chapter = + M_MODEL.createClass("http://purl.org/ontology/bibo/Chapter"); + /** + *

A collection of statutes.

+ */ + public static final OntClass Code = M_MODEL.createClass("http://purl.org/ontology/bibo/Code"); + /** + *

A document that simultaneously contains other documents.

+ */ + public static final OntClass CollectedDocument = + M_MODEL.createClass("http://purl.org/ontology/bibo/CollectedDocument"); + /** + *

A collection of Documents or Collections

+ */ + public static final OntClass Collection = + M_MODEL.createClass("http://purl.org/ontology/bibo/Collection"); + /** + *

A meeting for consultation or discussion.

+ */ + public static final OntClass Conference = + M_MODEL.createClass("http://purl.org/ontology/bibo/Conference"); + /** + *

A collection of legal cases.

+ */ + public static final OntClass CourtReporter = + M_MODEL.createClass("http://purl.org/ontology/bibo/CourtReporter"); + /** + *

A document (noun) is a bounded physical representation of body of information + * designed with the capacity (and usually intent) to communicate. A document + * may manifest symbolic, diagrammatic or sensory-representational information.

+ */ + public static final OntClass Document = + M_MODEL.createClass("http://purl.org/ontology/bibo/Document"); + /** + *

a distinct part of a larger document or collected document.

+ */ + public static final OntClass DocumentPart = + M_MODEL.createClass("http://purl.org/ontology/bibo/DocumentPart"); + /** + *

The status of the publication of a document.

+ */ + public static final OntClass DocumentStatus = + M_MODEL.createClass("http://purl.org/ontology/bibo/DocumentStatus"); + /** + *

An edited book.

+ */ + public static final OntClass EditedBook = + M_MODEL.createClass("http://purl.org/ontology/bibo/EditedBook"); + /** + *

A passage selected from a larger work.

+ */ + public static final OntClass Excerpt = + M_MODEL.createClass("http://purl.org/ontology/bibo/Excerpt"); + /** + *

aka movie.

+ */ + public static final OntClass Film = M_MODEL.createClass("http://purl.org/ontology/bibo/Film"); + /** + *

An instance or a session in which testimony and arguments are presented, esp. + * before an official, as a judge in a lawsuit.

+ */ + public static final OntClass Hearing = + M_MODEL.createClass("http://purl.org/ontology/bibo/Hearing"); + /** + *

A document that presents visual or diagrammatic information.

+ */ + public static final OntClass Image = M_MODEL.createClass("http://purl.org/ontology/bibo/Image"); + /** + *

A formalized discussion between two or more people.

+ */ + public static final OntClass Interview = + M_MODEL.createClass("http://purl.org/ontology/bibo/Interview"); + /** + *

something that is printed or published and distributed, esp. a given number + * of a periodical

+ */ + public static final OntClass Issue = M_MODEL.createClass("http://purl.org/ontology/bibo/Issue"); + /** + *

A periodical of scholarly journal Articles.

+ */ + public static final OntClass Journal = + M_MODEL.createClass("http://purl.org/ontology/bibo/Journal"); + /** + *

A document accompanying a legal case.

+ */ + public static final OntClass LegalCaseDocument = + M_MODEL.createClass("http://purl.org/ontology/bibo/LegalCaseDocument"); + /** + *

A document containing an authoritative determination (as a decree or judgment) + * made after consideration of facts or law.

+ */ + public static final OntClass LegalDecision = + M_MODEL.createClass("http://purl.org/ontology/bibo/LegalDecision"); + /** + *

A legal document; for example, a court decision, a brief, and so forth.

+ */ + public static final OntClass LegalDocument = + M_MODEL.createClass("http://purl.org/ontology/bibo/LegalDocument"); + /** + *

A legal document proposing or enacting a law or a group of laws.

+ */ + public static final OntClass Legislation = + M_MODEL.createClass("http://purl.org/ontology/bibo/Legislation"); + public static final OntClass Letter = + M_MODEL.createClass("http://purl.org/ontology/bibo/Letter"); + /** + *

A periodical of magazine Articles. A magazine is a publication that is issued + * periodically, usually bound in a paper cover, and typically contains essays, + * stories, poems, etc., by many writers, and often photographs and drawings, + * frequently specializing in a particular subject or area, as hobbies, news, + * or sports.

+ */ + public static final OntClass Magazine = + M_MODEL.createClass("http://purl.org/ontology/bibo/Magazine"); + /** + *

A small reference book, especially one giving instructions.

+ */ + public static final OntClass Manual = + M_MODEL.createClass("http://purl.org/ontology/bibo/Manual"); + /** + *

An unpublished Document, which may also be submitted to a publisher for publication.

+ */ + public static final OntClass Manuscript = + M_MODEL.createClass("http://purl.org/ontology/bibo/Manuscript"); + /** + *

A graphical depiction of geographic features.

+ */ + public static final OntClass Map = M_MODEL.createClass("http://purl.org/ontology/bibo/Map"); + /** + *

A periodical of documents, usually issued daily or weekly, containing current + * news, editorials, feature articles, and usually advertising.

+ */ + public static final OntClass Newspaper = + M_MODEL.createClass("http://purl.org/ontology/bibo/Newspaper"); + /** + *

Notes or annotations about a resource.

+ */ + public static final OntClass Note = M_MODEL.createClass("http://purl.org/ontology/bibo/Note"); + /** + *

A document describing the exclusive right granted by a government to an inventor + * to manufacture, use, or sell an invention for a certain number of years.

+ */ + public static final OntClass Patent = + M_MODEL.createClass("http://purl.org/ontology/bibo/Patent"); + /** + *

A public performance.

+ */ + public static final OntClass Performance = + M_MODEL.createClass("http://purl.org/ontology/bibo/Performance"); + /** + *

A group of related documents issued at regular intervals.

+ */ + public static final OntClass Periodical = + M_MODEL.createClass("http://purl.org/ontology/bibo/Periodical"); + public static final OntClass PersonalCommunicationDocument = + M_MODEL.createClass("http://purl.org/ontology/bibo/PersonalCommunicationDocument"); + /** + *

A compilation of documents published from an event, such as a conference.

+ */ + public static final OntClass Proceedings = + M_MODEL.createClass("http://purl.org/ontology/bibo/Proceedings"); + /** + *

An excerpted collection of words.

+ */ + public static final OntClass Quote = M_MODEL.createClass("http://purl.org/ontology/bibo/Quote"); + /** + *

A document that presents authoritative reference information, such as a dictionary + * or encylopedia .

+ */ + public static final OntClass ReferenceSource = + M_MODEL.createClass("http://purl.org/ontology/bibo/ReferenceSource"); + /** + *

A document describing an account or statement describing in detail an event, + * situation, or the like, usually as the result of observation, inquiry, etc..

+ */ + public static final OntClass Report = + M_MODEL.createClass("http://purl.org/ontology/bibo/Report"); + /** + *

A loose, thematic, collection of Documents, often Books.

+ */ + public static final OntClass Series = + M_MODEL.createClass("http://purl.org/ontology/bibo/Series"); + /** + *

A slide in a slideshow

+ */ + public static final OntClass Slide = M_MODEL.createClass("http://purl.org/ontology/bibo/Slide"); + /** + *

A presentation of a series of slides, usually presented in front of an audience + * with written text and images.

+ */ + public static final OntClass Slideshow = + M_MODEL.createClass("http://purl.org/ontology/bibo/Slideshow"); + /** + *

A document describing a standard

+ */ + public static final OntClass Standard = + M_MODEL.createClass("http://purl.org/ontology/bibo/Standard"); + /** + *

A bill enacted into law.

+ */ + public static final OntClass Statute = + M_MODEL.createClass("http://purl.org/ontology/bibo/Statute"); + /** + *

A document created to summarize research findings associated with the completion + * of an academic degree.

+ */ + public static final OntClass Thesis = + M_MODEL.createClass("http://purl.org/ontology/bibo/Thesis"); + /** + *

The academic degree of a Thesis

+ */ + public static final OntClass ThesisDegree = + M_MODEL.createClass("http://purl.org/ontology/bibo/ThesisDegree"); + /** + *

A web page is an online document available (at least initially) on the world + * wide web. A web page is written first and foremost to appear on the web, as + * distinct from other online resources such as books, manuscripts or audio documents + * which use the web primarily as a distribution mechanism alongside other more + * traditional methods such as print.

+ */ + public static final OntClass Webpage = + M_MODEL.createClass("http://purl.org/ontology/bibo/Webpage"); + /** + *

A group of Webpages accessible on the Web.

+ */ + public static final OntClass Website = + M_MODEL.createClass("http://purl.org/ontology/bibo/Website"); + /** + *

A seminar, discussion group, or the like, that emphasizes zxchange of ideas + * and the demonstration and application of techniques, skills, etc.

+ */ + public static final OntClass Workshop = + M_MODEL.createClass("http://purl.org/ontology/bibo/Workshop"); + + /** + *

The namespace of the vocabulary as a string

+ * + * @return namespace as String + * @see #NS + */ + public static String getURI() { + return NS; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/GEO.java b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/GEO.java new file mode 100644 index 000000000..ffb068520 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/GEO.java @@ -0,0 +1,267 @@ +package org.vivoweb.harvester.extractdspace.vocab.vivo; + +import org.apache.jena.ontology.AnnotationProperty; +import org.apache.jena.ontology.DatatypeProperty; +import org.apache.jena.ontology.ObjectProperty; +import org.apache.jena.ontology.OntClass; +import org.apache.jena.ontology.OntModel; +import org.apache.jena.ontology.OntModelSpec; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; + +public class GEO { + /** + *

The namespace of the vocabulary as a string

+ */ + public static final String NS = "http://aims.fao.org/aos/geopolitical.owl#"; + /** + *

The ontology model that holds the vocabulary terms

+ */ + private static final OntModel M_MODEL = + ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null); + /** + *

The namespace of the vocabulary as a resource

+ */ + public static final Resource NAMESPACE = M_MODEL.createResource(NS); + public static final ObjectProperty hasBorderWith = + M_MODEL.createObjectProperty("http://aims.fao.org/aos/geopolitical.owl#hasBorderWith"); + public static final ObjectProperty hasMember = + M_MODEL.createObjectProperty("http://aims.fao.org/aos/geopolitical.owl#hasMember"); + public static final ObjectProperty isAdministeredBy = + M_MODEL.createObjectProperty("http://aims.fao.org/aos/geopolitical.owl#isAdministeredBy"); + public static final ObjectProperty isInGroup = + M_MODEL.createObjectProperty("http://aims.fao.org/aos/geopolitical.owl#isInGroup"); + public static final ObjectProperty isPredecessorOf = + M_MODEL.createObjectProperty("http://aims.fao.org/aos/geopolitical.owl#isPredecessorOf"); + public static final ObjectProperty isSuccessorOf = + M_MODEL.createObjectProperty("http://aims.fao.org/aos/geopolitical.owl#isSuccessorOf"); + public static final DatatypeProperty GDP = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#GDP"); + public static final DatatypeProperty GDPNotes = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#GDPNotes"); + public static final DatatypeProperty GDPTotalInCurrentPrices = M_MODEL.createDatatypeProperty( + "http://aims.fao.org/aos/geopolitical.owl#GDPTotalInCurrentPrices"); + public static final DatatypeProperty GDPUnit = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#GDPUnit"); + public static final DatatypeProperty GDPYear = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#GDPYear"); + public static final DatatypeProperty HDI = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#HDI"); + public static final DatatypeProperty HDINotes = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#HDINotes"); + public static final DatatypeProperty HDITotal = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#HDITotal"); + public static final DatatypeProperty HDIUnit = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#HDIUnit"); + public static final DatatypeProperty HDIYear = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#HDIYear"); + public static final DatatypeProperty agriculturalArea = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#agriculturalArea"); + public static final DatatypeProperty agriculturalAreaNotes = M_MODEL.createDatatypeProperty( + "http://aims.fao.org/aos/geopolitical.owl#agriculturalAreaNotes"); + public static final DatatypeProperty agriculturalAreaTotal = M_MODEL.createDatatypeProperty( + "http://aims.fao.org/aos/geopolitical.owl#agriculturalAreaTotal"); + public static final DatatypeProperty agriculturalAreaUnit = M_MODEL.createDatatypeProperty( + "http://aims.fao.org/aos/geopolitical.owl#agriculturalAreaUnit"); + public static final DatatypeProperty agriculturalAreaYear = M_MODEL.createDatatypeProperty( + "http://aims.fao.org/aos/geopolitical.owl#agriculturalAreaYear"); + public static final DatatypeProperty codeAGROVOC = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#codeAGROVOC"); + public static final DatatypeProperty codeCurrency = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#codeCurrency"); + public static final DatatypeProperty codeDBPediaID = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#codeDBPediaID"); + public static final DatatypeProperty codeFAOSTAT = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#codeFAOSTAT"); + public static final DatatypeProperty codeFAOTERM = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#codeFAOTERM"); + public static final DatatypeProperty codeGAUL = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#codeGAUL"); + public static final DatatypeProperty codeISO2 = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#codeISO2"); + public static final DatatypeProperty codeISO3 = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#codeISO3"); + public static final DatatypeProperty codeUN = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#codeUN"); + public static final DatatypeProperty codeUNDP = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#codeUNDP"); + public static final DatatypeProperty countryArea = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#countryArea"); + public static final DatatypeProperty countryAreaNotes = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#countryAreaNotes"); + public static final DatatypeProperty countryAreaTotal = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#countryAreaTotal"); + public static final DatatypeProperty countryAreaUnit = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#countryAreaUnit"); + public static final DatatypeProperty countryAreaYear = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#countryAreaYear"); + public static final DatatypeProperty hasCode = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#hasCode"); + public static final DatatypeProperty hasCoordinate = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#hasCoordinate"); + public static final DatatypeProperty hasCurrency = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#hasCurrency"); + public static final DatatypeProperty hasListName = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#hasListName"); + public static final DatatypeProperty hasMaxLatitude = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#hasMaxLatitude"); + public static final DatatypeProperty hasMaxLongitude = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#hasMaxLongitude"); + public static final DatatypeProperty hasMinLatitude = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#hasMinLatitude"); + public static final DatatypeProperty hasMinLongitude = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#hasMinLongitude"); + public static final DatatypeProperty hasNationality = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#hasNationality"); + public static final DatatypeProperty hasOfficialName = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#hasOfficialName"); + public static final DatatypeProperty hasShortName = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#hasShortName"); + public static final DatatypeProperty hasStatistics = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#hasStatistics"); + public static final DatatypeProperty landArea = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#landArea"); + public static final DatatypeProperty landAreaNotes = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#landAreaNotes"); + public static final DatatypeProperty landAreaTotal = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#landAreaTotal"); + public static final DatatypeProperty landAreaUnit = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#landAreaUnit"); + public static final DatatypeProperty landAreaYear = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#landAreaYear"); + public static final DatatypeProperty nameCurrencyAR = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameCurrencyAR"); + public static final DatatypeProperty nameCurrencyEN = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameCurrencyEN"); + public static final DatatypeProperty nameCurrencyES = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameCurrencyES"); + public static final DatatypeProperty nameCurrencyFR = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameCurrencyFR"); + public static final DatatypeProperty nameCurrencyIT = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameCurrencyIT"); + public static final DatatypeProperty nameCurrencyRU = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameCurrencyRU"); + public static final DatatypeProperty nameCurrencyZH = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameCurrencyZH"); + public static final DatatypeProperty nameListAR = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameListAR"); + public static final DatatypeProperty nameListEN = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameListEN"); + public static final DatatypeProperty nameListES = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameListES"); + public static final DatatypeProperty nameListFR = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameListFR"); + public static final DatatypeProperty nameListIT = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameListIT"); + public static final DatatypeProperty nameListRU = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameListRU"); + public static final DatatypeProperty nameListZH = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameListZH"); + public static final DatatypeProperty nameOfficialAR = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameOfficialAR"); + public static final DatatypeProperty nameOfficialEN = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameOfficialEN"); + public static final DatatypeProperty nameOfficialES = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameOfficialES"); + public static final DatatypeProperty nameOfficialFR = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameOfficialFR"); + public static final DatatypeProperty nameOfficialIT = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameOfficialIT"); + public static final DatatypeProperty nameOfficialRU = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameOfficialRU"); + public static final DatatypeProperty nameOfficialZH = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameOfficialZH"); + public static final DatatypeProperty nameShortAR = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameShortAR"); + public static final DatatypeProperty nameShortEN = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameShortEN"); + public static final DatatypeProperty nameShortES = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameShortES"); + public static final DatatypeProperty nameShortFR = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameShortFR"); + public static final DatatypeProperty nameShortIT = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameShortIT"); + public static final DatatypeProperty nameShortRU = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameShortRU"); + public static final DatatypeProperty nameShortZH = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nameShortZH"); + public static final DatatypeProperty nationalityAR = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nationalityAR"); + public static final DatatypeProperty nationalityEN = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nationalityEN"); + public static final DatatypeProperty nationalityES = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nationalityES"); + public static final DatatypeProperty nationalityFR = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nationalityFR"); + public static final DatatypeProperty nationalityIT = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nationalityIT"); + public static final DatatypeProperty nationalityRU = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nationalityRU"); + public static final DatatypeProperty nationalityZH = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#nationalityZH"); + public static final DatatypeProperty population = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#population"); + public static final DatatypeProperty populationNotes = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#populationNotes"); + public static final DatatypeProperty populationTotal = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#populationTotal"); + public static final DatatypeProperty populationUnit = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#populationUnit"); + public static final DatatypeProperty populationYear = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#populationYear"); + /** + *

The value of the datatype property *validSince* associated to a particular + * area (territory or group) indicates the area's first year of validity. The + * geopolitical ontology traces back historic changes only until 1985, therefore, + * if an area has a validSince = 1985, this indicates that the area is/was valid + * since 1985 or before.

+ */ + public static final DatatypeProperty validSince = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#validSince"); + /** + *

The value of the datatype property *validUntil* associated to a particular + * area (territory or group) indicates the area's last year of validity. In case + * the area is currently valid, this value is set by default to 9999.

+ */ + public static final DatatypeProperty validUntil = + M_MODEL.createDatatypeProperty("http://aims.fao.org/aos/geopolitical.owl#validUntil"); + public static final AnnotationProperty sourceCreator = + M_MODEL.createAnnotationProperty("http://aims.fao.org/aos/geopolitical.owl#sourceCreator"); + public static final AnnotationProperty sourceIdentifier = M_MODEL.createAnnotationProperty( + "http://aims.fao.org/aos/geopolitical.owl#sourceIdentifier"); + public static final AnnotationProperty sourceModified = + M_MODEL.createAnnotationProperty("http://aims.fao.org/aos/geopolitical.owl#sourceModified"); + public static final OntClass area = + M_MODEL.createClass("http://aims.fao.org/aos/geopolitical.owl#area"); + public static final OntClass disputed = + M_MODEL.createClass("http://aims.fao.org/aos/geopolitical.owl#disputed"); + public static final OntClass economic_region = + M_MODEL.createClass("http://aims.fao.org/aos/geopolitical.owl#economic_region"); + public static final OntClass geographical_region = + M_MODEL.createClass("http://aims.fao.org/aos/geopolitical.owl#geographical_region"); + public static final OntClass group = + M_MODEL.createClass("http://aims.fao.org/aos/geopolitical.owl#group"); + public static final OntClass non_self_governing = + M_MODEL.createClass("http://aims.fao.org/aos/geopolitical.owl#non_self_governing"); + public static final OntClass organization = + M_MODEL.createClass("http://aims.fao.org/aos/geopolitical.owl#organization"); + public static final OntClass other = + M_MODEL.createClass("http://aims.fao.org/aos/geopolitical.owl#other"); + public static final OntClass self_governing = + M_MODEL.createClass("http://aims.fao.org/aos/geopolitical.owl#self_governing"); + public static final OntClass special_group = + M_MODEL.createClass("http://aims.fao.org/aos/geopolitical.owl#special_group"); + public static final OntClass territory = + M_MODEL.createClass("http://aims.fao.org/aos/geopolitical.owl#territory"); + + /** + *

The namespace of the vocabulary as a string

+ * + * @return namespace as String + * @see #NS + */ + public static String getURI() { + return NS; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/NS.java b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/NS.java new file mode 100644 index 000000000..e57f1516e --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/NS.java @@ -0,0 +1,36 @@ +package org.vivoweb.harvester.extractdspace.vocab.vivo; + +import org.apache.jena.ontology.AnnotationProperty; +import org.apache.jena.ontology.OntModel; +import org.apache.jena.ontology.OntModelSpec; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; + +public class NS { + /** + *

The namespace of the vocabulary as a string

+ */ + public static final String NS = "http://www.w3.org/2003/06/sw-vocab-status/ns#"; + /** + *

The ontology model that holds the vocabulary terms

+ */ + private static final OntModel M_MODEL = + ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null); + /** + *

The namespace of the vocabulary as a resource

+ */ + public static final Resource NAMESPACE = M_MODEL.createResource(NS); + public static final AnnotationProperty term_status = M_MODEL.createAnnotationProperty( + "http://www.w3.org/2003/06/sw-vocab-status/ns#term_status"); + + /** + *

The namespace of the vocabulary as a string

+ * + * @return namespace as String + * @see #NS + */ + public static String getURI() { + return NS; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/OBO.java b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/OBO.java new file mode 100644 index 000000000..9f77582d2 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/OBO.java @@ -0,0 +1,484 @@ +package org.vivoweb.harvester.extractdspace.vocab.vivo; + +import org.apache.jena.ontology.AnnotationProperty; +import org.apache.jena.ontology.DatatypeProperty; +import org.apache.jena.ontology.ObjectProperty; +import org.apache.jena.ontology.OntClass; +import org.apache.jena.ontology.OntModel; +import org.apache.jena.ontology.OntModelSpec; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; + +public class OBO { + /** + *

The namespace of the vocabulary as a string

+ */ + public static final String NS = "http://purl.obolibrary.org/obo/"; + /** + *

The ontology model that holds the vocabulary terms

+ */ + private static final OntModel M_MODEL = + ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null); + /** + *

The namespace of the vocabulary as a resource

+ */ + public static final Resource NAMESPACE = M_MODEL.createResource(NS); + public static final ObjectProperty ARG_2000028 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ARG_2000028"); + public static final ObjectProperty ARG_2000029 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ARG_2000029"); + public static final ObjectProperty ARG_2000390 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ARG_2000390"); + public static final ObjectProperty ARG_2000391 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ARG_2000391"); + public static final ObjectProperty ARG_2000399 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ARG_2000399"); + public static final ObjectProperty BFO_0000050 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/BFO_0000050"); + public static final ObjectProperty BFO_0000051 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/BFO_0000051"); + public static final ObjectProperty BFO_0000054 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/BFO_0000054"); + public static final ObjectProperty BFO_0000055 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/BFO_0000055"); + /** + *

change the domain tye to access service

+ */ + public static final ObjectProperty ERO_0000029 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000029"); + /** + *

Here there are things to be fixed (for instance a service can use a technique...)

+ */ + public static final ObjectProperty ERO_0000031 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000031"); + public static final ObjectProperty ERO_0000033 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000033"); + public static final ObjectProperty ERO_0000034 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000034"); + public static final ObjectProperty ERO_0000037 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000037"); + public static final ObjectProperty ERO_0000038 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000038"); + public static final ObjectProperty ERO_0000070 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000070"); + public static final ObjectProperty ERO_0000390 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000390"); + public static final ObjectProperty ERO_0000397 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000397"); + public static final ObjectProperty ERO_0000398 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000398"); + public static final ObjectProperty ERO_0000460 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000460"); + /** + *

placeholder: need to be modeled for the proper kind of service (production + * services)

+ */ + public static final ObjectProperty ERO_0000481 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000481"); + /** + *

Placeholder needs to be redesign

+ */ + public static final ObjectProperty ERO_0000482 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000482"); + public static final ObjectProperty ERO_0000543 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000543"); + public static final ObjectProperty ERO_0000572 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000572"); + public static final ObjectProperty ERO_0000775 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000775"); + public static final ObjectProperty ERO_0000918 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000918"); + public static final ObjectProperty ERO_0000919 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0000919"); + public static final ObjectProperty ERO_0001518 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0001518"); + public static final ObjectProperty ERO_0001520 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0001520"); + public static final ObjectProperty ERO_0001521 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/ERO_0001521"); + public static final ObjectProperty IAO_0000039 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/IAO_0000039"); + public static final ObjectProperty IAO_0000136 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/IAO_0000136"); + public static final ObjectProperty IAO_0000142 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/IAO_0000142"); + public static final ObjectProperty IAO_0000221 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/IAO_0000221"); + public static final ObjectProperty IAO_0000417 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/IAO_0000417"); + public static final ObjectProperty OBI_0000293 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/OBI_0000293"); + public static final ObjectProperty OBI_0000299 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/OBI_0000299"); + public static final ObjectProperty OBI_0000304 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/OBI_0000304"); + public static final ObjectProperty OBI_0000312 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/OBI_0000312"); + public static final ObjectProperty OBI_0000417 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/OBI_0000417"); + public static final ObjectProperty OBI_0000643 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/OBI_0000643"); + public static final ObjectProperty OBI_0000833 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/OBI_0000833"); + public static final ObjectProperty RO_0000052 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0000052"); + public static final ObjectProperty RO_0000053 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0000053"); + public static final ObjectProperty RO_0000056 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0000056"); + public static final ObjectProperty RO_0000057 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0000057"); + public static final ObjectProperty RO_0001000 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0001000"); + public static final ObjectProperty RO_0001015 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0001015"); + public static final ObjectProperty RO_0001018 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0001018"); + public static final ObjectProperty RO_0001019 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0001019"); + public static final ObjectProperty RO_0001025 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0001025"); + public static final ObjectProperty RO_0002220 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0002220"); + public static final ObjectProperty RO_0002233 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0002233"); + public static final ObjectProperty RO_0002234 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0002234"); + public static final ObjectProperty RO_0002350 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0002350"); + public static final ObjectProperty RO_0002351 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0002351"); + public static final ObjectProperty RO_0002353 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0002353"); + public static final ObjectProperty RO_0003000 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0003000"); + public static final ObjectProperty RO_0003001 = + M_MODEL.createObjectProperty("http://purl.obolibrary.org/obo/RO_0003001"); + public static final DatatypeProperty ARG_0000001 = + M_MODEL.createDatatypeProperty("http://purl.obolibrary.org/obo/ARG_0000001"); + public static final DatatypeProperty ARG_0000015 = + M_MODEL.createDatatypeProperty("http://purl.obolibrary.org/obo/ARG_0000015"); + public static final DatatypeProperty ARG_0000172 = + M_MODEL.createDatatypeProperty("http://purl.obolibrary.org/obo/ARG_0000172"); + public static final DatatypeProperty ARG_0000197 = + M_MODEL.createDatatypeProperty("http://purl.obolibrary.org/obo/ARG_0000197"); + public static final DatatypeProperty ARG_2000012 = + M_MODEL.createDatatypeProperty("http://purl.obolibrary.org/obo/ARG_2000012"); + public static final DatatypeProperty ERO_0000044 = + M_MODEL.createDatatypeProperty("http://purl.obolibrary.org/obo/ERO_0000044"); + public static final DatatypeProperty ERO_0000045 = + M_MODEL.createDatatypeProperty("http://purl.obolibrary.org/obo/ERO_0000045"); + public static final DatatypeProperty ERO_0000046 = + M_MODEL.createDatatypeProperty("http://purl.obolibrary.org/obo/ERO_0000046"); + public static final DatatypeProperty ERO_0000050 = + M_MODEL.createDatatypeProperty("http://purl.obolibrary.org/obo/ERO_0000050"); + public static final DatatypeProperty ERO_0000054 = + M_MODEL.createDatatypeProperty("http://purl.obolibrary.org/obo/ERO_0000054"); + public static final DatatypeProperty ERO_0000072 = + M_MODEL.createDatatypeProperty("http://purl.obolibrary.org/obo/ERO_0000072"); + public static final DatatypeProperty ERO_0000424 = + M_MODEL.createDatatypeProperty("http://purl.obolibrary.org/obo/ERO_0000424"); + public static final DatatypeProperty ERO_0000774 = + M_MODEL.createDatatypeProperty("http://purl.obolibrary.org/obo/ERO_0000774"); + public static final AnnotationProperty ARG_0000033 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/ARG_0000033"); + public static final AnnotationProperty BFO_0000179 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/BFO_0000179"); + public static final AnnotationProperty BFO_0000180 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/BFO_0000180"); + public static final AnnotationProperty IAO_0000111 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/IAO_0000111"); + public static final AnnotationProperty IAO_0000112 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/IAO_0000112"); + public static final AnnotationProperty IAO_0000114 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/IAO_0000114"); + public static final AnnotationProperty IAO_0000115 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/IAO_0000115"); + public static final AnnotationProperty IAO_0000116 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/IAO_0000116"); + public static final AnnotationProperty IAO_0000117 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/IAO_0000117"); + public static final AnnotationProperty IAO_0000118 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/IAO_0000118"); + public static final AnnotationProperty IAO_0000119 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/IAO_0000119"); + public static final AnnotationProperty IAO_0000231 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/IAO_0000231"); + public static final AnnotationProperty IAO_0000232 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/IAO_0000232"); + public static final AnnotationProperty IAO_0000412 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/IAO_0000412"); + public static final AnnotationProperty IAO_0000600 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/IAO_0000600"); + public static final AnnotationProperty IAO_0000601 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/IAO_0000601"); + public static final AnnotationProperty IAO_0000602 = + M_MODEL.createAnnotationProperty("http://purl.obolibrary.org/obo/IAO_0000602"); + public static final OntClass ARG_0000008 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ARG_0000008"); + public static final OntClass ARG_2000008 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ARG_2000008"); + public static final OntClass ARG_2000009 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ARG_2000009"); + public static final OntClass ARG_2000010 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ARG_2000010"); + public static final OntClass ARG_2000011 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ARG_2000011"); + public static final OntClass ARG_2000021 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ARG_2000021"); + public static final OntClass ARG_2000022 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ARG_2000022"); + public static final OntClass ARG_2000376 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ARG_2000376"); + public static final OntClass ARG_2000377 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ARG_2000377"); + public static final OntClass ARG_2000379 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ARG_2000379"); + public static final OntClass BCO_0000003 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BCO_0000003"); + public static final OntClass BCO_0000042 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BCO_0000042"); + public static final OntClass BFO_0000001 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000001"); + public static final OntClass BFO_0000002 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000002"); + public static final OntClass BFO_0000003 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000003"); + public static final OntClass BFO_0000004 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000004"); + public static final OntClass BFO_0000006 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000006"); + public static final OntClass BFO_0000008 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000008"); + public static final OntClass BFO_0000015 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000015"); + public static final OntClass BFO_0000016 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000016"); + public static final OntClass BFO_0000017 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000017"); + public static final OntClass BFO_0000019 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000019"); + public static final OntClass BFO_0000020 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000020"); + public static final OntClass BFO_0000023 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000023"); + public static final OntClass BFO_0000029 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000029"); + public static final OntClass BFO_0000031 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000031"); + public static final OntClass BFO_0000034 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000034"); + public static final OntClass BFO_0000038 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000038"); + public static final OntClass BFO_0000040 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000040"); + public static final OntClass BFO_0000141 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000141"); + public static final OntClass BFO_0000148 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/BFO_0000148"); + /** + *

See OBI listserv discussion for considerations in defining instrument. http://sourceforge.net/tracker/index.php?func=detail&aid=2894801&group_id=177891&atid=886178

+ */ + public static final OntClass ERO_0000004 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000004"); + /** + *

Coordinate with NIF. NIF ID: nlx_res_20090105

+ */ + public static final OntClass ERO_0000005 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000005"); + /** + *

Placeholder for class to be imported from the Reagent Ontology (ReO).

+ */ + public static final OntClass ERO_0000006 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000006"); + /** + *

Protocol is added to eagle-i temporarily until a relationship between the + * informatio entity "protocol" and these planned processes is created. This + * class refers to the axtual process not the document

+ */ + public static final OntClass ERO_0000007 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000007"); + public static final OntClass ERO_0000012 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000012"); + /** + *

Maybe SameAs "Investigation" but is the subject of funding

+ */ + public static final OntClass ERO_0000014 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000014"); + /** + *

This should be imported from OCRE- but they currently have no generic human + * study type. Def is modified.

+ */ + public static final OntClass ERO_0000015 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000015"); + public static final OntClass ERO_0000016 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000016"); + /** + *

Should have relationship to Organism

+ */ + public static final OntClass ERO_0000020 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000020"); + /** + *

IAO is a planned specification, in SWO is an Information artifact. In eagle-i, + * we have a need to collect material instances and is it thus currently classified + * as a material entity.

+ */ + public static final OntClass ERO_0000071 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000071"); + public static final OntClass ERO_0000224 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000224"); + public static final OntClass ERO_0000225 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000225"); + /** + *

Coordinate with NIF

+ */ + public static final OntClass ERO_0000391 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000391"); + /** + *

coordinate with NIF. NIF ID:nlx_res_20090419

+ */ + public static final OntClass ERO_0000392 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000392"); + /** + *

Coordinate with NIF. NIF ID: nlx_res_20090444

+ */ + public static final OntClass ERO_0000393 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000393"); + /** + *

Coordinate with NIF: NIF ID: nlx_res_20090416

+ */ + public static final OntClass ERO_0000394 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000394"); + /** + *

Coordinate with NIF: NIF ID: nlx_res_20090420

+ */ + public static final OntClass ERO_0000395 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000395"); + /** + *

Coordinate with NIF. NIF ID: nlx_res_20090418

+ */ + public static final OntClass ERO_0000396 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000396"); + public static final OntClass ERO_0000565 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000565"); + public static final OntClass ERO_0000595 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000595"); + public static final OntClass ERO_0000776 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000776"); + public static final OntClass ERO_0000777 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000777"); + public static final OntClass ERO_0000778 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000778"); + public static final OntClass ERO_0000779 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000779"); + public static final OntClass ERO_0000780 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000780"); + public static final OntClass ERO_0000783 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000783"); + public static final OntClass ERO_0000784 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000784"); + public static final OntClass ERO_0000785 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000785"); + public static final OntClass ERO_0000786 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000786"); + public static final OntClass ERO_0000787 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000787"); + public static final OntClass ERO_0000788 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000788"); + public static final OntClass ERO_0000789 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000789"); + public static final OntClass ERO_0000790 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000790"); + public static final OntClass ERO_0000914 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0000914"); + public static final OntClass ERO_0001245 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0001245"); + public static final OntClass ERO_0001254 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0001254"); + public static final OntClass ERO_0001255 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0001255"); + public static final OntClass ERO_0001256 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0001256"); + public static final OntClass ERO_0001257 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0001257"); + public static final OntClass ERO_0001258 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0001258"); + public static final OntClass ERO_0001259 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0001259"); + public static final OntClass ERO_0001260 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0001260"); + public static final OntClass ERO_0001261 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0001261"); + public static final OntClass ERO_0001262 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0001262"); + public static final OntClass ERO_0001263 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0001263"); + /** + *

Just a place horder. It will probably be replaced by NIF term: http://ontology.neuinfo.org/NIF/DigitalEntities/NIF-Resource.owl#nlx_res_20090405

+ */ + public static final OntClass ERO_0001716 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/ERO_0001716"); + public static final OntClass IAO_0000003 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/IAO_0000003"); + public static final OntClass IAO_0000005 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/IAO_0000005"); + public static final OntClass IAO_0000007 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/IAO_0000007"); + public static final OntClass IAO_0000009 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/IAO_0000009"); + public static final OntClass IAO_0000013 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/IAO_0000013"); + public static final OntClass IAO_0000027 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/IAO_0000027"); + public static final OntClass IAO_0000030 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/IAO_0000030"); + public static final OntClass IAO_0000032 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/IAO_0000032"); + public static final OntClass IAO_0000033 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/IAO_0000033"); + public static final OntClass IAO_0000102 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/IAO_0000102"); + public static final OntClass IAO_0000104 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/IAO_0000104"); + public static final OntClass IAO_0000109 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/IAO_0000109"); + public static final OntClass IAO_0000144 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/IAO_0000144"); + public static final OntClass IAO_0000300 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/IAO_0000300"); + public static final OntClass OBI_0000011 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/OBI_0000011"); + public static final OntClass OBI_0000017 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/OBI_0000017"); + public static final OntClass OBI_0000066 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/OBI_0000066"); + public static final OntClass OBI_0000086 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/OBI_0000086"); + public static final OntClass OBI_0000094 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/OBI_0000094"); + public static final OntClass OBI_0000272 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/OBI_0000272"); + public static final OntClass OBI_0000571 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/OBI_0000571"); + public static final OntClass OBI_0000835 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/OBI_0000835"); + public static final OntClass OBI_0001554 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/OBI_0001554"); + public static final OntClass OBI_0100026 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/OBI_0100026"); + public static final OntClass OBI_0500000 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/OBI_0500000"); + public static final OntClass UO_0000280 = + M_MODEL.createClass("http://purl.obolibrary.org/obo/UO_0000280"); + + /** + *

The namespace of the vocabulary as a string

+ * + * @return namespace as String + * @see #NS + */ + public static String getURI() { + return NS; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/SKOS.java b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/SKOS.java new file mode 100644 index 000000000..6e49a4123 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/SKOS.java @@ -0,0 +1,46 @@ +package org.vivoweb.harvester.extractdspace.vocab.vivo; + +import org.apache.jena.ontology.AnnotationProperty; +import org.apache.jena.ontology.ObjectProperty; +import org.apache.jena.ontology.OntClass; +import org.apache.jena.ontology.OntModel; +import org.apache.jena.ontology.OntModelSpec; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; + +public class SKOS { + /** + *

The namespace of the vocabulary as a string

+ */ + public static final String NS = "http://www.w3.org/2004/02/skos/core#"; + /** + *

The ontology model that holds the vocabulary terms

+ */ + private static final OntModel M_MODEL = + ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null); + /** + *

The namespace of the vocabulary as a resource

+ */ + public static final Resource NAMESPACE = M_MODEL.createResource(NS); + public static final ObjectProperty broader = + M_MODEL.createObjectProperty("http://www.w3.org/2004/02/skos/core#broader"); + public static final ObjectProperty narrower = + M_MODEL.createObjectProperty("http://www.w3.org/2004/02/skos/core#narrower"); + public static final ObjectProperty related = + M_MODEL.createObjectProperty("http://www.w3.org/2004/02/skos/core#related"); + public static final AnnotationProperty scopeNote = + M_MODEL.createAnnotationProperty("http://www.w3.org/2004/02/skos/core#scopeNote"); + public static final OntClass Concept = + M_MODEL.createClass("http://www.w3.org/2004/02/skos/core#Concept"); + + /** + *

The namespace of the vocabulary as a string

+ * + * @return namespace as String + * @see #NS + */ + public static String getURI() { + return NS; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/SKOS2.java b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/SKOS2.java new file mode 100644 index 000000000..ca24058b1 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/SKOS2.java @@ -0,0 +1,38 @@ +package org.vivoweb.harvester.extractdspace.vocab.vivo; + +import org.apache.jena.ontology.AnnotationProperty; +import org.apache.jena.ontology.OntModel; +import org.apache.jena.ontology.OntModelSpec; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; + +public class SKOS2 { + /** + *

The namespace of the vocabulary as a string

+ */ + public static final String NS = "http://www.w3.org/2008/05/skos#"; + /** + *

The ontology model that holds the vocabulary terms

+ */ + private static final OntModel M_MODEL = + ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null); + /** + *

The namespace of the vocabulary as a resource

+ */ + public static final Resource NAMESPACE = M_MODEL.createResource(NS); + public static final AnnotationProperty editorialNote = + M_MODEL.createAnnotationProperty("http://www.w3.org/2008/05/skos#editorialNote"); + public static final AnnotationProperty scopeNote = + M_MODEL.createAnnotationProperty("http://www.w3.org/2008/05/skos#scopeNote"); + + /** + *

The namespace of the vocabulary as a string

+ * + * @return namespace as String + * @see #NS + */ + public static String getURI() { + return NS; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/TERM.java b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/TERM.java new file mode 100644 index 000000000..acb2f3677 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/TERM.java @@ -0,0 +1,41 @@ +package org.vivoweb.harvester.extractdspace.vocab.vivo; + +import org.apache.jena.ontology.AnnotationProperty; +import org.apache.jena.ontology.ObjectProperty; +import org.apache.jena.ontology.OntModel; +import org.apache.jena.ontology.OntModelSpec; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; + +public class TERM { + /** + *

The namespace of the vocabulary as a string

+ */ + public static final String NS = "http://purl.org/dc/terms/"; + /** + *

The ontology model that holds the vocabulary terms

+ */ + private static final OntModel M_MODEL = + ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null); + /** + *

The namespace of the vocabulary as a resource

+ */ + public static final Resource NAMESPACE = M_MODEL.createResource(NS); + public static final ObjectProperty contributor = + M_MODEL.createObjectProperty("http://purl.org/dc/terms/contributor"); + public static final AnnotationProperty description = + M_MODEL.createAnnotationProperty("http://purl.org/dc/terms/description"); + public static final AnnotationProperty source = + M_MODEL.createAnnotationProperty("http://purl.org/dc/terms/source"); + + /** + *

The namespace of the vocabulary as a string

+ * + * @return namespace as String + * @see #NS + */ + public static String getURI() { + return NS; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/VCARD.java b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/VCARD.java new file mode 100644 index 000000000..28a90b783 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/VCARD.java @@ -0,0 +1,472 @@ +package org.vivoweb.harvester.extractdspace.vocab.vivo; + +import org.apache.jena.ontology.DatatypeProperty; +import org.apache.jena.ontology.ObjectProperty; +import org.apache.jena.ontology.OntClass; +import org.apache.jena.ontology.OntModel; +import org.apache.jena.ontology.OntModelSpec; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; + +public class VCARD { + /** + *

The namespace of the vocabulary as a string

+ */ + public static final String NS = "http://www.w3.org/2006/vcard/ns#"; + /** + *

The ontology model that holds the vocabulary terms

+ */ + private static final OntModel M_MODEL = + ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null); + /** + *

The namespace of the vocabulary as a resource

+ */ + public static final Resource NAMESPACE = M_MODEL.createResource(NS); + public static final ObjectProperty hasAddress = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasAddress"); + public static final ObjectProperty hasCalendarLink = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasCalendarLink"); + public static final ObjectProperty hasCalendarRequest = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasCalendarRequest"); + public static final ObjectProperty hasCalenderBusy = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasCalenderBusy"); + public static final ObjectProperty hasCategory = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasCategory"); + public static final ObjectProperty hasEmail = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasEmail"); + public static final ObjectProperty hasFormattedName = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasFormattedName"); + public static final ObjectProperty hasGeo = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasGeo"); + public static final ObjectProperty hasInstantMessage = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasInstantMessage"); + public static final ObjectProperty hasKey = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasKey"); + public static final ObjectProperty hasLanguage = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasLanguage"); + public static final ObjectProperty hasLogo = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasLogo"); + /** + *

To include a member in the group this vCard represents

+ */ + public static final ObjectProperty hasMember = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasMember"); + public static final ObjectProperty hasName = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasName"); + public static final ObjectProperty hasNickname = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasNickname"); + public static final ObjectProperty hasNote = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasNote"); + public static final ObjectProperty hasOrganizationName = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasOrganizationName"); + public static final ObjectProperty hasOrganizationalUnitName = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasOrganizationalUnitName"); + public static final ObjectProperty hasPhoto = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasPhoto"); + public static final ObjectProperty hasRelated = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasRelated"); + public static final ObjectProperty hasSound = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasSound"); + public static final ObjectProperty hasTelephone = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasTelephone"); + public static final ObjectProperty hasTimeZone = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasTimeZone"); + public static final ObjectProperty hasTitle = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasTitle"); + public static final ObjectProperty hasURL = + M_MODEL.createObjectProperty("http://www.w3.org/2006/vcard/ns#hasURL"); + public static final DatatypeProperty additionalName = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#additionalName"); + /** + *

The date of marriage, or equivalent, of the object the vCard represents

+ */ + public static final DatatypeProperty anniversary = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#anniversary"); + /** + *

To specify the birth date of the object the vCard represents

+ */ + public static final DatatypeProperty birthdate = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#birthdate"); + public static final DatatypeProperty calendarBusy = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#calendarBusy"); + public static final DatatypeProperty calendarLink = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#calendarLink"); + public static final DatatypeProperty calendarRequest = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#calendarRequest"); + public static final DatatypeProperty category = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#category"); + public static final DatatypeProperty country = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#country"); + public static final DatatypeProperty email = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#email"); + /** + *

Called Family Name in vCard

+ */ + public static final DatatypeProperty familyName = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#familyName"); + public static final DatatypeProperty formattedName = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#formattedName"); + /** + *

To specify the components of the sex and gender identity of the object the + * vCard represents. To enable other Gender/Sex codes to be used, this dataproperty + * has range URI. The vCard gender code classes are defined under Code/Gender

+ */ + public static final DatatypeProperty gender = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#gender"); + /** + *

Must use the geo URI scheme RFC5870

+ */ + public static final DatatypeProperty geo = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#geo"); + /** + *

called Given Name invCard

+ */ + public static final DatatypeProperty givenName = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#givenName"); + /** + *

Called Honorific Prefix in vCard

+ */ + public static final DatatypeProperty honorificPrefix = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#honorificPrefix"); + public static final DatatypeProperty honorificSuffix = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#honorificSuffix"); + public static final DatatypeProperty instantMessage = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#instantMessage"); + public static final DatatypeProperty key = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#key"); + /** + *

Use 2 char language code from RFC5646

+ */ + public static final DatatypeProperty language = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#language"); + public static final DatatypeProperty locality = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#locality"); + public static final DatatypeProperty logo = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#logo"); + public static final DatatypeProperty nickName = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#nickName"); + public static final DatatypeProperty note = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#note"); + public static final DatatypeProperty organizationName = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#organizationName"); + public static final DatatypeProperty organizationalUnitName = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#organizationalUnitName"); + public static final DatatypeProperty photo = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#photo"); + public static final DatatypeProperty postalCode = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#postalCode"); + public static final DatatypeProperty productId = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#productId"); + public static final DatatypeProperty region = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#region"); + public static final DatatypeProperty related = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#related"); + public static final DatatypeProperty revision = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#revision"); + public static final DatatypeProperty role = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#role"); + public static final DatatypeProperty sortAs = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#sortAs"); + public static final DatatypeProperty sound = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#sound"); + public static final DatatypeProperty source = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#source"); + public static final DatatypeProperty streetAddress = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#streetAddress"); + public static final DatatypeProperty telephone = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#telephone"); + public static final DatatypeProperty timeZone = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#timeZone"); + public static final DatatypeProperty title = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#title"); + /** + *

To specify a value that represents a globally unique identifier corresponding + * to the entity associated with the vCard

+ */ + public static final DatatypeProperty uid = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#uid"); + public static final DatatypeProperty url = + M_MODEL.createDatatypeProperty("http://www.w3.org/2006/vcard/ns#url"); + public static final OntClass Acquaintance = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Acquaintance"); + /** + *

To specify the components of the delivery address for the vCard object

+ */ + public static final OntClass Address = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Address"); + /** + *

These types are concerned with information related to the delivery addressing + * or label for the vCard object

+ */ + public static final OntClass Addressing = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Addressing"); + public static final OntClass Agent = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Agent"); + public static final OntClass Calendar = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Calendar"); + /** + *

To specify the URI for the busy time associated with the object that the vCard + * represents. Was called FBURI in vCard

+ */ + public static final OntClass CalendarBusy = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#CalendarBusy"); + /** + *

To specify the URI for a calendar associated with the object represented by + * the vCard. Was called CALURI in vCard.

+ */ + public static final OntClass CalendarLink = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#CalendarLink"); + /** + *

To specify the calendar user address [RFC5545] to which a scheduling request + * [RFC5546] should be sent for the object represented by the vCard. Was called + * CALADRURI in vCard

+ */ + public static final OntClass CalendarRequest = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#CalendarRequest"); + /** + *

To specify application category information about the vCard, also known as + * tags. This was called CATEGORIES in vCard.

+ */ + public static final OntClass Category = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Category"); + /** + *

Also called mobile telephone

+ */ + public static final OntClass Cell = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Cell"); + public static final OntClass Child = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Child"); + /** + *

Contains all the Code related Classes that are used to indicate vCard Types

+ */ + public static final OntClass Code = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Code"); + public static final OntClass Colleague = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Colleague"); + /** + *

These properties describe information about how to communicate with the object + * the vCard represents

+ */ + public static final OntClass Communication = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Communication"); + public static final OntClass Contact = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Contact"); + public static final OntClass Coresident = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Coresident"); + public static final OntClass Coworker = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Coworker"); + public static final OntClass Crush = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Crush"); + public static final OntClass Date = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Date"); + /** + *

To specify the electronic mail address for communication with the object the + * vCard represents

+ */ + public static final OntClass Email = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Email"); + public static final OntClass Emergency = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Emergency"); + /** + *

These properties are concerned with additional explanations, such as that + * related to informational notes or revisions specific to the vCard

+ */ + public static final OntClass Explanatory = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Explanatory"); + public static final OntClass Fax = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Fax"); + public static final OntClass Female = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Female"); + /** + *

Specifies the formatted text corresponding to the name of the object the vCard + * represents

+ */ + public static final OntClass FormattedName = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#FormattedName"); + public static final OntClass Friend = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Friend"); + public static final OntClass Gender = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Gender"); + /** + *

Used to indicate global positioning information that is specific to an address

+ */ + public static final OntClass Geo = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Geo"); + /** + *

These properties are concerned with information associated with geographical + * positions or regions associated with the object the vCard represents

+ */ + public static final OntClass Geographical = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Geographical"); + /** + *

Defines all the properties required to be a Group of Individuals or Organizations

+ */ + public static final OntClass Group = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Group"); + /** + *

This implies that the property is related to an individual's personal life

+ */ + public static final OntClass Home = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Home"); + /** + *

These types are used to capture information associated with the identification + * and naming of the entity associated with the vCard

+ */ + public static final OntClass Identification = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Identification"); + /** + *

Defines all the properties required to be an Individual

+ */ + public static final OntClass Individual = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Individual"); + /** + *

To specify the URI for instant messaging and presence protocol communications + * with the object the vCard represents. Was called IMPP in vCard.

+ */ + public static final OntClass InstantMessage = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#InstantMessage"); + public static final OntClass Key = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Key"); + public static final OntClass Kin = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Kin"); + /** + *

The parent class for all vCard Objects

+ */ + public static final OntClass Kind = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Kind"); + /** + *

To specify the language(s) that may be used for contacting the entity associated + * with the vCard.

+ */ + public static final OntClass Language = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Language"); + /** + *

Defines all the properties required to be a Location

+ */ + public static final OntClass Location = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Location"); + /** + *

To specify a graphic image of a logo associated with the object the vCard + * represents

+ */ + public static final OntClass Logo = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Logo"); + public static final OntClass Male = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Male"); + public static final OntClass Me = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Me"); + public static final OntClass Met = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Met"); + public static final OntClass Muse = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Muse"); + /** + *

Specifies the components of the name of the object the vCard represents

+ */ + public static final OntClass Name = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Name"); + public static final OntClass Neighbor = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Neighbor"); + /** + *

Specifies the text corresponding to the nickname of the object the vCard represents

+ */ + public static final OntClass Nickname = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Nickname"); + public static final OntClass None = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#None"); + /** + *

To specify supplemental information or a comment that is associated with the + * vCard

+ */ + public static final OntClass Note = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Note"); + /** + *

To specify the organizational name associated with the vCardDefines all the + * properties required to be an Organization

+ */ + public static final OntClass Organization = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Organization"); + public static final OntClass OrganizationName = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#OrganizationName"); + public static final OntClass OrganizationUnitName = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#OrganizationUnitName"); + /** + *

These properties are concerned with information associated with characteristics + * of the organization or organizational units of the object that the vCard represents

+ */ + public static final OntClass Organizational = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Organizational"); + public static final OntClass Other = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Other"); + public static final OntClass Pager = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Pager"); + public static final OntClass Parent = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Parent"); + /** + *

Specifies an image or photograph information that annotates some aspect of + * the object the vCard represents

+ */ + public static final OntClass Photo = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Photo"); + /** + *

To specify a relationship between another entity and the entity represented + * by this vCard

+ */ + public static final OntClass Related = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Related"); + public static final OntClass RelatedType = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#RelatedType"); + public static final OntClass Role = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Role"); + /** + *

Contains all the Security related Classes

+ */ + public static final OntClass Security = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Security"); + public static final OntClass Sibling = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Sibling"); + /** + *

To specify a digital sound content information that annotates some aspect + * of the vCard. This property is often used to specify the proper pronunciation + * of the name property value of the vCard

+ */ + public static final OntClass Sound = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Sound"); + public static final OntClass Spouse = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Spouse"); + public static final OntClass Sweetheart = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Sweetheart"); + public static final OntClass Telephone = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Telephone"); + public static final OntClass TelephoneType = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#TelephoneType"); + /** + *

Also called sms telephone

+ */ + public static final OntClass Text = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Text"); + public static final OntClass TextPhone = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#TextPhone"); + /** + *

Used to indicate time zone information that is specific to a location or address

+ */ + public static final OntClass TimeZone = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#TimeZone"); + /** + *

To specify the position or job of the object the vCard represents

+ */ + public static final OntClass Title = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Title"); + /** + *

This is called TYPE in vCard but renamed here to Context for less confusion + * (with types/class)

+ */ + public static final OntClass Type = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Type"); + /** + *

To specify a uniform resource locator associated with the object to which + * the vCard refers. Examples for individuals include personal web sites, blogs, + * and social networking site identifiers.

+ */ + public static final OntClass URL = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#URL"); + public static final OntClass Unknown = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Unknown"); + public static final OntClass Video = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Video"); + public static final OntClass Voice = + M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Voice"); + /** + *

This implies that the property is related to an individual's work place

+ */ + public static final OntClass Work = M_MODEL.createClass("http://www.w3.org/2006/vcard/ns#Work"); + + /** + *

The namespace of the vocabulary as a string

+ * + * @return namespace as String + * @see #NS + */ + public static String getURI() { + return NS; + } + +} diff --git a/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/VIVO.java b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/VIVO.java new file mode 100644 index 000000000..19d488385 --- /dev/null +++ b/src/main/java/org/vivoweb/harvester/extractdspace/vocab/vivo/VIVO.java @@ -0,0 +1,566 @@ +package org.vivoweb.harvester.extractdspace.vocab.vivo; + +import org.apache.jena.ontology.DatatypeProperty; +import org.apache.jena.ontology.ObjectProperty; +import org.apache.jena.ontology.OntClass; +import org.apache.jena.ontology.OntModel; +import org.apache.jena.ontology.OntModelSpec; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; + +public class VIVO { + /** + *

The namespace of the vocabulary as a string

+ */ + public static final String NS = "http://vivoweb.org/ontology/core#"; + /** + *

The ontology model that holds the vocabulary terms

+ */ + private static final OntModel M_MODEL = + ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null); + /** + *

The namespace of the vocabulary as a resource

+ */ + public static final Resource NAMESPACE = M_MODEL.createResource(NS); + public static final ObjectProperty affiliatedOrganization = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#affiliatedOrganization"); + public static final ObjectProperty assignedBy = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#assignedBy"); + public static final ObjectProperty assignee = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#assignee"); + public static final ObjectProperty assigneeFor = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#assigneeFor"); + public static final ObjectProperty assigns = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#assigns"); + public static final ObjectProperty conceptAssociatedWith = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#conceptAssociatedWith"); + /** + *

Indicates that the Orcid ID has been confirmed by this Person

+ */ + public static final ObjectProperty confirmedOrcidId = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#confirmedOrcidId"); + public static final ObjectProperty contributingRole = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#contributingRole"); + public static final ObjectProperty dateFiled = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#dateFiled"); + public static final ObjectProperty dateIssued = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#dateIssued"); + public static final ObjectProperty dateTimeInterval = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#dateTimeInterval"); + public static final ObjectProperty dateTimePrecision = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#dateTimePrecision"); + public static final ObjectProperty dateTimeValue = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#dateTimeValue"); + public static final ObjectProperty degreeCandidacy = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#degreeCandidacy"); + public static final ObjectProperty distributes = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#distributes"); + public static final ObjectProperty distributesFundingFrom = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#distributesFundingFrom"); + public static final ObjectProperty eligibleFor = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#eligibleFor"); + public static final ObjectProperty end = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#end"); + public static final ObjectProperty equipmentFor = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#equipmentFor"); + public static final ObjectProperty expirationDate = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#expirationDate"); + public static final ObjectProperty facilityFor = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#facilityFor"); + public static final ObjectProperty featuredIn = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#featuredIn"); + public static final ObjectProperty features = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#features"); + public static final ObjectProperty fundingVehicleFor = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#fundingVehicleFor"); + public static final ObjectProperty geographicFocus = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#geographicFocus"); + public static final ObjectProperty geographicFocusOf = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#geographicFocusOf"); + public static final ObjectProperty governingAuthorityFor = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#governingAuthorityFor"); + public static final ObjectProperty grantSubcontractedThrough = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#grantSubcontractedThrough"); + public static final ObjectProperty hasAssociatedConcept = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#hasAssociatedConcept"); + public static final ObjectProperty hasCollaborator = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#hasCollaborator"); + public static final ObjectProperty hasEquipment = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#hasEquipment"); + public static final ObjectProperty hasFacility = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#hasFacility"); + public static final ObjectProperty hasFundingVehicle = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#hasFundingVehicle"); + public static final ObjectProperty hasGoverningAuthority = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#hasGoverningAuthority"); + public static final ObjectProperty hasPredecessorOrganization = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#hasPredecessorOrganization"); + public static final ObjectProperty hasPrerequisite = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#hasPrerequisite"); + public static final ObjectProperty hasProceedings = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#hasProceedings"); + public static final ObjectProperty hasPublicationVenue = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#hasPublicationVenue"); + public static final ObjectProperty hasResearchArea = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#hasResearchArea"); + public static final ObjectProperty hasSubjectArea = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#hasSubjectArea"); + public static final ObjectProperty hasSuccessorOrganization = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#hasSuccessorOrganization"); + public static final ObjectProperty hasTranslation = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#hasTranslation"); + public static final ObjectProperty informationResourceSupportedBy = + M_MODEL.createObjectProperty( + "http://vivoweb.org/ontology/core#informationResourceSupportedBy"); + public static final ObjectProperty offeredBy = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#offeredBy"); + public static final ObjectProperty offers = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#offers"); + public static final ObjectProperty orcidId = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#orcidId"); + public static final ObjectProperty prerequisiteFor = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#prerequisiteFor"); + public static final ObjectProperty proceedingsOf = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#proceedingsOf"); + public static final ObjectProperty providesFundingThrough = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#providesFundingThrough"); + public static final ObjectProperty publicationVenueFor = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#publicationVenueFor"); + public static final ObjectProperty publisher = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#publisher"); + public static final ObjectProperty publisherOf = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#publisherOf"); + public static final ObjectProperty relatedBy = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#relatedBy"); + public static final ObjectProperty relates = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#relates"); + public static final ObjectProperty reproduces = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#reproduces"); + public static final ObjectProperty researchAreaOf = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#researchAreaOf"); + public static final ObjectProperty reviewedIn = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#reviewedIn"); + public static final ObjectProperty roleContributesTo = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#roleContributesTo"); + public static final ObjectProperty sponsoredBy = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#sponsoredBy"); + public static final ObjectProperty sponsors = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#sponsors"); + public static final ObjectProperty start = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#start"); + public static final ObjectProperty subcontractsGrant = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#subcontractsGrant"); + public static final ObjectProperty subjectAreaOf = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#subjectAreaOf"); + public static final ObjectProperty supportedBy = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#supportedBy"); + public static final ObjectProperty supportedInformationResource = M_MODEL.createObjectProperty( + "http://vivoweb.org/ontology/core#supportedInformationResource"); + public static final ObjectProperty supports = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#supports"); + public static final ObjectProperty translatorOf = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#translatorOf"); + public static final ObjectProperty validIn = + M_MODEL.createObjectProperty("http://vivoweb.org/ontology/core#validIn"); + public static final DatatypeProperty abbreviation = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#abbreviation"); + public static final DatatypeProperty cclCode = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#cclCode"); + public static final DatatypeProperty contactInformation = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#contactInformation"); + public static final DatatypeProperty courseCredits = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#courseCredits"); + public static final DatatypeProperty dateTime = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#dateTime"); + public static final DatatypeProperty departmentOrSchool = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#departmentOrSchool"); + public static final DatatypeProperty description = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#description"); + public static final DatatypeProperty eRACommonsId = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#eRACommonsId"); + public static final DatatypeProperty entryTerm = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#entryTerm"); + public static final DatatypeProperty freetextKeyword = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#freetextKeyword"); + public static final DatatypeProperty grantDirectCosts = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#grantDirectCosts"); + public static final DatatypeProperty hasMonetaryAmount = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#hasMonetaryAmount"); + public static final DatatypeProperty hasValue = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#hasValue"); + public static final DatatypeProperty hideFromDisplay = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#hideFromDisplay"); + public static final DatatypeProperty hrJobTitle = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#hrJobTitle"); + public static final DatatypeProperty iclCode = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#iclCode"); + public static final DatatypeProperty identifier = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#identifier"); + public static final DatatypeProperty isCorrespondingAuthor = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#isCorrespondingAuthor"); + public static final DatatypeProperty licenseNumber = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#licenseNumber"); + public static final DatatypeProperty localAwardId = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#localAwardId"); + public static final DatatypeProperty majorField = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#majorField"); + public static final DatatypeProperty middleName = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#middleName"); + public static final DatatypeProperty nihmsid = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#nihmsid"); + public static final DatatypeProperty outreachOverview = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#outreachOverview"); + public static final DatatypeProperty overview = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#overview"); + public static final DatatypeProperty patentNumber = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#patentNumber"); + public static final DatatypeProperty placeOfPublication = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#placeOfPublication"); + public static final DatatypeProperty pmcid = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#pmcid"); + public static final DatatypeProperty preferredDisplayOrder = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#preferredDisplayOrder"); + public static final DatatypeProperty rank = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#rank"); + public static final DatatypeProperty reportId = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#reportId"); + public static final DatatypeProperty researchOverview = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#researchOverview"); + public static final DatatypeProperty researcherId = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#researcherId"); + public static final DatatypeProperty scopusId = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#scopusId"); + public static final DatatypeProperty seatingCapacity = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#seatingCapacity"); + public static final DatatypeProperty sponsorAwardId = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#sponsorAwardId"); + public static final DatatypeProperty supplementalInformation = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#supplementalInformation"); + public static final DatatypeProperty teachingOverview = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#teachingOverview"); + public static final DatatypeProperty termLabel = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#termLabel"); + public static final DatatypeProperty termType = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#termType"); + public static final DatatypeProperty totalAwardAmount = + M_MODEL.createDatatypeProperty("http://vivoweb.org/ontology/core#totalAwardAmount"); + public static final OntClass Abstract = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Abstract"); + public static final OntClass AcademicDegree = + M_MODEL.createClass("http://vivoweb.org/ontology/core#AcademicDegree"); + public static final OntClass AcademicDepartment = + M_MODEL.createClass("http://vivoweb.org/ontology/core#AcademicDepartment"); + public static final OntClass AcademicTerm = + M_MODEL.createClass("http://vivoweb.org/ontology/core#AcademicTerm"); + public static final OntClass AcademicYear = + M_MODEL.createClass("http://vivoweb.org/ontology/core#AcademicYear"); + public static final OntClass AdministratorRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#AdministratorRole"); + public static final OntClass AdviseeRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#AdviseeRole"); + public static final OntClass AdvisingProcess = + M_MODEL.createClass("http://vivoweb.org/ontology/core#AdvisingProcess"); + public static final OntClass AdvisingRelationship = + M_MODEL.createClass("http://vivoweb.org/ontology/core#AdvisingRelationship"); + public static final OntClass AdvisorRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#AdvisorRole"); + public static final OntClass Association = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Association"); + public static final OntClass AttendeeRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#AttendeeRole"); + public static final OntClass AttendingProcess = + M_MODEL.createClass("http://vivoweb.org/ontology/core#AttendingProcess"); + /** + *

+ */ + public static final OntClass Authorship = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Authorship"); + public static final OntClass Award = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Award"); + public static final OntClass AwardReceipt = + M_MODEL.createClass("http://vivoweb.org/ontology/core#AwardReceipt"); + public static final OntClass AwardedDegree = + M_MODEL.createClass("http://vivoweb.org/ontology/core#AwardedDegree"); + public static final OntClass Blog = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Blog"); + public static final OntClass BlogPosting = + M_MODEL.createClass("http://vivoweb.org/ontology/core#BlogPosting"); + public static final OntClass Building = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Building"); + public static final OntClass Campus = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Campus"); + public static final OntClass CaseStudy = + M_MODEL.createClass("http://vivoweb.org/ontology/core#CaseStudy"); + public static final OntClass Catalog = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Catalog"); + public static final OntClass Center = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Center"); + public static final OntClass Certificate = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Certificate"); + public static final OntClass Certification = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Certification"); + public static final OntClass ClinicalOrganization = + M_MODEL.createClass("http://vivoweb.org/ontology/core#ClinicalOrganization"); + public static final OntClass ClinicalRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#ClinicalRole"); + public static final OntClass CoPrincipalInvestigatorRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#CoPrincipalInvestigatorRole"); + public static final OntClass CollectionProcess = + M_MODEL.createClass("http://vivoweb.org/ontology/core#CollectionProcess"); + public static final OntClass College = + M_MODEL.createClass("http://vivoweb.org/ontology/core#College"); + public static final OntClass Committee = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Committee"); + public static final OntClass Company = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Company"); + public static final OntClass Competition = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Competition"); + public static final OntClass ConferencePaper = + M_MODEL.createClass("http://vivoweb.org/ontology/core#ConferencePaper"); + public static final OntClass ConferencePoster = + M_MODEL.createClass("http://vivoweb.org/ontology/core#ConferencePoster"); + public static final OntClass ConferenceSeries = + M_MODEL.createClass("http://vivoweb.org/ontology/core#ConferenceSeries"); + public static final OntClass Consortium = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Consortium"); + public static final OntClass Continent = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Continent"); + public static final OntClass Contract = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Contract"); + public static final OntClass CoreLaboratory = + M_MODEL.createClass("http://vivoweb.org/ontology/core#CoreLaboratory"); + public static final OntClass Country = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Country"); + public static final OntClass County = + M_MODEL.createClass("http://vivoweb.org/ontology/core#County"); + public static final OntClass Course = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Course"); + public static final OntClass Credential = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Credential"); + public static final OntClass CurationProcess = + M_MODEL.createClass("http://vivoweb.org/ontology/core#CurationProcess"); + public static final OntClass Database = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Database"); + public static final OntClass Dataset = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Dataset"); + public static final OntClass DateTimeInterval = + M_MODEL.createClass("http://vivoweb.org/ontology/core#DateTimeInterval"); + public static final OntClass DateTimeValue = + M_MODEL.createClass("http://vivoweb.org/ontology/core#DateTimeValue"); + public static final OntClass DateTimeValuePrecision = + M_MODEL.createClass("http://vivoweb.org/ontology/core#DateTimeValuePrecision"); + public static final OntClass Department = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Department"); + public static final OntClass Division = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Division"); + public static final OntClass EditorRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#EditorRole"); + public static final OntClass EditorialArticle = + M_MODEL.createClass("http://vivoweb.org/ontology/core#EditorialArticle"); + public static final OntClass Editorship = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Editorship"); + public static final OntClass EducationalProcess = + M_MODEL.createClass("http://vivoweb.org/ontology/core#EducationalProcess"); + public static final OntClass EmeritusFaculty = + M_MODEL.createClass("http://vivoweb.org/ontology/core#EmeritusFaculty"); + public static final OntClass EmeritusLibrarian = + M_MODEL.createClass("http://vivoweb.org/ontology/core#EmeritusLibrarian"); + public static final OntClass EmeritusProfessor = + M_MODEL.createClass("http://vivoweb.org/ontology/core#EmeritusProfessor"); + public static final OntClass Equipment = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Equipment"); + public static final OntClass EventSeries = + M_MODEL.createClass("http://vivoweb.org/ontology/core#EventSeries"); + public static final OntClass Exhibit = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Exhibit"); + public static final OntClass ExtensionUnit = + M_MODEL.createClass("http://vivoweb.org/ontology/core#ExtensionUnit"); + public static final OntClass F1000Link = + M_MODEL.createClass("http://vivoweb.org/ontology/core#F1000Link"); + public static final OntClass Facility = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Facility"); + public static final OntClass FacultyAdministrativePosition = + M_MODEL.createClass("http://vivoweb.org/ontology/core#FacultyAdministrativePosition"); + public static final OntClass FacultyMember = + M_MODEL.createClass("http://vivoweb.org/ontology/core#FacultyMember"); + public static final OntClass FacultyMentoringRelationship = + M_MODEL.createClass("http://vivoweb.org/ontology/core#FacultyMentoringRelationship"); + public static final OntClass FacultyPosition = + M_MODEL.createClass("http://vivoweb.org/ontology/core#FacultyPosition"); + public static final OntClass Foundation = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Foundation"); + public static final OntClass FundingOrganization = + M_MODEL.createClass("http://vivoweb.org/ontology/core#FundingOrganization"); + public static final OntClass GeographicLocation = + M_MODEL.createClass("http://vivoweb.org/ontology/core#GeographicLocation"); + public static final OntClass GeographicRegion = + M_MODEL.createClass("http://vivoweb.org/ontology/core#GeographicRegion"); + public static final OntClass GeopoliticalEntity = + M_MODEL.createClass("http://vivoweb.org/ontology/core#GeopoliticalEntity"); + public static final OntClass GeoreferencingProcess = + M_MODEL.createClass("http://vivoweb.org/ontology/core#GeoreferencingProcess"); + public static final OntClass GovernmentAgency = + M_MODEL.createClass("http://vivoweb.org/ontology/core#GovernmentAgency"); + public static final OntClass GraduateAdvisingRelationship = + M_MODEL.createClass("http://vivoweb.org/ontology/core#GraduateAdvisingRelationship"); + public static final OntClass GraduateStudent = + M_MODEL.createClass("http://vivoweb.org/ontology/core#GraduateStudent"); + public static final OntClass Grant = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Grant"); + public static final OntClass Hospital = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Hospital"); + public static final OntClass IdentificationProcess = + M_MODEL.createClass("http://vivoweb.org/ontology/core#IdentificationProcess"); + public static final OntClass Institute = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Institute"); + public static final OntClass Internship = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Internship"); + public static final OntClass InvestigatorRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#InvestigatorRole"); + public static final OntClass InvitedTalk = + M_MODEL.createClass("http://vivoweb.org/ontology/core#InvitedTalk"); + public static final OntClass IssuedCredential = + M_MODEL.createClass("http://vivoweb.org/ontology/core#IssuedCredential"); + public static final OntClass Laboratory = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Laboratory"); + public static final OntClass LeaderRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#LeaderRole"); + public static final OntClass Librarian = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Librarian"); + public static final OntClass LibrarianPosition = + M_MODEL.createClass("http://vivoweb.org/ontology/core#LibrarianPosition"); + public static final OntClass Library = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Library"); + public static final OntClass License = + M_MODEL.createClass("http://vivoweb.org/ontology/core#License"); + public static final OntClass Licensure = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Licensure"); + public static final OntClass Location = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Location"); + public static final OntClass MeasurementProcess = + M_MODEL.createClass("http://vivoweb.org/ontology/core#MeasurementProcess"); + public static final OntClass MedicalResidency = + M_MODEL.createClass("http://vivoweb.org/ontology/core#MedicalResidency"); + public static final OntClass Meeting = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Meeting"); + public static final OntClass MemberRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#MemberRole"); + public static final OntClass Museum = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Museum"); + public static final OntClass NewsRelease = + M_MODEL.createClass("http://vivoweb.org/ontology/core#NewsRelease"); + public static final OntClass Newsletter = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Newsletter"); + public static final OntClass NonAcademic = + M_MODEL.createClass("http://vivoweb.org/ontology/core#NonAcademic"); + public static final OntClass NonAcademicPosition = + M_MODEL.createClass("http://vivoweb.org/ontology/core#NonAcademicPosition"); + public static final OntClass NonFacultyAcademic = + M_MODEL.createClass("http://vivoweb.org/ontology/core#NonFacultyAcademic"); + public static final OntClass NonFacultyAcademicPosition = + M_MODEL.createClass("http://vivoweb.org/ontology/core#NonFacultyAcademicPosition"); + public static final OntClass OrganizerRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#OrganizerRole"); + public static final OntClass OrganizingProcess = + M_MODEL.createClass("http://vivoweb.org/ontology/core#OrganizingProcess"); + public static final OntClass OutreachProviderRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#OutreachProviderRole"); + public static final OntClass PeerReviewerRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#PeerReviewerRole"); + public static final OntClass PopulatedPlace = + M_MODEL.createClass("http://vivoweb.org/ontology/core#PopulatedPlace"); + public static final OntClass Position = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Position"); + public static final OntClass Postdoc = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Postdoc"); + public static final OntClass PostdocOrFellowAdvisingRelationship = + M_MODEL.createClass("http://vivoweb.org/ontology/core#PostdocOrFellowAdvisingRelationship"); + public static final OntClass PostdocPosition = + M_MODEL.createClass("http://vivoweb.org/ontology/core#PostdocPosition"); + public static final OntClass PostdoctoralTraining = + M_MODEL.createClass("http://vivoweb.org/ontology/core#PostdoctoralTraining"); + public static final OntClass Presentation = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Presentation"); + public static final OntClass PresenterRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#PresenterRole"); + public static final OntClass PresentingProcess = + M_MODEL.createClass("http://vivoweb.org/ontology/core#PresentingProcess"); + public static final OntClass PrimaryPosition = + M_MODEL.createClass("http://vivoweb.org/ontology/core#PrimaryPosition"); + public static final OntClass PrincipalInvestigatorRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#PrincipalInvestigatorRole"); + public static final OntClass PrivateCompany = + M_MODEL.createClass("http://vivoweb.org/ontology/core#PrivateCompany"); + public static final OntClass Program = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Program"); + public static final OntClass Project = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Project"); + public static final OntClass Publisher = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Publisher"); + public static final OntClass Relationship = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Relationship"); + public static final OntClass ResearchOrganization = + M_MODEL.createClass("http://vivoweb.org/ontology/core#ResearchOrganization"); + public static final OntClass ResearchProposal = + M_MODEL.createClass("http://vivoweb.org/ontology/core#ResearchProposal"); + public static final OntClass ResearcherRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#ResearcherRole"); + public static final OntClass Review = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Review"); + public static final OntClass ReviewerRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#ReviewerRole"); + public static final OntClass Room = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Room"); + public static final OntClass School = + M_MODEL.createClass("http://vivoweb.org/ontology/core#School"); + public static final OntClass Score = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Score"); + public static final OntClass Screenplay = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Screenplay"); + public static final OntClass SeminarSeries = + M_MODEL.createClass("http://vivoweb.org/ontology/core#SeminarSeries"); + public static final OntClass ServiceProvidingLaboratory = + M_MODEL.createClass("http://vivoweb.org/ontology/core#ServiceProvidingLaboratory"); + public static final OntClass Speech = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Speech"); + public static final OntClass StateOrProvince = + M_MODEL.createClass("http://vivoweb.org/ontology/core#StateOrProvince"); + public static final OntClass Student = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Student"); + public static final OntClass StudentOrganization = + M_MODEL.createClass("http://vivoweb.org/ontology/core#StudentOrganization"); + /** + *

For example, the Midwest, northeast U.S.

+ */ + public static final OntClass SubnationalRegion = + M_MODEL.createClass("http://vivoweb.org/ontology/core#SubnationalRegion"); + public static final OntClass TeacherRole = + M_MODEL.createClass("http://vivoweb.org/ontology/core#TeacherRole"); + public static final OntClass Team = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Team"); + public static final OntClass Translation = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Translation"); + public static final OntClass UndergraduateAdvisingRelationship = + M_MODEL.createClass("http://vivoweb.org/ontology/core#UndergraduateAdvisingRelationship"); + public static final OntClass UndergraduateStudent = + M_MODEL.createClass("http://vivoweb.org/ontology/core#UndergraduateStudent"); + public static final OntClass University = + M_MODEL.createClass("http://vivoweb.org/ontology/core#University"); + public static final OntClass Video = + M_MODEL.createClass("http://vivoweb.org/ontology/core#Video"); + public static final OntClass WorkingPaper = + M_MODEL.createClass("http://vivoweb.org/ontology/core#WorkingPaper"); + public static final OntClass WorkshopSeries = + M_MODEL.createClass("http://vivoweb.org/ontology/core#WorkshopSeries"); + + /** + *

The namespace of the vocabulary as a string

+ * + * @return namespace as String + * @see #NS + */ + public static String getURI() { + return NS; + } + +} diff --git a/src/main/resources/aoi_dc.xslt b/src/main/resources/aoi_dc.xslt new file mode 100644 index 000000000..60e16233d --- /dev/null +++ b/src/main/resources/aoi_dc.xslt @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/aoi_dim.xslt b/src/main/resources/aoi_dim.xslt new file mode 100644 index 000000000..ef0182011 --- /dev/null +++ b/src/main/resources/aoi_dim.xslt @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/harvester.conf b/src/main/resources/harvester.conf new file mode 100644 index 000000000..53944c8bd --- /dev/null +++ b/src/main/resources/harvester.conf @@ -0,0 +1,11 @@ +type = OAI +filePrefix=d7_ +harvestTotalCount=5 +uriPrefix = https://dspace7.org/resource/ +endpoint = https://api7.dspace.org/server/oai/request +etl.dir.extract=data_src_dspace7/extract +etl.dir.transform=data_src_dspace7/transform +startDate=2020-01-01 +endDate=2025-01-01 +set=com_10673_1190 +metadataFormat=DC \ No newline at end of file