2 * Copyright (C) 2019 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.cdm
.io
.descriptive
.owl
.in
;
11 import java
.util
.Arrays
;
13 import org
.apache
.logging
.log4j
.LogManager
;
14 import org
.apache
.logging
.log4j
.Logger
;
15 import org
.springframework
.stereotype
.Component
;
17 import com
.hp
.hpl
.jena
.rdf
.model
.ResIterator
;
18 import com
.hp
.hpl
.jena
.rdf
.model
.Resource
;
20 import eu
.etaxonomy
.cdm
.common
.URI
;
21 import eu
.etaxonomy
.cdm
.io
.common
.CdmImportBase
;
22 import eu
.etaxonomy
.cdm
.io
.descriptive
.owl
.OwlUtil
;
23 import eu
.etaxonomy
.cdm
.model
.description
.Character
;
29 @Component("characterOwlImport")
30 public class CharacterOwlImport
31 extends CdmImportBase
<StructureTreeOwlImportConfigurator
, StructureTreeOwlImportState
> {
33 private static final long serialVersionUID
= -3659780404413458511L;
35 private final static Logger logger
= LogManager
.getLogger();
38 protected boolean doCheck(StructureTreeOwlImportState state
) {
39 logger
.warn("Checking not yet implemented for " + this.getClass().getSimpleName());
44 public void doInvoke(StructureTreeOwlImportState state
) {
45 URI source
= state
.getConfig().getSource();
46 state
.getModel().read(source
.toString());
47 ResIterator iterator
= state
.getModel().listResourcesWithProperty(OwlUtil
.propIsA
, OwlUtil
.CHARACTER
);
48 while(iterator
.hasNext()){
49 Resource characterResource
= iterator
.next();
50 Character character
= OwlImportUtil
.findTerm(Character
.class, characterResource
, this, state
.getModel(), state
);
51 character
= (Character
) getTermService().load(character
.getUuid(), Arrays
.asList(new String
[] {
58 "recommendedModifierEnumeration",
59 "recommendedStatisticalMeasures",
60 "recommendedMeasurementUnits",
61 "supportedCategoricalEnumerations",
63 OwlImportUtil
.addCharacterProperties(character
, characterResource
, this, state
.getModel(), state
);
64 getTermService().saveOrUpdate(character
);
69 protected boolean isIgnore(StructureTreeOwlImportState state
) {