DOREMUS-ANR / marc2rdf

Converter from UNIMARC/INTERMARC to RDF using the DOREMUS model
Apache License 2.0
6 stars 0 forks source link

Empty blank nodes #12

Closed fernanev closed 8 years ago

fernanev commented 8 years ago

When the tool converts the Philharmonie TUMs, it duplicates the property mus:U17_has_opus_statement if the tag 444p does not exist in the MARC file. This could be because in the code it doesn't check if it is empty or not:

/**************************** Expression: Opus ******************************************/
if (!(getOpus(Converter.getFile(), "144").equals(""))) {
   F22.addProperty(modelF22.createProperty(mus + "U17_has_opus_statement"), modelF22.createResource()
     .addProperty(modelF22.createProperty(cidoc + "P3_has_note"), getOpus(Converter.getFile(), "144"))
     .addProperty(modelF22.createProperty(cidoc + "P106_is_composed_of"), getOpusNumber(Converter.getFile(), "144"))
     .addProperty(modelF22.createProperty(cidoc + "P106_is_composed_of"), getOpusSubNumber(Converter.getFile(), "144"))
   );
if (!(getOpus(Converter.getFile(), "144").equals(getOpus(Converter.getFile(), "444")))) { //Si le contenu de 144 est différent de 444
     F22.addProperty(modelF22.createProperty(mus + "U17_has_opus_statement"), modelF22.createResource()
       .addProperty(modelF22.createProperty(cidoc + "P3_has_note"), getOpus(Converter.getFile(), "444"))
       .addProperty(modelF22.createProperty(cidoc + "P106_is_composed_of"), getOpusNumber(Converter.getFile(), "444"))
       .addProperty(modelF22.createProperty(cidoc + "P106_is_composed_of"), getOpusSubNumber(Converter.getFile(), "444"))
     );
   }
}

That gives as consequence rdf files having some duplicated and empty properties:

<http://data.doremus.org/Self_Contained_Expression/F22/...>
    mus:U17_has_opus_statement     [ cidoc-crm:P106_is_composed_of  "73" ;
                                     cidoc-crm:P3_has_note  "Op. 73"
                                   ] ;
    mus:U17_has_opus_statement     []  ;
pasqLisena commented 8 years ago

solved with previous commits