001/* 002 * Licensed to DuraSpace under one or more contributor license agreements. 003 * See the NOTICE file distributed with this work for additional information 004 * regarding copyright ownership. 005 * 006 * DuraSpace licenses this file to you under the Apache License, 007 * Version 2.0 (the "License"); you may not use this file except in 008 * compliance with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018package org.fcrepo.integration.rdf; 019 020import org.junit.Ignore; 021import org.junit.Test; 022 023/** 024 * @author cabeer 025 */ 026@Ignore // TODO FIX THESE TESTS 027public class ModsRdfIT extends AbstractIntegrationRdfIT { 028 @Test 029 public void testRoundtripModsRDF() { 030 // converted RDF-XML to TTL from 031 // https://raw.githubusercontent.com/blunalucero/MODS-RDF/master/Sample_record_Academic_Commons_MODS_RDF.rdf 032 // and fixed document URI and relative URI reference to use null-relative and hash uris 033 final String s = "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n" + 034 "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n" + 035 "@prefix identifier: <http://id.loc.gov/vocabulary/identifier/> .\n" + 036 "@prefix relator: <http://id.loc.gov/vocabulary/relator/> .\n" + 037 "@prefix note: <http://id.loc.gov/vocabulary/note/> .\n" + 038 "@prefix xs: <http://www.w3.org/2001/XMLSchema> .\n" + 039 "@prefix abstract: <http://id.loc.gov/vocabulary/abstract/> .\n" + 040 "@prefix access: <http://id.loc.gov/vocabulary/access/> .\n" + 041 "@prefix fo: <http://www.w3.org/1999/XSL/Format> .\n" + 042 "@prefix class: <http://id.loc.gov/vocabulary/class/> .\n" + 043 "@prefix fn: <http://www.w3.org/2005/xpath-functions> .\n" + 044 "@prefix mods: <http://www.loc.gov/mods/v3> .\n" + 045 "@prefix ri: <http://id.loc.gov/ontologies/RecordInfo#> .\n" + 046 "@prefix modsrdf: <http://www.loc.gov/mods/rdf/v1#> .\n" + 047 "@prefix madsrdf: <http://www.loc.gov/mads/rdf/v1#> .\n" + 048 "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n" + 049 "\n" + 050 "<>\n" + 051 " identifier:hdl \"http://hdl.handle.net/10022/AC:P:11905\" ;\n" + 052 " modsrdf:LanguageOfResource \"English\" ;\n" + 053 " modsrdf:abstract \"A mechanism had been recently proposed to show how an....\" ;\n" + 054 " modsrdf:administrativeMedatata [\n" + 055 " ri:languageOfCataloging \"eng\" ;\n" + 056 " ri:recordContentSource \"NNC\" ;\n" + 057 " ri:recordIdentifier \"5890\" ;\n" + 058 " ri:recordInfoRecordChangeDate \"2012-08-01 14:40:32 -0400\"^^<xsd:date> ;\n" + 059 " ri:recordInfoRecordCreationDate \"2011-12-06 10:27:50 -0500\"^^<xsd:date> ;\n" + 060 " a ri:AdministrativeMedatata\n" + 061 " ] ;\n" + 062 " modsrdf:genre [\n" + 063 " madsrdf:elementList ([\n" + 064 " madsrdf:elementValue \"Articles\" ;\n" + 065 " a madsrdf:GenreFormElement\n" + 066 " ]\n" + 067 " ) ;\n" + 068 " a madsrdf:GenreForm ;\n" + 069 " rdfs:label \"Articles\"\n" + 070 " ] ;\n" + 071 " modsrdf:locationOfResource [\n" + 072 " modsrdf:locationPhysicalLocation \"NNC\" ;\n" + 073 " a modsrdf:Location\n" + 074 " ] ;\n" + 075 " modsrdf:name <#d1e24>, <#d1e42>, <#d1e60>, <#d1e9> ;\n" + 076 " modsrdf:resourceDateIssued \"1992\"^^<xsd:date> ;\n" + 077 " modsrdf:roleRelationship [\n" + 078 " modsrdf:roleRelationshipName <#d1e24> ;\n" + 079 " modsrdf:roleRelationshipRole \"author\" ;\n" + 080 " a modsrdf:RoleRelationship\n" + 081 " ], [\n" + 082 " modsrdf:roleRelationshipName <#d1e42> ;\n" + 083 " modsrdf:roleRelationshipRole \"author\" ;\n" + 084 " a modsrdf:RoleRelationship\n" + 085 " ], [\n" + 086 " modsrdf:roleRelationshipName <#d1e60> ;\n" + 087 " modsrdf:roleRelationshipRole \"originator\" ;\n" + 088 " a modsrdf:RoleRelationship\n" + 089 " ], [\n" + 090 " modsrdf:roleRelationshipName <#d1e9> ;\n" + 091 " modsrdf:roleRelationshipRole \"author\" ;\n" + 092 " a modsrdf:RoleRelationship\n" + 093 " ] ;\n" + 094 " modsrdf:subjectComplex [\n" + 095 " madsrdf:componentList ([\n" + 096 " madsrdf:elementList ([\n" + 097 " madsrdf:elementValue \"Geophysics\" ;\n" + 098 " a madsrdf:TopicElement\n" + 099 " ]\n" + 100 " ) ;\n" + 101 " a madsrdf:Topic ;\n" + 102 " rdfs:label \"Geophysics\"\n" + 103 " ]\n" + 104 " ) ;\n" + 105 " a madsrdf:ComplexSubject ;\n" + 106 " rdfs:label \"Geophysics. \"\n" + 107 " ] ;\n" + 108 " modsrdf:titlePrincipal [\n" + 109 " madsrdf:elementList ([\n" + 110 " madsrdf:elementValue \"A detailed chronology of the Australasian impact event, " + 111 "the Brunhes-Matuyama geomagnetic polarity reversal, and global climate change\" ;\n" + 112 " a madsrdf:mainTitleElement\n" + 113 " ]\n" + 114 " ) ;\n" + 115 " a madsrdf:Title ;\n" + 116 " rdfs:label \"A detailed chronology of the Australasian impact event, the Brunhes-Matuyama " + 117 "geomagnetic polarity reversal, and global climate change\"\n" + 118 " ] ;\n" + 119 " a <http://id.loc.gov/vocabulary/resourceType#Text>, modsrdf:ModsResource .\n" + 120 "\n" + 121 "<#d1e24>\n" + 122 " madsrdf:elementList ([\n" + 123 " madsrdf:elementValue \"Kent\" ;\n" + 124 " a madsrdf:FamilyNameElement\n" + 125 " ]\n" + 126 " [\n" + 127 " madsrdf:elementValue \"Dennis V.\" ;\n" + 128 " a madsrdf:GivenNameElement\n" + 129 " ]\n" + 130 " ) ;\n" + 131 " a madsrdf:PersonalName ;\n" + 132 " rdfs:label \" Dennis V. Kent \" .\n" + 133 "\n" + 134 "<#d1e42>\n" + 135 " madsrdf:elementList ([\n" + 136 " madsrdf:elementValue \"Mello\" ;\n" + 137 " a madsrdf:FamilyNameElement\n" + 138 " ]\n" + 139 " [\n" + 140 " madsrdf:elementValue \"Gilberto A.\" ;\n" + 141 " a madsrdf:GivenNameElement\n" + 142 " ]\n" + 143 " ) ;\n" + 144 " a madsrdf:PersonalName ;\n" + 145 " rdfs:label \" Gilberto A. Mello \" .\n" + 146 "\n" + 147 "<#d1e60>\n" + 148 " madsrdf:elementList ([\n" + 149 " madsrdf:elementValue \"Columbia University. Lamont-Doherty Earth Observatory\" ;\n" + 150 " a madsrdf:FullNameElement\n" + 151 " ]\n" + 152 " ) ;\n" + 153 " a madsrdf:CorporateName ;\n" + 154 " rdfs:label \"Columbia University. Lamont-Doherty Earth Observatory\" .\n" + 155 "\n" + 156 "<#d1e9>\n" + 157 " madsrdf:elementList ([\n" + 158 " madsrdf:elementValue \"Schneider\" ;\n" + 159 " a madsrdf:FamilyNameElement\n" + 160 " ]\n" + 161 " [\n" + 162 " madsrdf:elementValue \"David A.\" ;\n" + 163 " a madsrdf:GivenNameElement\n" + 164 " ]\n" + 165 " ) ;\n" + 166 " a madsrdf:PersonalName ;\n" + 167 " rdfs:label \" David A. Schneider \" ."; 168 169 createLDPRSAndCheckResponse(getRandomUniqueId(), s); 170 } 171}