@Override public IndividualReference<Name,LocalIndividual> useName(Name<?> name) { return IndividualReference.anonymous(name); }
@Override public void visitLocalIndividual(LocalIndividual individual) { this.result=IndividualReference.anonymous(individual.id()); } @Override
@Test public void testIsPresent$LocalIndividualReference$nonExistingIndividual() { assertThat(anonymous(BLANK_NODE).isPresent(emptyDataSet()),equalTo(false)); }
@Test public void testIsPresent$LocalIndividualReference$existingIndividual() { assertThat(anonymous(BLANK_NODE).isPresent(exampleDataSet()),equalTo(true)); }
@Test public void testVisitor$LocalIndividualReference() { anonymous(BLANK_NODE). accept( new FailingVisitor() { @SuppressWarnings("rawtypes") @Override public void visitLocalIndividualReference(LocalIndividualReference reference) { assertThat(reference.ref(),equalTo((Name)BLANK_NODE)); } } ); }
protected static IndividualReference<?,?> id(String name, String... names) { return anonymous(NamingScheme.getDefault().name(name, names)); }
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("new"). individual(anonymous(BLANK_NODE)). hasProperty(HAS_TITLE). withValue("bnode"). hasLink(HAS_LINK). referringTo(external(EXTERNAL)). referringTo(anonymous(BLANK_NODE)). hasLink(HAS_LINK). toIndividual(external(EXTERNAL)). hasLink(HAS_LINK). referringTo(anonymous(BLANK_NODE)). hasProperty(SHOULD_LINK_TO). withValue("bnode").
hasProperty(SHOULD_LINK_TO). withValue("new"). individual(anonymous(BLANK_NODE)). hasProperty(HAS_TITLE). withValue("bnode"). hasLink(HAS_LINK). referringTo(external(EXTERNAL)). referringTo(anonymous(BLANK_NODE)). hasLink(HAS_LINK). toIndividual(external(EXTERNAL)). hasLink(HAS_LINK). referringTo(anonymous(BLANK_NODE)). hasProperty(SHOULD_LINK_TO). withValue("bnode").
hasProperty(SHOULD_LINK_TO). withValue("new"). individual(anonymous(BLANK_NODE)). hasProperty(HAS_TITLE). withValue("bnode"). hasLink(HAS_LINK). referringTo(external(EXTERNAL)). referringTo(anonymous(BLANK_NODE)). hasLink(HAS_LINK). toIndividual(external(EXTERNAL)). hasLink(HAS_LINK). referringTo(anonymous(BLANK_NODE)). hasProperty(SHOULD_LINK_TO). withValue("bnode").
hasProperty(SHOULD_LINK_TO). withValue("new"). individual(anonymous(BLANK_NODE)). hasProperty(HAS_TITLE). withValue("bnode"). hasLink(HAS_LINK). referringTo(external(EXTERNAL)). referringTo(anonymous(BLANK_NODE)). hasLink(HAS_LINK). toIndividual(external(EXTERNAL)). hasLink(HAS_LINK). referringTo(anonymous(BLANK_NODE)). hasProperty(SHOULD_LINK_TO). withValue("bnode").
hasProperty(SHOULD_LINK_TO). withValue("new"). individual(anonymous(BLANK_NODE)). hasProperty(HAS_TITLE). withValue("bnode"). hasLink(HAS_LINK). referringTo(external(EXTERNAL)). referringTo(anonymous(BLANK_NODE)). hasLink(HAS_LINK). toIndividual(external(EXTERNAL)). hasLink(HAS_LINK). referringTo(anonymous(BLANK_NODE)). hasProperty(SHOULD_LINK_TO). withValue("bnode").