Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Streams.concat(ss.node_props, ss.edge_props)
- .map(p -> new Pair<>(p.name, p.type))
- .distinct()
- .collect(groupingBy(Pair::getValue0))
- .forEach((name, props) -> {
- // If prop. appears with only one type, set the type otherwise use Object
- // (like autoschema does for everything).
- Class type = Object.class;
- if (props.size() == 1) {
- try {
- type = Class.forName(props.get(0).getValue1());
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- log.fatal("Class look up failed %s -> %s", name, props.get(0).getValue1())
- }
- }
- // NOTE: it fails on this line
- m.makePropertyKey(name).dataType(type).cardinality(Cardinality.SINGLE).make();
- });
- m.commit();
- gts.tx().commit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement