Skip to content

Commit

Permalink
small changes in identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominika Tkaczyk committed May 14, 2015
1 parent 57bb7e1 commit 0958b83
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions cermine-impl/src/main/java/pl/edu/icm/cermine/RDFGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.vocabulary.DC;
import com.hp.hpl.jena.vocabulary.VCARD;
import com.hp.hpl.jena.vocabulary.DCTerms;
import com.hp.hpl.jena.vocabulary.VCARD;
import java.io.*;
import java.util.Collection;
import org.apache.commons.cli.ParseException;
Expand All @@ -34,7 +34,6 @@
import pl.edu.icm.cermine.metadata.model.DocumentAuthor;
import pl.edu.icm.cermine.metadata.model.DocumentMetadata;
import pl.edu.icm.cermine.structure.model.BxDocument;
import pl.edu.icm.cermine.structure.model.BxZone;

/**
* NLM-based content extractor from PDF files.
Expand Down Expand Up @@ -94,9 +93,6 @@ public static void main(String[] args) throws ParseException, IOException {

BxDocument doc = ExtractionUtils.extractStructure(extractor.getConf(), in);

for (BxZone z : doc.asZones()) {
System.out.println(z.toText());
}
DocumentMetadata metadata = ExtractionUtils.extractMetadata(extractor.getConf(), doc);
BibEntry[] references = ExtractionUtils.extractReferences(extractor.getConf(), doc);

Expand All @@ -107,6 +103,7 @@ public static void main(String[] args) throws ParseException, IOException {
Resource volumeRes = model.createResource(volumeURI);
Resource docRes = model.createResource(docURI);
docRes.addProperty(DC.source, volumeRes);
docRes.addProperty(DC.identifier, prefix + volume + "/" + docName + ".pdf");
String title = metadata.getTitle();
if (title == null) {
title = "";
Expand All @@ -117,13 +114,13 @@ public static void main(String[] args) throws ParseException, IOException {
int autId = 0;
for (DocumentAuthor docAuthor : metadata.getAuthors()) {
for (DocumentAffiliation docAffiliation : docAuthor.getAffiliations()) {
String affURI = prefix + "affiliation/#" + volDoc + "_" + affId;
String autURI = prefix + "author/#" + docAuthor.getName().replaceAll("\\s", "-");
String affURI = prefix + "affiliation/" + volDoc + "_" + affId;
String autURI = prefix + "author/" + docAuthor.getName().replaceAll("\\s", "-");
String countryName = docAffiliation.getCountry();
if (countryName == null) {
countryName = "";
}
String countryURI = prefix + "country/#" + countryName.replaceAll("\\s", "-");
String countryURI = prefix + "country/" + countryName.replaceAll("\\s", "-");
String org = docAffiliation.getOrganization();
if (org == null) {
org = "";
Expand All @@ -147,8 +144,7 @@ public static void main(String[] args) throws ParseException, IOException {

int citId = 0;
for (BibEntry reference : references) {
System.out.println(reference.toBibTeX());
String citURI = prefix + "citation/#" + volDoc + "_" + citId;
String citURI = prefix + "citation/" + volDoc + "_" + citId;
title = reference.getFirstFieldValue(BibEntry.FIELD_TITLE);
if (title == null) {
title = "";
Expand Down

0 comments on commit 0958b83

Please sign in to comment.