protected OmObservableProperty createObservableProperty(PhenomenonEntity observableProperty) throws CodedException { String phenID = observableProperty.getIdentifier(); String description = observableProperty.getDescription(); OmObservableProperty omObservableProperty = new OmObservableProperty(phenID, description, null, null); if (observableProperty.isSetName()) { omObservableProperty.setHumanReadableIdentifier(observableProperty.getName()); addName(omObservableProperty, observableProperty); } return omObservableProperty; }
protected OmObservableProperty createObservableProperty(PhenomenonEntity observableProperty) throws CodedException { String phenID = observableProperty.getIdentifier(); String description = observableProperty.getDescription(); OmObservableProperty omObservableProperty = new OmObservableProperty(phenID, description, null, null); if (observableProperty.isSetName()) { omObservableProperty.setHumanReadableIdentifier(observableProperty.getName()); addName(omObservableProperty, observableProperty); } return omObservableProperty; }
public CategoryEntity getOrInsertCategory(PhenomenonEntity obsProp, Session session) { CategoryEntity category = getCategroyForIdentifier(obsProp.getIdentifier(), session); if (category == null) { category = new CategoryEntity(); category.setIdentifier(obsProp.getIdentifier()); category.setIdentifierCodespace(obsProp.getIdentifierCodespace()); category.setName(obsProp.getName()); category.setNameCodespace(obsProp.getNameCodespace()); category.setDescription(obsProp.getDescription()); session.save(category); session.flush(); session.refresh(category); } return category; }
public CategoryEntity getOrInsertCategory(PhenomenonEntity obsProp, Session session) { CategoryEntity category = getCategroyForIdentifier(obsProp.getIdentifier(), session); if (category == null) { category = new CategoryEntity(); category.setIdentifier(obsProp.getIdentifier()); category.setIdentifierCodespace(obsProp.getIdentifierCodespace()); category.setName(obsProp.getName()); category.setNameCodespace(obsProp.getNameCodespace()); category.setDescription(obsProp.getDescription()); session.save(category); session.flush(); session.refresh(category); } return category; }
protected <T extends SweAbstractDataComponent> T setCommonValues( T component, Data<?> valuedObservation) throws CodedException { if (valuedObservation != null) { PhenomenonEntity op = valuedObservation.getDataset().getPhenomenon(); component.setIdentifier(op.getIdentifier()); component.setDefinition(op.getIdentifier()); component.setDescription(op.getDescription()); if (op.isSetNameCodespace()) { String codespace = op.getNameCodespace().getName(); try { component.setName(new CodeType(op.getName(), new URI(codespace))); } catch (URISyntaxException e) { throw new NoApplicableCodeException().causedBy(e).withMessage( "Error while creating URI from '{}'", codespace); } } else { component.setName(op.getName()); } if (valuedObservation.getDataset().hasUnit() && component instanceof SweAbstractUomType) { SweAbstractUomType<?> uomType = (SweAbstractUomType<?>) component; uomType.setUom(valuedObservation.getDataset().getUnit().getUnit()); } } return component; }
protected <T extends SweAbstractDataComponent> T setCommonValues( T component, Data<?> valuedObservation) throws CodedException { if (valuedObservation != null) { PhenomenonEntity op = valuedObservation.getDataset().getPhenomenon(); component.setIdentifier(op.getIdentifier()); component.setDefinition(op.getIdentifier()); component.setDescription(op.getDescription()); if (op.isSetNameCodespace()) { String codespace = op.getNameCodespace().getName(); try { component.setName(new CodeType(op.getName(), new URI(codespace))); } catch (URISyntaxException e) { throw new NoApplicableCodeException().causedBy(e).withMessage( "Error while creating URI from '{}'", codespace); } } else { component.setName(op.getName()); } if (valuedObservation.getDataset().hasUnit() && component instanceof SweAbstractUomType) { SweAbstractUomType<?> uomType = (SweAbstractUomType<?>) component; uomType.setUom(valuedObservation.getDataset().getUnit().getUnit()); } } return component; }
simpleType.setDescription(observableProperty.getDescription());