Project

General

Profile

« Previous | Next » 

Revision 57038

[maven-release-plugin] copy for tag dnet-msro-service-6.0.1-SAXONHE

View differences:

modules/dnet-msro-service/tags/dnet-msro-service-6.0.1-SAXONHE/TODO.txt
1
1) Gestione delle informazioni da salvare nella history: 
2
	- le informazioni sono modellate  da una classe (name, value, description, ...)
3
	- sono mantenute in una struttura dati del processo esterna all'ENV
4
	- i nodi usano espliciti metodi per aggiungere informazioni
5

  
6
2) Nella history aggiungere i link alle api
7

  
8
3) Nel cronmaker mostrare 4 future date della cron expression
modules/dnet-msro-service/tags/dnet-msro-service-6.0.1-SAXONHE/deploy.info
1
{
2
"type_source": "SVN",
3
"goal": "package -U source:jar",
4
"url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet50/modules/dnet-msro-service/branches/saxonHE",
5
"deploy_repository": "dnet5-snapshots",
6
"version": "5",
7
"mail": "alessia.bardi@isti.cnr.it",
8
"deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet5-snapshots",
9
"name": "dnet-msro-service-saxonHE"
10
}
modules/dnet-msro-service/tags/dnet-msro-service-6.0.1-SAXONHE/src/test/java/eu/dnetlib/AppTest.java
1
package eu.dnetlib;
2

  
3
import java.io.StringReader;
4
import java.io.StringWriter;
5
import java.io.UnsupportedEncodingException;
6
import java.net.URLEncoder;
7
import javax.xml.transform.TransformerFactory;
8

  
9
import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
10
import org.dom4j.Document;
11
import org.dom4j.DocumentException;
12
import org.dom4j.io.SAXReader;
13
import org.junit.Test;
14
import org.w3c.dom.Node;
15
import org.w3c.dom.NodeList;
16

  
17
import static org.junit.Assert.assertEquals;
18

  
19
/**
20
 * Unit test for simple App.
21
 */
22
public class AppTest {
23

  
24
	private TransformerFactory tf = TransformerFactory.newInstance();
25

  
26
	@Test
27
	public void testXslt() {
28
		final String res = new ApplyXslt(getXslt(), tf).apply(getXml());
29
		System.out.println("******************");
30
		System.out.println(res);
31
		System.out.println("******************");
32
	}
33

  
34
	@Test
35
	public void testXpath() throws DocumentException {
36
		final SAXReader reader = new SAXReader();
37
		final Document doc = reader.read(new StringReader("<a><b>test</b></a>"));
38
		assertEquals("", doc.valueOf("//c"));
39
		assertEquals("test", doc.valueOf("//b"));
40
	}
41

  
42
	public static String javaMethod(final NodeList list) {
43
		System.out.println("******************");
44
		System.out.println("TYPE   : " + list.toString());
45
		System.out.println("LENGTH : " + list.getLength());
46
		for (int i = 0; i < list.getLength(); i++) {
47
			final Node node = list.item(i);
48

  
49
			System.out.println("ELEM " + i + ": " + node.getLocalName());
50
		}
51

  
52
		System.out.println("******************");
53
		return "ACUS";
54
	}
55

  
56
	private String getXml() {
57
		final StringWriter sw = new StringWriter();
58
		sw.append("<?xml version='1.0' encoding='UTF-8'?>\n");
59
		sw.append("<record>\n");
60
		sw.append("<metadata>\n");
61
		sw.append("<a>A text value</a>\n");
62
		sw.append("<b attr='attribute value'/>\n");
63
		sw.append("</metadata>\n");
64
		sw.append("</record>\n");
65

  
66
		return sw.toString();
67
	}
68

  
69
	private String getXslt() {
70
		final StringWriter sw = new StringWriter();
71

  
72
		sw.append("<?xml version='1.0' encoding='UTF-8'?>\n");
73
		sw.append(
74
				"<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:dnet='eu.dnetlib.AppTest' exclude-result-prefixes='xsl dnet'>\n");
75
		sw.append("<xsl:output omit-xml-declaration='yes' indent='yes'/>\n");
76
		sw.append("<xsl:template match='/*'>\n");
77
		sw.append("<xsl:variable name='metadata' select=\"//*[local-name()='metadata']/*\" />\n");
78
		sw.append("<ROWS>\n");
79
		sw.append("<xsl:value-of select='dnet:javaMethod($metadata)'/>\n");
80
		sw.append("</ROWS>\n");
81
		sw.append("</xsl:template>\n");
82
		sw.append("</xsl:stylesheet>\n");
83
		return sw.toString();
84
	}
85

  
86
	@Test
87
	public void encodetest() throws UnsupportedEncodingException {
88
		final String theUrl = "http://europepmc.org/GrantLookup/grants.php?&f%5B%5D=WT&range=all&format=xml&output=export";
89
		final String encoded = URLEncoder.encode(theUrl, "UTF-8");
90
		System.out.println(encoded);
91
	}
92

  
93
}
modules/dnet-msro-service/tags/dnet-msro-service-6.0.1-SAXONHE/src/test/java/eu/dnetlib/msro/notification/EmailDispatcherTest.java
1
package eu.dnetlib.msro.notification;
2

  
3
/**
4
 * Created by Alessia Bardi on 03/07/2018.
5
 *
6
 * @author Alessia Bardi
7
 */
8
public class EmailDispatcherTest {
9

  
10
	private transient EmailDispatcher dispatcher = new EmailDispatcher();
11

  
12

  
13
}
modules/dnet-msro-service/tags/dnet-msro-service-6.0.1-SAXONHE/src/test/java/eu/dnetlib/msro/workflows/nodes/transform/X3MTransformJobNodeTest.java
1
package eu.dnetlib.msro.workflows.nodes.transform;
2

  
3
import java.time.Duration;
4
import java.time.LocalDateTime;
5

  
6
import org.junit.Test;
7

  
8
/**
9
 * Created by Alessia Bardi on 13/04/2017.
10
 *
11
 * @author Alessia Bardi
12
 */
13
public class X3MTransformJobNodeTest {
14

  
15
	private X3MTransformJobNode transformJob = new X3MTransformJobNode();
16
	private String header = "<oai:header xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\">\n"
17
			+ "        <dri:objIdentifier>ariadne_mock::0000023f507999464aa2b78875b7e5d6</dri:objIdentifier>\n"
18
			+ "        <dri:recordIdentifier>2420500</dri:recordIdentifier>\n"
19
			+ "        <dri:dateOfCollection>2017-04-10T18:44:46.85+02:00</dri:dateOfCollection>\n"
20
			+ "        <dri:datasourceprefix>ariadne_mock</dri:datasourceprefix>\n"
21
			+ "        <dri:datasourcename>Ariadne Mock</dri:datasourcename>\n"
22
			+ "        <dri:dateOfTransformation>2017-04-12T16:31:45.766</dri:dateOfTransformation>\n"
23
			+ "        <dri:invalid value=\"true\">\n"
24
			+ "            <dri:error vocabularies=\"dnet:languages\" xpath=\"//*[local-name()='P72_has_language']\"\n"
25
			+ "                term=\"en\"/>\n"
26
			+ "        </dri:invalid>\n"
27
			+ "    </oai:header>";
28
	private String footer = "<oai:about xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\">\n"
29
			+ "        <provenance xmlns=\"http://www.openarchives.org/OAI/2.0/provenance\"\n"
30
			+ "            xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
31
			+ "            xsi:schemaLocation=\"http://www.openarchives.org/OAI/2.0/provenance http://www.openarchives.org/OAI/2.0/provenance.xsd\">\n"
32
			+ "            <originDescription xmlns=\"\" altered=\"true\" harvestDate=\"2017-04-10T18:44:46.85+02:00\">\n"
33
			+ "                <baseURL>sftp%3A%2F%2Fariadne2.isti.cnr.it%2F..%2F..%2Fdata%2Ftransform%2Facdm_correct</baseURL>\n"
34
			+ "                <identifier/>\n"
35
			+ "                <datestamp/>\n"
36
			+ "                <metadataNamespace/>\n"
37
			+ "            </originDescription>\n"
38
			+ "        </provenance>\n"
39
			+ "    </oai:about>";
40
	private String metadata="        <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n"
41
			+ "            xmlns:dbpedia-owl=\"http://dbpedia.org/ontology/\"\n"
42
			+ "            xmlns:acdm=\"http://registry.ariadne-infrastructure.eu/\"\n"
43
			+ "            xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\"\n"
44
			+ "            xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\"\n"
45
			+ "            xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"\n"
46
			+ "            xmlns:frbr=\"http://www.cidoc-crm.org/frbroo/\" xmlns:dcterms=\"http://purl.org/dc/terms/\"\n"
47
			+ "            xmlns:dcat=\"http://www.w3.org/ns/dcat#\" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\"\n"
48
			+ "            xmlns:crm=\"http://www.cidoc-crm.org/cidoc-crm/\"\n"
49
			+ "            xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n"
50
			+ "            <frbr:F30_Publication_Event rdf:about=\"uuid:AAAA\"/>\n"
51
			+ "            <crm:E65_Creation rdf:about=\"uuid:AAAB\"/>\n"
52
			+ "            <crm:E73_Information_Object\n"
53
			+ "                rdf:about=\"http://registry.ariadne-infrastructure.eu/dataset/2420500\">\n"
54
			+ "                <crm:P129_is_about>\n"
55
			+ "                    <crm:E73_Information_Object\n"
56
			+ "                        rdf:about=\"http://registry.ariadne-infrastructure.eu/subject/CAIRN\">\n"
57
			+ "                        <crm:P129_is_about>CAIRN</crm:P129_is_about>\n"
58
			+ "                    </crm:E73_Information_Object>\n"
59
			+ "                </crm:P129_is_about>\n"
60
			+ "                <crm:P129_is_about>\n"
61
			+ "                    <crm:E73_Information_Object\n"
62
			+ "                        rdf:about=\"http://registry.ariadne-infrastructure.eu/subject/HUT%20CIRCLE\">\n"
63
			+ "                        <crm:P129_is_about>HUT CIRCLE</crm:P129_is_about>\n"
64
			+ "                    </crm:E73_Information_Object>\n"
65
			+ "                </crm:P129_is_about>\n"
66
			+ "                <crm:P104_is_subject_to>ADS Terms and Conditions</crm:P104_is_subject_to>\n"
67
			+ "                <crm:P129_is_about>\n"
68
			+ "                    <crm:E73_Information_Object\n"
69
			+ "                        rdf:about=\"http://registry.ariadne-infrastructure.eu/subject/SHEEPFOLD\">\n"
70
			+ "                        <crm:P129_is_about>SHEEPFOLD</crm:P129_is_about>\n"
71
			+ "                    </crm:E73_Information_Object>\n"
72
			+ "                </crm:P129_is_about>\n"
73
			+ "                <crm:P129_is_about>\n"
74
			+ "                    <crm:E73_Information_Object\n"
75
			+ "                        rdf:about=\"http://registry.ariadne-infrastructure.eu/subject/FIELD%20SYSTEM\">\n"
76
			+ "                        <crm:P129_is_about>FIELD SYSTEM</crm:P129_is_about>\n"
77
			+ "                    </crm:E73_Information_Object>\n"
78
			+ "                </crm:P129_is_about>\n"
79
			+ "                <crm:P102_has_title>MID GLEN CROE</crm:P102_has_title>\n"
80
			+ "                <crm:P165_incorporates>\n"
81
			+ "                    <crm:E33_Linguistic_Object rdf:about=\"uuid:AAAG\">\n"
82
			+ "                        <crm:P72_has_language>en</crm:P72_has_language>\n"
83
			+ "                    </crm:E33_Linguistic_Object>\n"
84
			+ "                </crm:P165_incorporates>\n"
85
			+ "                <crm:P67_refers_to>\n"
86
			+ "                    <crm:E1_CRM_Entity rdf:about=\"uuid:AAAH\">\n"
87
			+ "                        <crm:P2_has_type>Sites and monuments databases or\n"
88
			+ "                            inventories</crm:P2_has_type>\n"
89
			+ "                    </crm:E1_CRM_Entity>\n"
90
			+ "                </crm:P67_refers_to>\n"
91
			+ "                <crm:P93i_was_taken_out_of_existence_by>\n"
92
			+ "                    <crm:E6_Destruction rdf:about=\"uuid:AAAE\">\n"
93
			+ "                        <crm:P4_has_time-span>\n"
94
			+ "                            <crm:E52_Time-Span rdf:about=\"uuid:AAAF\">\n"
95
			+ "                                <crm:P81_ongoing_throughout>2013-12-09\n"
96
			+ "                                    00:00:00.0</crm:P81_ongoing_throughout>\n"
97
			+ "                            </crm:E52_Time-Span>\n"
98
			+ "                        </crm:P4_has_time-span>\n"
99
			+ "                    </crm:E6_Destruction>\n"
100
			+ "                </crm:P93i_was_taken_out_of_existence_by>\n"
101
			+ "                <crm:P94i_was_created_by>\n"
102
			+ "                    <frbr:F30_Publication_Event rdf:about=\"uuid:AAAC\">\n"
103
			+ "                        <crm:P4_has_time-span>\n"
104
			+ "                            <crm:E52_Time-Span rdf:about=\"uuid:AAAD\">\n"
105
			+ "                                <crm:P81_ongoing_throughout>2013-12-09\n"
106
			+ "                                    00:00:00.0</crm:P81_ongoing_throughout>\n"
107
			+ "                            </crm:E52_Time-Span>\n"
108
			+ "                        </crm:P4_has_time-span>\n"
109
			+ "                    </frbr:F30_Publication_Event>\n"
110
			+ "                </crm:P94i_was_created_by>\n"
111
			+ "                <crm:P129_is_about>\n"
112
			+ "                    <crm:E73_Information_Object\n"
113
			+ "                        rdf:about=\"http://registry.ariadne-infrastructure.eu/subject/BUILDING\">\n"
114
			+ "                        <crm:P129_is_about>BUILDING</crm:P129_is_about>\n"
115
			+ "                    </crm:E73_Information_Object>\n"
116
			+ "                </crm:P129_is_about>\n"
117
			+ "                <crm:P1_is_identified_by>2420500</crm:P1_is_identified_by>\n"
118
			+ "                <crm:P106i_forms_part_of>http://registry.ariadne-infrastructure.eu/collection/22721290</crm:P106i_forms_part_of>\n"
119
			+ "                <crm:P3_has_note>Multiple instances of: SHEEPFOLD&lt;br /&gt;&lt;br /&gt;Multiple\n"
120
			+ "                    instances of: BUILDING&lt;br /&gt;Multiple instances of: FIELD SYSTEM&lt;br\n"
121
			+ "                    /&gt;Possible instance of: CAIRN&lt;br /&gt;Multiple instances of: HUT\n"
122
			+ "                    CIRCLE&lt;br /&gt;Possible instance of: HUT CIRCLE</crm:P3_has_note>\n"
123
			+ "            </crm:E73_Information_Object>\n"
124
			+ "        </rdf:RDF>";
125

  
126
	@Test
127
	public void testBuildXML(){
128
		LocalDateTime now = LocalDateTime.now();
129
		String res = transformJob.buildXML(header, now.toString(), metadata, footer);
130
		LocalDateTime end = LocalDateTime.now();
131
		System.out.println("Building XML took:"+Duration.between(now, end).toMillis());
132
	}
133
}
modules/dnet-msro-service/tags/dnet-msro-service-6.0.1-SAXONHE/src/test/java/eu/dnetlib/msro/workflows/xslt/LayoutToRecordStylesheetTest.java
1
package eu.dnetlib.msro.workflows.xslt;
2

  
3
import java.io.IOException;
4
import java.io.InputStream;
5
import java.io.StringReader;
6
import java.io.StringWriter;
7
import java.nio.charset.Charset;
8
import javax.xml.transform.Transformer;
9
import javax.xml.transform.TransformerException;
10
import javax.xml.transform.TransformerFactory;
11
import javax.xml.transform.stream.StreamResult;
12
import javax.xml.transform.stream.StreamSource;
13

  
14
import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
15
import eu.dnetlib.miscutils.functional.xml.XMLIndenter;
16
import eu.dnetlib.rmi.enabling.ISLookUpException;
17
import org.apache.commons.io.IOUtils;
18
import org.junit.Test;
19
import org.springframework.core.io.ClassPathResource;
20

  
21
import static org.junit.Assert.assertFalse;
22
import static org.junit.Assert.assertNotNull;
23

  
24
public class LayoutToRecordStylesheetTest {
25

  
26
	private static final String LAYOUT_TO_RECORD_STYLESHEET_XSL = "/eu/dnetlib/msro/workflows/xslt/layoutToRecordStylesheet.xsl";
27

  
28
	private static final String MDFORMAT_FIELDS = "/eu/dnetlib/msro/workflows/xslt/fields.xml";
29

  
30
	private static final String OAF_RECORD = "/eu/dnetlib/msro/workflows/xslt/exampleRecord.xml";
31

  
32
	private TransformerFactory tf = TransformerFactory.newInstance();
33

  
34
	@Test
35
	public void test1() throws ISLookUpException, IOException, TransformerException {
36
		final String xsl = prepareXslt("DMF");
37
		assertNotNull(xsl);
38
		assertFalse(xsl.isEmpty());
39

  
40
		System.out.println(xsl);
41

  
42
		final ApplyXslt xslt = new ApplyXslt(xsl, tf);
43

  
44
		final String indexRecord = xslt.apply(readFromClasspath(OAF_RECORD));
45

  
46
		assertNotNull(indexRecord);
47
		assertFalse(indexRecord.isEmpty());
48

  
49
		System.out.println(new XMLIndenter().apply(indexRecord));
50

  
51
		// StreamingInputDocumentFactory factory = new StreamingInputDocumentFactory();
52
		//
53
		// SolrInputDocument doc = factory.parseDocument(DateUtils.now_ISO8601(), indexRecord, "dsId", "dnetResult");
54
		// assertNotNull(doc);
55
		// assertFalse(doc.isEmpty());
56

  
57
		// System.out.println(doc);
58

  
59
	}
60

  
61
	protected String prepareXslt(final String format) throws ISLookUpException, IOException, TransformerException {
62

  
63
		final Transformer layoutTransformer = tf.newTransformer(streamSource(LAYOUT_TO_RECORD_STYLESHEET_XSL));
64

  
65
		final StreamResult layoutToXsltXslt = new StreamResult(new StringWriter());
66

  
67
		layoutTransformer.setParameter("format", format);
68
		layoutTransformer.transform(streamSource(MDFORMAT_FIELDS), layoutToXsltXslt);
69

  
70
		final String layoutToXsltXsltString = layoutToXsltXslt.getWriter().toString();
71
		System.out.println(new XMLIndenter().apply(layoutToXsltXsltString) + "\n\n\n");
72

  
73
		return layoutToXsltXsltString;
74
	}
75

  
76
	private StreamSource streamSource(final String s) throws IOException {
77
		return new StreamSource(new StringReader(readFromClasspath(s)));
78
	}
79

  
80
	private String readFromClasspath(final String s) throws IOException {
81
		final ClassPathResource resource = new ClassPathResource(s);
82
		final InputStream inputStream = resource.getInputStream();
83
		return IOUtils.toString(inputStream, Charset.forName("UTF-8"));
84
	}
85

  
86
}
modules/dnet-msro-service/tags/dnet-msro-service-6.0.1-SAXONHE/src/test/java/eu/dnetlib/x3m/X3MLEngineTest.java
1
package eu.dnetlib.x3m;
2

  
3
import java.io.ByteArrayOutputStream;
4
import java.io.IOException;
5
import java.io.InputStream;
6
import java.io.PrintStream;
7
import java.util.Arrays;
8
import java.util.Iterator;
9
import java.util.function.Function;
10
import java.util.function.IntFunction;
11

  
12
import eu.delving.x3ml.X3MLEngineFactory;
13
import eu.delving.x3ml.X3MLEngineFactory.OutputFormat;
14
import org.apache.commons.logging.Log;
15
import org.apache.commons.logging.LogFactory;
16
import org.junit.Ignore;
17
import org.junit.Test;
18
import org.springframework.core.io.ClassPathResource;
19

  
20
/**
21
 * Created by alessia on 31/01/17.
22
 */
23

  
24
public class X3MLEngineTest {
25

  
26
	private static final Log log = LogFactory.getLog(X3MLEngineTest.class);
27

  
28
	final String recordPath = "/eu/dnetlib/x3m/new-10304736.xml";
29
	final String mappingPath = "/eu/dnetlib/x3m/mappings.x3ml";
30
	final String policyPath = "/eu/dnetlib/x3m/maria-policy.xml";
31

  
32
	final String forthInputPath ="/eu/dnetlib/x3m/input.xml";
33
	final String forthMappingPath = "/eu/dnetlib/x3m/mappingsWithoutGenerator.x3ml";
34

  
35
	final String[] allInputFiles =
36
			new String[] { recordPath, "/eu/dnetlib/x3m/new-10304737.xml", "/eu/dnetlib/x3m/new-10304738.xml", "/eu/dnetlib/x3m/new-10304739.xml",
37
					"/eu/dnetlib/x3m/new-10304740.xml", "/eu/dnetlib/x3m/new-10304741.xml", "/eu/dnetlib/x3m/new-10304742.xml" };
38

  
39
	@Test
40
	public void testForth() throws Exception{
41
		X3MLEngineFactory x3mEngine = X3MLEngineFactory.create()
42
				.withMappings(getInputStreamFromClasspath(forthMappingPath))
43
				.withVerboseLogging()
44
				.withInput(getInputStreamFromClasspath(forthInputPath))
45
				.withOutput(System.out, OutputFormat.RDF_XML);
46
		x3mEngine.execute();
47
	}
48

  
49
	@Test
50
	public void testURIShortener() throws Exception{
51
		X3MLEngineFactory x3mEngine = X3MLEngineFactory.create()
52
				.withMappings(getInputStreamFromClasspath("/eu/dnetlib/x3m/mapping464_with_shortener.x3ml"))
53
				.withGeneratorPolicy(getInputStreamFromClasspath("/eu/dnetlib/x3m/parthenos_policy_uri_shortener.xml"))
54
				.withVerboseLogging()
55
				.withInput(getInputStreamFromClasspath("/eu/dnetlib/x3m/record_shortener.xml"))
56
				.withOutput(System.out, OutputFormat.RDF_XML);
57
		x3mEngine.execute();
58
	}
59

  
60
	@Test
61
	public void test() throws Exception {
62
		final ByteArrayOutputStream os = new ByteArrayOutputStream();
63
		final PrintStream ps = new PrintStream(os);
64

  
65
		X3MLEngineFactory x3mEngine = X3MLEngineFactory.create().withGeneratorPolicy(getInputStreamFromClasspath(policyPath))
66
				.withMappings(getInputStreamFromClasspath(mappingPath))
67
				.withVerboseLogging()
68
				.withInput(getInputStreamFromClasspath(recordPath))
69
				.withOutput(ps, OutputFormat.RDF_XML);
70
		x3mEngine.execute();
71

  
72
		logStream(os);
73

  
74
	}
75

  
76
	@Test
77
	public void testRDFPlain() throws Exception {
78
		final ByteArrayOutputStream os = new ByteArrayOutputStream();
79
		final PrintStream ps = new PrintStream(os);
80

  
81
		X3MLEngineFactory x3mEngine = X3MLEngineFactory.create().withGeneratorPolicy(getInputStreamFromClasspath(policyPath))
82
				.withMappings(getInputStreamFromClasspath(mappingPath))
83
				.withVerboseLogging()
84
				.withInput(getInputStreamFromClasspath(recordPath))
85
				.withOutput(ps, OutputFormat.RDF_XML_PLAIN);
86
		x3mEngine.execute();
87

  
88
		logStream(os);
89

  
90
	}
91

  
92

  
93
	@Test
94
	public void testAll() throws Exception {
95
		final ByteArrayOutputStream os = new ByteArrayOutputStream();
96
		final PrintStream ps = new PrintStream(os);
97
		X3MLEngineFactory x3mEngine = X3MLEngineFactory.create().withGeneratorPolicy(getInputStreamFromClasspath(policyPath))
98
				.withMappings(getInputStreamFromClasspath(mappingPath))
99
				.withVerboseLogging()
100
				.withInput(convertArray(allInputFiles, X3MLEngineTest::getInputStreamFromClasspath, InputStream[]::new))
101
				.withOutput(ps, OutputFormat.RDF_XML);
102
		x3mEngine.execute();
103
		logStream(os);
104
	}
105

  
106
	@Test
107
	@Ignore
108
	/**
109
	 * Test if it is possible to re-use the same X3MLEngineFactory to transform different XMLs.
110
	 * The test fails with an exception when trying to parse the mapping file for the second time.
111
	 */
112
	public void testAllIteratorReuse() throws Exception {
113
		Iterator<InputStream> it = convertIterator(allInputFiles, X3MLEngineTest::getInputStreamFromClasspath);
114
		X3MLEngineFactory x3mEngine = X3MLEngineFactory.create().withGeneratorPolicy(getInputStreamFromClasspath(policyPath))
115
				.withMappings(getInputStreamFromClasspath(mappingPath))
116
				.withVerboseLogging();
117
		int count =0;
118
		while(it.hasNext()){
119
			count++;
120
			System.out.println("Transforming file number "+count);
121
			final ByteArrayOutputStream os = new ByteArrayOutputStream();
122
			final PrintStream ps = new PrintStream(os);
123
			InputStream s = it.next();
124
			x3mEngine.withInput(s).withOutput(ps, OutputFormat.RDF_XML);
125
			x3mEngine.execute();
126
			logStream(os);
127
			os.close();
128
		}
129
	}
130

  
131
	@Test
132
	public void testAllIterator() throws Exception {
133
		Iterator<InputStream> it = convertIterator(allInputFiles, X3MLEngineTest::getInputStreamFromClasspath);
134

  
135
		int count =0;
136
		while(it.hasNext()){
137
			count++;
138
			System.out.println("Transforming file number "+count);
139
			final ByteArrayOutputStream os = new ByteArrayOutputStream();
140
			final PrintStream ps = new PrintStream(os);
141
			X3MLEngineFactory x3mEngine = X3MLEngineFactory.create().withGeneratorPolicy(getInputStreamFromClasspath(policyPath))
142
					.withMappings(getInputStreamFromClasspath(mappingPath))
143
					.withVerboseLogging();
144
			InputStream s = it.next();
145
			x3mEngine.withInput(s).withOutput(ps, OutputFormat.RDF_XML).execute();
146
			logStream(os);
147
			os.close();
148
		}
149
	}
150

  
151
	private void logStream(final ByteArrayOutputStream os){
152
		log.info("**************Result:\n");
153
		String s = new String(os.toByteArray());
154
		log.info(s);
155
	}
156

  
157
	public static InputStream getInputStreamFromClasspath(final String s) {
158
		try {
159
			final ClassPathResource resource = new ClassPathResource(s);
160
			return resource.getInputStream();
161
		}catch(IOException e){
162
			return null;
163
		}
164
	}
165

  
166
	public static <T, U> U[] convertArray(T[] from,
167
			Function<T, U> func,
168
			IntFunction<U[]> generator) {
169
		return Arrays.stream(from).map(func).toArray(generator);
170
	}
171

  
172
	public static <T, U> Iterator<U> convertIterator(T[] from,
173
			Function<T, U> func) {
174
		return Arrays.stream(from).map(func).iterator();
175
	}
176
}
modules/dnet-msro-service/tags/dnet-msro-service-6.0.1-SAXONHE/src/test/resources/eu/dnetlib/msro/workflows/xslt/fields.xml
1
<LAYOUT name="index">
2
     <FIELDS>
3
         <FIELD indexable="true" name="objIdentifier" result="false" stat="false" tokenizable="false" xpath="//dri:objIdentifier"/>
4
         <FIELD indexable="true" name="CobjContentSynthesis" result="true" stat="false" xpath="//dr:CobjContentSynthesis"/>
5
         <FIELD indexable="true" name="CobjTypology" result="true" stat="false" tokenizable="false" xpath="//dr:CobjTypology"/>
6
         <FIELD indexable="true" name="CobjIdentifier" result="true" stat="false" tokenizable="false" xpath="//dr:CobjIdentifier"/>
7
         <FIELD indexable="true" name="CobjModel" result="true" stat="false" tokenizable="false" xpath="//dr:CobjModel"/>
8
         <FIELD indexable="true" name="CobjMDFormats" result="true" stat="false" tokenizable="false" xpath="//dr:CobjMDFormats"/>
9
         <FIELD indexable="true" name="CobjDescriptionSynthesis" result="true" stat="false" xpath="//dr:CobjDescriptionSynthesis"/>
10
         <FIELD indexable="true" name="aggregatorName" result="true" stat="false" xpath="//dr:aggregatorName"/>
11
         <FIELD indexable="true" name="aggregatorInstitution" result="true" stat="false" xpath="//dr:aggregatorInstitution"/>
12
         <FIELD indexable="true" name="repositoryName" tokenizable="true" result="true" stat="true" xpath="//dr:repositoryName"/>
13
         <FIELD indexable="true" name="repositoryLink" result="true" stat="false" tokenizable="false" xpath="//dr:repositoryLink"/>
14
         <FIELD indexable="true" name="repositoryCountry" result="true" stat="false" tokenizable="false" xpath="//dr:repositoryCountry"/>
15
         <FIELD indexable="true" name="repositoryInstitution" result="true" stat="false" xpath="//dr:repositoryInstitution"/>
16
         <FIELD indexable="true" name="repositoryId" result="false" stat="false" xpath="//dri:repositoryId"/>
17
         <FIELD indexable="true" name="creator" result="true" stat="false" xpath="//dc:creator"/>
18
         <FIELD indexable="true" name="title" result="true" stat="false" xpath="//dc:title"/>
19
         <FIELD indexable="true" name="subject" tokenizable="true" result="true" stat="true" xpath="//dc:subject"/>
20
         <FIELD indexable="true" name="CobjCategory" result="true" stat="false" tokenizable="false" xpath="//dr:CobjCategory"/>
21
         <FIELD indexable="true" name="language" result="true" stat="false" tokenizable="false" xpath="//dc:language"/>
22
         <FIELD indexable="true" name="dateAccepted" result="true" stat="false" tokenizable="false" xpath="//*[local-name()='dateAccepted']"/>
23
         <FIELD indexable="true" name="identifier" result="true" stat="false" tokenizable="false" xpath="//dc:identifier"/>
24
         <FIELD indexable="true" name="publisher" tokenizable="true" result="true" stat="true" xpath="//dc:publisher"/>
25
         <FIELD indexable="true" name="source" tokenizable="true" result="true" stat="true" xpath="//dc:source"/>
26
         <FIELD indexable="true" name="contributor" tokenizable="true" result="true" stat="true" xpath="//dc:contributor"/>
27
         <FIELD indexable="true" name="relation" result="true" stat="false" tokenizable="false" xpath="//dc:relation"/>
28
         <FIELD indexable="true" name="description" result="true" stat="false" xpath="//dc:description"/>
29
		<!-- Browsing Fields -->
30
        <FIELD indexable="true" name="subjectforbrowsing" browsingAliasFor="subject" tokenizable="false" result="false" stat="false" xpath="//dc:subject"/>
31
        <FIELD indexable="true" name="contributorforbrowsing" browsingAliasFor="contributor" tokenizable="false" result="false" stat="false" xpath="//dc:contributor"/>
32
        <FIELD indexable="true" name="publisherforbrowsing" browsingAliasFor="publisher" tokenizable="false" result="false" stat="false" xpath="//dc:publisher"/>
33
        <FIELD indexable="true" name="sourceforbrowsing" browsingAliasFor="source" tokenizable="false" result="false" stat="false" xpath="//dc:source"/>
34
        <FIELD indexable="true" name="repositorynameforbrowsing" browsingAliasFor="repositoryName" tokenizable="false" result="false" stat="false" xpath="//dr:repositoryName"/>
35
    </FIELDS>
36
</LAYOUT>
modules/dnet-msro-service/tags/dnet-msro-service-6.0.1-SAXONHE/src/test/resources/eu/dnetlib/msro/workflows/xslt/exampleRecord.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<record xmlns:dc="http://purl.org/dc/elements/1.1/"
3
  xmlns:dr="http://www.driver-repository.eu/namespace/dr"
4
  xmlns:dri="http://www.driver-repository.eu/namespace/dri"
5
  xmlns:oaf="http://namespace.openaire.eu/oaf"
6
  xmlns:prov="http://www.openarchives.org/OAI/2.0/provenance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
7
  <header xmlns="http://namespace.openaire.eu/">
8
    <dri:objIdentifier>PUMA::017b981f757dec43ff5d691bed64f36f</dri:objIdentifier>
9
    <dri:recordIdentifier>oai:pumaoai.isti.cnr.it:cnr.isti/cnr.cnuce/1975-B4-019</dri:recordIdentifier>
10
    <dri:dateOfCollection/>
11
    <dri:mdFormat/>
12
    <dri:mdFormatInterpretation/>
13
    <dri:repositoryId>2c8bf258-251a-4cdc-b735-bbb4e651cae9_UmVwb3NpdG9yeVNlcnZpY2VSZXNvdXJjZXMvUmVwb3NpdG9yeVNlcnZpY2VSZXNvdXJjZVR5cGU=</dri:repositoryId>
14
    <dr:objectIdentifier/>
15
    <dr:dateOfCollection>2014-11-18T11:22:35Z</dr:dateOfCollection>
16
  </header>
17
  <metadata xmlns="http://namespace.openaire.eu/">
18
    <dc:creator>Bracci, Edoardo</dc:creator>
19
    <dc:creator>Medves, Riccardo</dc:creator>
20
    <dc:title>Foo</dc:title>
21
    <dc:date>1975-07-01</dc:date>
22
    <dc:description>No abstract available.</dc:description>
23
    <dc:identifier>http://puma.isti.cnr.it/dfdownloadnew.php?ident=cnr.isti/cnr.cnuce/1975-B4-019</dc:identifier>
24
    <dc:identifier>http://puma.isti.cnr.it/rmydownload.php?filename=cnr.isti/cnr.cnuce/1975-B4-019/1975-B4-019.pdf</dc:identifier>
25
    <dc:language>it</dc:language>
26
    <dc:source>Internal note CNUCE-Manuali-91-1975, 1975.</dc:source>
27
    <dc:subject>Utilities</dc:subject>
28
    <dr:CobjCategory>Otro</dr:CobjCategory>
29
    <oaf:dateAccepted>1975-07-01</oaf:dateAccepted>
30
    <oaf:collectedDatasourceid/>
31
    <oaf:accessrights>OPEN</oaf:accessrights>
32
    <oaf:hostedBy id="" name="PUblication MAnagement"/>
33
    <oaf:collectedFrom id="" name="PUblication MAnagement"/>
34
  </metadata>
35
</record>
modules/dnet-msro-service/tags/dnet-msro-service-6.0.1-SAXONHE/src/test/resources/eu/dnetlib/x3m/ehri_mapping.x3ml
1
<?xml version="1.0" encoding="UTF-8"?><!--Sample XML file generated by XMLSpy v2011 sp1 (http://www.altova.com)--><x3ml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" source_type="xpath" version="1.0" xsi:noNamespaceSchemaLocation="x3ml_v1.0.xsd">
2
    <info>
3
        <title>EHRI  -&gt; PE  Mapping File Official</title>
4
        <general_description>This mapping represents a mapping from the EHRI data registry to the Parthenos Entities format designed for the Parthenos project. The EHRI format is based on EAD. Each record provides metadata about itself qua metadata record and about some collection that it describes.</general_description>
5
        <source>
6
            <source_info>
7
                <source_schema type="" version=""/>
8
            </source_info>
9
            <source_collection/>
10
        </source>
11
        <target>
12
            <target_info>
13
                <target_schema schema_file="cidoc_crm_v6.0-draft-2015January.rdfs" type="rdfs" version="6.0">CIDOC-CRM</target_schema>
14
                <namespaces>
15
                    <namespace prefix="crm" uri="http://www.cidoc-crm.org/cidoc-crm/"/>
16
                </namespaces>
17
            </target_info>
18
            <target_info>
19
                <target_schema schema_file="CRMdig_v3.2.rdfs" type="rdfs" version="3.2">CRMdig</target_schema>
20
                <namespaces>
21
                    <namespace prefix="crmdig" uri="http://www.ics.forth.gr/isl/CRMext/CRMdig.rdfs/"/>
22
                </namespaces>
23
            </target_info>
24
            <target_info>
25
                <target_schema schema_file="CRMext4SKOSandLabel_v1.2.rdfs" type="rdfs" version="1.2">CRMext4SKOSandLabel</target_schema>
26
                <namespaces>
27
                    <namespace prefix="skos" uri="http://www.w3.org/2004/02/skos/core#"/>
28
                </namespaces>
29
            </target_info>
30
            <target_info>
31
                <target_schema schema_file="CRMpc_v1.0.rdfs" type="rdfs" version="1.0">CRMpc</target_schema>
32
                <namespaces>
33
                    <namespace prefix="crm" uri="http://www.cidoc-crm.org/cidoc-crm/"/>
34
                </namespaces>
35
            </target_info>
36
            <target_info>
37
                <target_schema schema_file="CRMpe_v1.8.1.rdfs" type="rdfs" version="1.8.1">CRMpe</target_schema>
38
                <namespaces>
39
                    <namespace prefix="crmpe" uri="http://www.ics.forth.gr/isl/CRMext/CRMpe.rdfs/"/>
40
                </namespaces>
41
            </target_info>
42
            <target_collection/>
43
        </target>
44
        <mapping_info>
45
            <mapping_created_by_org>EHRI</mapping_created_by_org>
46
            <mapping_created_by_person>Charles Riondet</mapping_created_by_person>
47
            <in_collaboration_with>George Bruseker</in_collaboration_with>
48
        </mapping_info>
49
        <example_data_info>
50
            <example_data_from>EHRI</example_data_from>
51
            <example_data_contact_person>Charles Riondet</example_data_contact_person>
52
            <example_data_source_record xml_link="New+ehri+sample___25-05-2017163732___4874.xml"/>
53
            <generator_policy_info generator_link="PARTHENOS-GeneratorPolicy___15-03-2017144440___5286.xml"/>
54
            <example_data_target_record rdf_link="EHRI___01-03-2017163035___1590.rdf"/>
55
            <thesaurus_info/>
56
        </example_data_info>
57
    </info>
58
    <namespaces>
59
        <namespace prefix="parthenos" uri="http://pathenos.d4science.org/handle/EHRI/Portal/"/>
60
        <namespace prefix="xmlns" uri="urn:isbn:1-931666-22-9"/>
61
        <namespace prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
62
        <namespace prefix="xsi" uri="http://www.w3.org/2001/XMLSchema-instance"/>
63
        <namespace prefix="schemaLocation" uri="urn:isbn:1-931666-22-9 http://www.loc.gov/ead/ead.xsd"/>
64
    </namespaces>
65
    <mappings>
66
        <mapping>
67
            <domain>
68
                <source_node>/ead/eadheader</source_node>
69
                <target_node>
70
                    <entity>
71
                        <type>crmpe:PE22_Persistent_Dataset</type>
72
                        <type>crm:E33_Linguistic_Object</type>
73
                        <instance_generator name="DatasetURI">
74
                            <arg name="term" type="xpath">eadid/text()</arg>
75
                        </instance_generator>
76
                        <label_generator name="SimpleLabel">
77
                            <arg name="label" type="xpath">eadid/text()</arg>
78
                        </label_generator>
79
                        <additional>
80
                            <relationship>crm:P2_has_type</relationship>
81
                            <entity>
82
                                <type>crm:E55_Type</type>
83
                                <instance_info>
84
                                    <constant>metadata</constant>
85
                                </instance_info>
86
                                <instance_generator name="ConceptURI">
87
                                    <arg name="term" type="constant">Metadata</arg>
88
                                </instance_generator>
89
                                <label_generator name="Constant">
90
                                    <arg name="text" type="constant">Metadata</arg>
91
                                </label_generator>
92
                            </entity>
93
                        </additional>
94
                    </entity>
95
                </target_node>
96
            </domain>
97
            <link>
98
                <path>
99
                    <source_relation>
100
                        <relation>filedesc/titlestmt/titleproper</relation>
101
                    </source_relation>
102
                    <target_relation>
103
                        <relationship>crm:P102_has_title</relationship>
104
                    </target_relation>
105
                </path>
106
                <range>
107
                    <source_node>filedesc/titlestmt/titleproper</source_node>
108
                    <target_node>
109
                        <entity>
110
                            <type>crm:E35_Title</type>
111
                            <instance_generator name="DatasetAppellationURI">
112
                                <arg name="term" type="xpath">../../../eadid/text()</arg>
113
                            </instance_generator>
114
                            <label_generator name="SimpleLabel">
115
                                <arg name="label" type="xpath">text()</arg>
116
                            </label_generator>
117
                        </entity>
118
                    </target_node>
119
                </range>
120
            </link>
121
            <link>
122
                <path>
123
                    <source_relation>
124
                        <relation>../archdesc</relation>
125
                    </source_relation>
126
                    <target_relation>
127
                        <relationship>crm:P129_is_about</relationship>
128
                    </target_relation>
129
                </path>
130
                <range>
131
                    <source_node>../archdesc</source_node>
132
                    <target_node>
133
                        <entity>
134
                            <type>crm:E78_Collection</type>
135
                            <instance_generator name="ThingURI">
136
                                <arg name="term" type="xpath">did/unitid/text()</arg>
137
                            </instance_generator>
138
                        </entity>
139
                    </target_node>
140
                </range>
141
            </link>
142
            <link>
143
                <path>
144
                    <source_relation>
145
                        <relation>profiledesc/langusage/language</relation>
146
                    </source_relation>
147
                    <target_relation>
148
                        <relationship>crm:P72_has_language</relationship>
149
                    </target_relation>
150
                    <comments>
151
                        <comment type="">
152
                            <rationale/>
153
                            <alternatives>if this is the language of the metadata or dataset and all cases potentially have a language, then you can double instantiate the eadheader also as E33 Linguistic Object and then use the property p72 has language</alternatives>
154
                            <typical_mistakes/>
155
                            <local_habits/>
156
                            <link_to_cook_book/>
157
                            <example>
158
                                <example_source/>
159
                                <example_target/>
160
                            </example>
161
                            <comments_last_update date="" person=""/>
162
                        </comment>
163
                    </comments>
164
                </path>
165
                <range>
166
                    <source_node>profiledesc/langusage/language</source_node>
167
                    <target_node>
168
                        <entity>
169
                            <type>crm:E56_Language</type>
170
                            <instance_generator name="ConceptURI">
171
                                <arg name="term" type="xpath">text()</arg>
172
                            </instance_generator>
173
                            <label_generator name="SimpleLabel">
174
                                <arg name="label" type="xpath">text()</arg>
175
                            </label_generator>
176
                        </entity>
177
                    </target_node>
178
                </range>
179
            </link>
180
            <link>
181
                <path>
182
                    <source_relation>
183
                        <relation>filedesc/publicationstmt</relation>
184
                    </source_relation>
185
                    <target_relation>
186
                        <relationship>crm:P94i_was_created_by</relationship>
187
                        <entity variable="create">
188
                            <type>crmdig:D7_Digital_Machine_Event</type>
189
                            <instance_generator name="UUID"/>
190
                            <label_generator name="CompositeLabel">
191
                                <arg name="label" type="constant">Initial Creation of</arg>
192
                                <arg name="text" type="xpath">../../eadid/text()</arg>
193
                            </label_generator>
194
                            <additional>
195
                                <relationship>crm:P2_has_type</relationship>
196
                                <entity>
197
                                    <type>crm:E55_Type</type>
198
                                    <instance_info>
199
                                        <constant>Initial Creation</constant>
200
                                    </instance_info>
201
                                    <instance_generator name="ConceptURI">
202
                                        <arg name="term" type="constant">Initial Creation</arg>
203
                                    </instance_generator>
204
                                    <label_generator name="Constant">
205
                                        <arg name="text" type="constant">Initial Creation</arg>
206
                                    </label_generator>
207
                                </entity>
208
                            </additional>
209
                        </entity>
210
                        <relationship>crm:P14_carried_out_by</relationship>
211
                    </target_relation>
212
                    <comments>
213
                        <comment type="">
214
                            <rationale/>
215
                            <alternatives>is this the creation that is further described in the next map? If so, you should stop with this creation node and put the carried out by the created by in the next map. Looking at your paths though it does not seem clear to me that they are the same creation. Are they?</alternatives>
216
                            <typical_mistakes/>
217
                            <local_habits/>
218
                            <link_to_cook_book/>
219
                            <example>
220
                                <example_source/>
221
                                <example_target/>
222
                            </example>
223
                            <comments_last_update date="" person=""/>
224
                        </comment>
225
                    </comments>
226
                </path>
227
                <range>
228
                    <source_node>filedesc/publicationstmt</source_node>
229
                    <target_node>
230
                        <entity>
231
                            <type>crm:E39_Actor</type>
232
                            <instance_generator name="ActorURI">
233
                                <arg name="term" type="xpath">publisher/text()</arg>
234
                            </instance_generator>
235
                            <label_generator name="SimpleLabel">
236
                                <arg name="label" type="xpath">publisher/text()</arg>
237
                            </label_generator>
238
                        </entity>
239
                    </target_node>
240
                </range>
241
            </link>
242
            <link>
243
                <path>
244
                    <source_relation>
245
                        <relation>profiledesc/creation/date</relation>
246
                    </source_relation>
247
                    <target_relation>
248
                        <relationship>crm:P94i_was_created_by</relationship>
249
                        <entity variable="create">
250
                            <type>crmdig:D7_Digital_Machine_Event</type>
251
                            <instance_generator name="UUID"/>
252
                        </entity>
253
                        <relationship>crm:P4_has_time-span</relationship>
254
                        <entity>
255
                            <type>crm:E52_Time-Span</type>
256
                            <instance_generator name="UUID"/>
257
                            <label_generator name="CompositeLabel">
258
                                <arg name="label" type="constant">Time-Span of Initial Creation of </arg>
259
                                <arg name="text" type="xpath">../../../eadid/text()</arg>
260
                            </label_generator>
261
                        </entity>
262
                        <relationship>crm:P81_ongoing_throughout</relationship>
263
                    </target_relation>
264
                </path>
265
                <range>
266
                    <source_node>profiledesc/creation/date</source_node>
267
                    <target_node>
268
                        <entity>
269
                            <type>http://www.w3.org/2000/01/rdf-schema#Literal</type>
270
                            <instance_generator name="Literal">
271
                                <arg name="text" type="xpath">text()</arg>
272
                            </instance_generator>
273
                        </entity>
274
                    </target_node>
275
                </range>
276
            </link>
277
            <link>
278
                <path>
279
                    <source_relation>
280
                        <relation>revisiondesc/change</relation>
281
                    </source_relation>
282
                    <target_relation>
283
                        <relationship>crmdig:L11i_was_output_of</relationship>
284
                    </target_relation>
285
                </path>
286
                <range>
287
                    <source_node>revisiondesc/change</source_node>
288
                    <target_node>
289
                        <entity>
290
                            <type>crmdig:D7_Digital_Machine_Event</type>
291
                            <instance_generator name="UUID"/>
292
                            <label_generator name="CompositeLabel">
293
                                <arg name="label" type="constant">Update Event for </arg>
294
                                <arg name="text" type="xpath">../../eadid/text()</arg>
295
                            </label_generator>
296
                            <additional>
297
                                <relationship>crm:P2_has_type</relationship>
298
                                <entity>
299
                                    <type>crm:E55_Type</type>
300
                                    <instance_info>
301
                                        <constant>Update</constant>
302
                                    </instance_info>
303
                                    <instance_generator name="ConceptURI">
304
                                        <arg name="term" type="constant">Update</arg>
305
                                    </instance_generator>
306
                                    <label_generator name="Constant">
307
                                        <arg name="text" type="constant">Update</arg>
308
                                    </label_generator>
309
                                </entity>
310
                            </additional>
311
                        </entity>
312
                    </target_node>
313
                </range>
314
            </link>
315
        </mapping>
316
        <mapping>
317
            <domain>
318
                <source_node>/ead/eadheader/revisiondesc/change</source_node>
319
                <target_node>
320
                    <entity>
321
                        <type>crmdig:D7_Digital_Machine_Event</type>
322
                        <instance_generator name="UUID"/>
323
                    </entity>
324
                </target_node>
325
            </domain>
326
            <link>
327
                <path>
328
                    <source_relation>
329
                        <relation>item</relation>
330
                    </source_relation>
331
                    <target_relation>
332
                        <relationship>crm:P3_has_note</relationship>
333
                    </target_relation>
334
                </path>
335
                <range>
336
                    <source_node>item</source_node>
337
                    <target_node>
338
                        <entity>
339
                            <type>http://www.w3.org/2000/01/rdf-schema#Literal</type>
340
                            <instance_generator name="Literal">
341
                                <arg name="text" type="xpath">text()</arg>
342
                            </instance_generator>
343
                        </entity>
344
                    </target_node>
345
                </range>
346
            </link>
347
            <link>
348
                <path>
349
                    <source_relation>
350
                        <relation>date</relation>
351
                    </source_relation>
352
                    <target_relation>
353
                        <relationship>crm:P4_has_time-span</relationship>
354
                        <entity>
355
                            <type>crm:E52_Time-Span</type>
356
                            <instance_generator name="UUID"/>
357
                            <label_generator name="CompositeLabel">
358
                                <arg name="label" type="constant">Time Span of Update Event for </arg>
359
                                <arg name="text" type="xpath">../../../eadid/text()</arg>
360
                            </label_generator>
361
                        </entity>
362
                        <relationship>crm:P81_ongoing_throughout</relationship>
363
                    </target_relation>
364
                </path>
365
                <range>
366
                    <source_node>date</source_node>
367
                    <target_node>
368
                        <entity>
369
                            <type>http://www.w3.org/2000/01/rdf-schema#Literal</type>
370
                            <instance_generator name="Literal">
371
                                <arg name="text" type="xpath">text()</arg>
372
                            </instance_generator>
373
                        </entity>
374
                    </target_node>
375
                </range>
376
            </link>
377
        </mapping>
378
        <mapping>
379
            <domain>
380
                <source_node>/ead/archdesc</source_node>
381
                <target_node>
382
                    <entity>
383
                        <type>crm:E78_Collection</type>
384
                        <type>crm:E33_Linguistic_Object</type>
385
                        <instance_generator name="UUID"/>
386
                        <label_generator name="SimpleLabel">
387
                            <arg name="label" type="xpath">did/unitid/text()</arg>
388
                        </label_generator>
389
                    </entity>
390
                </target_node>
391
                <comments>
392
                    <comment type="">
393
                        <rationale/>
394
                        <alternatives>So is each archive actually a dataset in the sense of a digital object or are they physical archives as well? If they are physical as well, persistent dataset won't work.</alternatives>
395
                        <typical_mistakes/>
396
                        <local_habits/>
397
                        <link_to_cook_book/>
398
                        <example>
399
                            <example_source/>
400
                            <example_target/>
401
                        </example>
402
                        <comments_last_update date="" person=""/>
403
                    </comment>
404
                </comments>
405
            </domain>
406
            <link>
407
                <path>
408
                    <source_relation>
409
                        <relation>dsc/controlaccess/subject</relation>
410
                    </source_relation>
411
                    <target_relation>
412
                        <relationship>crm:P129_is_about</relationship>
413
                    </target_relation>
414
                </path>
415
                <range>
416
                    <source_node>dsc/controlaccess/subject</source_node>
417
                    <target_node>
418
                        <entity>
419
                            <type>crm:E55_Type</type>
420
                            <instance_generator name="ConceptURI">
421
                                <arg name="term" type="xpath">text()</arg>
422
                            </instance_generator>
423
                            <label_generator name="Constant">
424
                                <arg name="text" type="xpath">text()</arg>
425
                            </label_generator>
426
                        </entity>
427
                    </target_node>
428
                    <comments>
429
                        <comment type="">
430
                            <rationale/>
431
                            <alternatives>Is control access about authorization to use? Might need to create a new relation for this if so.</alternatives>
432
                            <typical_mistakes/>
433
                            <local_habits/>
434
                            <link_to_cook_book/>
435
                            <example>
436
                                <example_source/>
437
                                <example_target/>
438
                            </example>
439
                            <comments_last_update date="" person=""/>
440
                        </comment>
441
                    </comments>
442
                </range>
443
            </link>
444
            <link>
445
                <path>
446
                    <source_relation>
447
                        <relation>did/unittitle</relation>
448
                    </source_relation>
449
                    <target_relation>
450
                        <relationship>crm:P102_has_title</relationship>
451
                    </target_relation>
452
                </path>
453
                <range>
454
                    <source_node>did/unittitle</source_node>
455
                    <target_node>
456
                        <entity>
457
                            <type>crm:E35_Title</type>
458
                            <instance_generator name="ThingAppellationURI">
459
                                <arg name="term" type="xpath">../unitid/text()</arg>
460
                            </instance_generator>
461
                            <label_generator name="SimpleLabel">
462
                                <arg name="label" type="xpath">text()</arg>
463
                            </label_generator>
464
                        </entity>
465
                    </target_node>
466
                </range>
467
            </link>
468
            <link>
469
                <path>
470
                    <source_relation>
471
                        <relation>bioghist/p</relation>
472
                    </source_relation>
473
                    <target_relation>
474
                        <relationship>crm:P108i_was_produced_by</relationship>
475
                        <entity variable="col_start">
476
                            <type>crm:E12_Production</type>
477
                            <instance_generator name="UUID"/>
478
                            <label_generator name="CompositeLabel">
479
                                <arg name="label" type="constant">Collection Event for </arg>
480
                                <arg name="text" type="xpath">../../did/unittitle/text()</arg>
481
                            </label_generator>
482
                        </entity>
483
                        <relationship>crm:P14_carried_out_by</relationship>
484
                        <entity variable="actor1">
485
                            <type>crm:E39_Actor</type>
486
                            <instance_generator name="UUID"/>
487
                        </entity>
488
                        <relationship>crm:P3_has_note</relationship>
489
                    </target_relation>
490
                </path>
491
                <range>
492
                    <source_node>bioghist/p</source_node>
493
                    <target_node>
494
                        <entity>
495
                            <type>http://www.w3.org/2000/01/rdf-schema#Literal</type>
496
                            <instance_generator name="Literal">
497
                                <arg name="text" type="xpath">text()</arg>
498
                            </instance_generator>
499
                        </entity>
500
                    </target_node>
501
                    <comments>
502
                        <comment type="">
503
                            <rationale/>
504
                            <alternatives>why has note here, what is source?</alternatives>
505
                            <typical_mistakes/>
506
                            <local_habits/>
507
                            <link_to_cook_book/>
508
                            <example>
509
                                <example_source/>
510
                                <example_target/>
511
                            </example>
512
                            <comments_last_update date="" person=""/>
513
                        </comment>
514
                    </comments>
515
                </range>
516
            </link>
517
            <link>
518
                <path>
519
                    <source_relation>
520
                        <relation>scopecontent/p</relation>
521
                    </source_relation>
522
                    <target_relation>
523
                        <relationship>crm:P3_has_note</relationship>
524
                    </target_relation>
525
                    <comments>
526
                        <comment type="">
527
                            <rationale/>
528
                            <alternatives/>
529
                            <typical_mistakes/>
530
                            <local_habits/>
531
                            <link_to_cook_book/>
532
                            <example>
533
                                <example_source/>
534
                                <example_target/>
535
                            </example>
536
                            <comments_last_update date="" person=""/>
537
                        </comment>
538
                    </comments>
539
                </path>
540
                <range>
541
                    <source_node>scopecontent/p</source_node>
542
                    <target_node>
543
                        <entity>
544
                            <type>http://www.w3.org/2000/01/rdf-schema#Literal</type>
545
                            <instance_generator name="CompositeLabel">
546
                                <arg name="label" type="constant">Scopecontent: </arg>
547
                                <arg name="text" type="xpath">text()</arg>
548
                            </instance_generator>
549
                        </entity>
550
                    </target_node>
551
                </range>
552
            </link>
553
            <link>
554
                <path>
555
                    <source_relation>
556
                        <relation>arrangement/p</relation>
557
                    </source_relation>
558
                    <target_relation>
559
                        <relationship>crm:P147i_was_curated_by</relationship>
560
                        <entity>
561
                            <type>crm:E87_Curation_Activity</type>
562
                            <instance_generator name="UUID"/>
563
                            <label_generator name="CompositeLabel">
564
                                <arg name="label" type="constant">Curation Activity for</arg>
565
                                <arg name="text" type="xpath">../../did/unittitle/text()</arg>
566
                            </label_generator>
567
                        </entity>
568
                        <relationship>crm:P33_used_specific_technique</relationship>
569
                        <entity>
570
                            <type>crm:E29_Design_or_Procedure</type>
571
                            <instance_generator name="UUID"/>
572
                            <label_generator name="CompositeLabel">
573
                                <arg name="label" type="constant">Curation Plan for </arg>
574
                                <arg name="text" type="xpath">../../did/unittitle/text()</arg>
575
                            </label_generator>
576
                        </entity>
577
                        <relationship>crm:P3_has_note</relationship>
578
                    </target_relation>
579
                </path>
580
                <range>
581
                    <source_node>arrangement/p</source_node>
582
                    <target_node>
583
                        <entity>
584
                            <type>http://www.w3.org/2000/01/rdf-schema#Literal</type>
585
                            <instance_generator name="Literal">
586
                                <arg name="text" type="xpath">text()</arg>
587
                            </instance_generator>
588
                        </entity>
589
                    </target_node>
590
                </range>
591
            </link>
592
            <link>
593
                <path>
594
                    <source_relation>
595
                        <relation>did/origination</relation>
596
                    </source_relation>
597
                    <target_relation>
598
                        <relationship>crm:P108i_was_produced_by</relationship>
599
                        <entity variable="col_start">
600
                            <type>crm:E12_Production</type>
601
                            <instance_generator name="UUID"/>
602
                            <label_generator name="CompositeLabel">
603
                                <arg name="label" type="constant">Production Activity for</arg>
604
                                <arg name="text" type="xpath">../unittitle/text()</arg>
605
                            </label_generator>
606
                        </entity>
607
                        <relationship>crm:P14_carried_out_by</relationship>
608
                    </target_relation>
609
                </path>
610
                <range>
611
                    <source_node>did/origination</source_node>
612
                    <target_node>
613
                        <entity variable="actor1">
614
                            <type>crm:E39_Actor</type>
615
                            <instance_generator name="UUID"/>
616
                        </entity>
617
                    </target_node>
618
                </range>
619
            </link>
620
            <link>
621
                <path>
622
                    <source_relation>
623
                        <relation>did/physdesc</relation>
624
                    </source_relation>
625
                    <target_relation>
626
                        <relationship>crm:P43_has_dimension</relationship>
627
                        <entity>
628
                            <type>crm:E54_Dimension</type>
629
                            <instance_generator name="UUID"/>
630
                            <label_generator name="CompositeLabel">
631
                                <arg name="label" type="constant">Dimension of</arg>
632
                                <arg name="text" type="xpath">../unittitle/text()</arg>
633
                            </label_generator>
634
                        </entity>
635
                        <relationship>crm:P3_has_note</relationship>
636
                    </target_relation>
637
                </path>
638
                <range>
639
                    <source_node>did/physdesc</source_node>
640
                    <target_node>
641
                        <entity>
642
                            <type>http://www.w3.org/2000/01/rdf-schema#Literal</type>
643
                            <instance_generator name="Literal">
644
                                <arg name="text" type="xpath">text()</arg>
645
                            </instance_generator>
646
                        </entity>
647
                    </target_node>
648
                </range>
649
            </link>
650
            <link>
651
                <path>
652
                    <source_relation>
653
                        <relation>did/repository/corpname</relation>
654
                    </source_relation>
655
                    <target_relation>
656
                        <relationship>crmpe:PP4i_is_object_hosted_by</relationship>
657
                        <entity>
658
                            <type>crmpe:PE2_Hosting_Service</type>
659
                            <instance_generator name="ServiceURI">
660
                                <arg name="term" type="xpath">text()</arg>
661
                            </instance_generator>
662
                            <label_generator name="SimpleLabel">
663
                                <arg name="label" type="xpath">text()</arg>
664
                            </label_generator>
665
                        </entity>
666
                        <relationship>crmpe:PP2_provided_by</relationship>
667
                    </target_relation>
668
                </path>
669
                <range>
670
                    <source_node>did/repository/corpname</source_node>
671
                    <target_node>
672
                        <entity>
673
                            <type>crm:E39_Actor</type>
674
                            <instance_generator name="ActorURI">
675
                                <arg name="term" type="xpath">text()</arg>
676
                            </instance_generator>
677
                            <label_generator name="SimpleLabel">
678
                                <arg name="label" type="xpath">text()</arg>
679
                            </label_generator>
680
                        </entity>
681
                    </target_node>
682
                    <comments>
683
                        <comment type="">
684
                            <rationale>Here, the Data Hosting services are the institutions holding the original materials.</rationale>
685
                            <alternatives>then you should just go all the way to actor and just use the data hosting service as an intermediate node.</alternatives>
686
                            <typical_mistakes/>
687
                            <local_habits/>
688
                            <link_to_cook_book/>
689
                            <example>
690
                                <example_source/>
691
                                <example_target/>
692
                            </example>
693
                            <comments_last_update date="" person=""/>
694
                        </comment>
695
                    </comments>
696
                </range>
697
            </link>
698
            <link>
699
                <path>
700
                    <source_relation>
701
                        <relation>did/unitdate</relation>
702
                    </source_relation>
703
                    <target_relation>
704
                        <relationship>crm:P108i_was_produced_by</relationship>
705
                        <entity variable="col_start">
706
                            <type>crm:E12_Production</type>
707
                            <instance_generator name="UUID"/>
708
                        </entity>
709
                        <relationship>crm:P4_has_time-span</relationship>
710
                        <entity>
711
                            <type>crm:E52_Time-Span</type>
712
                            <instance_generator name="UUID"/>
713
                            <label_generator name="CompositeLabel">
714
                                <arg name="label" type="constant">Time span of Collection Event for</arg>
715
                                <arg name="text" type="xpath">../unittitle/text()</arg>
716
                            </label_generator>
717
                        </entity>
718
                        <relationship>crm:P3_has_note</relationship>
719
                    </target_relation>
720
                </path>
721
                <range>
722
                    <source_node>did/unitdate</source_node>
723
                    <target_node>
724
                        <entity>
725
                            <type>http://www.w3.org/2000/01/rdf-schema#Literal</type>
726
                            <instance_generator name="Literal">
727
                                <arg name="text" type="xpath">text()</arg>
728
                            </instance_generator>
729
                        </entity>
730
                    </target_node>
731
                </range>
732
            </link>
733
            <link>
734
                <path>
735
                    <source_relation>
736
                        <relation>did/langmaterial/language</relation>
737
                    </source_relation>
738
                    <target_relation>
739
                        <relationship>crm:P72_has_language</relationship>
740
                        <entity>
741
                            <type>crm:E56_Language</type>
742
                            <instance_generator name="UUID"/>
743
                        </entity>
744
                        <relationship>crm:P3_has_note</relationship>
745
                    </target_relation>
746
                    <comments>
747
                        <comment type="">
748
                            <rationale/>
749
                            <alternatives>Is this because you want to indicate language of the archival object. in Which case you can double instantiate as Linguistic Object.</alternatives>
750
                            <typical_mistakes/>
751
                            <local_habits/>
752
                            <link_to_cook_book/>
753
                            <example>
754
                                <example_source/>
755
                                <example_target/>
756
                            </example>
757
                            <comments_last_update date="" person=""/>
758
                        </comment>
759
                    </comments>
760
                </path>
761
                <range>
762
                    <source_node>did/langmaterial/language</source_node>
763
                    <target_node>
764
                        <entity>
765
                            <type>http://www.w3.org/2000/01/rdf-schema#Literal</type>
766
                            <instance_generator name="Literal">
767
                                <arg name="text" type="xpath">text()</arg>
768
                            </instance_generator>
769
                        </entity>
770
                    </target_node>
771
                </range>
772
            </link>
773
            <link>
774
                <path>
775
                    <source_relation>
776
                        <relation>originalsloc/p</relation>
777
                    </source_relation>
778
                    <target_relation>
779
                        <relationship>crm:P130_shows_features_of</relationship>
780
                        <entity>
781
                            <type>crm:E78_Collection</type>
782
                            <instance_generator name="UUID"/>
783
                            <label_generator name="CompositeLabel">
784
                                <arg name="label" type="constant">Collection Containing Original Material of </arg>
785
                                <arg name="text" type="xpath">../../did/unittitle/text()</arg>
786
                            </label_generator>
787
                        </entity>
788
                        <relationship>crm:P3_has_note</relationship>
789
                    </target_relation>
790
                </path>
791
                <range>
792
                    <source_node>originalsloc/p</source_node>
793
                    <target_node>
794
                        <entity>
795
                            <type>http://www.w3.org/2000/01/rdf-schema#Literal</type>
796
                            <instance_generator name="Literal">
797
                                <arg name="text" type="xpath">text()</arg>
798
                            </instance_generator>
799
                        </entity>
800
                    </target_node>
801
                </range>
802
            </link>
803
            <link>
804
                <path>
805
                    <source_relation>
806
                        <relation>altformavail/p</relation>
807
                    </source_relation>
808
                    <target_relation>
809
                        <relationship>crm:P130i_features_are_also_found_on</relationship>
810
                        <entity>
811
                            <type>crm:E78_Collection</type>
812
                            <instance_generator name="UUID"/>
813
                            <label_generator name="CompositeLabel">
814
                                <arg name="label" type="constant">Collection Containing Similar Material as</arg>
815
                                <arg name="text" type="xpath">../../did/unittitle/text()</arg>
816
                            </label_generator>
817
                        </entity>
818
                        <relationship>crm:P3_has_note</relationship>
819
                    </target_relation>
820
                </path>
821
                <range>
822
                    <source_node>altformavail/p</source_node>
823
                    <target_node>
824
                        <entity>
825
                            <type>http://www.w3.org/2000/01/rdf-schema#Literal</type>
826
                            <instance_generator name="Literal">
827
                                <arg name="text" type="xpath">text()</arg>
828
                            </instance_generator>
829
                        </entity>
830
                    </target_node>
831
                </range>
832
            </link>
833
            <link>
834
                <path>
835
                    <source_relation>
836
                        <relation>otherfindaid/p</relation>
837
                    </source_relation>
838
                    <target_relation>
839
                        <relationship>crm:P129i_is_subject_of</relationship>
840
                        <entity>
841
                            <type>crmpe:PE22_Persistent_Dataset</type>
842
                            <instance_generator name="UUID"/>
843
                            <additional>
844
                                <relationship>crm:P2_has_type</relationship>
845
                                <entity>
846
                                    <type>crm:E55_Type</type>
847
                                    <instance_info>
848
                                        <constant>metadata</constant>
849
                                    </instance_info>
850
                                    <instance_generator name="ConceptURI">
851
                                        <arg name="term" type="constant">metadata (otherfindaid)</arg>
852
                                    </instance_generator>
853
                                    <label_generator name="SimpleLabel">
854
                                        <arg name="label" type="constant">metadata (otherfindaid)</arg>
855
                                    </label_generator>
856
                                </entity>
857
                            </additional>
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff