--- a/src/main/java/net/timbusproject/extractors/modules/tavernaextractor/ExtendedOWL.java
+++ b/src/main/java/net/timbusproject/extractors/modules/tavernaextractor/ExtendedOWL.java
@@ -100,8 +100,10 @@
/**
* PRONOM PUID
*/
- public static final String PRONOM_REGISTRY_URI = "http://www.loc.gov/premis/rdf/v1#hasFormatRegistryKey";
- public static final IRI PRONOM_REGISTRY_IRI = IRI.create(PRONOM_REGISTRY_URI);
+ public static final String PRONOM_REGISTRY_KEY_URI = "http://www.loc.gov/premis/rdf/v1#hasFormatRegistryKey";
+ public static final IRI PRONOM_REGISTRY_KEY_IRI = IRI.create(PRONOM_REGISTRY_KEY_URI);
+ public static final String PRONOM_REGISTRY_NAME_URI = "http://www.loc.gov/premis/rdf/v1#hasFormatRegistryName";
+ public static final IRI PRONOM_REGISTRY_NAME_IRI = IRI.create(PRONOM_REGISTRY_NAME_URI);
public ExtendedOWL() {
logger.setLevel(Level.DEBUG);
@@ -150,7 +152,7 @@
provenanceEntries = provenanceAccessClient.filterEntries(provenanceAccessClient.readCSV(droidCSVReport));
if (provenanceEntries.isEmpty()) {
- logger.error("ERROR: Stop processing due to an empty provenance entry list.");
+ logger.info("Nothing to apply due to an empty provenance entry set.");
return;
}
@@ -176,7 +178,7 @@
logger.debug(entry.toString());
for (OWLNamedIndividual ind : individuals) {
- if (hasAnnotationValue(ind, ontology, entry.getNAME()) && entry.getPUID() != null
+ if (hasAnnotationValue(ind, ontology, entry.getNameForExtensionUsage()) && entry.getPUID() != null
&& !entry.getPUID().isEmpty()) {
logger.info("Found individual (" + ind.getIRI() + ") which has to be extended with PUID ("
@@ -195,7 +197,7 @@
// add a new individual to existing ontology
private void updateOWL(OWLNamedIndividual ind, CSVEntry entry) {
- Queue<AddAxiom> changes = new LinkedList<AddAxiom>();
+ Queue<AddAxiom> changes = new LinkedList<>();
// Add File assertion
OWLClassAssertionAxiom swoClassAxiom_File = owlDataFactory.getOWLClassAssertionAxiom(PREMIS_FILE_CLASS, ind);
@@ -203,7 +205,7 @@
// Create new ObjectCharacteristics
OWLNamedIndividual swoIndividual_ObjectCharacteristics = owlDataFactory.getOWLNamedIndividual(IRI.create("#",
- replaceWhitespace(entry.getNAME()) + "Characteristics"));
+ replaceWhitespace(entry.getNameForExtensionUsage()) + "Characteristics"));
OWLClassAssertionAxiom swoClassAxiom_ObjectCharacteristics = owlDataFactory.getOWLClassAssertionAxiom(
PREMIS_OBJECTCHAR_CLASS, swoIndividual_ObjectCharacteristics);
changes.add(new AddAxiom(ontology, swoClassAxiom_ObjectCharacteristics));
@@ -221,7 +223,7 @@
// Create new FormatRegistry
OWLNamedIndividual swoIndividual_FormatRegistry = owlDataFactory.getOWLNamedIndividual(IRI.create("#",
- "PronomRegistry[" + entry.getNAME() + "]"));
+ "PronomRegistry[" + entry.getNameForExtensionUsage() + "]"));
OWLClassAssertionAxiom swoClassAxiom_FormatRegistry = owlDataFactory.getOWLClassAssertionAxiom(
PREMIS_FROMATREGISTRY_CLASS, swoIndividual_FormatRegistry);
changes.add(new AddAxiom(ontology, swoClassAxiom_FormatRegistry));
@@ -230,12 +232,19 @@
swoIndividual_FormatRegistry));
// Create new FormatRegistry Data Property Assertion
- OWLDataProperty owlp = owlDataFactory.getOWLDataProperty(PRONOM_REGISTRY_IRI);
+ OWLDataProperty owlp = owlDataFactory.getOWLDataProperty(PRONOM_REGISTRY_KEY_IRI);
OWLLiteral owlLiteral = owlDataFactory.getOWLLiteral("info:pronom/" + entry.getPUID(),
OWL2Datatype.RDFS_LITERAL);
OWLDataPropertyAssertionAxiom addProp = owlDataFactory.getOWLDataPropertyAssertionAxiom(owlp,
swoIndividual_FormatRegistry, owlLiteral);
changes.add(new AddAxiom(ontology, addProp));
+
+ OWLDataProperty owlp2 = owlDataFactory.getOWLDataProperty(PRONOM_REGISTRY_NAME_IRI);
+ OWLLiteral owlLiteral2 = owlDataFactory.getOWLLiteral("http://www.nationalarchives.gov.uk/PRONOM/",
+ OWL2Datatype.RDFS_LITERAL);
+ OWLDataPropertyAssertionAxiom addProp2 = owlDataFactory.getOWLDataPropertyAssertionAxiom(owlp2,
+ swoIndividual_FormatRegistry, owlLiteral2);
+ changes.add(new AddAxiom(ontology, addProp2));
// apply all changes to the Model
for (AddAxiom addAxiom : changes) {