@Test void testCreateRfdModelSTRINGKeywords() { Entity objectEntity = mock(Entity.class); EntityType entityType = mock(EntityType.class); Attribute attribute = mock(Attribute.class); List<Attribute> attributeList = singletonList(attribute); when(objectEntity.getEntityType()).thenReturn(entityType); String value = "molgenis,genetics,fair"; when(objectEntity.get("attributeName")).thenReturn(value); when(objectEntity.getString("attributeName")).thenReturn(value); when(entityType.getAtomicAttributes()).thenReturn(attributeList); when(attribute.getName()).thenReturn("attributeName"); when(attribute.getDataType()).thenReturn(STRING); LabeledResource tag = new LabeledResource("http: Multimap<Relation, LabeledResource> tags = ImmutableMultimap.of(isAssociatedWith, tag); when(tagService.getTagsForAttribute(entityType, attribute)).thenReturn(tags); Model result = writer.createRdfModel(objectEntity); assertEquals(3, result.size()); StringWriter writer = new StringWriter(); Rio.write(result, writer, TURTLE, new WriterConfig().set(INLINE_BLANK_NODES, true)); assertThat(writer.toString()).contains("dcat:keyword \"molgenis\", \"genetics\", \"fair\""); }
public Model createRdfModel(Entity objectEntity) { Model model = createEmptyModel(); Resource subject = createResource(objectEntity); addEntityToModel(subject, objectEntity, model); return model; }
EntityModelWriter { public Model createRdfModel(Entity objectEntity) { Model model = createEmptyModel(); Resource subject = createResource(objectEntity); addEntityToModel(subject, objectEntity, model); return model; } }
EntityModelWriter { public Model createRdfModel(Entity objectEntity) { Model model = createEmptyModel(); Resource subject = createResource(objectEntity); addEntityToModel(subject, objectEntity, model); return model; } EntityModelWriter(
      TagService<LabeledResource, LabeledResource> tagService, SimpleValueFactory valueFactory); }
EntityModelWriter { public Model createRdfModel(Entity objectEntity) { Model model = createEmptyModel(); Resource subject = createResource(objectEntity); addEntityToModel(subject, objectEntity, model); return model; } EntityModelWriter(
      TagService<LabeledResource, LabeledResource> tagService, SimpleValueFactory valueFactory); Model createRdfModel(Entity objectEntity); Model createEmptyModel(); void addEntityToModel(Resource subject, Entity objectEntity, Model model); boolean isADcatResource(EntityType entityType); }
EntityModelWriter { public Model createRdfModel(Entity objectEntity) { Model model = createEmptyModel(); Resource subject = createResource(objectEntity); addEntityToModel(subject, objectEntity, model); return model; } EntityModelWriter(
      TagService<LabeledResource, LabeledResource> tagService, SimpleValueFactory valueFactory); Model createRdfModel(Entity objectEntity); Model createEmptyModel(); void addEntityToModel(Resource subject, Entity objectEntity, Model model); boolean isADcatResource(EntityType entityType); static final String NS_DCAT; static final String NS_FDP; static final String NS_R3D; static final String NS_DATACITE; static final String NS_DCT; static final String NS_RDF; }