### Question:
KohaItem2Rdf { public Model mapItemsToModel(JsonArray items) { Model model = ModelFactory.createDefaultModel(); model.setNsPrefix("", DEICHMAN_NS_EXEMPLAR); model.setNsPrefix("duo", DUO_NS); model.setNsPrefix("xsd", XSD.getURI()); items.forEach(item -> { JsonObject itemData = item.getAsJsonObject(); Resource subject = createResource(BaseURI.exemplar() + "e" + itemData.get("barcode").getAsString()); String ontologyNS = BaseURI.ontology(); model.add( createStatement( subject, createProperty(RDF_SYNTAX_NS_TYPE), createResource(ontologyNS + DEICHMAN_ITEM) ) ); if (itemData.has("homebranch") && !itemData.get("homebranch").isJsonNull()) { model.add( createStatement( subject, createProperty(ontologyNS + DEICHMAN_BRANCH), createPlainLiteral(getBranch(itemData.get("homebranch").getAsString())) ) ); } safeAddTriple(model, "status", subject, ontologyNS + DEICHMAN_STATUS, itemData); safeAddTriple(model, "location", subject, ontologyNS + DEICHMAN_LOCATION, itemData); safeAddTriple(model, "barcode", subject, ontologyNS + DEICHMAN_BARCODE, itemData); safeAddTriple(model, "itemcallnumber", subject, DUO_NS + DUO_SHELFMARK, itemData); }); return model; } KohaItem2Rdf(); Model mapItemsToModel(JsonArray items);  }### Answer:
@Test public void test_mapItemsToModel() throws IOException { String in = IOUtils.toString( EntityServiceImplTest.class.getClassLoader().getResourceAsStream("biblio_expanded.json"), "UTF-8" ); JsonObject json = new Gson().fromJson(in, JsonObject.class); KohaItem2Rdf m2r = new KohaItem2Rdf(); Model m = m2r.mapItemsToModel(json.getAsJsonArray("items")); String barcode = "03010626460038"; String s = itemBase + "e" + barcode; Statement barcodeStatement = createStatement( createResource(s), createProperty(BaseURI.ontology("barcode")), createPlainLiteral(barcode) ); Statement locationStatement = createStatement( createResource(s), createProperty(BaseURI.ontology("location")), createPlainLiteral("m") ); Statement branchStatement = createStatement( createResource(s), createProperty(BaseURI.ontology("branch")), createPlainLiteral("Hovedbiblioteket") ); Statement shelfmarkStatement = createStatement( createResource(s), createProperty(duoNs + "shelfmark"), createPlainLiteral("952 Cri") ); String loanedBarcode = "03010626460056"; String sLoaned = itemBase + "e" + loanedBarcode; Statement loanedExample = createStatement( createResource(sLoaned), createProperty(BaseURI.ontology("status")), createPlainLiteral("Utlånt") ); Statement availableStatement = createStatement( createResource(s), createProperty(BaseURI.ontology("status")), createPlainLiteral("Ledig") ); assertNotNull(m); assertTrue(m.contains(branchStatement)); assertTrue(m.contains(barcodeStatement)); assertTrue(m.contains(locationStatement)); assertFalse(m.listSubjectsWithProperty(createProperty(BaseURI.ontology("status"))).toList().contains(s)); assertTrue(m.contains(shelfmarkStatement)); assertTrue(m.contains(loanedExample)); assertTrue(m.contains(availableStatement)); }