use of com.orientechnologies.orient.graph.graphml.OIgnoreGraphMLImportStrategy in project orientdb by orientechnologies.
the class OGremlinConsoleTest method testGraphMLImportIgnoreEAttribute.
@Test
public void testGraphMLImportIgnoreEAttribute() throws IOException {
final String INPUT_FILE = "src/test/resources/graph-example-fromexport.xml";
String dbUrl = "memory:testGraphMLImportIgnoreEAttribute";
new OGraphMLReader(new OrientGraphNoTx(dbUrl)).defineEdgeAttributeStrategy("friend", new OIgnoreGraphMLImportStrategy()).inputGraph(INPUT_FILE);
ODatabaseDocumentTx db = new ODatabaseDocumentTx(dbUrl);
db.open("admin", "admin");
try {
List<ODocument> result = db.query(new OSQLSynchQuery<ODocument>("select from E"));
Assert.assertFalse(result.isEmpty());
for (ODocument d : result) {
Assert.assertFalse(d.containsField("friend"));
}
} finally {
db.close();
}
}
use of com.orientechnologies.orient.graph.graphml.OIgnoreGraphMLImportStrategy in project orientdb by orientechnologies.
the class OGremlinConsoleTest method testGraphMLImportIgnoreVAttribute.
@Test
public void testGraphMLImportIgnoreVAttribute() throws IOException {
final String INPUT_FILE = "src/test/resources/graph-example-fromexport.xml";
String dbUrl = "memory:testGraphMLImportIgnoreVAttribute";
final OGraphMLReader graphml = new OGraphMLReader(new OrientGraphNoTx(dbUrl)).defineVertexAttributeStrategy("__type__", new OIgnoreGraphMLImportStrategy()).inputGraph(INPUT_FILE);
ODatabaseDocumentTx db = new ODatabaseDocumentTx(dbUrl);
db.open("admin", "admin");
try {
List<ODocument> result = db.query(new OSQLSynchQuery<ODocument>("select from V"));
Assert.assertFalse(result.isEmpty());
for (ODocument d : result) {
Assert.assertFalse(d.containsField("__type__"));
}
} finally {
db.close();
}
}
Aggregations