RdfConverter extends AbstractRdfConverter { @Override public void writeItemDocument(ItemDocument document) throws RDFHandlerException { if (!hasTask(RdfSerializer.TASK_ITEMS)) return; super.writeItemDocument(document); } RdfConverter(RdfWriter rdfWriter, Sites sites, PropertyRegister propertyRegister); void setTasks(int tasks); int getTasks(); @Override void writeTermTriples(Resource subject, TermKind kind, Collection<MonolingualTextValue> terms); @Override void writeSiteLinks(Resource subject, Map<String, SiteLink> siteLinks); @Override void writePropertyDatatype(PropertyDocument document); @Override void writeInterPropertyLinks(PropertyDocument document); @Override void writeSimpleStatement(Statement statement); @Override void writeFullStatement(Statement statement, boolean best); @Override void writeItemDocument(ItemDocument document); @Override void writePropertyDocument(PropertyDocument document); @Override void writeOWLDeclarations();  }
@Test public void testWriteItemDocument() throws RDFHandlerException, IOException, RDFParseException { ItemDocument document = this.objectFactory.createItemDocument(); this.rdfConverter.writeItemDocument(document); this.rdfWriter.finish(); Model model = RdfTestHelpers.parseRdf(out.toString()); assertEquals(model, RdfTestHelpers.parseRdf(RdfTestHelpers .getResourceFromFile("ItemDocument.rdf"))); }
@Test public void testWriteItemDocumentWithNullPropertyTypes() throws RDFHandlerException, IOException, RDFParseException { this.rdfConverter = new RdfConverter(this.rdfWriter, this.sites, new MockPropertyRegister.WithNullPropertyTypes()); ItemDocument document = this.objectFactory.createItemDocument(); this.rdfConverter.writeItemDocument(document); this.rdfWriter.finish(); Model model = RdfTestHelpers.parseRdf(out.toString()); assertEquals(model, RdfTestHelpers.parseRdf(RdfTestHelpers .getResourceFromFile("ItemDocumentUnknownPropertyTypes.rdf"))); }