use of nl.knaw.huygens.timbuctoo.rdf.LiteralTriple in project timbuctoo by HuygensING.
the class TriplePropertyConverterTest method toCreatesATripleWithAJsonVersionOfPersonNames.
@Test
public void toCreatesATripleWithAJsonVersionOfPersonNames() throws Exception {
PersonNames value = new PersonNames();
value.list.add(PersonName.newInstance("forename", "surname"));
ObjectMapper objectMapper = new ObjectMapper();
String objectValue = objectMapper.writeValueAsString(value);
Tuple<String, List<Triple>> to = instance.to(new PersonNamesProperty(PROP_NAME, value));
LiteralTriple triple = (LiteralTriple) to.getRight().get(0);
assertThat(triple.getSubject(), is(SUBJECT_URI));
assertThat(triple.getPredicate(), endsWith(PROP_NAME));
assertThat(triple.getObject(), is(objectValue));
assertThat(triple.getDatatype(), is("http://timbuctoo.huygens.knaw.nl/personnames"));
}
Aggregations