Search in sources :

Example 1 with HAS_ARCHETYPE_RELATION_NAME

use of nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ARCHETYPE_RELATION_NAME in project timbuctoo by HuygensING.

the class LoadSaveVreTest method loadLoadsInheritingCollections.

@Test
public void loadLoadsInheritingCollections() {
    final String entityTypeName = "wwperson";
    final String collectionName = "wwpersons";
    final String archetypeName = "person";
    final String archetypeCollectionName = "persons";
    final Vre instance = load(initGraph(g -> g.withVertex("vre", v -> v.withLabel(Vre.DATABASE_LABEL).withProperty(VRE_NAME_PROPERTY_NAME, "VreName")).withVertex("collection", v -> v.withLabel(Collection.DATABASE_LABEL).withProperty(Collection.COLLECTION_NAME_PROPERTY_NAME, collectionName).withProperty(Collection.ENTITY_TYPE_NAME_PROPERTY_NAME, entityTypeName).withProperty(Collection.IS_RELATION_COLLECTION_PROPERTY_NAME, false).withIncomingRelation(HAS_COLLECTION_RELATION_NAME, "vre")).withVertex("archetype", v -> v.withLabel(Collection.DATABASE_LABEL).withProperty(Collection.COLLECTION_NAME_PROPERTY_NAME, archetypeCollectionName).withProperty(Collection.ENTITY_TYPE_NAME_PROPERTY_NAME, archetypeName).withIncomingRelation(HAS_ARCHETYPE_RELATION_NAME, "collection"))));
    assertThat(instance.getImplementerOf("person").get().getEntityTypeName(), equalTo(entityTypeName));
}
Also used : TestGraphBuilder(nl.knaw.huygens.timbuctoo.util.TestGraphBuilder) HAS_ARCHETYPE_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ARCHETYPE_RELATION_NAME) Graph(org.apache.tinkerpop.gremlin.structure.Graph) Tuple(nl.knaw.huygens.timbuctoo.util.Tuple) HashMap(java.util.HashMap) Collection(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection) VRE_NAME_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.model.vre.Vre.VRE_NAME_PROPERTY_NAME) Lists(com.google.common.collect.Lists) VertexMatcher.likeVertex(nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex) Map(java.util.Map) Is.is(org.hamcrest.core.Is.is) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) DataStoreOperations(nl.knaw.huygens.timbuctoo.core.DataStoreOperations) TestGraphBuilder.newGraph(nl.knaw.huygens.timbuctoo.util.TestGraphBuilder.newGraph) Neo4jVertex(org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex) TinkerPopGraphManager(nl.knaw.huygens.timbuctoo.server.TinkerPopGraphManager) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) Test(org.junit.Test) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) Maps(com.google.common.collect.Maps) KEYWORD_TYPES_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.model.vre.Vre.KEYWORD_TYPES_PROPERTY_NAME) Consumer(java.util.function.Consumer) Matchers.instanceOf(org.hamcrest.Matchers.instanceOf) Direction(org.apache.tinkerpop.gremlin.structure.Direction) List(java.util.List) HAS_COLLECTION_RELATION_NAME(nl.knaw.huygens.timbuctoo.model.vre.Vre.HAS_COLLECTION_RELATION_NAME) Matchers.contains(org.hamcrest.Matchers.contains) Matchers.containsInAnyOrder(org.hamcrest.Matchers.containsInAnyOrder) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Vre(nl.knaw.huygens.timbuctoo.model.vre.Vre) Optional(java.util.Optional) VreBuilder.vre(nl.knaw.huygens.timbuctoo.model.vre.VreBuilder.vre) Tuple.tuple(nl.knaw.huygens.timbuctoo.util.Tuple.tuple) Vre(nl.knaw.huygens.timbuctoo.model.vre.Vre) Test(org.junit.Test)

Example 2 with HAS_ARCHETYPE_RELATION_NAME

use of nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ARCHETYPE_RELATION_NAME in project timbuctoo by HuygensING.

the class CollectionTest method setArchetypeConnectsTheCollectionToTheNewArchetype.

@Test
public void setArchetypeConnectsTheCollectionToTheNewArchetype() {
    String newArchetypeEntity = "newArchetype";
    GraphWrapper graphWrapper = newGraph().withVertex(v -> v.withLabel(DATABASE_LABEL).withProperty(ENTITY_TYPE_NAME_PROPERTY_NAME, ENTITY_NAME).withProperty(COLLECTION_NAME_PROPERTY_NAME, COLLECTION_NAME)).withVertex(v -> v.withLabel(DATABASE_LABEL).withProperty(ENTITY_TYPE_NAME_PROPERTY_NAME, newArchetypeEntity)).wrap();
    Vertex collectionVertex = graphWrapper.getGraph().traversal().V().has(T.label, LabelP.of(DATABASE_LABEL)).has(ENTITY_TYPE_NAME_PROPERTY_NAME, ENTITY_NAME).next();
    Collection instance = new Collection(VRE_NAME, collectionVertex, graphWrapper);
    Vertex archetypeVertex = graphWrapper.getGraph().traversal().V().has(T.label, LabelP.of(DATABASE_LABEL)).has(ENTITY_TYPE_NAME_PROPERTY_NAME, newArchetypeEntity).next();
    Collection archetype = new Collection("", archetypeVertex, graphWrapper);
    instance.setArchetype(archetype, "");
    assertThat(graphWrapper.getGraph().traversal().V(collectionVertex.id()).out(HAS_ARCHETYPE_RELATION_NAME).toList(), hasItem(likeVertex().withProperty(ENTITY_TYPE_NAME_PROPERTY_NAME, newArchetypeEntity)));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) HAS_ARCHETYPE_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ARCHETYPE_RELATION_NAME) LocalProperty(nl.knaw.huygens.timbuctoo.model.properties.LocalProperty) PROPERTY_TYPE_NAME(nl.knaw.huygens.timbuctoo.model.properties.ReadableProperty.PROPERTY_TYPE_NAME) LabelP(org.apache.tinkerpop.gremlin.neo4j.process.traversal.LabelP) DATABASE_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.model.properties.LocalProperty.DATABASE_PROPERTY_NAME) Matchers.not(org.hamcrest.Matchers.not) CLIENT_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.model.properties.ReadableProperty.CLIENT_PROPERTY_NAME) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) HAS_INITIAL_PROPERTY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_INITIAL_PROPERTY_RELATION_NAME) VertexMatcher.likeVertex(nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex) MockitoHamcrest.argThat(org.mockito.hamcrest.MockitoHamcrest.argThat) HAS_ENTITY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_RELATION_NAME) Assert.fail(org.junit.Assert.fail) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) TestGraphBuilder.newGraph(nl.knaw.huygens.timbuctoo.util.TestGraphBuilder.newGraph) FastNoSuchElementException(org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException) StringToStringConverter(nl.knaw.huygens.timbuctoo.model.properties.converters.StringToStringConverter) HAS_ENTITY_NODE_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_NODE_RELATION_NAME) Iterator(java.util.Iterator) COLLECTION_NAME_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.COLLECTION_NAME_PROPERTY_NAME) ENTITY_TYPE_NAME_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.ENTITY_TYPE_NAME_PROPERTY_NAME) Test(org.junit.Test) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) Mockito.when(org.mockito.Mockito.when) T(org.apache.tinkerpop.gremlin.structure.T) HAS_NEXT_PROPERTY_RELATION_NAME(nl.knaw.huygens.timbuctoo.model.properties.ReadableProperty.HAS_NEXT_PROPERTY_RELATION_NAME) Mockito.verify(org.mockito.Mockito.verify) DATABASE_LABEL(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.DATABASE_LABEL) Mockito.never(org.mockito.Mockito.never) GraphWrapper(nl.knaw.huygens.timbuctoo.server.GraphWrapper) EdgeMatcher.likeEdge(nl.knaw.huygens.timbuctoo.util.EdgeMatcher.likeEdge) Matchers.hasItem(org.hamcrest.Matchers.hasItem) HAS_DISPLAY_NAME_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_DISPLAY_NAME_RELATION_NAME) RDF_URI_PROP(nl.knaw.huygens.timbuctoo.rdf.Database.RDF_URI_PROP) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Matchers.is(org.hamcrest.Matchers.is) HAS_PROPERTY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_PROPERTY_RELATION_NAME) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Mockito.mock(org.mockito.Mockito.mock) VertexMatcher.likeVertex(nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) GraphWrapper(nl.knaw.huygens.timbuctoo.server.GraphWrapper) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.Test)

Example 3 with HAS_ARCHETYPE_RELATION_NAME

use of nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ARCHETYPE_RELATION_NAME in project timbuctoo by HuygensING.

the class DatabaseTest method findOrCreateCollectionAddsTheCollectionToItsArchetype.

@Test
public void findOrCreateCollectionAddsTheCollectionToItsArchetype() {
    String rdfUri = "http://www.example.com/entity";
    String localName = "entity";
    TinkerPopGraphManager graphWrapper = newGraph().withVertex(v -> v.withLabel(Vre.DATABASE_LABEL).withProperty("name", VRE_NAME)).withVertex(v -> {
        v.withLabel(Vre.DATABASE_LABEL);
        v.withProperty(Vre.VRE_NAME_PROPERTY_NAME, "Admin");
        v.withOutgoingRelation(Vre.HAS_COLLECTION_RELATION_NAME, "defaultArchetype");
    }).withVertex("defaultArchetype", v -> {
        v.withProperty(ENTITY_TYPE_NAME_PROPERTY_NAME, "concept");
        v.withProperty(COLLECTION_NAME_PROPERTY_NAME, "concepts");
    }).wrap();
    Node collectionNode = mock(Node.class);
    when(collectionNode.getLocalName()).thenReturn(localName);
    when(collectionNode.getURI()).thenReturn(rdfUri);
    Database instance = new Database(graphWrapper);
    Collection collection = instance.findOrCreateCollection(VRE_NAME, collectionNode.getURI(), collectionNode.getLocalName());
    assertThat(collection, hasProperty("vreName", equalTo(VRE_NAME)));
    assertThat(graphWrapper.getGraph().traversal().V().hasLabel(DATABASE_LABEL).has(RDF_URI_PROP, rdfUri).out(HAS_ARCHETYPE_RELATION_NAME).hasNext(), is(true));
}
Also used : HAS_ARCHETYPE_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ARCHETYPE_RELATION_NAME) LabelP(org.apache.tinkerpop.gremlin.neo4j.process.traversal.LabelP) Matchers.not(org.hamcrest.Matchers.not) RDF_SYNONYM_PROP(nl.knaw.huygens.timbuctoo.rdf.Database.RDF_SYNONYM_PROP) Matchers.hasProperty(org.hamcrest.Matchers.hasProperty) Assert.assertThat(org.junit.Assert.assertThat) VertexMatcher.likeVertex(nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex) HAS_ENTITY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_RELATION_NAME) Matchers.hasSize(org.hamcrest.Matchers.hasSize) OptionalPresentMatcher.present(nl.knaw.huygens.hamcrest.OptionalPresentMatcher.present) TestGraphBuilder.newGraph(nl.knaw.huygens.timbuctoo.util.TestGraphBuilder.newGraph) Edge(org.apache.tinkerpop.gremlin.structure.Edge) Before(org.junit.Before) HAS_ENTITY_NODE_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_NODE_RELATION_NAME) Matchers.notNullValue(org.hamcrest.Matchers.notNullValue) Matchers.allOf(org.hamcrest.Matchers.allOf) TinkerPopGraphManager(nl.knaw.huygens.timbuctoo.server.TinkerPopGraphManager) COLLECTION_NAME_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.COLLECTION_NAME_PROPERTY_NAME) ENTITY_TYPE_NAME_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.ENTITY_TYPE_NAME_PROPERTY_NAME) Set(java.util.Set) Test(org.junit.Test) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) Mockito.when(org.mockito.Mockito.when) T(org.apache.tinkerpop.gremlin.structure.T) DATABASE_LABEL(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.DATABASE_LABEL) List(java.util.List) Ignore(org.junit.Ignore) Node(org.apache.jena.graph.Node) RDF_URI_PROP(nl.knaw.huygens.timbuctoo.rdf.Database.RDF_URI_PROP) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Vre(nl.knaw.huygens.timbuctoo.model.vre.Vre) Optional(java.util.Optional) Matchers.is(org.hamcrest.Matchers.is) Mockito.mock(org.mockito.Mockito.mock) TinkerPopGraphManager(nl.knaw.huygens.timbuctoo.server.TinkerPopGraphManager) Node(org.apache.jena.graph.Node) Test(org.junit.Test)

Example 4 with HAS_ARCHETYPE_RELATION_NAME

use of nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ARCHETYPE_RELATION_NAME in project timbuctoo by HuygensING.

the class CollectionTest method setArchetypeSetsTheUriOfTheOriginalArchetypeToEdgeToTheArchetype.

@Test
public void setArchetypeSetsTheUriOfTheOriginalArchetypeToEdgeToTheArchetype() {
    String newArchetypeEntity = "newArchetype";
    GraphWrapper graphWrapper = newGraph().withVertex(v -> v.withLabel(DATABASE_LABEL).withProperty(ENTITY_TYPE_NAME_PROPERTY_NAME, ENTITY_NAME).withProperty(COLLECTION_NAME_PROPERTY_NAME, COLLECTION_NAME)).withVertex(v -> v.withLabel(DATABASE_LABEL).withProperty(ENTITY_TYPE_NAME_PROPERTY_NAME, newArchetypeEntity)).wrap();
    Vertex collectionVertex = graphWrapper.getGraph().traversal().V().has(T.label, LabelP.of(DATABASE_LABEL)).has(ENTITY_TYPE_NAME_PROPERTY_NAME, ENTITY_NAME).next();
    Collection instance = new Collection(VRE_NAME, collectionVertex, graphWrapper);
    Vertex archetypeVertex = graphWrapper.getGraph().traversal().V().has(T.label, LabelP.of(DATABASE_LABEL)).has(ENTITY_TYPE_NAME_PROPERTY_NAME, newArchetypeEntity).next();
    Collection archetype = new Collection("", archetypeVertex, graphWrapper);
    String originalArchetypeUri = "http://example.com/originalArchetype";
    instance.setArchetype(archetype, originalArchetypeUri);
    assertThat(graphWrapper.getGraph().traversal().V(collectionVertex.id()).outE(HAS_ARCHETYPE_RELATION_NAME).toList(), hasItem(likeEdge().withProperty(RDF_URI_PROP, originalArchetypeUri)));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) HAS_ARCHETYPE_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ARCHETYPE_RELATION_NAME) LocalProperty(nl.knaw.huygens.timbuctoo.model.properties.LocalProperty) PROPERTY_TYPE_NAME(nl.knaw.huygens.timbuctoo.model.properties.ReadableProperty.PROPERTY_TYPE_NAME) LabelP(org.apache.tinkerpop.gremlin.neo4j.process.traversal.LabelP) DATABASE_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.model.properties.LocalProperty.DATABASE_PROPERTY_NAME) Matchers.not(org.hamcrest.Matchers.not) CLIENT_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.model.properties.ReadableProperty.CLIENT_PROPERTY_NAME) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) HAS_INITIAL_PROPERTY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_INITIAL_PROPERTY_RELATION_NAME) VertexMatcher.likeVertex(nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex) MockitoHamcrest.argThat(org.mockito.hamcrest.MockitoHamcrest.argThat) HAS_ENTITY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_RELATION_NAME) Assert.fail(org.junit.Assert.fail) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) TestGraphBuilder.newGraph(nl.knaw.huygens.timbuctoo.util.TestGraphBuilder.newGraph) FastNoSuchElementException(org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException) StringToStringConverter(nl.knaw.huygens.timbuctoo.model.properties.converters.StringToStringConverter) HAS_ENTITY_NODE_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_NODE_RELATION_NAME) Iterator(java.util.Iterator) COLLECTION_NAME_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.COLLECTION_NAME_PROPERTY_NAME) ENTITY_TYPE_NAME_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.ENTITY_TYPE_NAME_PROPERTY_NAME) Test(org.junit.Test) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) Mockito.when(org.mockito.Mockito.when) T(org.apache.tinkerpop.gremlin.structure.T) HAS_NEXT_PROPERTY_RELATION_NAME(nl.knaw.huygens.timbuctoo.model.properties.ReadableProperty.HAS_NEXT_PROPERTY_RELATION_NAME) Mockito.verify(org.mockito.Mockito.verify) DATABASE_LABEL(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.DATABASE_LABEL) Mockito.never(org.mockito.Mockito.never) GraphWrapper(nl.knaw.huygens.timbuctoo.server.GraphWrapper) EdgeMatcher.likeEdge(nl.knaw.huygens.timbuctoo.util.EdgeMatcher.likeEdge) Matchers.hasItem(org.hamcrest.Matchers.hasItem) HAS_DISPLAY_NAME_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_DISPLAY_NAME_RELATION_NAME) RDF_URI_PROP(nl.knaw.huygens.timbuctoo.rdf.Database.RDF_URI_PROP) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Matchers.is(org.hamcrest.Matchers.is) HAS_PROPERTY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_PROPERTY_RELATION_NAME) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Mockito.mock(org.mockito.Mockito.mock) VertexMatcher.likeVertex(nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) GraphWrapper(nl.knaw.huygens.timbuctoo.server.GraphWrapper) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.Test)

Example 5 with HAS_ARCHETYPE_RELATION_NAME

use of nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ARCHETYPE_RELATION_NAME in project timbuctoo by HuygensING.

the class DatabaseTest method findOrCreateCollectionReturnsTheCollectionForARequestedVre.

@Test
public void findOrCreateCollectionReturnsTheCollectionForARequestedVre() {
    String vreName = "vreName";
    String rdfUri = "http://www.example.com/entity";
    String localName = "entity";
    TinkerPopGraphManager graphWrapper = newGraph().withVertex(v -> v.withLabel(Vre.DATABASE_LABEL).withProperty("name", vreName).withOutgoingRelation(Vre.HAS_COLLECTION_RELATION_NAME, "collection")).withVertex("collection", v -> v.withLabel("collection").withProperty(ENTITY_TYPE_NAME_PROPERTY_NAME, localName)).withVertex(v -> {
        v.withLabel(Vre.DATABASE_LABEL);
        v.withProperty(Vre.VRE_NAME_PROPERTY_NAME, "Admin");
        v.withOutgoingRelation(Vre.HAS_COLLECTION_RELATION_NAME, "defaultArchetype");
    }).withVertex("defaultArchetype", v -> {
        v.withProperty(ENTITY_TYPE_NAME_PROPERTY_NAME, "concept");
        v.withProperty(COLLECTION_NAME_PROPERTY_NAME, "concepts");
        v.withIncomingRelation(HAS_ARCHETYPE_RELATION_NAME, "collection");
    }).wrap();
    Node collectionNode = mock(Node.class);
    when(collectionNode.getLocalName()).thenReturn(localName);
    when(collectionNode.getURI()).thenReturn(rdfUri);
    Database instance = new Database(graphWrapper);
    Collection collection = instance.findOrCreateCollection(vreName, collectionNode.getURI(), collectionNode.getLocalName());
    assertThat(collection, hasProperty("vreName", equalTo(vreName)));
}
Also used : HAS_ARCHETYPE_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ARCHETYPE_RELATION_NAME) LabelP(org.apache.tinkerpop.gremlin.neo4j.process.traversal.LabelP) Matchers.not(org.hamcrest.Matchers.not) RDF_SYNONYM_PROP(nl.knaw.huygens.timbuctoo.rdf.Database.RDF_SYNONYM_PROP) Matchers.hasProperty(org.hamcrest.Matchers.hasProperty) Assert.assertThat(org.junit.Assert.assertThat) VertexMatcher.likeVertex(nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex) HAS_ENTITY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_RELATION_NAME) Matchers.hasSize(org.hamcrest.Matchers.hasSize) OptionalPresentMatcher.present(nl.knaw.huygens.hamcrest.OptionalPresentMatcher.present) TestGraphBuilder.newGraph(nl.knaw.huygens.timbuctoo.util.TestGraphBuilder.newGraph) Edge(org.apache.tinkerpop.gremlin.structure.Edge) Before(org.junit.Before) HAS_ENTITY_NODE_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_NODE_RELATION_NAME) Matchers.notNullValue(org.hamcrest.Matchers.notNullValue) Matchers.allOf(org.hamcrest.Matchers.allOf) TinkerPopGraphManager(nl.knaw.huygens.timbuctoo.server.TinkerPopGraphManager) COLLECTION_NAME_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.COLLECTION_NAME_PROPERTY_NAME) ENTITY_TYPE_NAME_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.ENTITY_TYPE_NAME_PROPERTY_NAME) Set(java.util.Set) Test(org.junit.Test) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) Mockito.when(org.mockito.Mockito.when) T(org.apache.tinkerpop.gremlin.structure.T) DATABASE_LABEL(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.DATABASE_LABEL) List(java.util.List) Ignore(org.junit.Ignore) Node(org.apache.jena.graph.Node) RDF_URI_PROP(nl.knaw.huygens.timbuctoo.rdf.Database.RDF_URI_PROP) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Vre(nl.knaw.huygens.timbuctoo.model.vre.Vre) Optional(java.util.Optional) Matchers.is(org.hamcrest.Matchers.is) Mockito.mock(org.mockito.Mockito.mock) TinkerPopGraphManager(nl.knaw.huygens.timbuctoo.server.TinkerPopGraphManager) Node(org.apache.jena.graph.Node) Test(org.junit.Test)

Aggregations

HAS_ARCHETYPE_RELATION_NAME (nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ARCHETYPE_RELATION_NAME)5 TestGraphBuilder.newGraph (nl.knaw.huygens.timbuctoo.util.TestGraphBuilder.newGraph)5 VertexMatcher.likeVertex (nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex)5 Vertex (org.apache.tinkerpop.gremlin.structure.Vertex)5 Matchers.equalTo (org.hamcrest.Matchers.equalTo)5 Test (org.junit.Test)5 COLLECTION_NAME_PROPERTY_NAME (nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.COLLECTION_NAME_PROPERTY_NAME)4 DATABASE_LABEL (nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.DATABASE_LABEL)4 ENTITY_TYPE_NAME_PROPERTY_NAME (nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.ENTITY_TYPE_NAME_PROPERTY_NAME)4 HAS_ENTITY_NODE_RELATION_NAME (nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_NODE_RELATION_NAME)4 HAS_ENTITY_RELATION_NAME (nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_RELATION_NAME)4 RDF_URI_PROP (nl.knaw.huygens.timbuctoo.rdf.Database.RDF_URI_PROP)4 LabelP (org.apache.tinkerpop.gremlin.neo4j.process.traversal.LabelP)4 T (org.apache.tinkerpop.gremlin.structure.T)4 Matchers.is (org.hamcrest.Matchers.is)4 Matchers.not (org.hamcrest.Matchers.not)4 Mockito.mock (org.mockito.Mockito.mock)4 Mockito.when (org.mockito.Mockito.when)4 List (java.util.List)3 Optional (java.util.Optional)3