Search in sources :

Example 1 with Item

use of eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyCollectionType.Item in project hale by halestudio.

the class OmlRdfGenerator method getPropertyCollection.

/**
 * Translate the list of the OML Properties To the Jaxb-based
 * PropertyCollectionType
 *
 * @param collection
 * @return
 */
private PropertyCollectionType getPropertyCollection(List<Property> collection) {
    PropertyCollectionType propCollectionType = new PropertyCollectionType();
    if (collection != null) {
        Iterator<?> iterator = collection.iterator();
        while (iterator.hasNext()) {
            // get property from a list
            Property property = (Property) iterator.next();
            // convert property to the property type
            // TODO could be the circular dependencies in case of
            // ComposedProperty
            PropertyType pType = getPropertyType(property);
            // add to the collection
            Item item = new Item();
            item.setProperty(pType);
            propCollectionType.getItem().add(item);
        }
    }
    return propCollectionType;
}
Also used : Item(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyCollectionType.Item) PropertyCollectionType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyCollectionType) PropertyType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyType) ComposedProperty(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.ComposedProperty) Property(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Property)

Example 2 with Item

use of eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyCollectionType.Item in project hale by halestudio.

the class OmlRdfReader method getPropertyCollection.

/**
 * Returns a List of OML Properties for given jaxb-based
 * PropertyCollectionType.
 *
 * @param collection
 * @return
 */
private List<Property> getPropertyCollection(PropertyCollectionType collection) {
    List<Property> properties = null;
    if (collection != null) {
        properties = new ArrayList<Property>();
        List<Item> collectionItems = collection.getItem();
        Iterator<Item> iterator = collectionItems.iterator();
        Item item;
        Property property;
        while (iterator.hasNext()) {
            item = iterator.next();
            if (item.getProperty() != null) {
                property = getProperty(item.getProperty());
                properties.add(property);
            }
        }
    }
    return properties;
}
Also used : Item(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyCollectionType.Item) ComposedProperty(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.ComposedProperty) Property(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Property)

Aggregations

ComposedProperty (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.ComposedProperty)2 Property (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Property)2 Item (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyCollectionType.Item)2 PropertyCollectionType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyCollectionType)1 PropertyType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyType)1