Search in sources :

Example 1 with PropertyKeyMaker

use of com.thinkaurelius.titan.core.schema.PropertyKeyMaker in project incubator-atlas by apache.

the class Titan0GraphManagement method makePropertyKey.

@Override
public AtlasPropertyKey makePropertyKey(String propertyName, Class propertyClass, AtlasCardinality cardinality) {
    if (cardinality.isMany()) {
        newMultProperties.add(propertyName);
    }
    PropertyKeyMaker propertyKeyBuilder = management.makePropertyKey(propertyName).dataType(propertyClass);
    if (cardinality != null) {
        Cardinality titanCardinality = TitanObjectFactory.createCardinality(cardinality);
        propertyKeyBuilder.cardinality(titanCardinality);
    }
    PropertyKey propertyKey = propertyKeyBuilder.make();
    return GraphDbObjectFactory.createPropertyKey(propertyKey);
}
Also used : PropertyKeyMaker(com.thinkaurelius.titan.core.schema.PropertyKeyMaker) Cardinality(com.thinkaurelius.titan.core.Cardinality) AtlasCardinality(org.apache.atlas.repository.graphdb.AtlasCardinality) AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) PropertyKey(com.thinkaurelius.titan.core.PropertyKey)

Example 2 with PropertyKeyMaker

use of com.thinkaurelius.titan.core.schema.PropertyKeyMaker in project incubator-atlas by apache.

the class Titan1GraphManagement method makePropertyKey.

@Override
public AtlasPropertyKey makePropertyKey(String propertyName, Class propertyClass, AtlasCardinality cardinality) {
    if (cardinality.isMany()) {
        newMultProperties.add(propertyName);
    }
    PropertyKeyMaker propertyKeyBuilder = management.makePropertyKey(propertyName).dataType(propertyClass);
    if (cardinality != null) {
        Cardinality titanCardinality = TitanObjectFactory.createCardinality(cardinality);
        propertyKeyBuilder.cardinality(titanCardinality);
    }
    PropertyKey propertyKey = propertyKeyBuilder.make();
    return GraphDbObjectFactory.createPropertyKey(propertyKey);
}
Also used : PropertyKeyMaker(com.thinkaurelius.titan.core.schema.PropertyKeyMaker) Cardinality(com.thinkaurelius.titan.core.Cardinality) AtlasCardinality(org.apache.atlas.repository.graphdb.AtlasCardinality) AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) PropertyKey(com.thinkaurelius.titan.core.PropertyKey)

Aggregations

Cardinality (com.thinkaurelius.titan.core.Cardinality)2 PropertyKey (com.thinkaurelius.titan.core.PropertyKey)2 PropertyKeyMaker (com.thinkaurelius.titan.core.schema.PropertyKeyMaker)2 AtlasCardinality (org.apache.atlas.repository.graphdb.AtlasCardinality)2 AtlasPropertyKey (org.apache.atlas.repository.graphdb.AtlasPropertyKey)2