Skip to content

Commit 38d8a8f

Browse files
committed
Testing the CRIS conversion
1 parent 7563add commit 38d8a8f

File tree

2 files changed

+52
-23
lines changed

2 files changed

+52
-23
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
bin/
2-
testxml/
2+
testxml/
3+
logs/*
4+
cache/publications/*
5+
cache/PERS_HAS_CARD/*
6+
cache/CARD_HAS_ORGA/*
7+
cache/persons/*
8+
conversionArchive/*

src/de/ifgi/lodum/testing/Cris.java

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -87,40 +87,63 @@ public static void main(String[] args) {
8787
}
8888
} */
8989

90-
createPersonPublicationRelation();
90+
//createPersonPublicationRelation();
9191

9292
//createPersonOrganizationRelation();
9393

9494
// 1. load all cards
95-
//convertCards();
95+
System.out.println("1. load all cards");
96+
convertCards();
97+
9698
// 2. load all organizations
97-
//convertOrganizations();
99+
System.out.println("2. load all organizations");
100+
convertOrganizations();
101+
98102
// 3. connect Organizations with Cards
103+
System.out.println("3. connect Organizations with Cards");
99104
//addCardIdsToOrgas();
100105
//addCardsToOrgas();
106+
101107
// 4. convert all Persons
102-
// convertPersons();
103-
//readInPersons();
108+
System.out.println("4. convert all Persons");
109+
convertPersons();
110+
readInPersons();
111+
104112
// 5. convert all education information and link/add them directly to Persons
105-
//testEducation();
113+
System.out.println("5. convert all education information and link/add them directly to Persons");
114+
testEducation();
115+
106116
// 6. relate all persons to organizations
107-
//createPersonOrganizationRelation();
117+
System.out.println("6. relate all persons to organizations");
118+
createPersonOrganizationRelation();
119+
108120
// 7. convert all CRIS projects
109-
//convertProjects();
121+
System.out.println("7. convert all CRIS projects");
122+
convertProjects();
123+
110124
// 8. relate all projects to persons
111-
//createProjectPersonRelation();
125+
System.out.println("8. relate all projects to persons");
126+
createProjectPersonRelation();
127+
112128
// 9. convert Publications
113-
//convertPublications();
129+
System.out.println("9. convert Publications");
130+
convertPublications();
131+
114132
// 10. relate persons and publications
115-
//createPersonPublicationRelation();
133+
System.out.println("10. relate persons and publications");
134+
createPersonPublicationRelation();
135+
116136
// 11.
117-
//crawlAndConvertPrices();
137+
System.out.println("11.");
138+
crawlAndConvertPrices();
139+
118140
// 12. create all persons relations
119-
// createProjectPersonRelation();
120-
//createPersonOrganizationRelation();
121-
// createPersonAwardRelation();
122-
// createPersonPublicationRelation();
123-
//crawlAndConvertPrices();
141+
System.out.println("12. create all persons relations");
142+
createProjectPersonRelation();
143+
createPersonOrganizationRelation();
144+
createPersonAwardRelation();
145+
createPersonPublicationRelation();
146+
crawlAndConvertPrices();
124147

125148
// convertOrganizations();
126149
// createPersonFoafDepiction();
@@ -345,7 +368,7 @@ private static void convertPersons(){
345368

346369
// String[] files={"W_person.xml"};
347370

348-
File folder = new File("testxml/persons_24_05_2012");
371+
File folder = new File("testxml/2014-04-07person");
349372
File[] listOfFiles = folder.listFiles();
350373
ArrayList<String> pubs = new ArrayList<String>();
351374
for (int i = 0; i < listOfFiles.length; i++) {
@@ -358,9 +381,9 @@ private static void convertPersons(){
358381
for(String file:pubs){
359382
System.out.println("Starting to process file:" + file);
360383
CrisPerson crisPerson = new CrisPerson("http://data.uni-muenster.de/context/cris/person/");
361-
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream("testxml/persons_24_05_2012/"+file),Charset.forName("UTF-8")));
384+
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream("testxml/2014-04-07person/"+file),Charset.forName("UTF-8")));
362385
crisPerson.readIntoModel("cris_person",in);
363-
crisPerson.getObjectModel().write(new FileOutputStream(new File("conversion/persons_24_05_2012/"+file+".ttl")), "TURTLE");
386+
crisPerson.getObjectModel().write(new FileOutputStream(new File("conversion/2014-04-07person/"+file+".ttl")), "TURTLE");
364387
//crisPerson.commitModelToStore();
365388
System.out.println("Finished processing file:" + file);
366389
}
@@ -386,13 +409,13 @@ private static void convertPersons(){
386409

387410
private static void readInPersons(){
388411
CrisPerson crisPerson = new CrisPerson("http://data.uni-muenster.de/context/cris/person1/");
389-
File folder = new File("conversion/persons_24_05_2012");
412+
File folder = new File("conversion/2014-04-07person");
390413
File[] listOfFiles = folder.listFiles();
391414

392415
for (int i = 0; i < listOfFiles.length; i++) {
393416
if (listOfFiles[i].isFile()) {
394417
try {
395-
crisPerson.getReposConnection().add(new File("conversion/persons_24_05_2012/"+listOfFiles[i].getName()),"http://data.uni-muenster.de/context/",RDFFormat.TURTLE) ;
418+
crisPerson.getReposConnection().add(new File("conversion/2014-04-07person/"+listOfFiles[i].getName()),"http://data.uni-muenster.de/context/",RDFFormat.TURTLE) ;
396419
crisPerson.commitModelToStore();
397420
System.out.println(listOfFiles[i].getName() +" have been commited");
398421
} catch (RDFParseException e) {

0 commit comments

Comments
 (0)