@Override public void visitNewIndividual(NewIndividual individual) { this.result=IndividualReference.newIndividual(individual.id()); } }
@Test public void testVisitor$NewIndividualReference$SELF() { newIndividual(SELF). accept( new FailingVisitor() { @Override public void visitNewIndividualReference(NewIndividualReference reference) { assertThat(reference.ref(),equalTo(SELF)); } } ); }
@Test public void testVisitor$NewIndividualReference$NEW() { newIndividual(NEW). accept( new FailingVisitor() { @Override public void visitNewIndividualReference(NewIndividualReference reference) { assertThat(reference.ref(),equalTo(NEW)); } } ); }
@Test public void testIsPresent$NewIndividualReference$SELF$nonExistingIndividual() { assertThat(newIndividual(SELF).isPresent(emptyDataSet()),equalTo(false)); }
@Test public void testIsPresent$NewIndividualReference$SELF$existingIndividual() { assertThat(newIndividual(SELF).isPresent(exampleDataSet()),equalTo(true)); }
@Test public void testIsPresent$NewIndividualReference$NEW$existingIndividual() { assertThat(newIndividual(NEW).isPresent(exampleDataSet()),equalTo(true)); }
@Test public void testIsPresent$NewIndividualReference$NEW$nonExistingIndividual() { assertThat(newIndividual(NEW).isPresent(emptyDataSet()),equalTo(false)); }
private DataSet exampleDataSet() { DataSet dataSet= DataDSL. dataSet(). individual(managed(MANAGED_INDIVIDUAL_ID)). hasProperty(HAS_TITLE). withValue("managed"). individual(relative(MANAGED_INDIVIDUAL_ID,RELATIVE_PATH)). hasProperty(HAS_TITLE). withValue("relative"). individual(newIndividual(SELF)). hasProperty(HAS_TITLE). withValue("self"). individual(newIndividual(NEW)). hasProperty(HAS_TITLE). withValue("new"). individual(anonymous(BLANK_NODE)). hasProperty(HAS_TITLE). withValue("bnode"). individual(external(EXTERNAL)). hasProperty(HAS_TITLE). withValue("external"). build(); return dataSet; }
hasProperty(SHOULD_LINK_TO). withValue("relative"). individual(newIndividual(SELF)). hasProperty(HAS_TITLE). withValue("self"). hasLink(HAS_LINK). referringTo(external(EXTERNAL)). referringTo(newIndividual(SELF)). hasLink(HAS_LINK). toIndividual(external(EXTERNAL)). hasLink(HAS_LINK). referringTo(newIndividual(SELF)). hasProperty(SHOULD_LINK_TO). withValue("self"). individual(newIndividual(NEW)). hasProperty(HAS_TITLE). withValue("new"). hasLink(HAS_LINK). referringTo(external(EXTERNAL)). referringTo(newIndividual(NEW)). hasLink(HAS_LINK). toIndividual(external(EXTERNAL)). hasLink(HAS_LINK). referringTo(newIndividual(NEW)). hasProperty(SHOULD_LINK_TO). withValue("new").
hasProperty(SHOULD_LINK_TO). withValue("relative"). individual(newIndividual(SELF)). hasProperty(HAS_TITLE). withValue("self"). hasLink(HAS_LINK). referringTo(external(EXTERNAL)). referringTo(newIndividual(SELF)). hasLink(HAS_LINK). toIndividual(external(EXTERNAL)). hasLink(HAS_LINK). referringTo(newIndividual(SELF)). hasProperty(SHOULD_LINK_TO). withValue("self"). individual(newIndividual(NEW)). hasProperty(HAS_TITLE). withValue("new"). hasLink(HAS_LINK). referringTo(external(EXTERNAL)). referringTo(newIndividual(NEW)). hasLink(HAS_LINK). toIndividual(external(EXTERNAL)). hasLink(HAS_LINK). referringTo(newIndividual(NEW)). hasProperty(SHOULD_LINK_TO). withValue("new").
hasProperty(SHOULD_LINK_TO). withValue("relative"). individual(newIndividual(SELF)). hasProperty(HAS_TITLE). withValue("self"). hasLink(HAS_LINK). referringTo(external(EXTERNAL)). referringTo(newIndividual(SELF)). hasLink(HAS_LINK). toIndividual(external(EXTERNAL)). hasLink(HAS_LINK). referringTo(newIndividual(SELF)). hasProperty(SHOULD_LINK_TO). withValue("self"). individual(newIndividual(NEW)). hasProperty(HAS_TITLE). withValue("new"). hasLink(HAS_LINK). referringTo(external(EXTERNAL)). referringTo(newIndividual(NEW)). hasLink(HAS_LINK). toIndividual(external(EXTERNAL)). hasLink(HAS_LINK). referringTo(newIndividual(NEW)). hasProperty(SHOULD_LINK_TO). withValue("new").
hasProperty(SHOULD_LINK_TO). withValue("relative"). individual(newIndividual(SELF)). hasProperty(HAS_TITLE). withValue("self"). hasLink(HAS_LINK). referringTo(external(EXTERNAL)). referringTo(newIndividual(SELF)). hasLink(HAS_LINK). toIndividual(external(EXTERNAL)). hasLink(HAS_LINK). referringTo(newIndividual(SELF)). hasProperty(SHOULD_LINK_TO). withValue("self"). individual(newIndividual(NEW)). hasProperty(HAS_TITLE). withValue("new"). hasLink(HAS_LINK). referringTo(external(EXTERNAL)). referringTo(newIndividual(NEW)). hasLink(HAS_LINK). toIndividual(external(EXTERNAL)). hasLink(HAS_LINK). referringTo(newIndividual(NEW)). hasProperty(SHOULD_LINK_TO). withValue("new").
hasProperty(SHOULD_LINK_TO). withValue("relative"). individual(newIndividual(SELF)). hasProperty(HAS_TITLE). withValue("self"). hasLink(HAS_LINK). referringTo(external(EXTERNAL)). referringTo(newIndividual(SELF)). hasLink(HAS_LINK). toIndividual(external(EXTERNAL)). hasLink(HAS_LINK). referringTo(newIndividual(SELF)). hasProperty(SHOULD_LINK_TO). withValue("self"). individual(newIndividual(NEW)). hasProperty(HAS_TITLE). withValue("new"). hasLink(HAS_LINK). referringTo(external(EXTERNAL)). referringTo(newIndividual(NEW)). hasLink(HAS_LINK). toIndividual(external(EXTERNAL)). hasLink(HAS_LINK). referringTo(newIndividual(NEW)). hasProperty(SHOULD_LINK_TO). withValue("new").